/* ════════════════════════════════════════════════════════════════════
   MAPA DE ESTILOS POR SEÇÃO
   ┌─────────────┬────────────────────┬─────────────────┬────────────────┬──────────────────────┐
   │ Seção       │ Wrapper            │ Grade           │ Card           │ Token da Imagem      │
   ├─────────────┼────────────────────┼─────────────────┼────────────────┼──────────────────────┤
   │ PLATAFORMAS │ .platforms-section │ .platforms-grid │ .platform-card │ --img-platform-size  │
   │ ADMINS      │ .admins-section    │ .admins-grid    │ .admin-card    │ --img-admin-size     │
   │ INFRA       │ .infra-section     │ .infra-grid     │ .infra-card    │ --img-infra-size     │
   │ EQUIPE      │ .team-section      │ .team-grid      │ .team-card     │ –                    │
   └─────────────┴────────────────────┴─────────────────┴────────────────┴──────────────────────┘
   Hierarquia de tamanho de imagem: plataformas > admins >= infra (menor no mobile).
   ════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:        #FF161F;
  --primary-dark:   #B80F16;
  --secondary:      #FBB900;
  --text:          #171717;
  --text-muted:    #5F6368;
  --bg:            #FFFFFF;
  --card-bg:       #FFFFFF;
  --border:        #DEDEDE;
  --stamp-ring:    #FFFFFF;

  --radius-sm:     10px;
  --radius-pill:   999px;
  --transition:    0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* Hierarquia de tamanhos das imagens por token */
  --img-platform-size: 96px;
  --platform-link-gap: 20px;
  --img-admin-size:    72px;
  --img-infra-size:    var(--img-admin-size);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Montserrat', 'Roboto', 'Helvetica', 'Arial', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ─── Seletor de Idioma Flutuante Fixado ─── */
.lang-selector {
  position: fixed;
  top: 16px;
  right: 24px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(244, 245, 247, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.lang-btn {
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: all var(--transition);
}

.lang-btn:hover { color: var(--text); }
.lang-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(255, 22, 31, 0.25);
}

/* ─── Hero ─── */
.hero {
  position: relative;
  border-bottom: 1px solid var(--border);
  padding: 56px 32px 28px;
  text-align: center;
}

.hero a { text-decoration: none; }

.hero-title {
  font-size: clamp(1.4rem, 3.2vw, 2.1rem);
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.2px;
  max-width: 46ch;
  margin: 0 auto;
}

.hero-subtitle {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ─── Layout e Títulos de Seção ─── */
main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 16px;
  width: 100%;
}

.platforms-section,
.admins-section,
.infra-section,
.team-section { margin-top: 8px; }

.section-label {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
  font-weight: 700;
}

h2.section-title {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.section-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 72ch;
  margin-bottom: 14px;
}

/* ─── Comportamento Compartilhado por Todos os Cards ─── */
.platform-card, .card, .team-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: filter var(--transition), opacity var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.platform-card:hover, .card:hover, .team-card:hover {
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(255, 22, 31, 0.1);
}

/* Seleção cruzada: ao passar o mouse num card, os demais entram em grayscale */
.portal:has(.card:hover, .selectable:hover) :is(.card, .selectable):not(:hover) {
  filter: grayscale(100%);
  opacity: 0.35;
}

@keyframes shake {
  0%   { transform: rotate(0deg)  scale(1.02); }
  15%  { transform: rotate(-5deg) scale(1.05); }
  30%  { transform: rotate(4deg)  scale(1.05); }
  45%  { transform: rotate(-3deg) scale(1.04); }
  60%  { transform: rotate(2deg)  scale(1.03); }
  75%  { transform: rotate(-1deg) scale(1.02); }
  100% { transform: rotate(0deg)  scale(1.02); }
}

:is(.card, .platform-card):hover :is(.card-img, .card-stamp),
.team-card:hover .team-card__avatar { animation: shake 0.45s ease; }

@media (prefers-reduced-motion: reduce) {
  :is(.card, .platform-card):hover :is(.card-img, .card-stamp),
  .team-card:hover .team-card__avatar { animation: none; }
}

/* Overlay do Link Principal */
.platform-link::after,
.card > a:first-child::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.platform-link:focus-visible,
.card > a:first-child:focus-visible { outline: none; }

.platform-card:has(.platform-link:focus-visible),
.card:has(> a:first-child:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* ════════════════════════════════════════════════════════════════════
   SEÇÃO 1 · PLATAFORMAS (.platforms-section › .platforms-grid › .platform-card)
   ════════════════════════════════════════════════════════════════════ */
.platforms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 28px;
}

.platform-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  position: relative;
  padding: 28px;
  cursor: pointer;
}

