/*
 * Stochastic Symposium — theme variable sets
 * =============================================
 * Four distinct, switchable visual themes for the front-of-house pages
 * (index.html, room.html, dossier.html, spectate.html). Activated by
 * `html[data-theme="NAME"]` (set by the inline bootstrap + theme.js).
 *
 * Themes: kline (default, warm dark) · hollow (cold bioluminescent cave) ·
 *         daylight (light paper, auto on prefers-color-scheme:light) ·
 *         phosphor (pure-black terminal, P1 phosphor green, all monospace)
 *
 * Each block defines the full union of custom properties used across the
 * four pages, so switching themes re-skins everything: body/prose text,
 * accents, borders, the account bar, inputs, buttons, code blocks, the
 * ledger, and the session/ambient view. Each page's own `:root {}` block
 * is untouched and still equals `kline` — it is only a fallback for the
 * rare case this stylesheet fails to load.
 *
 * Variable catalogue (25 colors + 5 derived tokens per theme):
 *   --bg --felt --surface --surface-light --border      backgrounds
 *   --ivory --ivory-dim --text-prose                     text tiers (primary / secondary / prose)
 *   --gold --gold-dim                                    accent (the ONE meaningful hue per theme)
 *   --neon --red --amber --stone --olive --warm-brown --green   status/semantic colors
 *   --on-accent                                           text color placed on a solid accent fill
 *   --ghost                                               faint placeholder/hint text
 *   --chan-water --chan-glow --chan-air --chan-echo --chan-earth --chan-creature   Hollow ambient channel colors
 *   --bg-rgb --border-rgb --gold-rgb --ivory-dim-rgb --scrim-rgb   "r,g,b" triplets for rgba(var(--x-rgb), alpha) tints
 *   --rule-style                                          border-style keyword for ASCII-style dividers (phosphor = dashed)
 *
 * WCAG verification: see the contrast table produced by the verifier
 * script (text/prose >= 7:1 AAA, secondary >= 4.5:1) for every theme.
 */

@media (prefers-color-scheme: light) {
  /* No-JS / pre-hydration progressive enhancement: if the OS prefers light
     and no data-theme has been set yet, render as Daylight immediately. */
  html:not([data-theme]) {
    --bg: #f4efe6;
    --felt: #efe8da;
    --surface: #fbf7ef;
    --surface-light: #fffdf9;
    --border: #a89878;
    --ivory: #1a1612;
    --ivory-dim: #5b5042;
    --text-prose: #311a14;
    --gold: #7a2410;
    --gold-dim: #8a4a28;
    --neon: #2f6b3a;
    --red: #a31f12;
    --amber: #8a5a10;
    --stone: #5f5547;
    --olive: #4c5c2e;
    --warm-brown: #6e4322;
    --green: #2f6b3a;
    --on-accent: #fdf8ef;
    --ghost: #8a7c62;
    --chan-water: #1f6b82;
    --chan-glow: #1f7a68;
    --chan-air: #48586a;
    --chan-echo: #6a4a72;
    --chan-earth: #704c28;
    --chan-creature: #3a5a2c;
    --bg-rgb: 244,239,230;
    --border-rgb: 168,152,120;
    --gold-rgb: 122,36,16;
    --ivory-dim-rgb: 91,80,66;
    --scrim-rgb: 20,16,12;
    --rule-style: solid;
    color-scheme: light;
  }
}

html[data-theme="kline"] {
    /* Kline — warm dark: amber on near-black */
    --bg: #0d0a07;
    --felt: #0f1a12;
    --surface: #161210;
    --surface-light: #1e1a16;
    --border: #2a2420;
    --ivory: #e8e0d0;
    --ivory-dim: #a89e90;
    --text-prose: #f3ead8;
    --gold: #c8922a;
    --gold-dim: #a9792a;
    --neon: #a8ff3e;
    --red: #e2583a;
    --amber: #d4a853;
    --stone: #9c9082;
    --olive: #8fa368;
    --warm-brown: #b08f68;
    --green: #5fae5f;
    --on-accent: #0d0a07;
    --ghost: #786a5c;
    --chan-water: #7fb8d6;
    --chan-glow: #7fd0c0;
    --chan-air: #a6bace;
    --chan-echo: #c3b4cf;
    --chan-earth: #c7ae82;
    --chan-creature: #9fc082;
    --bg-rgb: 13,10,7;
    --border-rgb: 42,36,32;
    --gold-rgb: 200,146,42;
    --ivory-dim-rgb: 168,158,144;
    --scrim-rgb: 10,8,6;
    --rule-style: solid;
    color-scheme: dark;
}

