/* ============================================================
   TEAM / EQUIPE — large rectangular cards (screenshot style)
   Full-bleed photo (B&W + blur at rest → sharp color on hover),
   name + [role], description, LinkedIn overlay.
   ============================================================ */

.team {
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  max-width: 100%;
  background: linear-gradient(135deg, #080B16, #0E1425, #1a2444, #0E1425, #080B16);
  background-size: 400% 400%;
  animation: teamGradient 60s linear infinite;
  padding: 4rem 1.5rem;
}
.team *, .team *::before, .team *::after { box-sizing: border-box; }

@keyframes teamGradient {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

.team::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(60, 215, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 215, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  pointer-events: none;
}

.team__title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 2rem;
  color: #ffffff;
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(60, 215, 255, 0.35);
}

.team__subtitle {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  color: var(--tertiary);
  margin-bottom: 2.5rem;
}

.team__state {
  text-align: center;
  color: var(--on-surface-variant);
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  padding: 2rem 0;
}

/* Grid — cards médios (fotos menores = mais densidade/nitidez) */
.team__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 300px));
  gap: 1.5rem;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  justify-content: center;
}

.team__grid--single {
  grid-template-columns: minmax(0, 320px);
  justify-content: center;
}

/* Card */
.team-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  background: rgba(12, 17, 30, 0.6);
  border: 1px solid rgba(60, 215, 255, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px);
  will-change: transform, opacity;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.5s ease,
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

.team-card.in { opacity: 1; transform: translateY(0); }
/* após revelar, libera o will-change para não pesar */
.team-card.in { will-change: auto; }

.team-card:hover {
  border-color: rgba(60, 215, 255, 0.5);
  box-shadow: 0 0 36px rgba(60, 215, 255, 0.16), inset 0 0 20px rgba(60, 215, 255, 0.05);
  transform: translateY(-4px);
}

/* Photo (full width, top of card) */
.team-card__photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #05080f;
  overflow: hidden;
}

.team-card__photo-wrap img,
.team-card__noimg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* apenas saturação reduzida + leve blur em repouso; sem grayscale e sem
     hue-rotate — assim a transição não passa por roxo. */
  filter: saturate(0.4) blur(3px) brightness(0.92);
  transform: scale(1.02);
  transition: filter 0.5s ease, transform 0.6s ease;
}

.team-card__noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 3rem;
  color: var(--tertiary);
  background: var(--surface-low);
  filter: none;
  transform: none;
}

.team-card:hover .team-card__photo-wrap img {
  filter: saturate(1) blur(0) brightness(1);
  transform: scale(1);
}

/* subtle gradient at the bottom of the photo for legibility */
.team-card__photo-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5, 8, 15, 0.6), transparent 45%);
  pointer-events: none;
}

/* LinkedIn overlay — centered on the (blurred) photo, fades on hover */
.team-card__linkedin {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(10, 14, 28, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: opacity 0.35s ease, transform 0.35s ease, background 0.25s, border-color 0.25s;
}

.team-card__linkedin svg { width: 34px; height: 34px; display: block; }

.team-card__linkedin:hover {
  background: rgba(60, 215, 255, 0.18);
  border-color: var(--tertiary);
}

/* when the card is highlighted, the icon steps aside to a corner badge */
.team-card:hover .team-card__linkedin {
  top: auto;
  bottom: 0.75rem;
  left: auto;
  right: 0.75rem;
  transform: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(10, 14, 28, 0.75);
}
.team-card:hover .team-card__linkedin svg { width: 22px; height: 22px; }

/* Card body */
.team-card__body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.team-card__name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
  letter-spacing: 0.01em;
  margin: 0 0 0.1rem;
}

/* Nome como imagem — mesmo formato do texto grande anterior (Orbitron branco) */
.team-card__name-img {
  display: block;
  height: 30px;
  width: auto;
  max-width: 100%;
  margin: 0 0 0.2rem;
  object-fit: contain;
  object-position: left center;
  /* estabiliza o SVG durante o scale/translate do reveal (evita tremor) */
  transform: translateZ(0);
  backface-visibility: hidden;
  image-rendering: auto;
}

