/* Byte Dimension — bytedimension.com
   One stylesheet for index.html and 404.html. Spec: docs/plan/v1.0.0/step1-structure-and-content.md
   Sections: 1 tokens · 2 fonts & base · 3 section pattern · 4 components · 5 characters · 6 scenes
             7 scroll-driven effects · 8 time-driven motion · 9 reduced motion · 10 scroll utilities */

/* ---------- 1. Tokens ---------- */
:root {
  --ink: #18243A;
  --blue: #3259B4;
  --tint: #F5F8FC;
  --line: #DCE3EE;
  --muted: #5F6B80; /* #6B778C darkened slightly to pass WCAG AA on Tint */
  --grey: #B7C1D0;
  --client: #EAF0F8;
  --paper: #fff;
  --b1: #3259B4; --b2: #3772DA; --b3: #3C8CFF; --b4: #1EAAE8; --b5: #00C8D2; --b6: #3CD7D8; --b7: #78E6DD;
  --fin1: var(--b1); --fin2: var(--b2); --fin3: var(--b3); --fin4: var(--b4);
  --fin5: var(--b5); --fin6: var(--b6); --fin7: var(--b7);
  --role: var(--b3);
  --sans: "Avenir Next", "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: 16px;
}
.c1 { --role: var(--b1); } .c2 { --role: var(--b2); } .c3 { --role: var(--b3); } .c4 { --role: var(--b4); }
.c5 { --role: var(--b5); } .c6 { --role: var(--b6); } .c7 { --role: var(--b7); }