html[data-theme="hollow"] {
    /* Hollow — cold dark: bioluminescent cyan in the cave */
    --bg: #070b12;
    --felt: #04120f;
    --surface: #0e1620;
    --surface-light: #16212e;
    --border: #2b3a4a;
    --ivory: #e7f1ec;
    --ivory-dim: #9fb3b0;
    --text-prose: #dcf3ec;
    --gold: #55e0d6;
    --gold-dim: #3aa39c;
    --neon: #baffe8;
    --red: #ff7a7a;
    --amber: #d9e86a;
    --stone: #8a9aa0;
    --olive: #86c08a;
    --warm-brown: #c3977a;
    --green: #5fcf8a;
    --on-accent: #04080c;
    --ghost: #566c78;
    --chan-water: #6fd0e8;
    --chan-glow: #7dffcf;
    --chan-air: #a9c3d6;
    --chan-echo: #c3aee0;
    --chan-earth: #b6a488;
    --chan-creature: #9fdba0;
    --bg-rgb: 7,11,18;
    --border-rgb: 43,58,74;
    --gold-rgb: 85,224,214;
    --ivory-dim-rgb: 159,179,176;
    --scrim-rgb: 4,6,10;
    --rule-style: solid;
    color-scheme: dark;
}

html[data-theme="daylight"] {
    /* Daylight — light paper: ink with oxblood accents */
    --bg: #f4efe6;
    --felt: #efe8da;
    --surface: #fbf7ef;
    --surface-light: #fffdf9;
    --border: #a89878;
    --ivory: #1a1612;
    --ivory-dim: #5b5042;
    --text-prose: #311a14;
    --gold: #7a2410;
    --gold-dim: #8a4a28;
    --neon: #2f6b3a;
    --red: #a31f12;
    --amber: #8a5a10;
    --stone: #5f5547;
    --olive: #4c5c2e;
    --warm-brown: #6e4322;
    --green: #2f6b3a;
    --on-accent: #fdf8ef;
    --ghost: #8a7c62;
    --chan-water: #1f6b82;
    --chan-glow: #1f7a68;
    --chan-air: #48586a;
    --chan-echo: #6a4a72;
    --chan-earth: #704c28;
    --chan-creature: #3a5a2c;
    --bg-rgb: 244,239,230;
    --border-rgb: 168,152,120;
    --gold-rgb: 122,36,16;
    --ivory-dim-rgb: 91,80,66;
    --scrim-rgb: 20,16,12;
    --rule-style: solid;
    color-scheme: light;
}

html[data-theme="phosphor"] {
    /* Phosphor — terminal: P1-phosphor green, all monospace */
    --bg: #000000;
    --felt: #020302;
    --surface: #0a0f0a;
    --surface-light: #101a10;
    --border: #2f4a2f;
    --ivory: #9dff8a;
    --ivory-dim: #5fbf5a;
    --text-prose: #b6ffb0;
    --gold: #c8ffb8;
    --gold-dim: #7fdf72;
    --neon: #e8ffe0;
    --red: #ff6b6b;
    --amber: #c8e86a;
    --stone: #749874;
    --olive: #6fae5a;
    --warm-brown: #8a9a5a;
    --green: #5fdf5a;
    --on-accent: #000000;
    --ghost: #3f6a3f;
    --chan-water: #5adfca;
    --chan-glow: #6dffb0;
    --chan-air: #9fcf9a;
    --chan-echo: #aaffcf;
    --chan-earth: #8aae5a;
    --chan-creature: #bfffb0;
    --bg-rgb: 0,0,0;
    --border-rgb: 47,74,47;
    --gold-rgb: 200,255,184;
    --ivory-dim-rgb: 95,191,90;
    --scrim-rgb: 0,0,0;
    --rule-style: dashed;
    color-scheme: dark;
}

/* ─── Phosphor: force monospace everywhere, kill italics ───
   Beats inline style="font-family:'Cormorant Garamond'..." attributes
   via !important — maximum machine legibility, single typeface. */
html[data-theme="phosphor"] * {
    font-family: 'IBM Plex Mono', monospace !important;
    font-style: normal !important;
}
