/* ============================================================================
   WEB ASCENSION PRO — SCROLL ENGINE SCAFFOLD  (style.css)
   ----------------------------------------------------------------------------
   This carries the MOTION PLUMBING + invisible standards only. It imposes NO
   look — the tokens below are NEUTRAL PLACEHOLDERS. Replace color/type/spacing
   per client (SKILL.md §7). Keep the reduced-motion + a11y sections as-is.
   ============================================================================ */
:root{
  /* —— REPLACE THESE PER CLIENT —— (neutral placeholders only) */
  --bg:#0a0a0c; --bg-2:#111114; --panel:#17171c; --ink:#f2f2f4; --muted:#9a9aa4;
  --muted-2:#6f6f79; --accent:#7cc4ff; --accent-hi:#b6e0ff; --accent-dk:#3f8fd0;
  --line:rgba(160,160,180,.14); --glow:rgba(124,196,255,.4);
  --maxw:1240px; --ease:cubic-bezier(.22,.61,.36,1);
  --display:"Satoshi",system-ui,sans-serif; --body:"Satoshi",system-ui,sans-serif;
}

/* ---------- Large-screen composition (HOUSE RULE: composition scales, reading caps) ----------
   Ship these on every build (SKILL.md §1.13). All display clamp() ceilings must cap in REM so
   these root bumps lift the whole composition; reading text stays ch-capped and never over-grows.
   1880 not 1920: real 1920 screens with scrollbars/OS scaling must still fire the top step. */
@media (min-width:1600px){
  html{ font-size:17px; }
  :root{ --maxw:1360px; }
}
@media (min-width:1880px){
  html{ font-size:18px; }
  :root{ --maxw:1460px; }
}

/* ---------- base ---------- */
*,*::before,*::after{ box-sizing:border-box; }
html{ overflow-x:clip; scroll-behavior:smooth; }
html.reduce{ scroll-behavior:auto; }
body{ margin:0; background:var(--bg); color:var(--ink); font-family:var(--body);
  font-size:clamp(1rem,.95rem + .3vw,1.125rem); line-height:1.6; -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility; overflow-x:clip; }
img,canvas,svg,video{ display:block; max-width:100%; }
a{ color:inherit; text-decoration:none; }
button{ font:inherit; color:inherit; cursor:pointer; }
:focus-visible{ outline:2px solid var(--accent); outline-offset:3px; border-radius:3px; }
h1,h2,h3{ font-family:var(--display); font-weight:600; line-height:.98; letter-spacing:-.02em; margin:0; text-wrap:balance; }
.word-em{ color:var(--accent); }

/* ---------- kinetic type + reveal gating (no flash before JS) ---------- */
.js [data-split]{ visibility:hidden; }
.js [data-reveal]{ visibility:hidden; }
.word{ display:inline-block; overflow:hidden; vertical-align:top; padding:0 .02em; }
.word-i{ display:inline-block; will-change:transform; }

/* ---------- loader ---------- */
.loader{ position:fixed; inset:0; z-index:200; background:var(--bg); display:grid; place-items:center;
  transition:opacity .7s var(--ease), visibility .7s; }
.loader.done{ opacity:0; visibility:hidden; pointer-events:none; }
.loader-inner{ display:flex; flex-direction:column; align-items:center; gap:18px; }
.loader-bar{ width:180px; height:2px; background:rgba(160,160,180,.18); border-radius:2px; overflow:hidden; }
.loader-bar span{ display:block; height:100%; width:0%; background:linear-gradient(90deg,var(--accent-dk),var(--accent-hi)); }
.loader-pct{ font-family:var(--display); font-size:.8rem; letter-spacing:.2em; color:var(--muted); }

/* ---------- page-transition veil ----------
   Exit: JS adds .on, then navigates on a PLAIN setTimeout (motion-engine §13.13).
   Arrival: html.veil-in (set pre-paint in <head>) starts the page covered with no
   transition; JS removes the class after first paint and it fades out on its own. */
.veil{ position:fixed; inset:0; z-index:190; background:var(--bg); opacity:0; visibility:hidden;
  pointer-events:none; transition:opacity .45s var(--ease), visibility .45s; }
.veil.on{ opacity:1; visibility:visible; }
html.veil-in .veil{ opacity:1; visibility:visible; transition:none; }
html.reduce .veil{ display:none; }

/* ---------- scroll progress + top bar ---------- */
.progress{ position:fixed; top:0; left:0; right:0; height:2px; z-index:120; }
.progress-bar{ display:block; height:100%; width:100%; transform:scaleX(0); transform-origin:0 50%;
  background:linear-gradient(90deg,var(--accent-dk),var(--accent-hi)); }
