/* FarFlow — camada de movimento e profundidade.
   Tudo aqui é enfeite: se este arquivo for removido, o site continua
   íntegro e legível, só sem animação. Nada de layout depende dele,
   exceto o stepper do #metodo (bloco 3). */

/* ══ 1 · entrada por scroll, escalonada ═══════════════════════════
   O .reveal de site.css já traz a seção inteira. Aqui os filhos das
   grades entram em sequência, para a leitura acompanhar o movimento. */

.reveal :is(.pillar, .assina-card, .fase, .fund-item, .mod, .claim,
            .telas-grid > div, .portal-list li, .selo li, .faq-item) {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .62s cubic-bezier(.22, 1, .36, 1),
              transform .62s cubic-bezier(.22, 1, .36, 1);
}
.reveal.in :is(.pillar, .assina-card, .fase, .fund-item, .mod, .claim,
               .telas-grid > div, .portal-list li, .selo li, .faq-item) {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--sd, 0) * 62ms);
}

/* o índice de cada filho vira o atraso — nono em diante compartilham o último */
:is(.pillars, .assina-grid, .implant-track, .fund-grid, .mods-grid,
    .telas-grid, .portal-list, .selo ul, .faq-list, .claims .wrap) > * { --sd: 8; }
:is(.pillars, .assina-grid, .implant-track, .fund-grid, .mods-grid,
    .telas-grid, .portal-list, .selo ul, .faq-list, .claims .wrap) > :nth-child(1) { --sd: 0; }
:is(.pillars, .assina-grid, .implant-track, .fund-grid, .mods-grid,
    .telas-grid, .portal-list, .selo ul, .faq-list, .claims .wrap) > :nth-child(2) { --sd: 1; }
:is(.pillars, .assina-grid, .implant-track, .fund-grid, .mods-grid,
    .telas-grid, .portal-list, .selo ul, .faq-list, .claims .wrap) > :nth-child(3) { --sd: 2; }
:is(.pillars, .assina-grid, .implant-track, .fund-grid, .mods-grid,
    .telas-grid, .portal-list, .selo ul, .faq-list, .claims .wrap) > :nth-child(4) { --sd: 3; }
:is(.pillars, .assina-grid, .implant-track, .fund-grid, .mods-grid,
    .telas-grid, .portal-list, .selo ul, .faq-list, .claims .wrap) > :nth-child(5) { --sd: 4; }
:is(.pillars, .assina-grid, .implant-track, .fund-grid, .mods-grid,
    .telas-grid, .portal-list, .selo ul, .faq-list, .claims .wrap) > :nth-child(6) { --sd: 5; }
:is(.pillars, .assina-grid, .implant-track, .fund-grid, .mods-grid,
    .telas-grid, .portal-list, .selo ul, .faq-list, .claims .wrap) > :nth-child(7) { --sd: 6; }
:is(.pillars, .assina-grid, .implant-track, .fund-grid, .mods-grid,
    .telas-grid, .portal-list, .selo ul, .faq-list, .claims .wrap) > :nth-child(8) { --sd: 7; }

/* ══ 2 · cabeçalho que reage ao scroll ════════════════════════════ */

nav { transition: background .35s ease, box-shadow .35s ease, border-color .35s ease; }
nav .wrap { transition: height .35s cubic-bezier(.22, 1, .36, 1); }
nav .wordmark { transition: font-size .35s cubic-bezier(.22, 1, .36, 1); }
nav .wordmark svg { transition: width .35s cubic-bezier(.22, 1, .36, 1),
                                height .35s cubic-bezier(.22, 1, .36, 1); }

nav.encolhida {
  background: color-mix(in srgb, var(--ink-deep) 86%, transparent);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  border-bottom-color: color-mix(in srgb, var(--pine-line) 90%, transparent);
  box-shadow: 0 14px 34px -22px rgba(0, 0, 0, .8);
}
nav.encolhida .wrap { height: 58px; }
nav.encolhida .wordmark { font-size: 19.5px; }
nav.encolhida .wordmark svg { width: 22px; height: 22px; }

