/* ============================================================================
   KITS DA CASA · kits.css · ART MACHINE (19/09/2026)
   Copiar VERBATIM para site/kits.css. Não editar no site: o que for específico
   do cliente vai em style.css. Os tokens de movimento são os da RECEITAS.md §E.
   ============================================================================ */
:root {
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-inout: cubic-bezier(0.83, 0, 0.17, 1);
  --ease-back:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-micro: .25s; --dur-reveal: .8s; --dur-chegada: 1.1s; --dur-cortina: 1.2s;
  --trilho-cena: 300vh; --trilho-ponte: 100vh;
  /* tema (P06 amanhecer interpola estas duas) */
  --bg: #f4f1ea; --fg: #14120f; --acento: #b8551f; --mudo: rgba(20,18,15,.55);
}
html { font-size: clamp(14px, calc(100vw / 1440 * 16), 19px); scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { margin: 0; background: var(--bg); color: var(--fg); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img, video, canvas { display: block; max-width: 100%; }

/* --- B1 cortina com contador -------------------------------------------- */
.am-cortina { position: fixed; inset: 0; z-index: 9999; background: var(--fg); color: var(--bg);
  display: grid; place-items: center; clip-path: inset(0 0 0 0 round 0); }
.am-cortina__n { font: 500 clamp(48px, 8vw, 120px)/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.am-cortina__rotulo { position: absolute; left: 24px; bottom: 24px; font: 500 12px/1 ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; opacity: .6; }

/* --- palco + trilho (cena scrub, P12 layered pinned reveal) --------------- */
.am-trilho { position: relative; height: var(--trilho-cena); }
.am-palco { position: sticky; top: 0; height: 100dvh; overflow: clip; }
.am-palco canvas { width: 100%; height: 100%; object-fit: cover; }
.am-sobre { position: relative; z-index: 2; }              /* a seção seguinte sobe POR CIMA do palco */
.am-grain::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>"); }
.am-vinheta::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0,0,0,.45) 100%); }

/* --- texto: reveal (B4/C3), acender (C1), acento (D2) --------------------- */
.am-linha { display: block; overflow: hidden; }
.am-linha > span { display: block; will-change: transform; }
.am-palavra { display: inline-block; }
.am-acender .am-palavra { opacity: .22; }
.am-acento { color: var(--acento); }
.am-fantasma { position: absolute; inset: auto 0 -0.08em 0; z-index: 0; font-size: clamp(120px, 22vw, 360px); line-height: .8; font-weight: 700;
  color: color-mix(in oklab, var(--fg) 6%, var(--bg)); pointer-events: none; user-select: none; white-space: nowrap; }

/* o conteúdo que divide o bloco com um fantasma fica por cima dele */
.am-fantasma ~ * { position: relative; z-index: 1; }

/* --- P10 dados sobre a cena ---------------------------------------------- */
.am-dados { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.am-dado { position: absolute; padding: 10px 14px; background: color-mix(in oklab, var(--bg) 88%, transparent); color: var(--fg);
  border: 1px solid color-mix(in oklab, var(--fg) 14%, transparent); border-radius: 6px; font: 500 12px/1.3 ui-monospace, monospace; letter-spacing: .06em; opacity: 0; transform: translateY(12px); }
.am-dados svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.am-dados path { fill: none; stroke: var(--acento); stroke-width: 1.5; }

/* --- C7 split-stage (uma coluna fixa, outra rola) -------------------------- */
.am-split { display: grid; grid-template-columns: 1fr 1fr; gap: 6vw; align-items: start; }
.am-split__fixa { position: sticky; top: 15vh; }
@media (max-width: 820px) { .am-split { grid-template-columns: 1fr; } .am-split__fixa { position: static; } }

/* --- C8 trilho horizontal -------------------------------------------------- */
.am-htrilho { position: relative; height: 300vh; }
.am-htrilho__palco { position: sticky; top: 0; height: 100dvh; overflow: clip; display: flex; align-items: center; }
.am-htrilho__faixa { display: flex; gap: 3vw; padding: 0 6vw; will-change: transform; }
.am-htrilho__faixa > * { flex: 0 0 auto; }
@media (max-width: 820px) { .am-htrilho { height: auto; } .am-htrilho__palco { position: static; height: auto; }
  .am-htrilho__faixa { overflow-x: auto; scroll-snap-type: x mandatory; transform: none !important; } .am-htrilho__faixa > * { scroll-snap-align: start; } }

/* --- P11 foto pinada cede espaço ------------------------------------------ */
.am-ceder { position: relative; height: 200vh; }
.am-ceder__palco { position: sticky; top: 0; height: 100dvh; overflow: clip; display: grid; place-items: center; }
.am-ceder__foto { width: min(70vw, 900px); will-change: transform; }
.am-ceder__texto { position: absolute; right: 6vw; top: 50%; transform: translateY(-50%); width: 34vw; opacity: 0; }
@media (max-width: 820px) { .am-ceder { height: auto; } .am-ceder__palco { position: static; height: auto; display: block; padding: 10vh 16px; }
  .am-ceder__foto { width: 100%; transform: none !important; } .am-ceder__texto { position: static; width: auto; transform: none !important; opacity: 1 !important; margin-top: 24px; } }

/* --- D6 pill de capítulo --------------------------------------------------- */
.am-pill { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; padding: 10px 16px; border-radius: 999px;
  background: color-mix(in oklab, var(--fg) 92%, transparent); color: var(--bg); font: 500 12px/1 ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase;
  display: flex; gap: 14px; align-items: center; white-space: nowrap; }
.am-pill b { font-weight: 500; opacity: .5; }
@media (max-width: 820px) { .am-pill { font-size: 11px; padding: 8px 12px; } }

/* --- C4 contadores --------------------------------------------------------- */
.am-contador { font-variant-numeric: tabular-nums; }

/* --- C19 coreografia de peças (a OFICINA): palco com perspectiva, peças absolutas ---- */
.am-3d { perspective: 1400px; transform-style: preserve-3d; }
.am-peca { position: absolute; transform-style: preserve-3d; backface-visibility: hidden; }
.am-peca img { pointer-events: none; }

/* --- reduzir movimento ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .am-cortina { display: none; }
  .am-linha > span, .am-acender .am-palavra, .am-dado { opacity: 1 !important; transform: none !important; }
}