/* Cargo principal — mono em caixa alta com colchetes */
.team-card__role {
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tertiary);
  margin: 0;
  line-height: 1.4;
}
.team-card__role::before { content: '[ '; opacity: 0.6; }
.team-card__role::after { content: ' ]'; opacity: 0.6; }

/* Especialidade — linha secundária, legível, sem caixa alta forçada */
.team-card__spec {
  font-size: 0.82rem;
  color: var(--on-surface-variant);
  letter-spacing: 0.01em;
  line-height: 1.5;
  margin: 0.15rem 0 0.75rem;
}

.team-card__desc {
  font-size: 0.92rem;
  color: var(--on-surface-variant);
  line-height: 1.65;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.team-card__more {
  margin-top: 0.9rem;
  align-self: flex-start;
  background: rgba(60, 215, 255, 0.08);
  border: 1px solid rgba(60, 215, 255, 0.3);
  color: var(--tertiary);
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s, transform 0.2s;
}
.team-card__more:hover {
  background: rgba(60, 215, 255, 0.16);
  border-color: var(--tertiary);
  box-shadow: 0 0 16px rgba(60, 215, 255, 0.25);
  transform: translateY(-1px);
}

/* Responsive */
@media (min-width: 1920px) {
  .team__title { font-size: 2.6rem; }
  .team__grid { max-width: 1500px; gap: 2.25rem; }
  .team-card__desc { font-size: 1.02rem; }
}

@media (max-width: 768px) {
  .team { padding: 1.75rem 0.9rem; }
  .team, .team__title, .team__subtitle { text-align: center; }
  .team__title { font-size: 1.2rem; margin-bottom: 0.25rem; }
  .team__subtitle { font-size: 0.68rem; margin-bottom: 1rem; }
  .team__grid, .team__grid--single {
    width: 100%;
    grid-template-columns: minmax(0, 300px);
    justify-content: center;
    gap: 0.75rem;
  }
  .team-card__photo-wrap { aspect-ratio: 16 / 10; }
  .team-card__body { padding: 0.7rem 0.9rem 0.9rem; gap: 0.1rem; }
  .team-card__name-img { height: 21px; }
  .team-card__role { font-size: 0.68rem; }
  .team-card__spec { font-size: 0.75rem; margin: 0.1rem 0 0.4rem; }
  .team-card__more { margin-top: 0.5rem; padding: 0.35rem 0.8rem; font-size: 0.66rem; }
}

/* ── Mobile estreito ≤480px: equipe ainda mais compacta ── */
@media (max-width: 480px) {
  .team { padding: 1.4rem 0.75rem; }
  .team__title { font-size: 1.05rem; }
  .team__subtitle { font-size: 0.62rem; margin-bottom: 0.85rem; letter-spacing: 0.05em; }
  .team__grid, .team__grid--single {
    width: 100%;
    grid-template-columns: minmax(0, 280px);
    justify-content: center;
    gap: 0.6rem;
  }
  .team-card { border-radius: 8px; text-align: left; }
  .team-card__photo-wrap { aspect-ratio: 16 / 9; }
  .team-card__body { padding: 0.6rem 0.75rem 0.75rem; }
  .team-card__name-img { height: 18px; }
  .team-card__role { font-size: 0.64rem; }
  .team-card__spec { font-size: 0.72rem; margin: 0.05rem 0 0.35rem; }
  .team-card__more { margin-top: 0.4rem; padding: 0.3rem 0.75rem; font-size: 0.62rem; }
}

/* ════════════════════════════════════════════════════════════
   MOBILE PORTRAIT ONLY — grid 2 colunas de CÍRCULOS (2x4)
   ════════════════════════════════════════════════════════════ */
@media (max-width: 600px) and (orientation: portrait) {
  .team { padding: 1.6rem 0.9rem; }
  .team__title { font-size: 1.1rem; }
  .team__subtitle { font-size: 0.62rem; margin-bottom: 1.1rem; }

  .team__grid,
  .team__grid--single {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.1rem 0.75rem;
    max-width: 420px;
    width: 100%;
    justify-content: center;
  }

  /* Card vira coluna centrada, fundo transparente (só o círculo + texto) */
  .team-card {
    background: none;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    align-items: center;
    text-align: center;
    overflow: visible;
  }
  .team-card:hover {
    border: none;
    box-shadow: none;
    transform: translateY(-2px);
  }

  /* Foto circular */
  .team-card__photo-wrap {
    width: 118px;
    height: 118px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(60, 215, 255, 0.3);
    box-shadow: 0 0 18px rgba(60, 215, 255, 0.12);
    margin: 0 auto;
  }
  .team-card__photo-wrap::after { display: none; }
  .team-card__photo-wrap img { filter: saturate(0.55) blur(1.5px) brightness(0.95); }
  .team-card:hover .team-card__photo-wrap {
    border-color: var(--tertiary);
    box-shadow: 0 0 24px rgba(60, 215, 255, 0.28);
  }

  .team-card__body {
    padding: 0.55rem 0.25rem 0;
    align-items: center;
    gap: 0.1rem;
  }
  .team-card__name-img {
    height: 15px;
    margin: 0 auto 0.15rem;
    object-position: center;
  }
  .team-card__role {
    font-size: 0.58rem;
    letter-spacing: 0.03em;
  }
  /* No círculo compacto escondemos a especialidade e o botão — detalhe no toque */
  .team-card__spec { display: none; }
  .team-card__more {
    margin: 0.35rem auto 0;
    padding: 0.25rem 0.7rem;
    font-size: 0.58rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .team, .team::before, .team-card__photo-wrap img { animation: none; }
  .team-card__photo-wrap img { filter: saturate(0.5); transform: none; }
}

/* ============================================================
   Team modal ("Ver +") — reuses .popup glass styles
   ============================================================ */
.team-popup__head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}

.team-popup__photo-wrap {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-low);
}

