/* Quantta: movimento e transições de página.
   Tudo aqui só vale quando js/motion.js adiciona a classe .mo ao <html>.
   Sem JS ou com "reduzir movimento" ativado, o site aparece normal e estático. */

:root { --ul: var(--amber); --ease-io: cubic-bezier(.7, 0, .2, 1); }

/* ---------- cortina de transição entre páginas ---------- */
.curtain { position: fixed; inset: 0; z-index: 1000; display: flex; pointer-events: none; }
.curtain i { flex: 1; background: var(--ink); transform: scaleY(0); transform-origin: bottom; will-change: transform; }
.curtain i:nth-child(2), .curtain i:nth-child(4) { background: var(--blue); }
.curtain i:nth-child(3) { background: var(--amber); }
.curtain .mk { position: absolute; left: 50%; top: 50%; width: 96px; height: 96px; margin: -48px 0 0 -48px; opacity: 0; }

/* cobre a tela antes mesmo do JS rodar (página chegando de outra página) */
html.pt-cover:not(.pt-ready)::before { content: ""; position: fixed; inset: 0; z-index: 999; background: var(--ink); animation: pt-failsafe 0s linear 3s forwards; }
@keyframes pt-failsafe { to { opacity: 0; visibility: hidden; } }

.pt-cover .curtain i { transform: scaleY(1); transform-origin: top; }
.pt-cover .curtain .mk { opacity: 1; }

.pt-in .curtain { pointer-events: auto; }
.pt-in .curtain i { transform-origin: bottom; animation: bar-in .6s var(--ease-io) both; animation-delay: calc(var(--n) * 70ms); }
.pt-in .curtain .mk { animation: mk-in .45s var(--ease) .38s both; }

.pt-out .curtain i { transform: scaleY(1); transform-origin: top; animation: bar-out .8s var(--ease-io) both; animation-delay: calc(var(--n) * 70ms); }
.pt-out .curtain .mk { opacity: 1; animation: mk-out .4s ease both; }

@keyframes bar-in { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes bar-out { from { transform: scaleY(1); } to { transform: scaleY(0); } }
@keyframes mk-in { from { opacity: 0; transform: scale(.55) rotate(-40deg); } to { opacity: 1; transform: none; } }
@keyframes mk-out { to { opacity: 0; transform: scale(1.4); } }

/* ---------- barra de progresso e cabeçalho ---------- */
.progress { position: fixed; left: 0; top: 0; height: 4px; width: 100%; background: var(--amber); transform: scaleX(0); transform-origin: left; z-index: 150; pointer-events: none; }
.mo .site-header { transition: background .3s; }
.mo .header-in { transition: height .35s var(--ease); }
.mo .brand img { transition: height .35s var(--ease); }
.site-header.scrolled .header-in { height: 62px; }
.site-header.scrolled .brand img { height: 36px; }
.nav a.active { border-color: var(--amber); }

/* ---------- títulos: palavras sobem de dentro de uma máscara ---------- */
.mo .split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
.mo .split .wi { display: inline-block; transform: translateY(108%) rotate(4deg); transform-origin: left bottom; }
.mo .split.go .wi { transform: none; transition: transform .95s var(--ease); transition-delay: calc(var(--i) * 55ms); }
.mo .h2.reveal { opacity: 1; transform: none; }
.mo .split em { background: linear-gradient(var(--ul), var(--ul)) 0 94% / 0% .12em no-repeat; transition: background-size 1s var(--ease) .6s; }
.mo .split.go em { background-size: 100% .12em; }
.contact { --ul: var(--cream); }
.about, .contact, .hero { --ul: var(--amber); }

/* ---------- entrada do hero ---------- */
.mo .hero .pill, .mo .hero .lead, .mo .hero-tags, .mo .hero-cta { opacity: 0; }
.mo.ready .hero .pill { animation: up .8s var(--ease) .05s both; }
.mo.ready .hero .lead { animation: up .9s var(--ease) .55s both; }
.mo.ready .hero-tags { animation: up .9s var(--ease) .7s both; }
.mo.ready .hero-cta { animation: up .9s var(--ease) .85s both; }
@keyframes up { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

.mo .art { opacity: 0; transform: translateY(calc(var(--py, 0) * 1px)); }
.mo.ready .art { opacity: 1; transition: opacity .6s .1s; }
.mo.ready .art::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform-origin: top; animation: unveil 1s var(--ease-io) .1s both; pointer-events: none; }
@keyframes unveil { from { transform: scaleY(1); } to { transform: scaleY(0); } }

.mo .a-grid line { opacity: 0; }
.mo.ready .a-grid line { animation: fade .8s ease both; animation-delay: calc(.5s + var(--g, 0) * 45ms); }
@keyframes fade { to { opacity: 1; } }
.mo .a-ring { stroke-dasharray: 704; stroke-dashoffset: 704; transform-box: fill-box; transform-origin: center; transform: rotate(-90deg); }
.mo.ready .a-ring { animation: draw 1.5s var(--ease-io) .45s both; }
.mo .a-tail { stroke-dasharray: 160; stroke-dashoffset: 160; }
.mo.ready .a-tail { animation: draw 0.7s var(--ease) 1.5s both; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.mo .a-dot { transform-box: fill-box; transform-origin: center; transform: scale(0); }
.mo.ready .a-dot { animation: pop .8s cubic-bezier(.3, 1.6, .5, 1) 1.1s both, float 7s ease-in-out 2s infinite; }
@keyframes pop { to { transform: scale(1); } }
@keyframes float { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-12px) scale(1); } }
.mo .a-dim { opacity: 0; }
.mo.ready .a-dim { animation: fade .8s ease 1.9s both; }