.platform-link {
  display: flex;
  align-items: flex-start;
  gap: var(--platform-link-gap);
  width: 100%;
  text-decoration: none;
  color: inherit;
}

.platform-card .card-project-link {
  margin-left: calc(var(--img-platform-size) + var(--platform-link-gap));
  margin-top: 4px;
}

.platform-icon-wrap { position: relative; flex-shrink: 0; line-height: 0; }

.platform-icon-wrap .card-img {
  width:  var(--img-platform-size);
  height: var(--img-platform-size);
  padding: 7px;
}

.platform-icon-wrap .card-stamp {
  width:  calc(var(--img-platform-size) * 0.3);
  height: calc(var(--img-platform-size) * 0.3);
  bottom: -4px;
  right: -6px;
}

.platform-content { min-width: 0; }

.platform-wordmark {
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.wm-black { color: var(--text); }
.wm-red   { color: var(--primary); }
.wm-gold  { color: var(--secondary); }

.platform-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.platform-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--primary);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--transition), color var(--transition), transform var(--transition);
}

.platform-card:hover .platform-cta,
.platform-card:has(.platform-link:focus-visible) .platform-cta { opacity: 1; transform: translateY(0); }
.platform-card:hover .platform-cta { color: var(--primary-dark); }

/* ════════════════════════════════════════════════════════════════════
   SEÇÃO 2 · ADMINS  (.admins-section › .admins-grid › .admin-card)
   SEÇÃO 3 · INFRA   (.infra-section  › .infra-grid  › .infra-card)
   ════════════════════════════════════════════════════════════════════ */
.admins-grid,
.infra-grid {
  --gap: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  justify-content: center;
  margin-bottom: 36px;
}

.admin-card { --img: var(--img-admin-size); }
.infra-card { --img: var(--img-infra-size); }

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  width: 120px;
  padding: 22px 24px 18px;
  text-decoration: none;
  color: inherit;
}

.card > a:first-child {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
}

.card-img {
  display: block;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  object-fit: contain;
  transition: filter var(--transition), transform var(--transition);
}

.card .card-img { width: var(--img); height: var(--img); padding: 7px; margin-bottom: 14px; }

.card-img-wrap { position: relative; display: inline-block; line-height: 0; }

.card-stamp {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 34%;
  height: 34%;
  border-radius: 50%;
  border: 2px solid var(--stamp-ring);
  background: #FFFFFF;
  object-fit: contain;
  box-shadow: 0 2px 6px rgba(23, 23, 23, 0.18);
}

.card-name { font-size: 0.85rem; font-weight: 700; text-align: center; margin-bottom: 4px; color: var(--text); }
.card-desc { font-size: 0.75rem; color: var(--text-muted); text-align: center; line-height: 1.5; }

.card-arrow {
  margin-top: 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.06em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--transition), transform var(--transition);
}

.card:hover .card-arrow { opacity: 1; transform: translateY(0); }

/* Links secundários */
.card-project-link,
.card-extra-link {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  position: relative;
  z-index: 2;
  transition: color var(--transition);
}

.card-project-link { display: inline-block; margin-top: 10px; letter-spacing: 0.01em; }
.card-extra-link   { display: inline-flex; align-items: center; gap: 5px; }

.card-project-link:hover, .card-project-link:focus-visible,
.card-extra-link:hover,   .card-extra-link:focus-visible { color: var(--primary); outline: none; }

.additional-card-img { width: 14px; height: 14px; object-fit: contain; flex-shrink: 0; vertical-align: middle; }

