/* ==========================================================================
   JORNADA / FUNIL INTERATIVO
   Modo "live" (.journey.is-live): palco fixo de 100svh, dirigido por js/funnel.js.
   Sem JS ou com prefers-reduced-motion: layout estático (hero + funil + etapas empilhadas).
   ========================================================================== */

.journey { position: relative; background: var(--bg); }
.journey-anchor { position: absolute; top: 0; left: 0; width: 1px; height: 1px; }

.journey-sticky { position: relative; padding: calc(var(--nav-h) + 3rem) clamp(1rem, 5vw, 3rem) 4rem; }

.journey-bg {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(60% 50% at 50% 46%, rgba(255, 207, 0, 0.07), transparent 70%),
    radial-gradient(40% 40% at 88% 10%, rgba(255, 255, 255, 0.035), transparent 70%);
}
.journey-bg::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(70% 60% at 50% 45%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 45%, #000 20%, transparent 75%);
}

/* ---------- Hero ---------- */
.hero-copy { position: relative; z-index: 3; max-width: 38rem; }
.hero-title {
  margin: 1.25rem 0 1.5rem; font-size: var(--fs-display); font-weight: 700;
  line-height: 0.98; letter-spacing: -0.045em; text-wrap: balance;
}
.hero-title span { color: var(--gold); }
.hero-copy .lead { max-width: 33rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

/* ---------- Funil (SVG) ---------- */
.funnel-wrap { position: relative; z-index: 2; display: grid; place-items: center; margin: 2rem auto 0; }
.funnel { width: min(100%, 640px); height: auto; aspect-ratio: 1000 / 720; overflow: visible; }

.f-back { fill: rgba(255, 255, 255, 0.03); transition: fill .7s var(--ease); }
.f-glass { fill: url(#fGlass); stroke: rgba(255, 255, 255, 0.16); stroke-width: 1.2; transition: stroke .5s, filter .6s; }
.f-rim { fill: none; stroke: rgba(255, 255, 255, 0.22); stroke-width: 1.2; transition: stroke .5s; }
.f-mouth { fill: rgba(3, 7, 18, 0.7); stroke: rgba(255, 255, 255, 0.4); stroke-width: 1.6; }
.f-sheen { fill: url(#fSheen); pointer-events: none; mix-blend-mode: screen; opacity: 0.55; }

.band.is-done .f-back { fill: rgba(255, 207, 0, 0.05); }
.band.is-on .f-back { fill: rgba(255, 207, 0, 0.14); }
.band.is-on .f-glass { stroke: var(--gold); filter: drop-shadow(0 0 14px rgba(255, 207, 0, 0.42)); }
.band.is-on .f-rim, .band.is-done .f-rim { stroke: var(--gold-line); }
.band.is-on .f-rim { stroke: var(--gold); }

.p { fill: rgba(255, 255, 255, 0.82); }
.p.is-hero { fill: var(--gold); filter: drop-shadow(0 0 5px rgba(255, 207, 0, 0.7)); }

.dust circle { fill: rgba(255, 255, 255, 0.5); animation: dust 7s ease-in-out infinite; animation-delay: var(--dl, 0s); transform-box: fill-box; }
.dust circle:nth-child(3n) { fill: rgba(255, 207, 0, 0.7); }
@keyframes dust { 0%, 100% { transform: translate(0, 0); opacity: 0.2; } 50% { transform: translate(var(--dx, 6px), -16px); opacity: 0.9; } }

.f-conv-core { fill: var(--gold); }
.f-conv-ring { fill: none; stroke: var(--gold); stroke-width: 1.4; transform-box: fill-box; transform-origin: center; opacity: 0; }
.funnel.is-conv .f-conv-ring { animation: ring 2.2s ease-out infinite; }
.funnel.is-conv .f-conv-ring:nth-child(2) { animation-delay: 1.1s; }
@keyframes ring { 0% { transform: scale(0.6); opacity: 0.8; } 100% { transform: scale(2.4); opacity: 0; } }
.f-conv { opacity: 0.25; transition: opacity .6s; }
.funnel.is-conv .f-conv, .funnel.is-late .f-conv { opacity: 1; }

/* rótulos (apenas telas largas, depois da fase hero) */
.funnel .labels { opacity: var(--pn-o, 0); }
@media (max-width: 1199px) { .funnel .labels { display: none; } }
.lbl text { font-family: var(--font); fill: var(--text-dim); transition: fill .4s; }
.lbl .n { font-size: 13px; font-weight: 600; letter-spacing: 0.14em; }
.lbl .t { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.lbl .s { font-size: 13px; }
.lbl line { stroke: rgba(255, 255, 255, 0.16); stroke-dasharray: 3 5; transition: stroke .4s; }
.lbl circle { fill: rgba(255, 255, 255, 0.3); transition: fill .4s, r .4s; }
.lbl.is-on .n, .lbl.is-on circle { fill: var(--gold); }
.lbl.is-on .t { fill: #fff; }
.lbl.is-on .s { fill: var(--text-muted); }
.lbl.is-on line { stroke: var(--gold); stroke-dasharray: none; }
.lbl.is-done .t { fill: var(--text-muted); }

/* ---------- Painel de texto das etapas ---------- */
.stage-panel { position: relative; z-index: 4; }
.stage-copy { padding: 2.5rem 0; border-top: 1px solid var(--line); }
.stage-kicker { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); }
.stage-kicker span { color: var(--gold); margin-right: 0.5rem; }
.stage-title { margin: 0.6rem 0 1.1rem; font-size: clamp(1.625rem, 2.6vw, 2.25rem); font-weight: 700; line-height: 1.08; letter-spacing: -0.03em; text-wrap: balance; }
.stage-quote { font-size: 1.0625rem; font-weight: 500; line-height: 1.45; color: #fff; padding-left: 1rem; border-left: 2px solid var(--gold); text-wrap: pretty; }
.stage-text { margin-top: 1.1rem; font-size: var(--fs-sm); color: var(--text-muted); text-wrap: pretty; }
.stage-role { margin-top: 0.9rem; font-size: var(--fs-sm); color: var(--text-2); }
.stage-role b { display: block; font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 0.2rem; }
.stage-note { margin-top: 1.25rem; font-size: 0.75rem; color: var(--text-dim); }

.stage-rail { display: none; list-style: none; }
.scroll-cue { display: none; }

/* ==========================================================================
   MODO ESTÁTICO (padrão sem JS / reduced-motion)
   ========================================================================== */
.journey:not(.is-live) .journey-sticky { display: grid; gap: 3rem; max-width: var(--maxw); margin-inline: auto; }
.journey:not(.is-live) .funnel-wrap { display: block; margin: 0; width: 100%; }
.journey:not(.is-live) .funnel { margin-inline: auto; }
.journey:not(.is-live) .stage-panel { max-width: 40rem; margin-inline: auto; }
.journey:not(.is-live) .funnel .lbl { display: none; }

/* ==========================================================================
   MODO LIVE (palco fixo)
   ========================================================================== */
.journey.is-live { height: 600vh; }
.journey.is-live .journey-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh; padding: 0; overflow: hidden; display: block;
}
.is-live .hero-copy {
  position: absolute; left: clamp(1rem, 5vw, 5rem); top: 50%; width: min(36rem, 44vw); max-width: none;
  transform: translate3d(0, calc(-50% + var(--hc-y, 0px)), 0); opacity: var(--hc-o, 1);
  will-change: transform, opacity;
}
.is-live .funnel-wrap {
  position: absolute; inset: 0; margin: 0; padding-top: var(--nav-h);
  transform-origin: 50% 55%; will-change: transform;
}
.is-live .funnel { width: auto; height: min(84vh, 84svh, 760px); max-width: none; }

.is-live .stage-panel {
  position: absolute; left: clamp(1rem, 5vw, 5rem); top: 50%; width: min(23.5rem, 30vw);
  transform: translateY(-50%); opacity: var(--pn-o, 0); display: grid; pointer-events: none;
}
.is-live .stage-copy {
  grid-area: 1 / 1; padding: 0; border: 0; align-self: center;
  opacity: 0; visibility: hidden; transform: translateY(26px);
  transition: opacity .55s var(--ease-io), transform .8s var(--ease), visibility 0s .55s;
}
.is-live .stage-copy > * { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .8s var(--ease); }
.is-live .stage-copy.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; pointer-events: auto; }
.is-live .stage-copy.is-active > * { opacity: 1; transform: none; }
.is-live .stage-copy.is-active > :nth-child(1) { transition-delay: .12s; }
.is-live .stage-copy.is-active > :nth-child(2) { transition-delay: .2s; }
.is-live .stage-copy.is-active > :nth-child(3) { transition-delay: .3s; }
.is-live .stage-copy.is-active > :nth-child(4) { transition-delay: .4s; }
.is-live .stage-copy.is-active > :nth-child(5) { transition-delay: .5s; }
.is-live .stage-copy.is-past { transform: translateY(-26px); }
.is-live .stage-note { position: absolute; left: 0; bottom: -3.25rem; width: 100%; margin: 0; }
.is-live .stage-panel .stage-note { display: none; }

/* nota fixa na base */
.is-live::after { content: none; }

/* trilho de progresso (vertical, à direita) */
.is-live .stage-rail {
  display: flex; flex-direction: column; justify-content: space-between; gap: 0;
  position: absolute; right: clamp(0.75rem, 2.5vw, 2.25rem); top: 50%; transform: translateY(-50%);
  height: min(46vh, 22rem); z-index: 5; opacity: var(--pn-o, 0);
}
.stage-rail::before, .stage-rail::after { content: ''; position: absolute; left: 4px; top: 5px; bottom: 5px; width: 1px; background: var(--line-strong); }
.stage-rail::after { background: var(--gold); transform-origin: top; transform: scaleY(var(--p, 0)); }
.stage-rail li { position: relative; z-index: 1; }
.stage-rail a { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; padding: 2px 0; }
.stage-rail i { width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1px solid rgba(255, 255, 255, 0.35); transition: all .4s var(--ease); }
.stage-rail span { position: absolute; right: 1.75rem; white-space: nowrap; font-size: 0.75rem; color: var(--text-muted); opacity: 0; transform: translateX(6px); transition: all .3s; pointer-events: none; }
.stage-rail a:hover span, .stage-rail a:focus-visible span { opacity: 1; transform: none; }
.stage-rail a.is-on i { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 12px rgba(255, 207, 0, 0.8); transform: scale(1.3); }
.stage-rail a.is-done i { background: var(--gold); border-color: var(--gold); }

.is-live .scroll-cue {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem; position: absolute; left: 50%; bottom: 1.5rem;
  transform: translateX(-50%); z-index: 5; opacity: var(--hc-o, 1); font-size: 0.6875rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dim);
}
.scroll-cue i { width: 1px; height: 2.5rem; background: linear-gradient(var(--gold), transparent); animation: cue 2s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ==========================================================================
   TELAS MÉDIAS: funil permanece à direita, sem rótulos
   ========================================================================== */
@media (max-width: 1199px) and (min-width: 900px) {
  .is-live .stage-panel { width: min(22rem, 38vw); }
  .is-live .hero-copy { width: min(34rem, 46vw); }
}

/* ==========================================================================
   MOBILE / TABLET RETRATO: composição reorganizada, não apenas reduzida
   ========================================================================== */
@media (max-width: 899px) {
  .journey.is-live { height: 560vh; }
  .is-live .hero-copy {
    left: 0; right: 0; width: auto; top: calc(var(--nav-h) + 0.75rem); padding-inline: clamp(1rem, 5vw, 2rem);
    transform: translate3d(0, var(--hc-y, 0px), 0);
  }
  .is-live .hero-copy .eyebrow { font-size: 0.6875rem; }
  .is-live .hero-title { font-size: clamp(2rem, 9.2vw, 2.75rem); margin: 0.75rem 0 0.9rem; }
  .is-live .hero-copy .lead { font-size: 0.9375rem; line-height: 1.5; }
  .is-live .hero-actions { margin-top: 1.1rem; gap: 0.5rem; }
  .is-live .hero-actions .btn--ghost { display: none; }

  .is-live .funnel-wrap { inset: auto 0 0 0; top: auto; padding: 0; height: 60svh; align-content: end; }
  .is-live .funnel { height: 100%; width: auto; max-width: 100vw; }

  .is-live .stage-panel {
    left: 0; right: 0; top: auto; bottom: 0; width: auto; transform: none; height: 38svh; align-items: start;
    padding: 1.1rem clamp(1rem, 5vw, 2rem) 1rem; display: grid;
    background: linear-gradient(180deg, rgba(3,7,18,0) 0%, rgba(3,7,18,.92) 14%, #030712 100%);
  }
  .is-live .stage-title { font-size: 1.375rem; margin: 0.35rem 0 0.6rem; }
  .is-live .stage-quote { font-size: 0.9375rem; }
  .is-live .stage-text { display: none; }
  .is-live .stage-role { font-size: 0.8125rem; margin-top: 0.6rem; }
  .is-live .stage-role b { display: inline; margin-right: 0.4rem; }

  .is-live .stage-rail {
    flex-direction: row; top: auto; bottom: calc(38svh - 0.2rem); left: clamp(1rem, 5vw, 2rem); right: clamp(1rem, 5vw, 2rem);
    transform: none; height: auto; align-items: center; z-index: 6;
  }
  .stage-rail::before, .stage-rail::after { left: 4px; right: 4px; top: 50%; bottom: auto; width: auto; height: 1px; }
  .stage-rail::after { transform-origin: left; transform: scaleX(var(--p, 0)); }
  .stage-rail span { display: none; }
  .is-live .scroll-cue { display: none; }
}

@media (max-width: 899px) and (max-height: 700px) {
  .is-live .hero-copy .lead { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .dust { display: none; }
}