/* fio de progresso da leitura, rente à borda inferior da barra */
.nav-progresso {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
  transform: scaleX(0); transform-origin: left;
  background: linear-gradient(90deg, var(--bronze), var(--accent));
  opacity: 0; transition: opacity .35s ease;
}
nav.encolhida .nav-progresso { opacity: .9; }

/* ══ 3 · #metodo como stepper de rolagem ══════════════════════════
   Única parte deste arquivo que carrega layout: o HTML do #metodo
   pressupõe .flow-scroll / .flow-stage / .flow-steps. */

.flow-scroll {
  display: grid; grid-template-columns: .78fr 1.22fr; gap: 76px;
  margin-top: 58px; align-items: start;
}
/* O painel gruda logo abaixo da barra e para por aí. Duas tentativas de
   centrá-lo na tela falharam e não vale repetir: `top: 50vh` com
   `translateY(-50%)` sobe o painel mesmo antes de ele grudar, e ele invade
   o título da seção; caixa de `height: 100vh` com o conteúdo centrado não
   invade, mas abre um vazio enorme entre o título e o painel enquanto a
   etapa I ainda está no topo da coluna. Ancorado no topo ele nasce na mesma
   linha da etapa I e nunca sai do lugar. */
.flow-stage { position: sticky; top: 118px; padding-bottom: 24px; }
.fs-n {
  font-family: var(--display); font-style: italic; font-size: 68px;
  line-height: 1; color: var(--bronze); display: block;
  font-variant-numeric: tabular-nums;
}
.fs-t { font-size: 27px; margin-top: 12px; }
.fs-rail { list-style: none; margin-top: 30px; border-left: 1px solid var(--paper-line); }
.fs-rail li {
  position: relative; padding: 9px 0 9px 20px;
  font-size: 12px; letter-spacing: .09em; text-transform: uppercase;
  color: color-mix(in srgb, var(--muted-light) 65%, transparent);
  transition: color .35s ease;
}
.fs-rail li::before {
  content: ""; position: absolute; left: -1px; top: 0; bottom: 0; width: 2px;
  background: var(--bronze); transform: scaleY(0); transform-origin: top;
  transition: transform .45s cubic-bezier(.22, 1, .36, 1);
}
.fs-rail li.passou::before, .fs-rail li.ativa::before { transform: scaleY(1); }
.fs-rail li.passou { color: color-mix(in srgb, var(--muted-light) 80%, transparent); }
.fs-rail li.ativa { color: var(--text); }

.flow-steps { list-style: none; }
.flow-step {
  min-height: 33vh; display: flex; flex-direction: column; justify-content: center;
  padding: 26px 0 26px 32px; border-left: 1px solid var(--paper-line);
  transition: opacity .5s ease, border-color .5s ease;
}
/* o esmaecimento só existe depois que o script assume o controle —
   sem JS, as seis etapas ficam todas legíveis */
.flow-scroll.ligado .flow-step { opacity: .38; }
.flow-scroll.ligado .flow-step.ativa { opacity: 1; border-left-color: var(--bronze); }
.flow-step .n {
  font-family: var(--display); font-style: italic; font-size: 15px;
  color: var(--bronze); display: block; margin-bottom: 12px;
}
.flow-step h3 { font-size: 25px; margin-bottom: 12px; }
.flow-step p { font-size: 15px; color: var(--muted-light); line-height: 1.75; max-width: 46ch; }

/* ══ 4 · luz no verde-abeto ═══════════════════════════════════════
   Uma aura que respira atrás das seções escuras. Só transform e
   opacity — não repinta layout, não custa scroll. */

.section.dark, .cta-final { position: relative; overflow: hidden; }
.section.dark > .wrap, .cta-final > .wrap { position: relative; z-index: 1; }