/* ════════════════════════════════════════════════════════════════════
   SEÇÃO 4 · EQUIPE (.team-section › .team-grid › .team-card)
   ════════════════════════════════════════════════════════════════════ */
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.team-grid > * { grid-column: span 2; }
.team-grid > :last-child:nth-child(odd) { grid-column: 2 / span 2; }

.team-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
}

.team-card__avatar {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #FFFFFF;
  border: 2px solid var(--border);
}

.team-card__avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #FFFFFF;
}

.team-card__initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.team-card__info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.team-card__role {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.team-card__name { font-size: 0.92rem; font-weight: 700; line-height: 1.3; color: var(--text); }

/* ─── Rodapé ─── */
footer { border-top: 1px solid var(--border); background: var(--bg); margin-top: auto; }

.footer-main { max-width: 1100px; margin: 0 auto; padding: 16px 24px; }

.footer-disclaimer {
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-muted);
  text-align: justify;
  hyphens: auto;
}

.footer-bottom {
  text-align: center;
  padding: 18px 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVIDADE E COMPORTAMENTO DE TAMANHOS DIFERENCIADOS
   ════════════════════════════════════════════════════════════════════ */

/* Tablet (≤ 768px): Admins e Infra em 2 colunas proporcionais */
@media (max-width: 768px) {
  :root {
    --img-admin-size: 60px;
    --img-platform-size: 84px;
  }

  .hero { padding: 64px 20px 20px; }
  .lang-selector { top: 12px; right: 16px; }
  main  { padding: 20px 16px 16px; }
  .footer-main { padding-left: 16px; padding-right: 16px; }

  .platforms-grid { grid-template-columns: 1fr; gap: 36px; }

  .admins-grid,
  .infra-grid { --gap: 16px; --cols: 2; }

  .card { width: calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); min-width: 0; }

  .team-grid { grid-template-columns: 1fr; }
  .team-grid > *,
  .team-grid > :last-child:nth-child(odd) { grid-column: auto; }
}

/* Smartphone (≤ 560px): Diferenciação completa por seção
   Plataformas (1 col / 72px) · Admins (2 col / 48px) · Infra (3 col / 36px) */
@media (max-width: 560px) {
  :root {
    --img-platform-size: 72px;
    --img-admin-size:    48px;
    --img-infra-size:    36px;
    --platform-link-gap: 14px;
  }

  .hero { padding: 68px 14px 20px; }
  .lang-selector { top: 10px; right: 12px; }
  .lang-btn { padding: 6px 10px; min-width: 36px; min-height: 36px; font-size: 0.75rem; }

  .platforms-grid { gap: 14px; margin-bottom: 22px; }
  .platform-card  { padding: 16px 16px 14px; }
  .platform-icon-wrap .card-img { padding: 5px; }
  .platform-wordmark { font-size: 1.2rem; margin-bottom: 4px; }
  .platform-desc     { font-size: 0.8rem; line-height: 1.45; margin-bottom: 4px; }
  .platform-card .card-project-link { margin-top: 2px; }

  .admins-grid,
  .infra-grid { --gap: 12px; margin-bottom: 28px; }
  .admins-grid { --cols: 2; }
  .infra-grid  { --cols: 3; }

  .admin-card { padding: 16px 10px 12px; }
  .infra-card { padding: 12px 6px 10px; }

  .card .card-img { padding: 5px; margin-bottom: 10px; }
  .infra-card .card-img { padding: 4px; margin-bottom: 8px; }

  .admin-card .card-name { font-size: 0.8rem; margin-bottom: 4px; }
  .infra-card .card-name { font-size: 0.7rem; margin-bottom: 3px; overflow-wrap: anywhere; }
  .admin-card .card-desc { font-size: 0.7rem; }
  .infra-card .card-desc { font-size: 0.62rem; line-height: 1.4; }
  .admin-card .card-arrow { margin-top: 8px; }
  .infra-card .card-arrow { margin-top: 6px; }
  .infra-card .card-project-link,
  .infra-card .card-extra-link { font-size: 0.62rem; margin-top: 6px; }
}

/* Telas de toque sem hover */
@media (max-width: 560px) and (hover: none) {
  .platform-cta,
  .card-arrow { display: none; }
}