/* tokens.css — the ONLY file that contains hex/rgb/hsl values or font names.
   DESIGN-V2 (normative) seed — measured values cited in DESIGN-V2.md;
   legacy aliases kept so the existing templates keep working as DESIGN-V2
   rolls out (step 7). */

:root {
  /* ── DESIGN-V2 semantic colour tokens ─────────────────────────────── */
  --ink: #1f2023;          /* body, near-black; >=7:1 on --bg (decision, rev 2) */
  --ink-strong: #2e0a63;   /* h1/h2 only (QCe H1 = #2E0A63) */
  --muted: #5c5f66;        /* secondary UI text, >=4.5:1 (decision rev 2) */
  --link: #490f99;         /* text links (old --brand-deep) 7.6:1 */
  --nav-link: #5b3f85;     /* nav/TOC links (old --brand-link) */
  --action: #490f99;       /* buttons / CTA (old --brand-deep) */
  --accent: #9446ed;       /* fills only, never text (old --brand-accent) 4.1:1 */
  --accent-soft: #f2ebfe;  /* tint / selection / prompt card (old --brand-accent-soft) */
  --surface: #ffffff;      /* page surface (old --bg) */
  --surface-2: #fcfaff;    /* raised surface (old --bg-tint) */
  --card-bg: #f6f6f6;      /* definitions/excerpt cards (old) */
  --border: #e1e6ea;       /* 1px rule (old --muted-disabled) */
  /* form validation only — never on the review card (DESIGN.md §2) */
  --ok: #15803d;
  --warn: #b45309;
  --err: #b91c1c;
  --focus: #9446ed;        /* focus ring colour (old --brand-accent) */
  --focus-offset: 2px;

  /* ── DESIGN-V2 type scale (six UI + one prose) ────────────────────── */
  --text-tiny: 0.688rem;   /* smallest: rail eyebrows (11px) */
  --text-xs: 0.75rem;      /* captions, meta */
  --text-xs-lh: 1.4;
  --text-sm: 0.875rem;     /* UI labels, buttons */
  --text-sm-lh: 1.5;
  --text-base: 1rem;       /* UI body */
  --text-base-lh: 1.6;
  --text-lg: 1.125rem;     /* sub-headers */
  --text-lg-lh: 1.5;
  --text-xl: 1.5rem;       /* section heads */
  --text-xl-lh: 1.3;
  --text-2xl: 2rem;        /* page title */
  --text-2xl-lh: 1.25;
  --text-prose: 1.1875rem; /* reading body — the measure token (rev 3: /1.7) */
  --text-prose-lh: 1.7;

  /* ── DESIGN §3 spacing (4px base) ──────────────────────────────────── */
  --space-1: 0.25rem;  /* 4 */
  --space-2: 0.5rem;   /* 8  */
  --space-3: 0.75rem;  /* 12 */
  --space-4: 1rem;     /* 16 */
  --space-5: 1.5rem;   /* 24 */
  --space-6: 2rem;     /* 32 */
  --space-7: 3rem;     /* 48 */
  --space-8: 4rem;     /* 64 */

  /* ── DESIGN motion (rev 3: reveal <=120ms; no --dur-slow) ──────────── */
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);

  /* ── DESIGN elevation: overlay only (rev 2 E) ──────────────────────── */
  --elev-overlay: 0 8px 24px rgba(0,0,0,.12);

  /* ── DESIGN z-index scale (rev 3) ──────────────────────────────────── */
  --z-rail: 10;
  --z-popover: 100;
  --z-drawer: 500;
  --z-toast: 1000;

  /* ── legacy aliases (kept so pre-roll-out templates still resolve) ─── */
  --bg: #ffffff;            /* old == --surface */
  --bg-tint: #fcfaff;       /* old == --surface-2 */
  --muted-disabled: #e1e6ea;/* old == --border */
  --brand-deep: #490f99;    /* old == --link/--action */
  --brand-link: #5b3f85;    /* old == --nav-link */
  --brand-emphasis: #4c139b;
  --gray-label: #777777;
  --gray-caption: #6d6d6d;

  /* spot/soft colors + shadows — exact existing values (rev-2 rule A) */
  --tint-rail: #f3f3f3;
  --ink-soft: #303d5b;       /* old pre-v2 ink; other pages keep until 38B step 7 */
  --spot-hover: #7c5cff;     /* old .del-btn hover purple */
  --spot-emph: #1b1033;
  --spot-link: #5b3fc4;
  --ok-soft: #2e7d46;        /* old roadmap due green */
  --err-soft: #b3261e;       /* old error red */
  --shadow-s: 0 0 1px rgba(0,0,0,.08);
  --scrim: rgba(0,0,0,.35);   /* dialog backdrop overlay */
  --shadow-1: 0 1px 2px rgba(0,0,0,.1);
  --shadow-2: 0 4px 12px rgba(0,0,0,.18);

  /* ── fonts (DESIGN-V3 §2: reading serif + UI sans) ─────────────────── */
  --font-reading: "Source Serif 4", Georgia, serif;
  --font-ui: "Inter", system-ui, sans-serif;
}