/* iholp · movimento (versão 2)
   Ideia única: "o rastro". A página se comporta como o produto: cada etapa
   deixa um registro. Uma trilha acompanha a rolagem e os blocos entram
   como lançamentos sendo registrados.
   Tudo aqui só vale com a classe .motion no <html>, que o motion.js liga
   quando há suporte e a pessoa não pediu movimento reduzido. Sem ela,
   a página fica exatamente como a versão estática. */

@property --sweep { syntax: "<percentage>"; inherits: false; initial-value: 100%; }

/* ---------- Trilha de rolagem ---------- */
.trail-bar { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--cyan); transform: scaleX(var(--scroll, 0)); transform-origin: left; pointer-events: none; }
.nav { transition: box-shadow .25s; }
.nav.is-stuck { box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .7); }
.nav__links a { position: relative; transition: color .2s; }
.nav__links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 2px; background: var(--cyan); transform: scaleX(0); transform-origin: left; transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.nav__links a.is-current { color: var(--white); }
.nav__links a.is-current::after { transform: scaleX(1); }

.rail { display: none; }
@media (min-width: 1400px) {
  .rail { position: fixed; z-index: 15; left: max(22px, calc((100vw - 1160px) / 2 - 72px)); top: 50%; transform: translateY(-50%); display: grid; gap: 22px; padding: 0; }
  .rail::before, .rail::after { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: rgba(140, 138, 160, .45); }
  .rail::after { background: var(--orange); transform: scaleY(var(--rail, 0)); transform-origin: top; transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
  .rail a { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; height: 12px; text-decoration: none; }
  .rail i { width: 12px; height: 12px; border-radius: 50%; background: #a9a7bb; box-shadow: 0 0 0 3px rgba(255, 255, 255, .0); transition: background-color .3s, transform .3s, box-shadow .3s; }
  .rail a.is-done i { background: var(--orange); }
  .rail a.is-current i { background: var(--orange); transform: scale(1.35); box-shadow: 0 0 0 5px rgba(184, 78, 5, .22); }
  .rail span { padding: 3px 9px; border-radius: 999px; background: var(--indigo-deep); color: var(--white); font-size: .74rem; font-weight: 600; white-space: nowrap; opacity: 0; transform: translateX(-6px); transition: opacity .2s, transform .2s; pointer-events: none; }
  .rail a:hover span, .rail a:focus-visible span { opacity: 1; transform: none; }
}

/* ---------- Entrada dos blocos ---------- */
.motion .rv { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 80ms); }
.motion .rv.is-in { opacity: 1; transform: none; }
.motion .rv--left { transform: translateX(-26px); }
.motion .rv--right { transform: translateX(26px); }
.motion .rv--scale { transform: translateY(26px) scale(.97); }

/* linhas de topo que se desenham (como um registro sendo traçado) */
.motion .pains, .motion .map section, .motion .audit__list div:first-child { border-top-color: transparent; position: relative; }
.motion .pains::before, .motion .map section::before, .motion .audit__list div:first-child::before {
  content: ""; position: absolute; left: 0; top: -2px; height: 2px; width: 100%; background: var(--cyan);
  transform: scaleX(0); transform-origin: left; transition: transform .9s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 80ms);
}
.motion .pains::before { background: var(--indigo); }
.motion .pains.is-in::before, .motion .map section.is-in::before, .motion .audit__list div:first-child.is-in::before { transform: scaleX(1); }

