/* tokens.css — the atlas base system. Per-system accents arrive as --sysA/--sysB
   on :root (set by the router) and must never carry meaning alone. */
:root {
  /* color */
  --paper: #EEECE4;
  --paper-high: #F4F2EB;
  --ink: #0A0A09;
  --ink-muted: rgba(10, 10, 9, .62);
  --ink-faint: rgba(10, 10, 9, .32);
  --rule: rgba(10, 10, 9, .18);
  --rule-strong: rgba(10, 10, 9, .42);
  --signal: #FF3B18;
  --field-dark: #11110F;
  --paper-on-dark: #EEECE4;
  --rule-on-dark: rgba(238, 236, 228, .22);
  --muted-on-dark: rgba(238, 236, 228, .6);

  /* system accents (fallback to base when no dossier is active) */
  --sysA: var(--ink);
  --sysB: var(--signal);
  --accent: var(--signal);

  /* type families */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-ui: "Inter Tight", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  /* Fraunces axes: display voice = large optical cut, slightly soft, no wonk */
  --display-weight: 380;
  --display-weight-strong: 520;

  /* type scale */
  --t-cover: clamp(5rem, 13vw, 13rem);
  --t-display: clamp(3.5rem, 8vw, 8.5rem);
  --t-section: clamp(2.25rem, 5vw, 5.5rem);
  --t-sub: clamp(1.5rem, 2.5vw, 2.5rem);
  --t-lead: clamp(1.2rem, 1.7vw, 1.75rem);
  --t-body: clamp(1rem, 1.05vw, 1.125rem);
  --t-caption: .75rem;
  --t-micro: .6875rem;

  /* space (8px base) */
  --s-1: .5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
  --s-6: 3rem;
  --s-8: 4rem;
  --s-12: 6rem;
  --s-scene: clamp(4.5rem, 12vh, 15rem);

  /* layout */
  --margin: clamp(1rem, 3.4vw, 3.5rem);
  --gutter: clamp(12px, 1.6vw, 32px);
  --measure: 66ch;
  --head-h: 3.5rem;

  /* motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.76, 0, .24, 1);
  --ease-strong: cubic-bezier(.19, 1, .22, 1);
  /* ONE duration scale for the whole site. Every transition/animation picks the
     tier that matches its job — no ad-hoc .22s/.32s/.45s values:
       micro  controls (buttons, chips, close) — snappy is correct here
       label  small UI/label swaps
       hover  CONTENT hover (index rows, cards, figures, bands) — one tempo
       change content/route changes
       reveal block + letter reveals
       open   large openings and long sweeps                                   */
  --d-micro: 200ms;
  --d-label: 420ms;
  --d-hover: 460ms;
  --d-change: 560ms;
  --d-reveal: 700ms;
  --d-open: 950ms;
  /* the dossier's content cue: how long the plate leads before the content
     arrives. main.js reads this token so the letter/block reveals start on the
     same beat as the fade — the two can never drift apart. */
  --d-stage-cue: 600ms;
}

/* ==========================================================================
   COLOR MODES — personalization, inspired by dataset palettes.
   Layout, stamps, and hierarchy never change; only tokens do.
   tools/test-modes.mjs parses these blocks and asserts WCAG ratios — keep the
   `--token: value;` one-per-line format.
   ========================================================================== */

/* INK — dark inversion of the atlas itself */
:root[data-mode="ink"] {
  --paper: #131311;
  --paper-high: #1A1A17;
  --ink: #EEECE4;
  --ink-muted: rgba(238, 236, 228, .62);
  --ink-faint: rgba(238, 236, 228, .4);
  --rule: rgba(238, 236, 228, .16);
  --rule-strong: rgba(238, 236, 228, .4);
  --signal: #FF4A28;
  --field-dark: #050504;
  --paper-on-dark: #EEECE4;
  --rule-on-dark: rgba(238, 236, 228, .22);
  --muted-on-dark: rgba(238, 236, 228, .6);
}

/* CORK — warm dark, after Oryzo AI (02) */
:root[data-mode="cork"] {
  --paper: #140B05;
  --paper-high: #1D1109;
  --ink: #FFD9B3;
  --ink-muted: rgba(255, 217, 179, .64);
  --ink-faint: rgba(255, 217, 179, .42);
  --rule: rgba(255, 217, 179, .16);
  --rule-strong: rgba(255, 217, 179, .42);
  --signal: #FF8539;
  --field-dark: #070301;
  --paper-on-dark: #FFD9B3;
  --rule-on-dark: rgba(255, 217, 179, .22);
  --muted-on-dark: rgba(255, 217, 179, .6);
}

/* BOTANICAL — light, after Floema (01) */
:root[data-mode="botanical"] {
  --paper: #F3F0E4;
  --paper-high: #F8F6EC;
  --ink: #241F21;
  --ink-muted: rgba(36, 31, 33, .66);
  --ink-faint: rgba(36, 31, 33, .36);
  --rule: rgba(36, 31, 33, .18);
  --rule-strong: rgba(36, 31, 33, .44);
  --signal: #5A7030;
  --field-dark: #1C1719;
  --paper-on-dark: #F3F0E4;
  --rule-on-dark: rgba(243, 240, 228, .22);
  --muted-on-dark: rgba(243, 240, 228, .62);
}

/* CINEMA — mono, after Siena Film Foundation (14) & Watson (20) */
:root[data-mode="cinema"] {
  --paper: #FAF7EF;
  --paper-high: #FFFFFF;
  --ink: #0B0B0B;
  --ink-muted: rgba(11, 11, 11, .58);
  --ink-faint: rgba(11, 11, 11, .35);
  --rule: rgba(11, 11, 11, .16);
  --rule-strong: rgba(11, 11, 11, .44);
  --signal: #B63B2F;
  --field-dark: #000000;
  --paper-on-dark: #FAF7EF;
  --rule-on-dark: rgba(250, 247, 239, .22);
  --muted-on-dark: rgba(250, 247, 239, .6);
}
