/* Hallmark · genre: editorial · macrostructure: Map / Diagram
 * theme: Almanac-warm (light paper · roman-serif display · warm rust accent)
 * nav: N9 edge-aligned minimal · footer: Ft4 dense colophon · enrichment: Tier-A CSS diagram
 * differs from previous build (Cobalt) on all three axes:
 *   paper band  light  (was cool-light)
 *   display     roman-serif Newsreader (was grotesk-sans Space Grotesk)
 *   accent hue  warm rust ~38 (was electric cobalt ~250)
 * pre-emit critique: P5 H5 E5 S5 R5 V5
 */

:root {
  color-scheme: light dark;

  /* ---- type: 2 + 1 ------------------------------------------------------ */
  --font-display: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* ---- scale: perfect fourth (1.333) ------------------------------------ */
  --text-2xs: 0.694rem;
  --text-xs: 0.79rem;
  --text-sm: 0.889rem;
  --text-base: 1rem;
  --text-lg: 1.2rem;
  --text-xl: 1.44rem;
  --text-2xl: 1.85rem;
  --text-3xl: 2.4rem;
  --text-display: clamp(2.6rem, 6.2vw, 4.6rem);

  /* ---- 4pt space -------------------------------------------------------- */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.25rem;
  --space-xl: 3.5rem;
  --space-2xl: 5rem;
  --space-3xl: 7.5rem;
  --page-gutter: clamp(1.15rem, 5vw, 4.5rem);
  --measure: 68ch;

  /* ---- colour: warm-oat anchor, hue 60-75 ------------------------------- */
  --color-paper: oklch(97% 0.008 75);
  --color-paper-2: oklch(94.6% 0.011 74);
  --color-paper-3: oklch(91.5% 0.013 72);
  --color-rule: oklch(84% 0.011 70);
  --color-rule-strong: oklch(72% 0.013 66);
  /* L=50%: at 58% this scored 3.66:1 against --color-paper-2, failing WCAG AA
     for the small labels that use it (spec dt, thead th, .node__shape). Chroma
     and hue are unchanged; only lightness moved. Now 5.49 / 5.12 / 4.67 on
     paper / paper-2 / paper-3. The dark palette already passed at 60%. */
  --color-neutral: oklch(50% 0.011 65);
  --color-muted: oklch(43% 0.013 60);
  --color-ink: oklch(21% 0.015 55);
  --color-accent: oklch(50% 0.165 38);
  --color-accent-soft: oklch(90% 0.045 45);
  --color-focus: oklch(50% 0.165 38);

  /* ---- lines, radii, motion --------------------------------------------- */
  --rule-hair: 1px;
  --rule-mid: 2px;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --dur-instant: 90ms;
  --dur-short: 160ms;
  --dur-med: 260ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* ---- z scale ----------------------------------------------------------- */
  --z-base: 0;
  --z-raised: 10;
  --z-sticky: 20;
  --z-overlay: 30;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-paper: oklch(15.5% 0.011 62);
    --color-paper-2: oklch(19% 0.013 62);
    --color-paper-3: oklch(23% 0.014 62);
    --color-rule: oklch(33% 0.012 62);
    --color-rule-strong: oklch(45% 0.013 62);
    --color-neutral: oklch(60% 0.011 66);
    --color-muted: oklch(74% 0.010 70);
    --color-ink: oklch(93.5% 0.009 75);
    --color-accent: oklch(68% 0.135 42);
    --color-accent-soft: oklch(32% 0.055 42);
    --color-focus: oklch(72% 0.135 42);
  }
}
