/* ==========================================================================
   SEÇÃO "COMO FUNCIONA / MEU MÉTODO"
   Estrutura e animação conforme a especificação "Metodo em Etapas"
   (GSAP + ScrollTrigger, pin na rolagem nativa).
   Adaptações para o site do Octávio:
   - paleta do hero: fundo preto #0f0f0f, texto branco #e2e2e2, roxos da marca;
   - títulos/contador em TWK Everett Black Italic, textos em Inter;
   - medidas da spec estavam em rem com base 62.5% (1rem = 10px). Como o site
     usa base 16px, todos os valores foram convertidos para px equivalentes;
   - a granulação fica restrita à seção (não ao body), para não afetar o hero.
   ========================================================================== */

.curiosity-reel,
.team-scroll {
  --metodo-bg: var(--preto);
  --metodo-ink: var(--branco);
  --metodo-muted: rgba(226, 226, 226, 0.68);
  --metodo-card-bg: #171717;
  --padding-x: clamp(12px, 2.8vw, 32px);
}

/* Granulação (escopo da seção) */
.curiosity-reel::before,
.team-content::before {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  content: "";
  opacity: 0.16;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.55) 0.5px, transparent 0.7px),
    radial-gradient(rgba(0, 0, 0, 0.6) 0.5px, transparent 0.7px);
  background-size: 3px 3px, 4px 4px;
  background-position: 0 0, 1px 2px;
  mix-blend-mode: soft-light;
}

.team-card-image,
.curiosity-reel img { display: block; max-width: 100%; }

/* ---------------- Abertura: Como funciona / Meu Método ---------------- */
.curiosity-reel {
  position: relative;
  width: 100%;
  height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(76, 5, 158, 0.22), transparent 38%),
    var(--metodo-bg);
  color: var(--metodo-ink);
}

.curiosity-reel-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  width: min(645px, 92vw);
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: translate(-50%, -50%);
}

