/* ==========================================================================
   CodeRifts design tokens — single source of truth.

   Extracted 2026-08-22 from the :root blocks that were inlined into 80 HTML
   files. Values are byte-identical to what those files declared; this file
   moves them, it does not change them.

   HOW IT WORKS
   ------------
   :root                          the canonical palette, used by 75 pages.
   :root[data-token-theme="..."]  a page that historically diverged. The
                                  attribute goes on <html>. Attribute
                                  selectors outspecify bare :root, so a
                                  themed page keeps exactly its old values.

   WHY THE `initial` DECLARATIONS
   ------------------------------
   A divergent page never declared the full canonical set. Some of them
   reference a canonical token anyway (e.g. /agents/ uses var(--muted) but
   never defined it). Today that var() is invalid-at-computed-value-time and
   the declaration is dropped. If :root above supplied a value, those pages
   would suddenly start painting it — a visual change. Setting the token to
   `initial` makes it guaranteed-invalid again, reproducing the old
   behaviour exactly. Do not "tidy" these away.

   Three pages additionally scope the canonical 13 to
   `#standard-site-chrome, #standard-site-footer` in their own <style> so the
   shared nav/footer keeps the standard palette on an off-palette page. Those
   rules are ID-specificity and still win inside the chrome. Left in place.

   Guarded by scripts/check-token-drift.mjs (CI: token-drift.yml).
   ========================================================================== */

:root {
  --background: #0E1116;
  --foreground: #F8FAFC;
  --card: #1B1F27;
  --card-foreground: #F8FAFC;
  --primary: #60A5FA;
  --primary-foreground: #FFFFFF;
  --muted: #1B1F27;
  --muted-foreground: #CBD5E1;
  --destructive: #FB7185;
  --success: #22C55E;
  --warning: #EAB308;
  --border: #334155;
  --ring: #3B82F6;
}

/* --------------------------------------------------------------------------
   zinc — /agents/
   shadcn zinc scale rather than the site's slate scale. Declared 8 tokens.
   -------------------------------------------------------------------------- */
:root[data-token-theme="zinc"] {
  --background: #09090b;
  --foreground: #fafafa;
  --card: #18181b;
  --primary: #3b82f6;
  --primary-foreground: #ffffff;
  --muted-foreground: #a1a1aa;
  --destructive: #ef4444;
  --border: #27272a;

  /* never declared here; var(--muted) is referenced and must stay invalid */
  --card-foreground: initial;
  --muted: initial;
  --success: initial;
  --warning: initial;
  --ring: initial;
}

/* --------------------------------------------------------------------------
   partial-standard — /decision-spec/how-agents-use-this/
   Canonical values, but only 6 of the 13 were ever declared.
   -------------------------------------------------------------------------- */
:root[data-token-theme="partial-standard"] {
  --background: #0E1116;
  --foreground: #F8FAFC;
  --card: #1B1F27;
  --primary: #3B82F6;
  --muted-foreground: #94A3B8;
  --border: #334155;

  --card-foreground: initial;
  --primary-foreground: initial;
  --muted: initial;
  --destructive: initial;
  --success: initial;
  --warning: initial;
  --ring: initial;
}

/* --------------------------------------------------------------------------
   ink — /for-agents/ and /docs/what-each-path-does/
   A separate naming system (bg/ink/panel/line/mut). Union of the two pages:
   /docs/what-each-path-does/ declared 12, /for-agents/ declared 9. The extra
   three (--bad, --sans, --warn) are unreferenced on /for-agents/, so the
   union is a no-op there — verified against its var() reference set.
   -------------------------------------------------------------------------- */
:root[data-token-theme="ink"] {
  --bg: #0e1116;
  --ink: #e8ebf0;
  --panel: #151a21;
  --line: #232a34;
  --mut: #8a94a3;
  --accent: #3b82f6;
  --accent-dim: #1e3a5f;
  --ok: #5fb878;
  --bad: #f43f5e;
  --warn: #eab308;
  --mono: ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace;
  --sans: Inter,ui-sans-serif,system-ui,sans-serif;

  /* the canonical set is deliberately NOT available at :root on these pages;
     it resolves only inside #standard-site-chrome / #standard-site-footer */
  --background: initial;
  --foreground: initial;
  --card: initial;
  --card-foreground: initial;
  --primary: initial;
  --primary-foreground: initial;
  --muted: initial;
  --muted-foreground: initial;
  --destructive: initial;
  --success: initial;
  --warning: initial;
  --border: initial;
  --ring: initial;
}

/* --------------------------------------------------------------------------
   github-dark — /system-prompts/ and /providers/
   GitHub's dark palette. /system-prompts/ declared these 10. /providers/
   carried the same colours hard-coded with no :root at all; the grade-*
   and --row-border aliases below are its values, verbatim, so its table
   swatches keep their exact colours.
   -------------------------------------------------------------------------- */
:root[data-token-theme="github-dark"] {
  --bg: #0D1117;
  --surface: #161B22;
  --text: #C9D1D9;
  --text-muted: #8B949E;
  --border: #30363D;
  --accent: #58A6FF;
  --green: #3FB950;
  --red: #F85149;
  --orange: #D29922;
  --purple: #BC8CFF;

  /* /providers/ grade swatches — its own hard-coded values */
  --grade-a: #238636;
  --grade-b: #56d364;
  --grade-c: #d29922;
  --grade-d: #da3633;
  --grade-f: #b62324;
  --grade-unknown: #484f58;
  --row-border: #21262d;

  --background: initial;
  --foreground: initial;
  --card: initial;
  --card-foreground: initial;
  --primary: initial;
  --primary-foreground: initial;
  --muted: initial;
  --muted-foreground: initial;
  --destructive: initial;
  --success: initial;
  --warning: initial;
  --ring: initial;
}
