/* =============================================================================
   swaysalyedweb: design tokens (starter)
   Token NAMES match the reference build (MacBook Pro with M5) exactly, so section
   patterns, base.css components and JS that reads CSS variables port without renames.
   Names like --space-black / --silver / --die are ROLES here, not literal colours:
     --space-black = dark finish (lit mid-tone)   --silver = light finish
     --die         = the component interior       --copper/--teal = canvas-only sheen
   The 16 values tagged  [PRODUCT]  must be re-derived for each product
   (method + 5 worked examples: references/design-system.md section 4).
   Everything untagged is the house style: keep it.
   Do not add tokens casually; the only addition over the reference is --accent-ink.
   Keep colour tokens as #hex: the JS reads them at boot and parses hex only.
     product.js   screen wallpaper: --void --space-shade --accent --teal
     component.js plan + PCB tones: --die --die-line --text-dark --accent --copper --teal
     sections.js  fill sky (default day): --paper --copper --silver --space-edge --space-shade --void
   Three places cannot read tokens and carry the hexes by hand (re-derive them too):
     index.html <meta name="theme-color"> (= --void) · assets/favicon.svg · assets/og.svg

   JS motion constants (live in core.js, listed here so the system is in one place):
     Lenis {lerp:.09, wheelMultiplier:.9, autoRaf:false}; gsap.ticker drives lenis.raf; lagSmoothing(0)
     scrub: camera 1 · component/data .8 · type/rail .6
     pinEnd(k) = innerHeight*k*(isMobile?.6:1); k: hero 4 · centrepiece ≈ 1 screen per zoom stop
     (starter P2: 5 for 5 stops; the M5 ran 7 for 7) · everything else 1.5–2
     stagger: lines .08s · chars .03s · odometer digits 30ms right→left
   ========================================================================== */
