/*
 * Olima colour tokens: the one source for the landing, the cabinet (account/), the admin panel
 * and the desktop client (client/ui). Values follow docs/brandbook.md §3.
 *
 * Edit ONLY this file, then run `node scripts/sync-tokens.mjs`: it copies it to
 * landing/tokens.css, account/tokens.css, admin/tokens.css and client/ui/tokens.css
 * (each site is served from its own folder, so each needs its own copy).
 * `client/test/tokens.test.js` fails when a copy drifts.
 *
 * Apps keep their own variable names and point them at these (`--paper: var(--o-canvas)`),
 * so a dark switch here re-colours every app. Dark: `data-theme="dark"` on <html>, or the
 * system setting unless the page sets `data-theme="light"`.
 */
:root {
  --o-canvas: #faf8f5;
  --o-card: #ffffff;
  --o-subtle: #f5f3ef;
  --o-spine: #f2efe9;
  --o-matcha: #ebf0e8;
  --o-matcha-line: #d5dfd0;
  --o-olive: #4e6e4e;
  --o-olive-hover: #3d583d;
  --o-on-olive: #faf8f5;
  --o-terra: #d97757;
  --o-terra-bg: #fdf3f0;
  --o-terra-line: #f5d0c5;
  --o-terra-ink: #9a3412;
  --o-sage-ink: #2e472e;
  --o-ok-bg: #e6f4ea;
  --o-ok-ink: #2e6f40;
  --o-warn-bg: #fef3c7;
  --o-warn-ink: #b45309;
  --o-ink: #1c1917;
  --o-ink-2: #44403c;
  --o-muted: #78716c;
  --o-line: #e7e5e4;
  --o-line-strong: #d6d3d1;
  /* Package bar: green above half, yellow from a third to half, red below a third. */
  --o-meter-ok: #4e6e4e;
  --o-meter-mid: #d4a12a;
  --o-meter-low: #c8553d;
  --o-meter-empty: #e7e5e4;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --o-canvas: #141614;
    --o-card: #1e211e;
    --o-subtle: #181b18;
    --o-spine: #181b18;
    --o-matcha: #252b25;
    --o-matcha-line: #364236;
    --o-olive: #6b926b;
    --o-olive-hover: #7ea57e;
    --o-on-olive: #141614;
    --o-terra: #e28769;
    --o-terra-bg: #2a1f1b;
    --o-terra-line: #4a3027;
    --o-terra-ink: #f0b39c;
    --o-sage-ink: #b7d0b2;
    --o-ok-bg: #1f3324;
    --o-ok-ink: #9fd0ad;
    --o-warn-bg: #3a2f12;
    --o-warn-ink: #f0c36b;
    --o-ink: #f5f5f4;
    --o-ink-2: #d6d3d1;
    --o-muted: #a8a29e;
    --o-line: #2c312c;
    --o-line-strong: #364236;
    --o-meter-ok: #6b926b;
    --o-meter-mid: #e0b54b;
    --o-meter-low: #e2735c;
    --o-meter-empty: #2c312c;
  }
}

:root[data-theme="dark"] {
  --o-canvas: #141614;
  --o-card: #1e211e;
  --o-subtle: #181b18;
  --o-spine: #181b18;
  --o-matcha: #252b25;
  --o-matcha-line: #364236;
  --o-olive: #6b926b;
  --o-olive-hover: #7ea57e;
  --o-on-olive: #141614;
  --o-terra: #e28769;
  --o-terra-bg: #2a1f1b;
  --o-terra-line: #4a3027;
  --o-terra-ink: #f0b39c;
  --o-sage-ink: #b7d0b2;
  --o-ok-bg: #1f3324;
  --o-ok-ink: #9fd0ad;
  --o-warn-bg: #3a2f12;
  --o-warn-ink: #f0c36b;
  --o-ink: #f5f5f4;
  --o-ink-2: #d6d3d1;
  --o-muted: #a8a29e;
  --o-line: #2c312c;
  --o-line-strong: #364236;
  --o-meter-ok: #6b926b;
  --o-meter-mid: #e0b54b;
  --o-meter-low: #e2735c;
  --o-meter-empty: #2c312c;
}
