/**
 * Radixia design tokens — the single source of truth.
 *
 * Every Radixia surface reads its colour, type, spacing and motion from here:
 * the website (Astro), MCP Census (Cloudflare Worker), and anything else in the
 * labs line. Nothing downstream should redeclare these values. If you find
 * yourself copying a hex code out of this file, that is the bug.
 *
 * The contrast comments are load-bearing. Several values look arbitrary and are
 * not — they are the result of measuring against WCAG AA on the specific
 * surfaces they land on. Changing one means re-measuring it, not eyeballing it.
 *
 * ---------------------------------------------------------------------------
 * v1.0.0 — the accent is no longer magenta.
 *
 * Marco's call, 2026-08-10: every pink and violet gradation leaves the system.
 * Two rules in the website's DESIGN.md fall with it — One Bloom, which made
 * Bloom Magenta the identity, and Warm-Neutral, which required the violet
 * undertone in the greys. DESIGN.md is the document to rewrite next; this file
 * only stops asserting the old values.
 *
 * What was measured before deciding: magenta covered 2.61% of the site's first
 * screen against its own ~10% budget, so "less magenta" was never the fix. The
 * accent is the only saturated colour on the page, so it carries the whole
 * chromatic identity at any size — and the ground sat on the accent's own hue
 * axis (270° ground, 327° accent), which is why the accent read as the site's
 * colour instead of as an accent. Ground and accent had to move together:
 *
 *   accent  327° 85% sat  ->  357° oxide red, and the ground's undertone
 *   ground  270° violet   ->  ~40° warm, saturation collapsed
 *
 * The tokens are also RENAMED: `--magenta*` becomes `--accent*`. No aliases,
 * deliberately. MCP Census's sync script reads the generated JS mirror and
 * already maps magenta -> accent (its own comment: structural CSS that says
 * `--accent` can be re-themed by anyone), so an alias of the form
 * `--magenta: var(--accent)` would be copied into its theme verbatim and become
 * a circular reference. Both consumers are migrated in the same pass instead.
 * BREAKING for anything else reading --magenta*.
 * ---------------------------------------------------------------------------
 *
 * ---------------------------------------------------------------------------
 * v1.2.0 — the accent is Radixia Purple. The oxide-red experiment ends here.
 *
 * Same day, later: the official Radixia Brand Guidelines (v1.0, master v1.3)
 * were released and none of this repo had seen them yet. They freeze exactly
 * two colours for the logo — #660099 (Radixia Purple) and white — and say so
 * in the plainest possible terms: "the palette is deliberately rigid... no
 * secondary palette, no gradients", and rule 03 of incorrect use is "do not
 * recolor: only #660099 or white." That settles the collision the v1.1.0 note
 * above left open: the oxide-red accent this package shipped and the v1.3
 * violet lockup were 77° apart on the same screen, and it is the accent that
 * has to move, not the logo. The guide itself only governs the mark; "support
 * palette for products and communication" is explicitly listed as **not yet
 * defined**. Extending #660099 to the site's own accent, rather than inventing
 * a third hue next to a frozen logo, is the coherent reading of a system whose
 * own rule is "no secondary palette" — Marco's call, not a technical one.
 *
 * No token is renamed. Only values move, hue-rotated from the oxide-red
 * numbers straight to 280° (the accent's own hue) at the *same* saturation and
 * lightness the oxide system used — the lesson that survives the hue change is
 * that the accent should be the only saturated colour on the page, so the
 * neutrals stay exactly as desaturated as they were, just re-hued to match:
 *
 *   accent  357° oxide red  ->  280° Radixia Purple (#660099 exactly)
 *   ground   ~40° warm      ->  280°, same S/L as the oxide neutrals
 *
 * Every ratio below is recomputed against the new backgrounds, not carried
 * over — a hue rotation shifts relative luminance (blue contributes far less
 * to it than red does), so a value that cleared AA at 357° is not guaranteed
 * to clear it at 280°. All of them do, several with more margin than before.
 * ---------------------------------------------------------------------------
 *
 * ---------------------------------------------------------------------------
 * v2.0.0 — one typeface. The two-voice system retires.
 *
 * Radixia Brand Guidelines v1.7 (design frozen, August 2026) settles the
 * typography question v1.4 left half-open: Inter is the ONLY corporate/UI
 * typeface. Editorial and product/UI content are told apart by weight, size
 * and tracking alone — never by a second family. That retires Fraunces
 * (display/headings) and Public Sans (body); `--font-mono` is unchanged and
 * stays code-only.
 *
 * `--font-display` and `--font-body` are RENAMED to a single `--font-sans`,
 * not aliased. Keeping both names pointed at Inter would preserve the API
 * while lying about it — the whole point of retiring the two-voice system is
 * that the names no longer describe two different voices. The alias route
 * was already rejected once, for the same structural reason as the v1.0.0
 * magenta->accent rename above: MCP Census's sync script copies token
 * *values* verbatim into its own generated theme, so `--font-display:
 * var(--font-sans)` would land there as an unresolvable circular reference,
 * not a working style. Both consumers are migrated in the same pass instead.
 * BREAKING for anything reading --font-display or --font-body.
 *
 * Four tracking tokens are ADDED — `--track-display/-nav/-label/-meta`. With
 * one family, tracking is the only axis left that carries the register
 * distinction that family used to carry; getting a byline's +0.06em confused
 * with a label's +0.02em collapses editorial into product exactly the way a
 * wrong `--radius-btn` reads as off-brand (see that token's own comment).
 * Weight, size and line-height stay literals in the consuming CSS, as they
 * already were — four axes times six roles of new tokens would document an
 * invariant that does not exist.
 *
 * Fraunces and Public Sans stay in `fonts.css`/`fonts-absolute.css` for this
 * release: `@font-face` is lazy, an unreferenced family costs zero bytes, and
 * removing the files now would break Census before it has migrated off them.
 * They are retired in 2.1.0, once Census and the site are both confirmed on
 * this version.
 * ---------------------------------------------------------------------------
 */