/* ---------- marquee guiada pela rolagem ---------- */
.mo .marquee-track { animation: none; will-change: transform; }

/* ---------- revelações ao rolar, com direção ---------- */
.mo .reveal { --rx: 0px; --ry: 36px; opacity: 0; transform: translate(var(--rx), var(--ry)); transition: opacity .8s var(--ease), transform 1s var(--ease), box-shadow .9s var(--ease) .3s; }
.mo .reveal.in { --rx: 0px; --ry: 0px; opacity: 1; }
.mo .h2.reveal, .mo .h2.reveal.in { transition: none; }
.mo .paths .reveal:not(.in):nth-child(odd) { --rx: -64px; --ry: 0px; }
.mo .paths .reveal:not(.in):nth-child(even) { --rx: 64px; --ry: 0px; }
.mo .portrait.reveal:not(.in) { --rx: -56px; --ry: 0px; }
.mo .about .prose.reveal:not(.in) { --rx: 56px; --ry: 0px; }
.mo .cards .reveal:nth-child(2), .mo .deliver .reveal:nth-child(2) { transition-delay: 0s, 0s, .4s; }
.mo .deliver .reveal:nth-child(2) { transition-delay: .1s, .1s, .5s; }
.mo .deliver .reveal:nth-child(3) { transition-delay: .2s, .2s, .6s; }
.mo .deliver .reveal:nth-child(4) { transition-delay: .3s, .3s, .7s; }
.mo .cards .reveal:nth-child(2) { transition-delay: .15s, .15s, .55s; }
/* a sombra "estala" no lugar quando o cartão chega */
.mo .path.reveal:not(.in), .mo .card.reveal:not(.in), .mo .dcard.reveal:not(.in), .mo form.reveal:not(.in) { box-shadow: 0 0 0 var(--ink); }
.mo .path-dark.reveal:not(.in) { box-shadow: 0 0 0 var(--amber); }

/* passos do "como funciona" entram em sequência */
.mo .steps.reveal { opacity: 1; transform: none; }
.mo .steps .step { opacity: 0; transform: translateY(34px); transition: opacity .7s var(--ease), transform .9s var(--ease); }
.mo .steps.in .step { opacity: 1; transform: none; }
.mo .steps.in .step:nth-child(2) { transition-delay: .12s; }
.mo .steps.in .step:nth-child(3) { transition-delay: .24s; }
.mo .steps.in .step:nth-child(4) { transition-delay: .36s; }

/* linhas das listas riscam da esquerda para a direita */
.mo .pillars, .mo .items, .mo .checklist, .mo .faq, .mo .contact-list { position: relative; }
.mo .mo-r { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .9s var(--ease); }
.mo .mo-r.in { opacity: 1; transform: none; }

/* ---------- microinterações ---------- */
.btn svg { transition: transform .25s var(--ease); }
.btn:hover svg { transform: translateX(5px); }
.mo .path, .mo .card, .mo .dcard { transition: opacity .8s var(--ease), transform 1s var(--ease), box-shadow .9s var(--ease) .3s; }
.mo .path.in:hover, .mo .card.in:hover, .mo .dcard.in:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--ink); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.mo .path-dark.in:hover { box-shadow: 8px 8px 0 var(--amber); }

@media (max-width: 640px) {
  .curtain .mk { width: 72px; height: 72px; margin: -36px 0 0 -36px; }
  .mo .paths .reveal:not(.in):nth-child(odd), .mo .paths .reveal:not(.in):nth-child(even),
  .mo .portrait.reveal:not(.in), .mo .about .prose.reveal:not(.in) { --rx: 0px; --ry: 36px; }
}

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