/*
 * Design tokens — colour.
 *
 * Values are the exact hex table from
 * design_handoff_ilifu_software_catalog/README.md ("Design Tokens"). `:root`
 * carries the `dark` theme (the handoff README calls it "terminal"; the
 * design's own THEMES table keys it `dark`) as the default so the page has
 * sane colours even before `[data-theme]` is set. `[data-theme="dark"]`
 * repeats the same values explicitly so switching *back* to dark from
 * another theme is a plain attribute-selector match rather than "falls
 * through to :root", which would silently break if a future theme were
 * ever nested inside another selector.
 *
 * `--code` (terminal/code surface), `--field` (input surface) and
 * `--on-accent` (text drawn on accent fills) are kept distinct on purpose —
 * collapsing them is what breaks contrast in `idia`, where the accent is a
 * mid-tone blue but inputs and code blocks are pure white.
 *
 * `--on-code` is the fourth member of that set and the only value below that
 * the handoff's token table does not list. It has to exist: `idia` sets
 * `--code` and `--fg` to the *same* colour (#00355e), so the catalog's load
 * line — light text on a dark navy block — renders literally invisible in
 * that theme if it draws its text with `--fg`, and no other shipped token is
 * light in all three themes (`--fg` is dark in `idia`; `--on-accent` is dark
 * in `dark` and `amber`). Each value below is the theme's own existing
 * high-contrast-on-`--code` colour, not a new hue: `--fg` for `dark` and
 * `amber`, `--on-accent`/`--panel` white for `idia`. See the handoff
 * README's own warning that collapsing surface and on-surface tokens "breaks
 * contrast in light themes" — this is exactly that failure.
 *
 * `--on-code-accent`, `--on-code-warn` and `--on-code-dim` are the same idea
 * one step further, and exist for exactly one surface: the admin screen's
 * watcher log, which the handoff specifies as a `--code` block carrying
 * *four* foregrounds ("rows of `timestamp` (`--dim`, `flex: none`) +
 * message; indexing lines in `--accent`, warnings in `--warn`"). In `dark`
 * and `amber` the plain tokens are already fine on `--code` (10.7:1, 9.9:1,
 * 5.5:1 and 9.3:1, 11.6:1, 4.8:1) and these are defined equal to them, so
 * nothing changes there. In `idia`, `--code` is the same navy as `--fg` and
 * the plain tokens measure 2.60:1, 2.14:1 and 2.90:1 against it — the log is
 * the one thing on the screen whose whole job is to be read, and none of it
 * passed WCAG AA. The `idia` values below are lighter tints of that theme's
 * own accent, warn and dim hues (5.92:1, 5.93:1, 5.96:1 on `--code`), not
 * new hues. The decorative `$` prompt in the catalog's load line stays plain
 * `--accent` — it is `aria-hidden` and carries no information, and the notes
 * at `.catalog-load__prompt` / `.detail-code__prompt` explain why.
 *
 * `idia`'s accent is deliberately #0079ad rather than the IDIA brand blue
 * #009ada: #009ada fails WCAG AA for text/icons on the white `--panel`/`--bg`
 * this theme uses. Do not "correct" it back to the brand value — see
 * design_handoff_ilifu_software_catalog/README.md, "Design Tokens".
 */

:root,
[data-theme='dark'] {
  --bg: #0c0f0e;
  --panel: #131716;
  --panel2: #191e1c;
  --line: #252c29;
  --line2: #323a36;
  --fg: #dfe6e2;
  --fg2: #aab5af;
  --dim: #7d8a83;
  --accent: #5fd39a;
  --accent2: #1d3b30;
  --warn: #dcb166;
  --err: #df7a62;
  --code: #080a09;
  --field: #080a09;
  --on-accent: #080a09;
  --on-code: #dfe6e2;
  --on-code-accent: #5fd39a;
  --on-code-warn: #dcb166;
  --on-code-dim: #7d8a83;
  --sel: #1c2b25;
}

[data-theme='idia'] {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel2: #eef2f5;
  --line: #dde3e8;
  --line2: #c2ccd4;
  --fg: #00355e;
  --fg2: #3c5063;
  --dim: #6c7b8a;
  --accent: #0079ad;
  --accent2: #dcf0f9;
  --warn: #8a5b0c;
  --err: #a3301c;
  --code: #00355e;
  --field: #ffffff;
  --on-accent: #ffffff;
  --on-code: #ffffff;
  --on-code-accent: #5cbde8;
  --on-code-warn: #e0a93a;
  --on-code-dim: #9db6c8;
  --sel: #e2f2fa;
}

[data-theme='amber'] {
  --bg: #100d08;
  --panel: #171309;
  --panel2: #1d180d;
  --line: #2c2413;
  --line2: #3d331c;
  --fg: #f0d9a7;
  --fg2: #c4ab7c;
  --dim: #8d7a55;
  --accent: #e8a33d;
  --accent2: #3a2a10;
  --warn: #e8c23d;
  --err: #d9694a;
  --code: #0a0805;
  --field: #0a0805;
  --on-accent: #0a0805;
  --on-code: #f0d9a7;
  --on-code-accent: #e8a33d;
  --on-code-warn: #e8c23d;
  --on-code-dim: #8d7a55;
  --sel: #332510;
}