:root {
  --paper: #f8f6f9;
  --paper-2: #f1edf3;
  --ink: #1a171c;
  --ink-2: #4c4450;
  /* Clears WCAG AA on every light surface: 5.48:1 on --paper, 5.08:1 on
     --paper-2 (.section--tint), 5.88:1 on --card. This token carries small text
     (mono eyebrows, counters, card meta), so it is the first to fail when the
     ground moves, and --paper-2 is the binding constraint rather than --paper —
     same margin the oxide system held (4.52:1 there) despite the hue change. */
  --ink-3: #6b6170;
  /* Radixia Purple, #660099 exactly — frozen by the brand guidelines, not a
     shade picked for this file. White on it is 10.37:1, up from 7.15:1 on the
     oxide red it replaces. */
  --accent: #660099;
  --accent-deep: #440066;
  /* Link hover. Links rest at --accent-deep (13.59:1 on --paper) and brighten on
     hover; this clears AA at 5.28:1 and still reads as a brightening. */
  --link-hover: #9f0ce9;
  /* Hero engine only: roots-engine.ts reads it for the mid-depth branches, which
     are the bulk of the drawing. Never a UI colour — see the note in Versioning.
     30% saturation, in the accent's hue family, matching the register the oxide
     version held (also 30%) so the drawing's presence on a dark ground does not
     regress: presence there comes from saturation, not contrast. 6.87:1 on
     --paper. */
  --hero-mid: #6d4681;
  /* Deprecated alias, removed in the next major. Nothing outside this repo's own
     website reads it (MCP Census's sync map never included it), so unlike the
     --magenta aliases this one cannot be copied into a downstream theme and
     become a circular reference. */
  --violet: var(--hero-mid);
  --line: #e0d8e3;
  --card: #ffffff;
  --dark-panel: #1a171c;
  color-scheme: light;

  --font-sans: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Register-carrying tracking, in em (guide values are 1/1000 em: -10 ->
     -0.01em, +60 -> 0.06em). One family means tracking is the only axis left
     that tells editorial from product/UI apart — see the v2.0.0 note above.
     No --track-body: `normal` is the CSS default and a token for "nothing"
     documents no invariant. */
  --track-display: -0.01em;  /* headline, editorial — guide's -10 */
  --track-nav: 0.01em;       /* navigation — guide's +10 */
  --track-label: 0.02em;     /* label / status / button, uppercase — guide's +20 */
  --track-meta: 0.06em;      /* byline / metadata, uppercase — guide's +60 */

  --w-max: 1240px;
  --w-prose: 720px;
  /* Two radii, deliberately different: cards and panels are soft at 10px,
     buttons are nearly square at 3px. Both are tokens rather than one token and
     one literal, because a consumer reading only `--radius` will put buttons on
     10px and the difference is the first thing that reads as off-brand. */
  --radius: 10px;
  --radius-btn: 3px;

  /* Motion — ONE vocabulary of easings and durations, shared by every
     micro-interaction and reveal. Consistency of movement is what reads as
     expensive: same curve, same timings, everywhere. */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);      /* soft deceleration */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-1: 0.16s;   /* micro-feedback: hover/focus */
  --dur-2: 0.28s;   /* composite states: cards, buttons */
  --dur-3: 0.62s;   /* scroll reveals */

  /* CTA background: white text stays AA (>=4.5:1) on these. 10.37:1 resting,
     13.59:1 hover. Overridden in dark below — not because white stops clearing
     AA on it, but because #660099 is 1.76:1 against the dark ground, so the
     button stopped reading as an object. */
  --accent-btn: #660099;
  --accent-btn-hover: #440066;

  /* On-dark surface palette. The .section--dark / terminal / footer panels are
     dark in both themes, so these accents are theme-independent tokens instead
     of the hard-coded hexes they replace. Measured on --dark-panel (#121113):
     fg 14.89:1, fg-2 11.40:1, fg-3 9.66:1, muted 5.57:1, accent 6.43:1. */
  --od-heading: #ffffff;
  --od-fg: #eae2ee;
  --od-fg-2: #d2c5d8;
  --od-fg-3: #c3b5c9;
  --od-muted: #95879b;
  --od-muted-2: #a99bb0;
  --od-accent: #c378e8;
  --od-accent-2: #db94ff;
}