.aura {
  position: absolute; pointer-events: none; z-index: 0;
  width: 78vw; max-width: 900px; aspect-ratio: 1;
  background: radial-gradient(closest-side,
    color-mix(in srgb, var(--accent) 13%, transparent), transparent 72%);
  filter: blur(24px);
  animation: deriva 27s ease-in-out infinite alternate;
  will-change: transform;
}
.aura-a { top: -22%; right: -12%; }
.aura-b { bottom: -28%; left: -14%; animation-duration: 33s; animation-direction: alternate-reverse; }
@keyframes deriva {
  from { transform: translate3d(-2.5%, -2%, 0) scale(1); opacity: .55; }
  to   { transform: translate3d(3.5%, 3%, 0) scale(1.14); opacity: .95; }
}
.hero .aura { opacity: .7; }

/* ══ 5 · transição entre páginas ══════════════════════════════════ */

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-sai .26s ease both; }
::view-transition-new(root) { animation: vt-entra .4s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes vt-sai { to { opacity: 0; } }
@keyframes vt-entra { from { opacity: 0; transform: translateY(10px); } }

/* ══ 6 · números da faixa de argumentos ═══════════════════════════ */

.claim .n { font-variant-numeric: tabular-nums; }

/* ══ formulário: estados de envio ═════════════════════════════════ */

.form button[type="submit"] { position: relative; }
.form.enviando button[type="submit"] { opacity: .6; pointer-events: none; }
/* Precisa ser `.form .form-status`, e nao `.form-status`: dentro de
   .cta-final o seletor `p` impoe max-width 52ch e vence por especificidade
   (0,1,1 contra 0,1,0), estreitando a mensagem para ~450px. */
.form .form-status {
  margin: 16px auto 0; max-width: none; font-size: 13.5px; line-height: 1.65;
  text-align: center; padding: 12px 16px; border-radius: var(--radius); display: none;
}
.form-status.visivel { display: block; }
.form-status.erro {
  color: var(--accent-soft);
  border: 1px solid var(--pine-line);
  background: color-mix(in srgb, var(--ink) 45%, transparent);
}
.form-ok { display: none; text-align: center; }
.form-ok.visivel { display: block; animation: enter .7s cubic-bezier(.22, 1, .36, 1) both; }
.form-ok .marca {
  width: 52px; height: 52px; margin: 0 auto 22px; border-radius: 50%;
  border: 1px solid var(--accent); display: grid; place-items: center;
  color: var(--accent); font-size: 22px;
}
.form-ok h3 { font-size: 25px; color: var(--paper); margin-bottom: 12px; }
.form-ok p { color: var(--muted-dark); max-width: 44ch; margin: 0 auto 8px; font-size: 15px; }
.form-ok .secundario { font-size: 13px; color: color-mix(in srgb, var(--muted-dark) 75%, transparent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ══ responsivo ═══════════════════════════════════════════════════ */

@media (max-width: 960px) {
  .flow-scroll { grid-template-columns: 1fr; gap: 0; margin-top: 42px; }
  .flow-stage { display: none; }
  /* precisa repetir .flow-scroll.ligado: a media query não vence especificidade */
  .flow-step, .flow-scroll.ligado .flow-step { min-height: 0; opacity: 1; padding: 22px 0 22px 22px; }
  .flow-step h3 { font-size: 21px; }
  .aura { width: 120vw; filter: blur(18px); }
}

/* ══ quem pediu menos movimento, recebe menos movimento ═══════════ */

@media (prefers-reduced-motion: reduce) {
  .reveal :is(.pillar, .assina-card, .fase, .fund-item, .mod, .claim,
              .telas-grid > div, .portal-list li, .selo li, .faq-item) {
    opacity: 1; transform: none; transition: none;
  }
  nav, nav .wrap, nav .wordmark, nav .wordmark svg { transition: none; }
  .aura { animation: none; opacity: .7; }
  .flow-scroll.ligado .flow-step { opacity: 1; }
  .fs-rail li::before { transition: none; }
  .form-ok.visivel { animation: none; }
  @view-transition { navigation: none; }
}