.topbar{ position:fixed; inset:0 0 auto 0; z-index:110; display:flex; align-items:center; justify-content:space-between;
  padding:18px clamp(18px,4vw,44px);
  padding-left:max(clamp(18px,4vw,44px),env(safe-area-inset-left)); padding-right:max(clamp(18px,4vw,44px),env(safe-area-inset-right));
  transition:background .4s var(--ease), backdrop-filter .4s var(--ease); }
.topbar.scrolled{ background:color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter:blur(10px); border-bottom:1px solid var(--line); }
.top-actions{ display:flex; align-items:center; gap:14px; }

/* ---------- motion toggle (persistent opt-in/out) ---------- */
.motion-toggle{ display:inline-flex; align-items:center; gap:9px; padding:8px 15px; border-radius:40px;
  border:1px solid var(--line); background:color-mix(in srgb,var(--panel) 60%, transparent); color:var(--muted);
  font-family:var(--body); font-size:.7rem; letter-spacing:.14em; text-transform:uppercase;
  transition:border-color .35s var(--ease), color .35s var(--ease), background .35s var(--ease); }
.motion-toggle:hover{ border-color:color-mix(in srgb,var(--accent) 50%, transparent); color:var(--ink); }
.mt-dot{ width:8px; height:8px; border-radius:50%; background:var(--muted-2); transition:background .35s var(--ease), box-shadow .35s var(--ease); }
.motion-toggle[aria-pressed="true"]{ color:var(--ink); border-color:color-mix(in srgb,var(--accent) 40%, transparent); }
.motion-toggle[aria-pressed="true"] .mt-dot{ background:var(--accent); box-shadow:0 0 10px var(--glow); }

/* ---------- scrub sections ---------- */
[data-scrub]{ position:relative; }
[data-scrub-pin]{ position:relative; height:100svh; overflow:hidden; background:var(--bg); }
[data-scrub-pin] canvas{ position:absolute; inset:0; width:100%; height:100%; }
[data-phase]{ }               /* your caption styling here */

/* ---------- step accordion (Vectr pattern) ---------- */
.steps{ list-style:none; margin:0; padding:0; }
.step{ padding:6px 0; border-top:1px solid var(--line); }
.step:first-of-type{ border-top:0; }
.step-row{ display:flex; align-items:center; gap:16px; padding:12px 0; }
.step-num{ flex:0 0 auto; display:grid; place-items:center; width:34px; height:34px; border-radius:9px;
  font-family:var(--display); font-size:.78rem; font-variant-numeric:tabular-nums; color:var(--muted); background:transparent; transition:all .5s var(--ease); }
.step-title{ font-size:clamp(1.35rem,2.4vw,1.9rem); color:var(--muted-2); transition:color .5s var(--ease); }
.step-body{ position:relative; display:grid; grid-template-rows:0fr; opacity:0; padding-left:50px;
  transition:grid-template-rows .55s var(--ease), opacity .45s var(--ease); }
.step-body>*{ min-height:0; }
.step-body p{ margin:0 0 14px; color:var(--muted); max-width:38ch; overflow:hidden; }
.step-line{ position:absolute; left:16px; margin-top:2px; width:2px; height:calc(100% - 20px); background:var(--line); border-radius:2px; overflow:hidden; }
.step-line i{ position:absolute; inset:0 0 auto 0; height:100%; display:block; transform:scaleY(0); transform-origin:top; background:linear-gradient(180deg,var(--accent-hi),var(--accent-dk)); }
.step.is-active .step-num{ color:var(--bg); background:var(--ink); }
.step.is-active .step-title{ color:var(--ink); }
.step.is-active .step-body{ grid-template-rows:1fr; opacity:1; }
.step.is-active .step-line i{ transform:scaleY(1); } /* desktop JS overrides inline for partial fill */
[data-step-media]{ position:relative; }
.jm{ position:absolute; inset:0; margin:0; opacity:0; transform:scale(1.06); transition:opacity .7s var(--ease), transform 1.2s var(--ease); }
.jm.is-active{ opacity:1; transform:scale(1); }

/* ---------- horizontal cards + illuminate-on-enter (Patch pattern) ---------- */
[data-hcards]{ display:flex; gap:24px; will-change:transform; }
.card{ flex:0 0 300px; transition:transform .5s var(--ease), border-color .5s var(--ease), box-shadow .5s var(--ease); }
.card-ico{ transition:transform .5s var(--ease), color .5s var(--ease), filter .5s var(--ease); }
.card.is-lit{ transform:translateY(-6px); border-color:color-mix(in srgb,var(--accent) 55%, transparent);
  box-shadow:0 30px 60px -30px rgba(0,0,0,.8), 0 0 46px -12px var(--glow); }