/* Dark theme. NOT the system default any more: the website's pre-paint script
   sets data-theme explicitly and defaults to light, because this system is
   built on paper and following the OS served most visitors its inversion. This
   block stays for the surfaces that do follow the OS. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #181419;
    --paper-2: #201c22;
    --ink: #eae2ee;
    --ink-2: #bdb1c4;
    --ink-3: #95879b;
    /* Three values, because one cannot do all three jobs on a dark ground.
       --accent paints graphics that carry no text (hero nodes, hairline fills):
       4.16:1 against this ground. --accent-btn carries white text at 5.80:1 and
       still separates from the ground at 3.14:1. --accent-deep is the text/link
       colour at 7.12:1. Using --accent for the button would put white on
       #ad49df at 4.38:1, just under AA. */
    --accent: #ad49df;
    --accent-btn: #9d12e2;
    --accent-btn-hover: #660099;
    --accent-deep: #d181f8;
    --link-hover: #dfa8fa;
    /* 44% saturation on dark, matching the register the oxide accent held, and
       5.46:1 against this ground where that oxide version managed 5.39:1. */
    --hero-mid: #ae77ca;
    --line: #322b36;
    --card: #1b161d;
    --dark-panel: #121113;
    color-scheme: dark;
  }
}
/* Manual override */
:root[data-theme="dark"] {
  --paper: #181419;
  --paper-2: #201c22;
  --ink: #eae2ee;
  --ink-2: #bdb1c4;
  --ink-3: #95879b;
  --accent: #ad49df;
  --accent-btn: #9d12e2;
  --accent-btn-hover: #660099;
  --accent-deep: #d181f8;
  --link-hover: #dfa8fa;
  --hero-mid: #ae77ca;
  --line: #322b36;
  --card: #1b161d;
  --dark-panel: #121113;
  color-scheme: dark;
}
