/**
 * The NeuroVolt colour and surface tokens, as CSS custom properties.
 *
 * The signal and surface values are copied from NeuroGRID's design canvas
 * (`neurogrid/docs/design/_style.html` for light, `_dark.html` for dark); the
 * four phase values are copied from NeuroLYST's
 * (`fault-analyst/docs/design/_style.html` and `_dark.html`). None is this
 * package's to change. A colour that looks wrong is a canvas
 * decision, not a CSS one; `test/contrast.test.ts` and
 * `test/tokens-agreement.test.ts` exist so a value cannot drift from the
 * canvas or from `src/tokens.ts` without a failing test naming which one.
 *
 * The two font stacks are the only non-colour values. `test/tokens-agreement.test.ts`
 * reads hex values only, so they sit outside the colour `TokenSet`;
 * `test/fonts.test.ts` proves they match `theme.css` and `fonts.css`.
 *
 * This file carries values only, no rule beyond `:root`. A component's own
 * spacing, radius or shadow is that component's decision, not a token this
 * package hands out. The rejected alternative, a full design-system token
 * set, would cover ground the canvas has not designed yet and would be
 * invented here rather than drawn there.
 *
 * The colours have fixed meanings. Red (`--danger`) is a fault. Amber
 * (`--warn`) is a protection operation. Green (`--ok`) is healthy or cleared.
 * Cyan (`--cyan`) is a measured value. Violet (`--violet`) is the state colour
 * for ground and earthing: a ground-fault zone or an earthed element. A `-bg`
 * variant is the fill of a chip or a row in that state; a `-line` variant is
 * its border. `--deep` is the brand blue, `--electric` its accent, `--on-deep`
 * the text colour that sits on `--deep`.
 *
 * A phase colour (`--phase-a`, `--phase-b`, `--phase-c`, `--phase-n`) identifies
 * a conductor (A, B, C, or the neutral or residual conductor, `--phase-n`) on a
 * waveform trace or a phase label, never a state; state stays with danger,
 * warn and ok. A phase is never
 * told by colour alone: the legend names every channel.
 *
 * Dark values are declared twice: once under `:root[data-theme="dark"]` for
 * an explicit choice the console remembers, and once under
 * `@media (prefers-color-scheme: dark)` for a visitor who has made no choice
 * yet. The media query is guarded by `:not([data-theme="light"])` so an
 * explicit light choice on an OS set to dark still renders light. Without
 * the guard the media query would outrank the attribute for every property it
 * sets, because a `@media` block and an attribute selector carry the same
 * specificity and the media block comes second in source order.
 */

:root {
  /* The family names `fonts.css` provides and `theme.css` maps for Tailwind.
     Theme-independent, so the dark blocks do not repeat them. */
  --font-sans: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --deep: #0031a7;
  --deep-ink: #002271;
  --electric: #379ef9;
  --ink: #0b0e14;
  --muted: #5a6472;
  --line: #e3e7ec;
  --surface: #f7f9fb;
  --bg: #ffffff;
  --panel: #ffffff;
  --deep-line: #cddcf7;
  --danger: #c81e1e;
  --warn: #b45309;
  --ok: #15803d;
  --violet: #6d28d9;
  --phase-a: #d12d2d;
  --phase-b: #a16207;
  --phase-c: #0e7490;
  --phase-n: #7c3aed;
  --cyan: #0e7490;
  --danger-bg: #fdf1f1;
  --warn-bg: #fdf7ee;
  --ok-bg: #eef8f1;
  --deep-bg: #eff4fd;
  --danger-line: #e8b9b9;
  --warn-line: #f0d9bb;
  --ok-line: #cfe3d6;
  --violet-line: #c9c2ee;
  --on-deep: #ffffff;
}

:root[data-theme="dark"] {
  --deep: #4d8ef5;
  --deep-ink: #7fb0f8;
  --electric: #379ef9;
  --ink: #e6edf3;
  --muted: #97a1b0;
  --line: #262d3a;
  --surface: #12161f;
  --bg: #0b0e14;
  --panel: #161b26;
  --deep-line: #2c4a7d;
  --danger: #ff6b6b;
  --warn: #ffb020;
  --ok: #3fb950;
  --violet: #b085f5;
  --phase-a: #ff6b6b;
  --phase-b: #ffd166;
  --phase-c: #4dd0e1;
  --phase-n: #b085f5;
  --cyan: #4dd0e1;
  --danger-bg: #2a1417;
  --warn-bg: #2a2010;
  --ok-bg: #10251a;
  --deep-bg: #11223c;
  --danger-line: #5e2a2a;
  --warn-line: #5a4318;
  --ok-line: #1f4d31;
  --violet-line: #4a3a7a;
  --on-deep: #0b0e14;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --deep: #4d8ef5;
    --deep-ink: #7fb0f8;
    --electric: #379ef9;
    --ink: #e6edf3;
    --muted: #97a1b0;
    --line: #262d3a;
    --surface: #12161f;
    --bg: #0b0e14;
    --panel: #161b26;
    --deep-line: #2c4a7d;
    --danger: #ff6b6b;
    --warn: #ffb020;
    --ok: #3fb950;
    --violet: #b085f5;
    --phase-a: #ff6b6b;
    --phase-b: #ffd166;
    --phase-c: #4dd0e1;
    --phase-n: #b085f5;
    --cyan: #4dd0e1;
    --danger-bg: #2a1417;
    --warn-bg: #2a2010;
    --ok-bg: #10251a;
    --deep-bg: #11223c;
    --danger-line: #5e2a2a;
    --warn-line: #5a4318;
    --ok-line: #1f4d31;
    --violet-line: #4a3a7a;
    --on-deep: #0b0e14;
  }
}