/* ---------- 2. Fonts & base ---------- */
@font-face {
  font-family: "Nunito Sans";
  src: url("/resources/fonts/nunito-sans-latin-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--b3); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
svg text { font-family: var(--sans); }
svg .mono { font-family: var(--mono); }

/* ---------- 3. Section pattern ---------- */
.s { position: relative; padding: clamp(64px, 9vw, 100px) var(--gutter) clamp(56px, 7vw, 88px); text-align: center; }
.tint { background: var(--tint); }
.dark { background: var(--ink); color: #fff; }
.label {
  margin: 0 0 16px;
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--blue);
}
.dark .label { color: var(--b7); }
h1, h2, h3, h4 { font-weight: 600; }
h1 { margin: 0; font-size: clamp(40px, 5.4vw, 60px); line-height: 1.1; letter-spacing: -0.01em; }
h1 .accent { color: var(--blue); }
h2 { margin: 0 0 14px; font-size: clamp(30px, 4.2vw, 48px); line-height: 1.15; letter-spacing: -0.01em; }
.desc { max-width: 44em; margin: 0 auto; font-size: clamp(17px, 1.5vw, 20px); color: var(--muted); }
.dark .desc { color: #AEB8C9; }

/* corner mark: the logo symbol, fixed, links to the top (not a nav bar) */
.corner-mark { position: fixed; top: 12px; left: 12px; z-index: 20; display: block; width: 48px; height: 48px; padding: 4px; }
.corner-mark svg { width: 40px; height: 40px; }
.corner-mark[data-on-dark] { --fin1: #fff; --fin2: #fff; --fin3: #fff; --fin4: #fff; --fin5: #fff; --fin6: #fff; --fin7: #fff; }

/* ---------- 4. Components ---------- */
/* fills and strokes used inside SVG symbols */
.pp { fill: var(--paper); }
.cl { fill: var(--client); }
.rc, .fr { fill: var(--role); }
.rs { stroke: var(--role); }
.sr { stroke: var(--role); }
.s3 { stroke: var(--b3); fill: none; }
.f1 { fill: var(--fin1); } .f2 { fill: var(--fin2); } .f3 { fill: var(--fin3); } .f4 { fill: var(--fin4); }
.f5 { fill: var(--fin5); } .f6 { fill: var(--fin6); } .f7 { fill: var(--fin7); }
.ground { fill: var(--tint); }

/* ✦ ROLE badge in HTML (story crew strips) */
.rb {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; font-size: 12px; font-weight: 600; letter-spacing: 0.3px; line-height: 18px; color: var(--ink);
  white-space: nowrap;
}
.rb::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: #fff; border: 1.3px solid var(--role); transform: skewX(-12deg);
}
.rb svg { width: 7px; height: 7px; fill: var(--role); opacity: 0.8; }

/* ---------- 5. Characters ---------- */
.faded { --fin1: var(--grey); --fin2: var(--grey); --fin3: var(--grey); --fin4: var(--grey);
         --fin5: var(--grey); --fin6: var(--grey); --fin7: var(--grey); opacity: 0.15; }
.op-cheer, .op-sync .fr, .wave-b { opacity: 0; }
.op-sync { opacity: 0; }

/* ---------- 6. Scenes ---------- */
/* 01 · Hero */
.s-hero { padding: 0; }
.s-hero .stage {
  position: relative; height: 100svh; min-height: 320px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  padding: 36px var(--gutter) 10px;
}
.hero-head { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.lockup { width: 110px; height: auto; margin-bottom: 26px; }
.hero-head .sub { margin: 18px 0 0; max-width: 34em; font-size: clamp(16px, 1.5vw, 20px); color: var(--muted); }
.crew-wrap { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; width: 100%; display: flex; justify-content: center; }
.crew { width: 100%; height: 100%; max-width: 1280px; }
.crew-phone { display: none; }
.crew-wide .bdg { transform: scale(var(--bs, 1)); transform-box: fill-box; transform-origin: 50% 0; }
.scroll-cue {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 44px; padding: 6px 12px; font-family: var(--mono); font-size: 12px; letter-spacing: 2px; color: var(--muted); text-decoration: none;
}
.scroll-cue svg { width: 16px; height: 10px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tech { position: absolute; inset: 0; pointer-events: none; }
.tw {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  font-family: var(--mono); font-weight: 600; font-size: var(--fs); color: var(--c); opacity: var(--o); white-space: nowrap;
}
.tw.far { filter: blur(0.6px); }
@media (max-width: 599px) {
  .crew-wide { display: none; }
  .crew-phone { display: block; }
  .s-hero .stage { padding-top: 56px; }
  .lockup { width: 84px; margin-bottom: 20px; }
  h1 .accent { display: block; }
}
@media (max-height: 560px) and (min-width: 600px) {
  .lockup { width: 64px; margin-bottom: 10px; }
  .s-hero .stage { padding-top: 16px; }
  h1 { font-size: 36px; }
  .hero-head .sub { margin-top: 8px; font-size: 15px; }
}

/* 02 · Who we are */
.who-arcs { width: 100%; max-width: 1320px; margin: 12px auto 0; }
.who-grid { display: none; max-width: 640px; margin: 40px auto 0; }
.who-exp, .who-acc { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 10px; }
.who-exp li {
  position: relative; isolation: isolate; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 8px; font-size: 14px; font-weight: 600;
}
.who-exp li::before { content: ""; position: absolute; inset: 0; z-index: -1; background: #fff; border: 1.6px solid var(--ink); transform: skewX(-12deg); }
.who-exp svg { width: 15px; height: 15px; flex: none; fill: var(--role); }
.who-acc li { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; line-height: 1.3; }
.who-acc svg { width: 8px; height: 8px; fill: var(--role); }
.who-mid { position: relative; display: flex; justify-content: center; margin: 18px 0 22px; }
.who-lead { width: 260px; }
.who-stamp { position: absolute; right: 0; top: 0; width: 86px; }
@media (max-width: 1099px) {
  .who-arcs { display: none; }
  .who-grid { display: block; }
}
@media (max-width: 599px) {
  .who-exp li { font-size: 13px; padding: 6px 4px; }
  .who-acc li { font-size: 11px; }
  .who-stamp { width: 70px; }
}

/* 03 · The collapse */
.s-collapse { padding: 0; }
.s-collapse .stage { display: flex; flex-direction: column; align-items: center; padding: clamp(64px, 9vw, 100px) var(--gutter) clamp(32px, 4vw, 48px); }
.board-wrap { width: 100%; display: flex; justify-content: center; margin-top: 28px; }
.board { width: 100%; max-width: 832px; height: auto; }
.board-phone { display: none; max-width: 420px; }
.step-dots { display: flex; justify-content: center; gap: 48px; margin: 18px 0 0; padding: 0; list-style: none; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.step-dots li { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dot { position: relative; width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.dot .on { position: absolute; inset: 0; border-radius: 50%; background: var(--blue); }
@media (max-width: 599px) {
  .board-wide { display: none; }
  .board-phone { display: block; }
  .step-dots { gap: 12px; font-size: 10px; }
  .step-dots li { max-width: 33%; text-align: center; }
}

/* 04 · How we work */
.flow { width: 100%; margin: 24px auto 0; }
.flow-wide { max-width: 1410px; }
.flow-phone { display: none; max-width: 420px; }
@media (max-width: 1023px) {
  .flow-wide { display: none; }
  .flow-phone { display: block; }
}

/* 05 · Stories */
.stories { display: grid; grid-template-columns: repeat(2, minmax(0, 580px)); justify-content: center; gap: 40px; margin-top: 48px; text-align: left; }
.story { background: #fff; border: 2px solid var(--line); border-radius: 20px; padding: 28px 34px 30px; min-width: 0; }
.story-top { display: flex; justify-content: space-between; gap: 12px; }
.mini { width: 140px; flex: none; }
.tag { margin: 4px 0 18px; }
.tag span {
  display: inline-block; padding: 5px 16px; background: var(--role); color: var(--ink);
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.5px;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.story h3 { margin: 0; font-size: 23px; line-height: 1.3; }
.chips { display: flex; gap: 14px; margin: 22px 0 24px; }
.chip { position: relative; isolation: isolate; display: flex; flex-direction: column; min-width: 150px; padding: 8px 20px 10px; }
.chip::before {
  content: ""; position: absolute; inset: 0; z-index: -1; transform: skewX(-5deg);
  background: color-mix(in srgb, var(--role) 12%, #fff); border: 1.5px solid var(--role);
}
.chip .num { font-size: 34px; font-weight: 700; line-height: 1.15; color: var(--blue); font-variant-numeric: tabular-nums; }
.chip .cl { font-size: 14px; font-weight: 600; }
.story h4 { margin: 18px 0 6px; font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--blue); }
.story p { margin: 0; font-size: 15px; }
.crew-strip {
  position: relative; display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 22px 0 0; padding: 0 26px 0 4px;
  max-height: 24px; overflow: hidden; list-style: none;
}
.crew-strip .more { position: absolute; right: 0; top: -8px; font-size: 22px; font-weight: 700; color: var(--blue); }
@media (max-width: 899px) {
  .stories { grid-template-columns: minmax(0, 580px); }
}
@media (max-width: 599px) {
  .story { padding: 22px 20px 24px; }
  .mini { width: 96px; }
  .story h3 { font-size: 20px; }
  .chip { min-width: 0; flex: 1; padding: 8px 14px; }
  .chip .num { font-size: 30px; }
  .crew-strip { max-height: none; padding-right: 0; }
  .crew-strip .more { position: static; line-height: 18px; }
}

/* 06 · Why it wins */
.label-title { margin-bottom: 14px; }
.wins { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 24px; max-width: 1200px; margin: 56px auto 0; padding: 0; }
.wicon { width: 96px; height: 96px; margin: 0 auto 22px; }
.win h3 { margin: 0 0 8px; font-size: 22px; }
.win p { max-width: 16em; margin: 0 auto; font-size: 15px; color: var(--muted); }
@media (max-width: 1023px) { .wins { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 640px; } }
@media (max-width: 599px) { .wins { grid-template-columns: 1fr; } }

/* 07 · Contact + footer */
.s-contact { padding-bottom: 32px; }
.email { position: relative; display: flex; justify-content: center; align-items: stretch; gap: 6px; margin: 40px 0 28px; }
.email-chip, .copy {
  display: inline-flex; align-items: center; background: var(--b5); color: var(--ink); border: 0;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.email-chip { padding: 14px 30px; font-family: var(--mono); font-size: 20px; font-weight: 700; text-decoration: none; }
.copy { position: relative; justify-content: center; width: 56px; min-height: 44px; cursor: pointer; }
.copy svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.8; }
.copy .front { fill: var(--b5); }
.copy .copied {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-family: var(--mono); font-size: 12px; font-weight: 700; white-space: nowrap; opacity: 0;
}
.copy[data-copied] svg { opacity: 0; }
.copy[data-copied] .copied { opacity: 1; }
.email-chip:focus-visible, .copy:focus-visible { outline: 3px solid #fff; clip-path: none; }
.email-fallback { margin: 0; font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--b5); }
.contact-crew { width: min(600px, 100%); margin: 0 auto; --paper: #22304A; color: #F5F8FC; }
.footer {
  --edge: max(var(--gutter), calc((100% - 1200px) / 2));
  position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  padding: 28px var(--edge) 40px; background: var(--ink); color: #AEB8C9; font-size: 14px;
}
/* the divider sits above the logo, never across it */
.footer::before { content: ""; position: absolute; top: 0; left: var(--edge); right: var(--edge); height: 1.5px; background: #2C3A55; }
.footer img { width: 90px; height: auto; }
.footer p { margin: 0 0 12px; } /* baseline level with the lockup wordmark */
@media (max-width: 599px) {
  .email-chip { padding: 12px 16px; font-size: 15px; }
  .footer { flex-direction: column; align-items: center; text-align: center; }
}

/* 404 */
.lost-page { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 72px var(--gutter) 48px; text-align: center; }
.lost { width: 300px; margin-bottom: 24px; }
.lost-page h1 { margin-bottom: 12px; font-size: clamp(34px, 5vw, 48px); }
.home-link { display: inline-block; margin-top: 24px; padding: 12px 8px; font-weight: 600; }

/* ---------- 7. Scroll-driven effects ----------
   main.js writes --p (0..1) on each [data-scene]. The default is 1, the final state:
   that is what visitors see without JS or with reduced motion. */
[data-scene] { --p: 1; }
.fx-pop, .fx-fade, .fx-hide, .fx-fold, .fx-draw, .fx-scalex, .clone {
  --t: clamp(0, (var(--p) - var(--a, 0)) / var(--sp, 0.1), 1);
}
.fx-pop {
  opacity: var(--t);
  transform: translateY(calc((1 - var(--t)) * 14px)) scale(calc(0.7 + 0.3 * var(--t)));
  transform-box: fill-box; transform-origin: 50% 100%;
}
.fx-fade { opacity: var(--t); }
.fx-hide { opacity: calc(1 - var(--t)); }
.fx-fold { opacity: calc(1 - var(--t)); transform: scale(calc(1 - 0.7 * var(--t))); transform-box: fill-box; transform-origin: 50% 100%; }
.fx-show { opacity: calc(clamp(0, (var(--p) - var(--a, 0)) * 1000 + 1, 1) * clamp(0, (var(--b, 9) - var(--p)) * 1000, 1)); }
.fx-draw { stroke-dasharray: 1 1; stroke-dashoffset: calc(1 - var(--t)); }
.fx-scalex { transform: scaleX(var(--t)); transform-box: fill-box; transform-origin: 0 50%; }

/* fading copies + clone wave: Step 1 wave_t(p, rank, beat = .4, step = .3) */
.clone {
  --dir: 1; --k: 1; --o: 0.35; --sc: 0.84; --rank: 0;
  --a: calc(var(--w0, 0) + var(--rank) * 0.3 * var(--ws, 1));
  --sp: calc(0.4 * var(--ws, 1));
  transform: translate(calc(var(--t) * var(--dir) * var(--k) * 12px), calc(var(--t) * var(--k) * -22px)) scale(calc(1 - (1 - var(--sc)) * var(--t)));
  opacity: calc(min(var(--t) * 50, 1) * (var(--o) + (0.55 - var(--o)) * (1 - var(--t))));
}
.clone.L { --dir: -1; }
.clone.k2 { --k: 2; --o: 0.15; --sc: 0.7056; }
.rk1 { --rank: 1; } .rk2 { --rank: 2; }
.s-how { --w0: 0.55; --ws: 0.2; }
.s-how .clone { --o: 0.3; }

/* pinned tracks: extra scroll length for the hero wave and the collapse */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .s-hero { height: 150svh; }
  .s-hero .stage { position: sticky; top: 0; }
  .s-collapse { height: 210svh; }
  .s-collapse .stage { position: sticky; top: 0; height: 100svh; min-height: 320px; contain: paint; }
  .s-collapse .board-wrap { flex: 1 1 auto; min-height: 0; }
  .s-collapse .board { height: 100%; }
}

/* ---------- 8. Time-driven motion (opener, idle loops, reveals) ---------- */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  /* opener, Step 1 §8.2: equip 0–1.5 s · rally 1.5–3.5 s · in sync 3.5–4.5 s · settle 4.5–6 s */
  .s-hero:not([data-opener="done"]) .op-plates { animation: op-snap 0.25s steps(3) 0.3s both; }
  .s-hero:not([data-opener="done"]) .op-emblem { animation: op-snap 0.25s steps(3) 0.7s both; }
  .s-hero:not([data-opener="done"]) .op-boots { animation: op-snap 0.25s steps(3) 1.0s both; }
  .s-hero:not([data-opener="done"]) .op-crest { animation: op-in 0.3s steps(3) 1.3s both; }
  .s-hero:not([data-opener="done"]) .op-glow { animation: op-in 0.6s 1.3s both; }
  .s-hero:not([data-opener="done"]) .op-rally { animation: op-jump 0.55s cubic-bezier(0.3, 1.5, 0.6, 1) both; }
  .s-hero:not([data-opener="done"]) .op-rally.r1 { animation-delay: 1.5s; }
  .s-hero:not([data-opener="done"]) .op-rally.r2 { animation-delay: 1.8s; }
  .s-hero:not([data-opener="done"]) .op-rally.r3 { animation-delay: 2.2s; }
  .s-hero:not([data-opener="done"]) .op-rally.r4 { animation-delay: 2.5s; }
  .s-hero:not([data-opener="done"]) .op-rally.r5 { animation-delay: 2.9s; }
  .s-hero:not([data-opener="done"]) .op-rally.r6 { animation-delay: 3.2s; }
  .s-hero:not([data-opener="done"]) .op-cheer { animation: op-cheer 0.9s linear 3.6s forwards; }
  .s-hero:not([data-opener="done"]) .op-uncheer { animation: op-uncheer 0.9s linear 3.6s forwards; }
  .s-hero:not([data-opener="done"]) .op-sync { animation: op-sync 1s 3.6s forwards; transform-box: fill-box; transform-origin: 50% 50%; }
  .s-hero:not([data-opener="done"]) .op-copies,
  .s-hero:not([data-opener="done"]) .op-cue,
  .s-hero:not([data-opener="done"]) .tech { animation: op-hold 4.5s linear both; }
  @keyframes op-snap { 0% { opacity: 0; transform: scale(1.6); } 100% { opacity: 1; transform: scale(1); } }
  @keyframes op-in { from { opacity: 0; } to { opacity: 1; } }
  @keyframes op-jump { 0% { opacity: 0; transform: translateY(-48px); } 55% { opacity: 1; transform: translateY(6px); } 100% { transform: none; } }
  /* explicit hold points instead of steps(1): engines disagree on which value steps() holds at the end */
  @keyframes op-cheer { 0%, 99% { opacity: 1; } 100% { opacity: 0; } }
  @keyframes op-uncheer { 0%, 99% { opacity: 0; } 100% { opacity: 1; } }
  @keyframes op-sync { 0% { opacity: 0; transform: scale(0.3); } 20% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }
  @keyframes op-hold { 0%, 99% { opacity: 0; } 100% { opacity: 1; } }
  .op-plates, .op-emblem, .op-boots { transform-box: fill-box; transform-origin: 50% 50%; }

  /* idle loops, Step 1 §8.8: stepped (Tuzki-like), staggered by .d1–.d6 */
  .d1 { --d: 0s; } .d2 { --d: -1.3s; } .d3 { --d: -2.1s; } .d4 { --d: -0.6s; } .d5 { --d: -3.4s; } .d6 { --d: -2.7s; }
  .bob { animation: bob 3.2s steps(4) var(--d, 0s) infinite alternate; }
  .blink { animation: blink 4.8s steps(1) var(--d, 0s) infinite; transform-box: fill-box; transform-origin: 50% 50%; }
  .lblink { animation: blink 6.5s steps(1) var(--d, -1s) infinite; transform-box: fill-box; transform-origin: 50% 50%; }
  .breath { animation: breath 4s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
  .glow { animation: glow 4s ease-in-out infinite alternate; }
  .wave-a { animation: wave-a 3.2s steps(1) infinite; }
  .wave-b { animation: wave-b 3.2s steps(1) infinite; }
  @keyframes bob { from { transform: translateY(0); } to { transform: translateY(-4px); } }
  @keyframes blink { 0%, 93% { transform: none; } 94% { transform: scaleY(0.25); } 97% { transform: none; } }
  @keyframes breath { from { transform: scaleY(1); } to { transform: scaleY(1.015); } }
  @keyframes glow { from { opacity: 0.8; } to { opacity: 1; } }
  @keyframes wave-a { 0% { opacity: 1; } 12% { opacity: 0; } 24% { opacity: 1; } 36% { opacity: 0; } 100% { opacity: 0; } }
  @keyframes wave-b { 0% { opacity: 0; } 12% { opacity: 1; } 24% { opacity: 0; } 36% { opacity: 1; } 100% { opacity: 1; } }

  /* tech background, Step 1 §8.4: slow drift + fade, words swapped by main.js each loop */
  .tw { animation: tw var(--dur, 12s) linear var(--del, 0s) infinite; }
  @keyframes tw {
    0% { opacity: 0; translate: 0 20px; }
    20%, 75% { opacity: var(--o); }
    100% { opacity: 0; translate: 0 calc(var(--dy, 80px) * -1); }
  }

  /* reveals (stories, why it wins, contact) — only once main.js is running */
  html[data-motion="on"] .reveal { transition: opacity 0.6s ease, transform 0.6s ease; }
  html[data-motion="on"] .reveal:not([data-seen]) { opacity: 0; transform: translateY(18px); }
  html[data-motion="on"] .win[data-seen] .wi-fast .wi-a { animation: wi-streak 0.6s steps(3) 0.3s both; }
  html[data-motion="on"] .win[data-seen] .wi-quality .wi-a { stroke-dasharray: 1 1; animation: wi-draw 0.6s steps(4) 0.3s both; }
  html[data-motion="on"] .win[data-seen] .wi-quality .wi-b { animation: wi-glint 0.4s steps(2) 0.9s both; transform-box: fill-box; transform-origin: 50% 50%; }
  html[data-motion="on"] .win[data-seen] .wi-handoffs .wi-a { animation: wi-orbit 1.2s steps(6) 0.3s both; transform-origin: 0 2px; }
  html[data-motion="on"] .win[data-seen] .wi-cost .wi-a { animation: wi-dip 0.6s steps(3) 0.3s both; }
  @keyframes wi-streak { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
  @keyframes wi-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  @keyframes wi-glint { from { transform: scale(0); } to { transform: scale(1); } }
  @keyframes wi-orbit { from { transform: rotate(-90deg); } to { transform: rotate(0); } }
  @keyframes wi-dip { 0% { transform: translateY(-8px); } 60% { transform: translateY(3px); } 100% { transform: none; } }

  /* pause loops while their section is off screen */
  html[data-motion="on"] .s:not([data-active]) * { animation-play-state: paused; }
}

/* ---------- 9. Reduced motion: final states, nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tw { opacity: calc(var(--o) * 0.7); }
}

/* ---------- 10. Scroll utilities: --a (start), --b (end), --sp (span) as fractions of --p ---------- */
.a0 { --a: 0; } .a5 { --a: 0.05; } .a8 { --a: 0.08; } .a10 { --a: 0.1; } .a15 { --a: 0.15; } .a16 { --a: 0.16; } .a20
{ --a: 0.2; } .a24 { --a: 0.24; } .a25 { --a: 0.25; } .a30 { --a: 0.3; } .a31 { --a: 0.31; } .a33 { --a: 0.33; } .a35
{ --a: 0.35; } .a36 { --a: 0.36; } .a37 { --a: 0.37; } .a39 { --a: 0.39; } .a40 { --a: 0.4; } .a41 { --a: 0.41; } .a42
{ --a: 0.42; } .a45 { --a: 0.45; } .a47 { --a: 0.47; } .a48 { --a: 0.48; } .a49 { --a: 0.49; } .a50 { --a: 0.5; } .a51
{ --a: 0.51; } .a53 { --a: 0.53; } .a54 { --a: 0.54; } .a55 { --a: 0.55; } .a56 { --a: 0.56; } .a60 { --a: 0.6; } .a65
{ --a: 0.65; } .a66 { --a: 0.66; } .a68 { --a: 0.68; } .a70 { --a: 0.7; } .a72 { --a: 0.72; } .a74 { --a: 0.74; } .a75
{ --a: 0.75; } .a76 { --a: 0.76; } .a78 { --a: 0.78; } .a80 { --a: 0.8; } .a81 { --a: 0.81; } .a82 { --a: 0.82; } .a84
{ --a: 0.84; } .a85 { --a: 0.85; } .a86 { --a: 0.86; } .a87 { --a: 0.87; } .a88 { --a: 0.88; } .a90 { --a: 0.9; } .a92
{ --a: 0.92; }
.b16 { --b: 0.16; } .b24 { --b: 0.24; } .b33 { --b: 0.33; } .b66 { --b: 0.66; } .b80 { --b: 0.8; }
.sp4 { --sp: 0.04; } .sp5 { --sp: 0.05; } .sp6 { --sp: 0.06; } .sp8 { --sp: 0.08; } .sp10 { --sp: 0.1; } .sp12 { --sp:
0.12; } .sp95 { --sp: 0.95; }
.copy[data-copied] { width: 104px; }