/* ---------- Hero: sequência de abertura ---------- */
/* O texto do hero nunca fica invisível: só desliza, para o título aparecer de imediato (LCP). */
.motion .hero__copy > * { transform: translateY(16px); animation: rise .7s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(var(--i, 0) * 70ms); }
.motion .hero__shot { opacity: 0; transform: perspective(1400px) translateY(40px) rotateX(8deg) scale(.96); transform-origin: 50% 100%; animation: settle .9s cubic-bezier(.2, .7, .2, 1) .1s forwards; }
.motion .hero__mark { animation: drift 1.6s cubic-bezier(.2, .7, .2, 1) both; translate: 0 var(--parallax, 0px); }
.motion .hero .stat { opacity: 0; transform: translateY(10px); animation: rise .5s ease-out forwards; animation-delay: calc(var(--i, 0) * 70ms + .5s); }
.motion .hero .bar i { transform: scaleX(0); transform-origin: left; animation: growX .8s cubic-bezier(.2, .7, .2, 1) .8s forwards; }
.motion .hero .donut { --sweep: 0%; -webkit-mask: conic-gradient(#000 var(--sweep), transparent 0); mask: conic-gradient(#000 var(--sweep), transparent 0); animation: sweep .9s cubic-bezier(.4, 0, .2, 1) .7s forwards; }
.motion .hero .app__side .is-on { animation: blip 1.2s ease-out 1.2s both; }

@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes settle { to { opacity: 1; transform: perspective(1400px) translateY(0) rotateX(0) scale(1); } }
@keyframes drift { from { opacity: 0; transform: translate(40px, -30px) rotate(6deg); } to { opacity: .09; transform: none; } }
@keyframes growX { to { transform: scaleX(1); } }
@keyframes sweep { to { --sweep: 100%; } }
@keyframes blip { 0% { box-shadow: 0 0 0 0 rgba(61, 90, 241, .45); } 100% { box-shadow: 0 0 0 10px rgba(61, 90, 241, 0); } }

/* ---------- Fluxo: a linha acompanha a etapa ---------- */
.flow__steps::after { content: ""; position: absolute; left: 8.33%; top: 23px; height: 2px; width: calc(83.34% * var(--flow, 0)); background: var(--indigo); transition: width .5s cubic-bezier(.2, .7, .2, 1); }
.flow__steps button { z-index: 1; }
.motion .flow__text.is-swap > * { animation: swap .45s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 50ms); }
.motion .pill.is-swap { animation: stamp .45s cubic-bezier(.3, 1.6, .5, 1) both; }
.motion .ledger__note.is-swap { animation: swap .45s ease-out both; }
@keyframes swap { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes stamp { from { opacity: 0; transform: scale(1.25) rotate(-4deg); } to { opacity: 1; transform: none; } }
.meter i { transition: width .5s cubic-bezier(.2, .7, .2, 1); }
@media (max-width: 760px) { .flow__steps::after { display: none; } }

/* ---------- Telas do produto ---------- */
.kb__card { transition: transform .2s, box-shadow .2s; }
.kb__card:hover { transform: translateY(-3px); box-shadow: 0 10px 20px -10px rgba(30, 34, 60, .35); }
.motion .kb.is-in .kb__card { animation: rise .5s ease-out both; animation-delay: calc(var(--i, 0) * 70ms + 150ms); }
.motion .kb .kb__card { opacity: 0; transform: translateY(12px); }

.motion .bud__table tbody tr, .motion .bud__table tfoot tr { opacity: 0; transform: translateX(-10px); transition: opacity .45s ease-out, transform .45s ease-out; transition-delay: calc(var(--i, 0) * 90ms + 200ms); }
.motion .bud.is-in .bud__table tr { opacity: 1; transform: none; }

.motion .chart__bars i { transform: scaleY(0); transform-origin: bottom; transition: transform .8s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i, 0) * 70ms + 100ms); }
.motion .cash.is-in .chart__bars i { transform: scaleY(1); }
.chart__bars i { transition: filter .2s; }
.chart__m:hover .chart__bars i { filter: brightness(1.12); }

.motion .path li { opacity: 0; transform: translateX(-8px); transition: opacity .35s, transform .35s; transition-delay: calc(var(--i, 0) * 110ms + 250ms); }
.motion .duo__card.is-in .path li { opacity: 1; transform: none; }

/* ---------- Auditoria: o histórico é escrito linha a linha ---------- */
.motion .trail__list li { opacity: 0; transform: translateY(-6px); transition: opacity .4s ease-out, transform .4s ease-out, background-color .6s; transition-delay: calc(var(--i, 0) * 420ms + 300ms); }
.motion .trail.is-in .trail__list li { opacity: 1; transform: none; }
.motion .trail.is-in .trail__list li.is-audit { animation: audit 1.6s ease-out calc(5 * 420ms + 700ms) 2; }
@keyframes audit { 0%, 100% { box-shadow: inset 3px 0 0 var(--cyan); } 50% { box-shadow: inset 3px 0 0 var(--cyan), inset 0 0 0 999px rgba(63, 200, 244, .16); } }

/* ---------- Comparativo ---------- */
.motion .cmp tbody td:last-child { clip-path: inset(0 100% 0 0); transition: clip-path .6s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 110ms + 250ms); }
.motion .cmp.is-in tbody td:last-child { clip-path: inset(0 0 0 0); }

/* ---------- Botões e campos ---------- */
.btn { transition: background-color .15s, border-color .15s, transform .18s cubic-bezier(.2, .7, .2, 1), box-shadow .18s; }
.btn--accent:hover, .btn--wa:hover { transform: translateY(-2px); box-shadow: 0 12px 22px -12px rgba(0, 0, 0, .55); }
.btn:active { transform: translateY(0) scale(.98); }
.chips span { transition: transform .18s; }
.chips span:hover { transform: translateY(-2px); }
.who__list li, .security__list div { transition: padding-left .25s cubic-bezier(.2, .7, .2, 1); }
.who__list li:hover, .security__list div:hover { padding-left: 10px; }
.motion .form__done:not([hidden]) > * { animation: rise .5s ease-out both; opacity: 0; transform: translateY(14px); animation-delay: calc(var(--i, 0) * 90ms); }
.motion .form__done:not([hidden]) img { animation: land .7s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes land { from { opacity: 0; transform: translate(-30px, 20px) rotate(-18deg) scale(.6); } to { opacity: 1; transform: none; } }
.motion .demo__mark { translate: 0 var(--parallax2, 0px); }

@media (prefers-reduced-motion: reduce) {
  .trail-bar, .rail::after { transition: none; }
}
