/* Monte Lattice design tokens - the ONE place a color or typeface is defined.
   Every template loads this first; rapture.css (Art Deco pages + Console) and profile.css
   (homepage) consume these names and define no palette of their own.

   Palette: dusk blue ground, champagne accent, warm-neutral light surfaces. The token NAMES are
   historical (they date from the green-and-gold palette) and are kept so the palette stays
   one file:
     --teal       = the dusk-blue ground (bands: nav, masthead, title bands, footer)
     --brass      = the display champagne (rules, ticks, fills, text on the blue band)
     --brass-text = the darker champagne for words on paper
     --brass-warm = the same accent muted for LARGER marks (see below)
     --teal-deep  = a navy below --teal, for blocks that recede rather than protrude
   The accent has two values on purpose. --brass is correct for a hairline or a small numeral,
   where it reads as lit. The identical value across a large area reads as glare, so anything
   bigger than a line or a short phrase takes --brass-warm, which is the same hue pulled down
   (L 67->57, S 63->41). Neither is ever a field on this site: the largest --brass-warm mark is
   a drop cap or a 3px cell edge. If a future block wants a solid accent ground, --brass-warm is
   the value to start from, never --brass.
   Rules: the full light palette lives on bare :root (also written :root[data-theme="light"],
   so an explicit light choice names itself). Dark mode redefines only token values under
   data-theme="dark" and sets color-scheme with them. 2026-10-13: Kevin chose dark as the default,
   so every page is SERVED with data-theme="dark" on <html> (no script needed, no light frame);
   a stored ml-theme=light, or the toggle, switches it. The OS preference is deliberately NOT
   followed. Neutrals lean warm toward the champagne; none is a pure grey.
   Contrast (WCAG 2.x relative luminance, computed from the hex values), measured 2026-10-13:
     light: ink/paper 14.2, ink/surface 15.7, muted/paper 5.6, muted/surface 6.2,
            brass-text/paper 5.2, brass-text/surface 5.7, ok/surface 5.0, down/surface 5.5,
            on-teal/teal 13.1, brass/teal 7.9, brass-warm/teal 5.6, brass-warm/teal-deep 6.4
     dark:  ink/paper 14.3, ink/surface 12.9, muted/paper 7.0, muted/surface 6.3,
            brass-text/paper 10.9, brass-text/surface 9.8, ok/surface 7.4, down/surface 6.0,
            on-teal/teal 16.1, brass/teal 11.5, brass-warm/teal 8.1,
            brass-warm/teal-deep 8.6
   (The 2026-09-26 figures overstated two pairs: light brass-warm/teal was 5.55, dark 8.02 - not
   6.1. On-teal text also runs at 55-94% alpha over --teal; at 55% it is 5.0 light, 5.6 dark.)
   Ground warmed 2026-09-27: --teal/--teal-deep hue +7.2deg in OKLCH (toward red) in both modes;
   dark also +0.01 OKLab L, with on-teal/brass/brass-warm lifted just enough that no pair fell.
   Ground warmed again 2026-10-12: --teal/--teal-deep hue +6.7 / +7.5 deg (light) and +7.8 / +8.6 deg
   (dark) in OKLCH, toward red, lightness held; --brass and --brass-warm are unchanged and no
   pair fell by more than 0.02 (the largest fall: light brass/teal 7.97 -> 7.95). On-teal at 55%
   alpha re-measured the same day: 5.0 light, 5.6 dark.
   Light ground warmed 2026-10-13: --paper #F2F5FA (blue-white, luminance 0.911) -> #EDE9E1 (OKLCH
   0.935 / 0.0115 / 84.6, luminance 0.817, about 10% dimmer), --surface #E4EBF8 (a darker blue) ->
   #F7F4EF (luminance 0.907, so nothing on a light page is brighter than the old ground), --muted
   #5E5760 (mauve, hue 319) -> #5F5A54 (hue 72). The hue sits in the brass family (--brass is 79.6)
   at chroma 0.012 or less: a warm neutral, not parchment. Cards are one step LIGHTER than the
   ground, as on apple.com (separation 1.104:1; the white-on-white defect was 1.06). Chart marks
   on the card: chart-1..6 7.8, 3.7, 3.6, 3.5, 4.2, 3.5; heatmap cal1..4 1.57, 2.21, 4.63, 9.52.
   --warn is only a fill or border, so it answers to 3:1 (4.30 on the new surface).
   The old light ground (#F2F5FA) could not get lighter: at a fixed --paper, a lighter ground needs a
   lighter --brass to hold brass/teal, and that pulls brass/paper below 1.69. The warmed ground is
   dimmer, so that limit no longer binds.
   Plain --brass is 1.69 on light paper, so it is for rules, fills and text on the blue band,
   never body text on paper. Words on paper take --brass-text, which is measured to clear AA. */

:root,
:root[data-theme="light"] {
  color-scheme: light;

  /* core */
  --teal: #22254A;          /* bands: nav, masthead, title bands, footer */
  --brass: #E0B978;         /* rules, hairlines, corner ticks, fills, text on teal */
  --brass-warm: #BE9A64;    /* the accent for marks larger than a hairline; never a field */
  --paper: #EDE9E1;         /* page ground: a soft warm off-white */
  --ink: #1D1A1F;           /* body text */

  /* derived */
  --surface: #F7F4EF;       /* cards and stat tiles: warm, one step lighter than paper */
  --muted: #5F5A54;         /* secondary text: a warm grey */
  --brass-text: #7E5A1C;    /* brass-coloured words on paper */
  --on-teal: #EEF2F9;       /* text on a teal band or over imagery */
  --teal-deep: #181A36;     /* blocks that recede below the teal ground */
  --rule: color-mix(in srgb, var(--ink) 14%, transparent);
  --rule-strong: color-mix(in srgb, var(--ink) 20%, transparent);
  --scrim: #0A1224;         /* photo scrims; used through color-mix for alpha */

  /* status (Console) */
  --ok: #2F7556;
  --warn: #9A6A16;
  --down: #A8432C;
  --cal0: color-mix(in srgb, var(--ink) 8%, transparent);
  --cal1: #B6C6E2;
  --cal2: #8FA8CE;
  --cal3: #4F6FA3;
  --cal4: #243F6E;

  /* chart series (Chart.js reads these at load; plain hex so JS can add alpha) */
  --chart-1: #2E4C7F;
  --chart-2: #A27820;
  --chart-3: #3F8C8A;
  --chart-4: #6A84AD;
  --chart-5: #9C6B3A;
  --chart-6: #7A8752;
  --chart-grid: #1D1A1F1F;

  /* type */
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --teal: #14152B;
  --brass: #EDCB8C;
  --brass-warm: #CEA872;
  --paper: #121C31;
  --ink: #EEEAF0;
  --surface: #19253D;
  --muted: #ABA4B2;
  --brass-text: #EDCB8C;
  --on-teal: #EFF3FA;
  --teal-deep: #0D0F1E;
  --ok: #5CC79F;
  --warn: #E0A548;
  --down: #EE8670;
  --cal1: #2A3D62;
  --cal2: #3E5E95;
  --cal3: #6F95D1;
  --cal4: #A9C4EE;
  --chart-1: #7FA4DC;
  --chart-2: #EBC98A;
  --chart-3: #5FBDB8;
  --chart-4: #B3C3DD;
  --chart-5: #D9A273;
  --chart-6: #A7B77E;
  --chart-grid: #EEEAF01A;
}

html, body { background: var(--paper); color: var(--ink); }
