/* Duesify tokens: every value lives here; components use the names only (check.py rule 10). */

:root {
  /* ---------- Colour: neutrals (navy-tinted greys) ---------- */
  --black: #000000;
  --ink: #111a2b;                 /* navy-ink: text on light, the skip link */
  --mist: #f4f6fa;                /* the light stage, a breath of navy */
  --paper: #ffffff;
  /* text roles per stage (contrast: DESIGN.md 3.1, check.py rule 14) */
  --dk-fg: #f5f7fb;
  --dk-fg-2: #a3adbf;
  --dk-fg-3: #8a94a8;
  --dk-hair: rgba(255, 255, 255, 0.14);
  --lt-fg: #111a2b;
  --lt-fg-2: #5b6578;
  --lt-hair: rgba(17, 26, 43, 0.1);
  --dk-fg-2-hc: #c9d0dc;
  --lt-fg-2-hc: #3a4458;
  --chip-bg: rgba(17, 26, 43, 0.05);

  /* ---------- Colour: navy, Duesi's colour ---------- */
  /* navy is the ground: stages, surfaces, art, eyebrows. Blue (below) stays the signal: links, focus, the one button.
     assets/js/stack-scene.js keeps RGB copies of these (a worker cannot read custom properties): change both. */
  --abyss: #050b17;               /* navy-black: deepest art shadow */
  --night: #0a1731;               /* the navy stage */
  --night-2: #0f2042;             /* raised surface on night: cards, panels */
  --night-3: #162b54;             /* inner shape on night-2 */
  --navy: #1d3358;                /* the brand navy (= the coming-soon page's --cs-navy) */
  --navy-hi: #344e7c;             /* art mid-tone */
  --navy-ink: #2a4a80;            /* navy as text on light: eyebrows (8.1:1 on mist) */
  --crest: #96b0d8;               /* pale navy: eyebrows on dark (9.5:1 on black, 8.1:1 on night), art highlights */
  --navy-tint: #e7edf7;           /* navy-tinted panel on paper / mist */
  /* text roles on the night stage */
  --nt-fg: #f5f7fb;               /* 16.6:1 on night */
  --nt-fg-2: #a9b6cc;             /* 8.7:1 on night, 7.9:1 on night-2 */
  --nt-fg-3: #8a99b4;             /* 6.2:1 on night, 5.6:1 on night-2 */
  --nt-hair: rgba(150, 176, 216, 0.18);
  --nt-fg-nav: rgba(245, 247, 251, 0.72);
  --nt-pill: rgba(150, 176, 216, 0.16);
  --nt-chip: rgba(150, 176, 216, 0.1);
  --nt-edge: rgba(255, 255, 255, 0.07);   /* the lit top edge of a navy surface */
  /* rgb triplets for light and art (rgba() only) */
  --night-rgb: 10, 23, 49;
  --crest-rgb: 150, 176, 216;
  --navy-rgb: 29, 51, 88;
  --blue-nt-rgb: 108, 180, 255;   /* --blue-nt as a triplet: at most one live accent in art */
  --black-rgb: 0, 0, 0;
  /* the horizon (base.css 9b): light, never UI or text */
  --hz-rim: 222, 234, 255;        /* the limb's thin bright edge */
  --hz-sky: 98, 156, 245;         /* inner atmosphere: a bright, cool blue */
  --hz-mid: 46, 92, 186;          /* mid atmosphere */
  --hz-deep: 22, 46, 104;         /* outer atmosphere: navy */
  --hz-sun: 255, 255, 255;
  /* Duesify blue: the only interactive colour (never a background, never navy) */
  --blue: #0a62c9;
  --blue-press: #0855ae;
  --blue-dk: #4aa3ff;
  --blue-dk-press: #2f8ef5;
  --blue-nt: #6cb4ff;             /* links and focus on night (8.2:1) */
  --blue-nt-press: #4aa3ff;       /* 6.8:1 */

  /* ---------- Type ---------- */
  --font: "Inter Var", "Inter Fallback", Arial, sans-serif;

  /* seven roles, fluid 320 -> 1440 px */
  --fs-hero: clamp(3rem, 2.143rem + 4.286vw, 6rem);
  --fs-display: clamp(2.25rem, 1.607rem + 3.214vw, 4.5rem);
  --fs-h2: clamp(2rem, 1.643rem + 1.786vw, 3.25rem);
  --fs-title: clamp(1.3125rem, 1.188rem + 0.625vw, 1.75rem);
  --fs-lead: clamp(1.1875rem, 1.152rem + 0.179vw, 1.3125rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.875rem;

  --fw-display: 600;
  --fw-title: 600;
  --fw-body: 400;

  --tr-hero: -0.022em;
  --tr-display: -0.02em;
  --tr-h2: -0.018em;
  --tr-title: -0.012em;
  --tr-lead: -0.009em;
  --tr-body: -0.011em;
  --tr-small: -0.004em;
  --tr-mark: -0.015em;

  --lh-hero: 1.04;
  --lh-display: 1.07;
  --lh-h2: 1.1;
  --lh-title: 1.18;
  --lh-lead: 1.4;
  --lh-body: 1.47;
  --lh-small: 1.43;

  /* ---------- Space (4/8 pt) ---------- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 128px;
  --section-y: clamp(5.5rem, 4.643rem + 4.286vw, 8.5rem);
  --stack-gap: clamp(1rem, 0.857rem + 0.714vw, 1.5rem);

  /* ---------- Grid ---------- */
  --page: 1080px;
  --gutter: max(20px, min(5vw, 48px), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --col-gap: clamp(16px, 2vw, 24px);
  --measure: 34em;

  /* ---------- Radii (three) ---------- */
  --r-s: 12px;
  --r-l: 24px;
  --r-pill: 999px;
  --card-pad: clamp(var(--sp-5), 3vw, var(--sp-7));   /* card padding; full-bleed art pulls out by it */

  /* ---------- Shadow (cards on mist and paper only; navy surfaces use --nt-edge instead) ---------- */
  --shadow-rest: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 30px rgba(0, 0, 0, 0.06);

  /* ---------- Material: the bar's one frosted navy, on every page and stage (DESIGN.md 3.3) ---------- */
  --mat-night: rgba(10, 23, 49, 0.8);
  --mat-night-solid: rgb(10, 23, 49);
  --mat-filter: saturate(180%) blur(20px);

  /* ---------- Chrome ---------- */
  --safe-top: env(safe-area-inset-top, 0px);   /* a phone's status bar over the page: the bar grows by it */
  --header-h: calc(52px + var(--safe-top));
  --tap: 44px;
  --focus-w: 2px;
  --focus-off: 3px;
  --focus-r: 6px;
  --nav-h: 32px;
  --nav-pad: 14px;
  --menu-row: 56px;
  --dot: 7px;
  --btn-pad: 22px;
  --title-line: clamp(72px, 22svh, 220px);  /* bar to the statement title, the same on every page */

  /* ---------- Motion: curves ---------- */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-standard: cubic-bezier(0.4, 0, 0.6, 1);
  --ease-material: cubic-bezier(0.28, 0.11, 0.32, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
  /* springs as linear() (WWDC23 formula): bounce 0, and bounce 0.12 for the pill */
  --spring: linear(0, 0.0028 0.8%, 0.0163 2.1%, 0.0387 3.3%, 0.0788 5%, 0.1667 7.9%, 0.3624 13.8%, 0.4552 16.7%, 0.551 20%, 0.6342 23.3%, 0.7049 26.7%, 0.7638 30%, 0.8176 33.8%, 0.8601 37.5%, 0.8997 42.1%, 0.9308 47.1%, 0.9541 52.5%, 0.9717 58.8%, 0.9832 65.4%, 0.9914 73.8%, 1);
  --spring-brisk: linear(0, 0.0056 1.2%, 0.0209 2.5%, 0.0532 4.2%, 0.0959 5.8%, 0.1862 8.8%, 0.401 15%, 0.4962 17.9%, 0.5948 21.2%, 0.6805 24.6%, 0.7446 27.5%, 0.8057 30.8%, 0.8551 34.2%, 0.8985 37.9%, 0.9341 42.1%, 0.9593 46.2%, 0.9792 51.2%, 0.9925 57.1%, 1.0026 70.8%, 1);

  /* ---------- Motion: durations ---------- */
  --dur-press: 120ms;
  --dur-hover: 200ms;
  --dur-ui: 240ms;
  --dur-ui-l: 320ms;
  --dur-exit: 160ms;
  --dur-reduced: 150ms;
  --dur-reveal-s: 560ms;
  --dur-reveal: 760ms;
  --dur-hero: 900ms;
  --dur-beat: 810ms;
  --dur-pill: 530ms;
  --dur-page-out: 120ms;
  --dur-page-gap: 100ms;
  --dur-page-in: 320ms;
  --dur-hz-night: 1600ms;         /* hero horizon rises */
  --dur-dawn: 1800ms;             /* closer: the atmosphere fills */
  --dur-dawn-rim: 1200ms;
  --dur-dawn-sun: 1400ms;
  --dur-draw: 1200ms;             /* placeholder art strokes draw */
  --dur-morph: 140ms;
  --dur-morph-rot: 180ms;
  --dur-soon: 5400ms;
  --dur-gl-in: 400ms;             /* the live GL frame over the poster */
  --dur-cue-in: 600ms;
  --dur-type: 38ms;              /* About's editor: one character (hw.js TYPE) */
  --dur-drip: 2600ms;             /* Home's intro: the last drops run and stop */

  /* ---------- Motion: delays ---------- */
  --delay-morph: 110ms;
  --delay-items: 120ms;
  --delay-tray-close: 80ms;
  --delay-follow: 160ms;
  --delay-sub: 60ms;
  --delay-hz-night: 450ms;
  --delay-dawn-rim: 150ms;
  --delay-dawn-sun: 400ms;
  --delay-cue: 1600ms;

  /* ---------- Motion: distances, scales, staggers ---------- */
  --rise-s: 8px;
  --rise-m: 16px;
  --rise-l: clamp(20px, 1.5vw + 12px, 32px);
  --blur-in: 8px;
  --rise-hz: 40px;
  --scale-press: 0.97;
  --scale-enter: 0.985;
  --stagger-ui: 24ms;
  --stagger: 70ms;
  --stagger-hero: 90ms;

  /* ---------- Scroll ---------- */
  --lit-dim-dark: 0.5;
  --lit-dim-light: 0.65;
  --descent: clamp(240px, 42svh, 440px);   /* black -> night, at the top of a night stage that follows black */
  --dive-len: 150svh;             /* Home's opening: scroll while its stage is pinned (the dive into one drop) */

  /* ---------- The opening's sign (DESIGN.md 9 Home): one reference glass per orientation, shown like object-fit: cover ---------- */
  --rain-k: max(100cqw / 1440, 100cqh / 900);   /* 1 ref px in CSS px, resolved in the stage (a size container) */
  --rain-fs: 118; --rain-ts: 21; --rain-word-y: -113.9; --rain-tag-y: 37.9;   /* ref px: sizes, line tops from the centre */
  --fs-word: calc(var(--rain-k) * var(--rain-fs));
  --fs-word-tag: max(14px, calc(var(--rain-k) * var(--rain-ts)));
  --tr-word: -0.034em;
  /* the sign's halo, as rain.js draws it (GS, GA): one tight crest glow (polish 1: the wide navy one is gone) */
  --glow-sign: drop-shadow(0 0 0.05em rgba(var(--crest-rgb), 0.55));
  --glow-sign-off: drop-shadow(0 0 0.05em rgba(var(--crest-rgb), 0));
  /* the pop-in's curves, sampled from the formulas rain.js evaluates (largest gap 0.15 px at 118 px) */
  --spring-sign: linear(0, 0.0028 0.78%, 0.0109 1.56%, 0.0238 2.34%, 0.0409 3.12%, 0.0619 3.91%, 0.0862 4.69%, 0.1135 5.47%, 0.1433 6.25%, 0.209 7.81%, 0.2805 9.38%, 0.4311 12.5%, 0.5064 14.06%, 0.5795 15.62%, 0.6494 17.19%, 0.7149 18.75%, 0.7756 20.31%, 0.8309 21.88%, 0.8805 23.44%, 0.9244 25%, 0.9625 26.56%, 0.995 28.12%, 1.0223 29.69%, 1.0445 31.25%, 1.062 32.81%, 1.0753 34.38%, 1.0848 35.94%, 1.0909 37.5%, 1.0941 39.06%, 1.0947 40.62%, 1.0901 43.75%, 1.0799 46.88%, 1.0666 50%, 1.0383 56.25%, 1.0149 62.5%, 1.0063 65.62%, 0.9999 68.75%, 0.9926 75%, 0.991 81.25%, 0.9926 87.5%, 1);
  --ease-fall: linear(0, 0.001 1.77%, 0.0039 3.54%, 0.0088 5.31%, 0.0156 7.08%, 0.0244 8.85%, 0.0352 10.63%, 0.0479 12.4%, 0.0625 14.17%, 0.0791 15.94%, 0.0977 17.71%, 0.1182 19.48%, 0.1406 21.25%, 0.165 23.02%, 0.1914 24.79%, 0.2197 26.56%, 0.25 28.33%, 0.2822 30.1%, 0.3164 31.88%, 0.3525 33.65%, 0.3906 35.42%, 0.4307 37.19%, 0.4727 38.96%, 0.5166 40.73%, 0.5625 42.5%, 0.6104 44.27%, 0.6602 46.04%, 0.7119 47.81%, 0.7656 49.58%, 0.8213 51.35%, 0.8789 53.13%, 0.9385 54.9%, 1 56.67%, 1.0088 57.81%, 1.0157 58.96%, 1.0207 60.1%, 1.0239 61.25%, 1.0256 63.54%, 1.0228 65.83%, 1 75%, 1);
  --ease-smooth: linear(0, 0.028, 0.104, 0.216, 0.352, 0.5, 0.648, 0.784, 0.896, 0.972, 1);
  --dur-sign-rise: 750ms; --dur-sign-fade: 280ms; --stagger-sign: 75ms; --delay-sign: 250ms;
  --dur-sign-fall: 600ms; --dur-sign-dot: 100ms; --delay-sign-dot: 860ms;
  --dur-sign-tag: 900ms; --delay-sign-tag: 1600ms;
  --rise-sign: 0.42em; --fall-sign: -1.5em;

  /* ---------- Layers ---------- */
  --z-content: 1;
  --z-header: 50;
  --z-skip: 100;
}

@media (max-width: 733px) {
  :root { --header-h: calc(48px + var(--safe-top)); }
}
@media (orientation: portrait) {
  :root { --rain-k: max(100cqw / 390, 100cqh / 844); --rain-fs: 60; --rain-ts: 16; --rain-word-y: -97.8; --rain-tag-y: -21.8; }
}
/* large screens: one wider step for the page box; the type scale stays (DESIGN.md 3.3) */
@media (min-width: 1800px) and (min-height: 1000px) {
  :root { --page: 1200px; }
}