.curiosity-reel-eyebrow {
  margin: 0 0 18px;
  color: var(--metodo-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.curiosity-reel-title {
  margin: 0;
  color: var(--metodo-ink);
  font-family: var(--font-display);
  font-size: clamp(48px, 8.8vw, 88px);
  font-style: italic;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  text-transform: uppercase;
}

.curiosity-reel-title span { padding-right: 0.08em; }

.curiosity-reel-bar {
  display: block;
  width: 64px;
  height: 3px;
  margin: 30px 0 24px;
  background: var(--roxo-claro);
}

.curiosity-reel-text {
  max-width: 380px;
  margin: 0;
  color: var(--metodo-muted);
  font-size: clamp(15px, 1.15vw, 17px);
  line-height: 1.6;
}

/* ---------------- Palco fixo com as etapas ---------------- */
.team-scroll {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 100svh;
  background: var(--metodo-bg);
  color: var(--metodo-ink);
  --progress: 0;
  --scroll-velocity: 0;
  --total-items: 5;
}

.team-content {
  position: relative;
  top: 0;
  left: 0;
  display: flex;
  width: 100%;
  height: 100svh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 var(--padding-x);
  isolation: isolate;
}

.team-index {
  position: absolute;
  z-index: 8;
  top: clamp(50px, 9.8vw, 92px);
  left: 50%;
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0;
  color: var(--metodo-ink);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateX(-50%);
  mix-blend-mode: difference;
}

.team-index-number { opacity: 0.62; }

.team-cards {
  --width: min(504px, 39vw, 62vh);
  --height: min(550px, 42.5vw, 67.5vh);
  --stack-gap: clamp(18px, 2.2vw, 32px);
  position: relative;
  z-index: 3;
  display: grid;
  width: var(--width);
  height: var(--height);
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.team-card {
  position: absolute;
  inset: 0;
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--metodo-card-bg);
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.team-card-scene {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: clip;
  background-position: center;
  background-size: cover;
}

.team-card-image {
  --parallax-factor: 0.9px;
  --parallax-scale: 1.1;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  object-position: center;
  filter: grayscale(100%);
  opacity: 0.3;
  transform:
    translateX(calc(var(--scroll-velocity) * var(--parallax-factor)))
    translateY(calc(var(--scroll-velocity) * var(--parallax-factor)))
    translateZ(0)
    scale(var(--parallax-scale));
  transition: filter 1.4s ease, opacity 1.4s ease;
}

.team-card.is-active .team-card-image {
  filter: grayscale(0%);
  opacity: 1;
}

/* Descrições */
.team-info {
  position: absolute;
  inset: 0;
  z-index: 5;
  padding: 0 var(--padding-x);
  pointer-events: none;
}

.team-description {
  position: absolute;
  top: clamp(180px, 26.1vh, 267px);
  right: clamp(24px, 8.8vw, 120px);
  width: min(240px, calc(100vw - 48px));
  margin: 0;
  color: var(--metodo-muted);
  font-size: clamp(15px, 1.25vw, 18px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.4;
  text-wrap: balance;
  overflow-wrap: normal;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.team-description strong {
  display: block;
  margin-bottom: 10px;
  color: var(--metodo-ink);
  font-family: var(--font-display);
  font-size: 1.25em;
  font-style: italic;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.team-description.is-active {
  opacity: 1;
  transform: translateY(0);
}

/* Contador */
.team-counter {
  position: absolute;
  z-index: 5;
  bottom: clamp(48px, 8vh, 76px);
  left: clamp(60px, 12.5vw, 180px);
  color: var(--roxo-claro);
  font-family: var(--font-display);
  font-size: clamp(120px, 16.6vw, 240px);
  font-style: italic;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 0.9;
  text-transform: uppercase;
  pointer-events: none;
}

.team-counter-value {
  display: block;
  min-width: 1.18em;
  font-variant-numeric: tabular-nums;
  will-change: opacity, transform;
}

/* ---------------- Tablet: 768px a 1199px ---------------- */
@media (max-width: 1199px) {
  .curiosity-reel-title { font-size: clamp(44px, 7.5vw, 72px); }

  .team-cards {
    --width: min(74vw, 333px, 42vh);
    --height: min(81vw, 364px, 46vh);
  }

  .team-description {
    top: auto;
    right: auto;
    bottom: clamp(40px, 7vh, 70px);
    left: 50%;
    width: min(82vw, 320px);
    font-size: clamp(13px, 3.8vw, 15px);
    text-align: center;
    transform: translate(-50%, 18px);
  }

  .team-description.is-active { transform: translate(-50%, 0); }

  .team-counter {
    top: clamp(70px, 13vh, 100px);
    bottom: auto;
    left: var(--padding-x);
    font-size: clamp(58px, 18vw, 100px);
    opacity: 0.85; /* spec: 0.42 para texto marfim; roxo sobre preto precisa de mais */
  }

  .team-card-image {
    --parallax-factor: 0.45px;
    --parallax-scale: 1.08;
  }
}

/* ---------------- Mobile: abaixo de 768px ---------------- */
@media (max-width: 767px) {
  .curiosity-reel-title { font-size: clamp(40px, 12vw, 56px); }

  .team-content { padding: 0 16px; }

  .team-cards {
    --width: min(82vw, 255px, 38vh);
    --height: min(calc(var(--width) * 1.09), 43vh);
    margin-bottom: clamp(70px, 12vh, 110px);
  }

  .team-description {
    bottom: clamp(24px, 5vh, 48px);
    width: calc(100vw - 32px);
  }

  .team-description strong { margin-bottom: 6px; }
}

/* Fundo preto: "Método" em roxo claro de destaque (legível no preto) */
.curiosity-reel-title span { color: var(--roxo-destaque); }
.team-counter { color: var(--roxo-destaque); }

/* Ícones sem fundo: o card fica transparente e sem a cópia da imagem como fundo */
.team-card { background: transparent; }
.team-card-scene { background: none; }
/* Ícone em destaque: branco puro #ffffff (PNGs já em #ffffff), sem halo */
.team-card.is-active .team-card-image {
  filter: none;
  opacity: 1;
}

/* Fundo preto liso: sem a textura granulada da especificação original */
.curiosity-reel::before,
.team-content::before {
  content: none;
}

/* ==========================================================================
   Ícones brancos com luz roxa atrás (mesma linguagem do fundo dos Planos):
   uma mancha de luz difusa + um feixe diagonal desfocado.
   ========================================================================== */
.team-card-scene { isolation: isolate; }

.team-card-image { z-index: 1; }

.team-card-scene::before,
.team-card-scene::after {
  position: absolute;
  z-index: 0;
  content: "";
  pointer-events: none;
  opacity: 0.25;
  transition: opacity 1.4s ease;
}

/* luz difusa central */
.team-card-scene::before {
  inset: 12% 10%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 45% 45%, rgba(157, 92, 245, 0.75) 0%, rgba(124, 58, 237, 0.45) 30%, rgba(76, 5, 158, 0.18) 55%, transparent 72%);
  filter: blur(18px);
}

/* feixe diagonal, como os arcos de luz dos Planos */
.team-card-scene::after {
  top: -10%;
  left: 38%;
  width: 26%;
  height: 120%;
  border-radius: 50%;
  background: linear-gradient(180deg, transparent 0%, rgba(167, 112, 255, 0.55) 45%, rgba(76, 5, 158, 0.25) 70%, transparent 100%);
  filter: blur(26px);
  transform: rotate(32deg);
}

.team-card.is-active .team-card-scene::before { opacity: 1; }
.team-card.is-active .team-card-scene::after { opacity: 0.85; }

/* luz mais aberta em volta do ícone e feixe mais visível */
.team-card-scene::before {
  inset: 0;
  background:
    radial-gradient(ellipse 48% 44% at 50% 50%, rgba(157, 92, 245, 0.7) 0%, rgba(124, 58, 237, 0.42) 45%, rgba(76, 5, 158, 0.15) 75%, transparent 100%);
  filter: blur(22px);
}

.team-card-scene::after {
  left: 36%;
  width: 30%;
  background: linear-gradient(180deg, transparent 0%, rgba(178, 128, 255, 0.75) 42%, rgba(76, 5, 158, 0.3) 72%, transparent 100%);
}

.team-card.is-active .team-card-scene::after { opacity: 1; }

/* ==========================================================================
   Ajuste: ícone um pouco menos branco e luz roxa mais destacada.
   Uma sombra escura bem sutil separa o símbolo do brilho para ele não sumir.
   ========================================================================== */
.team-card.is-active .team-card-image {
  filter: brightness(0.8) drop-shadow(0 0 6px rgba(5, 5, 5, 0.55));
  opacity: 1;
}

.team-card-scene::before {
  background:
    radial-gradient(ellipse 54% 50% at 50% 50%, rgba(157, 92, 245, 0.95) 0%, rgba(124, 58, 237, 0.62) 42%, rgba(76, 5, 158, 0.28) 72%, transparent 100%);
  filter: blur(24px);
}

.team-card-scene::after {
  background: linear-gradient(180deg, transparent 0%, rgba(178, 128, 255, 0.95) 42%, rgba(76, 5, 158, 0.42) 72%, transparent 100%);
}

/* Luz roxa livre: o card não corta mais o brilho (antes havia overflow
   hidden/clip, que formava a borda quadrada). A luz também passa um pouco
   dos limites do card para se dissolver no fundo. */
.team-card,
.team-card-scene {
  overflow: visible;
}

.team-card-scene::before {
  inset: -18%;
  background:
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(157, 92, 245, 0.95) 0%, rgba(124, 58, 237, 0.6) 30%, rgba(76, 5, 158, 0.25) 55%, transparent 72%);
  filter: blur(30px);
}

.team-card-scene::after {
  top: -25%;
  height: 150%;
  background: linear-gradient(180deg, transparent 0%, rgba(178, 128, 255, 0.9) 40%, rgba(76, 5, 158, 0.4) 65%, transparent 100%);
  filter: blur(34px);
}

/* Mesmo preto que aparece na seção Planos (#050505, medido na tela) */
.curiosity-reel,
.team-scroll {
  --metodo-bg: #050505;
}