:root{
  /* COLOUR (surfaces): a luminance ladder of cool studio darks + one warm paper; adjacent sections sit on different rungs. */
  --void:#0B0A08;          /* [PRODUCT] page black = oklch(.12 .003 H_darkFinish); lifted off #000 so the emission section reads deeper */
  --black:#000;            /* emission/display section only (LEDs off). Keep. */
  --space-black:#34302A;   /* [PRODUCT] dark finish, lit mid-tone: oklch(.24–.36, C<=.03, H_darkFinish) */
  --space-shade:#1A1713;   /* [PRODUCT] dark finish in shadow: mid L-.09, C*.8 */
  --space-edge:#524B42;    /* [PRODUCT] rim-light tone on edges: mid L+.11, C*1.1 */
  --silver:#E4DED3;        /* [PRODUCT] light finish: L ~.90 */
  --silver-shade:#ADA698;  /* [PRODUCT] light finish in shadow: L ~.73 */
  --paper:#F3EEE4;         /* [PRODUCT] light finish in daylight: oklch(.955 .004–.012 H 75–95, warm). Never pure white */
  --graphite:#1E1B17;      /* [PRODUCT] mid-dark rail surface: oklch(.227 .004 H_darkFinish) */
  --die:#0F0D0B;           /* [PRODUCT] component interior (PCB, driver, pack, sensor): L .15–.20, hue shifted 20–40deg from void */
  --die-line:#2A261F;      /* [PRODUCT] component hairlines/tooltip border: die L+.10, C*2 */
  --copper:#B8743F;        /* [PRODUCT] canvas-only material sheen #1, alpha <= .18, never UI */
  --teal:#2F6F6A;          /* [PRODUCT] canvas-only material sheen #2, alpha <= .18, never UI */
  --display:#FFFFFF;       /* emitted light only (screens, LEDs, sun, finale line). The only pure white. Keep. */

  /* COLOUR (text + rules): primary at 100%, hierarchy via muted + size, not stacked opacities. Hue may tilt toward H_darkFinish at C<=.008. */
  --text-dark:#F6F2EA;     /* on dark: 18.6:1 on void */
  --muted-dark:#ABA499;    /* on dark: 7.9 void / 7.6 die / 6.6 graphite */
  --text-light:#1E1B17;    /* on paper: 14.9:1 */
  --muted-light:#675F54;   /* on paper: 4.69:1 (reference #6E6E73 measured 4.49 and failed AA; fixed here) */
  --hair-dark:rgb(240 234 222 / .16);   /* 1px rules on dark */
  --hair-light:rgb(30 27 23 / .18);     /* 1px rules on paper */

  /* ACCENT: one colour from a real functional signal on the product (LED, record dot, action button).
     [PRODUCT] Budget <= 6 uses; list them here and nowhere else. Reference list:
       1 nav progress hairline  2 focus ring  3 centrepiece hero moment (lit cells)
       4 product data bars (baseline stays ink)  5 active stop in centrepiece HUD  6 threshold state (low battery)
     Never: links, hovers, buttons, headings, icons, backgrounds, gradients, CSS glows.
     No indigo/violet/purple anywhere: OKLCH hue 265–330 is banned for the accent and all UI. */
  --accent:#F2A33A;                     /* [PRODUCT] reference = MagSafe LED amber, oklch(.776 .148 69); >= 4.5:1 on void */
  --accent-glow:rgb(242 163 58 / .35);  /* [PRODUCT] same rgb as --accent at .35: canvas-only glow for lit cells */
  --accent-ink:#985B1A;                 /* [PRODUCT] ADDITION: accent on paper when --accent < 3:1 there; same hue, L ~.53, C*.75 (>= 4.5:1) */
  --focus:0 0 0 2px var(--void),0 0 0 4px var(--accent);

  /* TYPE: the visitor's own SF (no font requests, no FOUT) + system mono for labels/figures. No third family.
     Two tiers with a deliberate gap: text steps at 1.25 from 16–17px; display jumps ~1.618 up to viewport numerals. */
  --font-display:-apple-system,BlinkMacSystemFont,"SF Pro Display","Helvetica Neue",Helvetica,Arial,sans-serif;
  --font-text:-apple-system,BlinkMacSystemFont,"SF Pro Text","Helvetica Neue",Helvetica,Arial,sans-serif;
  --font-mono:ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace;
  --step--2:clamp(.6875rem,.67rem + .08vw,.75rem);   /* 11–12 mono labels, uppercase, +.08em */
  --step--1:clamp(.8125rem,.79rem + .1vw,.875rem);   /* 13–14 captions, controls, nav */
  --step-0:clamp(1rem,.97rem + .15vw,1.0625rem);     /* 16–17 body */
  --step-1:clamp(1.25rem,1.2rem + .2vw,1.328rem);    /* 20–21 sub, rail caption, data labels */
  --step-2:clamp(1.5rem,1.4rem + .45vw,1.66rem);     /* 24–26.5 lead, price line */
  --step-3:clamp(1.875rem,1.7rem + .8vw,2.075rem);   /* 30–33 the word-by-word statement */
  --display-1:clamp(2.5rem,1.6rem + 4vw,5rem);       /* 40–80 section H2 (free sections) */
  --display-2:clamp(3.5rem,1.8rem + 7vw,6.75rem);    /* 56–108 hero H1 */
  --display-3:clamp(4.5rem,1rem + 11vw,10.9rem);     /* 72–175 finish name / knockout words: keep in negative space */
  --display-4:clamp(6rem,16vw,17.7rem);              /* 96–283 rail numerals, odometers */
  /* in-stage H2 (shares a stage with the product) is set in sections.css: clamp(1.75rem,1.1rem + 2.1vw,3.25rem), lh 1.02, -.03em */
  --lh-display:.95; --lh-tight:1.1; --lh-body:1.47;
  --track-display:-.025em; --track-mega:-.045em; --track-mono:.08em;   /* tracking tightens as size grows; positive only on uppercase mono */
  --w-display:600; --w-mega:700; --w-body:400;

  /* SPACE: 4px base; airy sections 112–200px, dense 48–72px; nothing off-scale except clamp()ed viewport offsets. */
  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px; --space-5:24px;
  --space-6:32px; --space-7:48px; --space-8:72px; --space-9:112px; --space-10:168px;
  --gutter:clamp(16px,4vw,64px);
  --pad-airy:clamp(112px,18vh,200px); --pad-dense:clamp(48px,8vh,72px);
  --measure:34ch; --measure-wide:60ch; --nav-h:48px;

  /* RADII: radius signals material; only where the product has one. No rounded cards (there are no cards). */
  --r-0:0;              /* film frames, charts, bars, canvases, ruled tables */
  --r-tag:3px;          /* mono tags, leader labels */
  --r-control:8px;      /* tooltips, default focus ring */
  --r-screen:12px;      /* [PRODUCT] match the product's real screen/window corner */
  --r-pill:999px;       /* seg, toggle, swatch, buttons: read as physical switches */

  /* MOTION: one curve per job. expo-out reveals, power3.inOut for state/camera, hovers never snap, never bounce. */
  --ease-reveal:cubic-bezier(.16,1,.3,1);   /* gsap 'expo.out': reveals, count-ups, bars, odometers */
  --ease-state:cubic-bezier(.65,0,.35,1);   /* gsap 'power3.inOut': state changes, theme flips, camera/click flights */
  --ease-hover:cubic-bezier(.25,.9,.3,1);   /* hover in/out */
  --dur-press:120ms;    /* :active */
  --dur-hover:280ms;    /* hover, tooltip/note in, step crossfade */
  --dur-state:480ms;    /* segmented selection, theme flip, row collapse, peek */
  --dur-sweep:700ms;    /* finish/material change, underline sweep */
  --dur-reveal:900ms;   /* line reveals, bars + count-up, odometer, curtain, lid toggle */
  --dur-flight:1200ms;  /* click-to-scroll flights */

  /* Z: fixed WebGL stage under every section; atmosphere and chrome above. In-stage: canvas 0, copy 2, controls 3, tooltip 4. */
  --z-stage:0; --z-section:1; --z-section-ui:5; --z-grain:50; --z-nav:100; --z-cursor:200; --z-preloader:300; --z-skip:400;
}