.team-popup__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.team-popup__name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
  margin: 0 0 0.3rem;
}

.team-popup__title { margin: 0 0 0.5rem; }
.team-popup__name-img {
  display: block;
  height: 24px;
  width: auto;
  max-width: 100%;
  margin: 0 0 0.4rem;
  object-fit: contain;
  object-position: left center;
}
.team-popup__title .team-card__role {
  font-size: 0.76rem;
}
.team-popup__title .team-card__spec {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
}

.team-popup__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.team-popup__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  color: var(--primary);
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border: 1px solid rgba(60, 215, 255, 0.18);
  border-radius: 6px;
  background: rgba(60, 215, 255, 0.05);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.team-popup__link:hover {
  color: var(--tertiary);
  border-color: rgba(60, 215, 255, 0.45);
  background: rgba(60, 215, 255, 0.12);
}
.team-popup__link svg { width: 15px; height: 15px; }

.team-popup__desc {
  font-size: 0.95rem;
  color: var(--on-surface-variant);
  line-height: 1.75;
  margin: 0;
}

.team-popup__certs-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tertiary);
  margin: 0 0 0.75rem;
}

.team-popup__certs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.team-popup__cert {
  display: block;
  padding: 0.6rem 0.9rem;
  background: rgba(60, 215, 255, 0.06);
  border: 1px solid rgba(60, 215, 255, 0.18);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--on-surface-variant);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
a.team-popup__cert::before { content: '✓ '; color: var(--tertiary); }
a.team-popup__cert:hover {
  border-color: rgba(60, 215, 255, 0.45);
  background: rgba(60, 215, 255, 0.12);
  color: var(--on-surface);
}

@media (max-width: 480px) {
  .team-popup__head { flex-direction: column; text-align: center; }
  .team-popup__name { font-size: 1.1rem; }
}
