/* Mímisbrunnr design tokens: the ONE place the shared palette is defined.
   Edit here, then run design/sync.sh. Every app reads these variables:
   the landing site directly, the instruments through tailwind-theme.css.

   Two themes, set on <html> by theme.js:
     Night (default, no attribute)  peat, fog, well-water
     Snow  (data-theme="snow")      the same, in daylight
   Print always uses Snow.

   Contrast (WCAG): every ink, --ink-faint included, clears 4.5:1 on all
   three surfaces in both themes (faint: Night 4.6–5.4, Snow 4.6–5.3), so
   labels, dates, placeholders and footers in it are legible text. Keep it
   one step below --ink-muted; never go darker (Night) or lighter (Snow).

   Chart palettes were run through the dataviz validator against --bg-panel
   (Night #11171b, Snow #f7f9f8): categorical and sequential pass in both. */

:root {
  color-scheme: dark;

  /* surfaces, back to front */
  --bg: #0b0f12;
  --bg-panel: #11171b;
  --bg-raised: #172026;
  --line: #222d33;
  --line-strong: #34434b;

  /* ink, strongest to weakest */
  --ink: #d5dde0;
  --ink-soft: #c0cacd;
  --ink-secondary: #a6b3b8;
  --ink-muted: #8b999f;
  --ink-faint: #7c8a90;

  /* accent: well-water. --on-accent is text on an accent fill. */
  --accent: #82b7b0;
  --accent-strong: #a6d3cc;
  --accent-deep: #3f6f69;
  --on-accent: #0b0f12;

  /* status: reserved for state, never a series; always with a label */
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-critical: #d03b3b;
  --status-critical-text: #f26d6d;

  /* categorical: fixed slots, colour follows the entity, never its rank */
  --cat-1: #3987e5;  /* blue */
  --cat-2: #d95926;  /* orange */
  --cat-3: #199e70;  /* aqua */
  --cat-4: #c98500;  /* yellow */
  --cat-5: #d55181;  /* magenta */
  --cat-6: #9085e9;  /* violet */
  --cat-other: #6b777c;

  /* sequential magnitude, low → high (amber; light end is high on Night) */
  --seq-1: #a3540c;
  --seq-2: #bf6a10;
  --seq-3: #d78415;
  --seq-4: #ea9f22;
  --seq-5: #f6ba3f;
  --seq-6: #fdd57a;
  --map-land: #34434b;

  /* type */
  --f-display: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --f-read: "Source Serif 4", Georgia, serif;
  --f-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --f-rune: "Noto Sans Runic", "Segoe UI Historic", "Segoe UI Symbol", serif;

  --measure: 66ch;
  --shell: 1080px;
}

/* Snow. Kept as a mixin-by-duplication for print below; change both. */
:root[data-theme="snow"] {
  color-scheme: light;
  --bg: #eef1f0;
  --bg-panel: #f7f9f8;
  --bg-raised: #ffffff;
  --line: #cfd8d8;
  --line-strong: #b4c1c2;
  --ink: #182024;
  --ink-soft: #2b373c;
  --ink-secondary: #3f4c52;
  --ink-muted: #4f5d63;
  --ink-faint: #616e74;
  --accent: #2c6862;
  --accent-strong: #1f524d;
  --accent-deep: #9cc2bd;
  --on-accent: #ffffff;
  --status-good: #0b7a0b;
  --status-warning: #8a5a00;
  --status-critical: #c43a3a;
  --status-critical-text: #b42828;
  --cat-1: #2a78d6;
  --cat-2: #e0602d;
  --cat-3: #14936a;
  --cat-4: #c48300;
  --cat-5: #d4588a;
  --cat-6: #6250d6;
  --cat-other: #8a969b;
  --seq-1: #e6a33c;
  --seq-2: #d68a1e;
  --seq-3: #bf700c;
  --seq-4: #a35908;
  --seq-5: #834506;
  --seq-6: #633304;
  --map-land: #d3dadb;
}

@media print {
  :root, :root[data-theme="snow"] {
    color-scheme: light;
    --bg: #ffffff;
    --bg-panel: #ffffff;
    --bg-raised: #ffffff;
    --line: #cfd8d8;
    --line-strong: #b4c1c2;
    --ink: #182024;
    --ink-soft: #2b373c;
    --ink-secondary: #3f4c52;
    --ink-muted: #4f5d63;
    --ink-faint: #616e74;
    --accent: #2c6862;
    --accent-strong: #1f524d;
    --accent-deep: #9cc2bd;
    --on-accent: #ffffff;
    --status-good: #0b7a0b;
    --status-warning: #8a5a00;
    --status-critical: #c43a3a;
    --status-critical-text: #b42828;
    --cat-1: #2a78d6;
    --cat-2: #e0602d;
    --cat-3: #14936a;
    --cat-4: #c48300;
    --cat-5: #d4588a;
    --cat-6: #6250d6;
    --cat-other: #8a969b;
    --seq-1: #e6a33c;
    --seq-2: #d68a1e;
    --seq-3: #bf700c;
    --seq-4: #a35908;
    --seq-5: #834506;
    --seq-6: #633304;
    --map-land: #d3dadb;
  }
}