.card.is-lit .card-ico{ color:var(--accent-hi); transform:scale(1.14); filter:drop-shadow(0 0 14px var(--glow)); }
.card.is-lit h3{ color:var(--accent-hi); }

/* ============================================================
   REDUCED MOTION (html.reduce, set pre-paint) — keep as-is.
   Everything static, reachable, and still looking intentional.
   ============================================================ */
html.reduce [data-split], html.reduce [data-reveal]{ visibility:visible !important; }
html.reduce [data-phase]{ position:relative; opacity:1; }
html.reduce [data-phase] + [data-phase]{ display:none; }
html.reduce [data-scrub-pin]{ /* a data-poster still is applied inline by JS */ }
html.reduce [data-hcards]{ flex-wrap:wrap; justify-content:center; transform:none !important; overflow:visible; }
html.reduce .step-body{ grid-template-rows:1fr; opacity:1; }
html.reduce .step-num{ color:var(--accent); }
html.reduce .step-title{ color:var(--ink); }
html.reduce .jm{ position:relative; opacity:1; transform:none; } /* or show only first — your call */

/* ---------- a11y / mobile polish ---------- */
button, a{ touch-action:manipulation; }
@media (max-width:860px){
  /* give every pinned effect a mobile path (single column / native swipe) */
  [data-hcards]{ overflow-x:auto; scroll-snap-type:x proximity; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
  [data-hcards]::-webkit-scrollbar{ display:none; }
  .card{ flex-basis:78vw; scroll-snap-align:center; }
}

/* ---------- scroll cue (house standard; JS injects internals, drives --p/--fill) ---------- */
.scroll-cue{ --p:0; --fill:0%; position:absolute; left:50%; bottom:clamp(18px,3.6vh,34px); transform:translateX(-50%);
  display:grid; justify-items:center; gap:10px; font-size:.64rem; font-weight:600; letter-spacing:.3em; text-transform:uppercase;
  color:color-mix(in srgb,var(--ink) 78%, transparent); pointer-events:none; z-index:6; transition:opacity .4s var(--ease); }
.sc-label{ text-indent:.3em; }
.sc-stage{ position:relative; width:48px; height:48px; display:block; animation:cue-bob 1.8s cubic-bezier(.45,0,.55,1) infinite; }
@keyframes cue-bob{ 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(6px); } }
.sc-ring{ position:absolute; inset:0; width:48px; height:48px; transform:rotate(-90deg); }
.sc-ring circle{ fill:none; stroke-width:1.4; }
.scr-t{ stroke:color-mix(in srgb,var(--accent) 22%, transparent); }
.scr-f{ stroke:var(--accent-hi); stroke-linecap:round; stroke-dasharray:131.9;
  stroke-dashoffset:calc(131.9 * (1 - var(--p))); }
.sc-arrows{ position:absolute; left:50%; top:50%; width:18px; height:26px; transform:translate(-50%,-50%); }
.sc-a{ position:absolute; inset:0; width:100%; height:100%; }
.sc-a-base{ color:color-mix(in srgb,var(--ink) 40%, transparent); }
.sc-a-lit{ color:var(--accent-hi); clip-path:inset(0 0 calc(100% - var(--fill)) 0); }
html.reduce .scroll-cue{ display:none; }

/* ---------- clearly-styled placeholder tiles (awaiting real client assets) ---------- */
.ph-tile{ position:relative; border-radius:16px; border:1px dashed var(--line); display:grid; place-items:center;
  aspect-ratio:16/10; background:repeating-linear-gradient(-45deg, transparent 0 14px, color-mix(in srgb,var(--accent) 5%, transparent) 14px 15px); }
.ph-inner{ display:grid; justify-items:center; gap:12px; text-align:center; padding:20px; }
.ph-chip{ font-size:.6rem; font-weight:700; letter-spacing:.24em; text-transform:uppercase; color:var(--accent);
  border:1px dashed color-mix(in srgb,var(--accent) 45%, transparent); border-radius:30px; padding:6px 13px; }
.ph-inner p{ color:var(--muted-2); font-size:.82rem; max-width:26ch; }

/* ---------- generic expander panel ---------- */
[id] > .x-inner{ min-height:0; }
.x-panel{ overflow:hidden; height:0; opacity:0; }
html.reduce .x-panel, html:not(.js) .x-panel{ height:auto !important; opacity:1 !important; }
