/* ASIC Point design tokens: one set of names, eleven themes.
   Every page loads this file first; components (signal.css, landing.css, diagrams.css,
   problem.css, wave.css) use only these custom properties, never raw colours.

   Themes are selected by data-theme on <html> (set before paint by
   tools/templates/initial-paint.mjs). The selectors are [data-theme="…"], not :root-only,
   so any element can preview a theme: the header picker renders each option in its own
   colours this way.

     navy        dark   the bluish bench (default when the OS prefers dark)
     vellum      light  pale drafting film, navy ink (default when the OS prefers light)
     phosphor    dark   green trace on oscilloscope glass, Tek channel colours
     datasheet   light  black ink on white, printed part-spec timing diagrams
     silkscreen  dark   white legend on green solder mask, gold pads
     noir        dark   pitch black and white, lit like a film-noir set (chiaroscuro)
     fallout     dark   glowing green terminal: scanlines, phosphor glow, a CRT refresh bar
     remix       dark   youthful and loud: neon stickers, ticker tapes, lava-lamp blobs, a vinyl wheel
     riot        light  Beach Riot: punk zine meets a beach party; sand, sunset, confetti, a beach-ball wheel
     halloween   dark   a full moon, bats, slime drips and a jack-o'-lantern wheel
     contrast    dark   maximum contrast, yellow focus, underlined links

   tools/check-themes.mjs checks every theme for WCAG AA text contrast and 3:1 for
   graphics (traces, diagram strokes, focus rings). docs/ui-direction.md lists the tokens. */

:root {
  /* Type (modern pass, 2026-10-27): Geist for headings and reading, Geist Mono for code and
     readouts. Earlier: Archivo condensed headings and Atkinson Hyperlegible. */
  --display: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --display-stretch: 100%;
  --legend-stretch: 100%;
  /* Scale: major third from 17px. */
  --fs-xs: 12.5px; --fs-sm: 14px; --fs-base: 17px; --fs-md: 19px; --fs-lg: 23px;
  --fs-xl: 28px; --fs-2xl: 36px; --fs-3xl: clamp(36px, 4.8vw, 56px); --fs-hero: clamp(48px, 6.8vw, 96px);
  --lh-tight: 1.04; --lh-head: 1.15; --lh-body: 1.62;
  /* Space: 4px steps. */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --gutter: clamp(16px, 4vw, 48px);
  --measure: 70ch;
  /* Radii by role: chips and inputs, controls and screens, the instrument case, capsules. */
  --r-chip: 6px; --r-ctl: 10px; --r-case: 18px; --r-pill: 999px;
  --radius: var(--r-ctl);
  /* Borders and elevation: hairlines everywhere; shadows only on the case and pop-overs. */
  --bw: 1px; --bw-strong: 2px; --focus-w: 3px;
  --shadow-case: 0 1px 0 rgb(255 255 255 / .06) inset, 0 18px 40px -28px rgb(0 0 0 / .55);
  --shadow-pop: 0 14px 40px -12px rgb(0 0 0 / .45);
  /* Motion. */
  --dur-1: 120ms; --dur-2: 220ms; --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- vellum (light): pale drafting film, navy ink ---------- */
:root, [data-theme="vellum"] {
  color-scheme: light;
  --paper: #f7f8fa; --paper-2: #eef1f5; --card: #ffffff;
  --ink: #0b1320; --ink-2: #283445; --muted: #556072;
  --rule: #e2e7ee; --rule-strong: #7b879a;
  --accent: #c2410c; --accent-soft: #fdece4; --on-accent: #ffffff; --focus: #c2410c; --link: #b13a09;
  --good: #136a63; --good-soft: #d5ebe6; --bad: #a3301a; --bad-soft: #f5dcd4; --warn: #775508;
  /* instrument: case, screen and LEDs */
  --case: #eef1f5; --case-2: #d6dde6; --case-ink: #0b1320;
  --screen: #0b1220; --screen-2: #111a2a; --screen-rule: #24324a; --screen-ink: #e6edf5; --screen-muted: #9db0c4;
  --screen-grid: rgb(157 176 196 / .07);
  --ok: #8fe0c8; --busy: #f2c26b; --hot: #ff9478;
  /* syntax, on --screen */
  --syn-kw: #8cc8ff; --syn-str: #b8e3a4; --syn-com: #90adbb; --syn-num: #f2c57c; --syn-sys: #d9bcff; --syn-mac: #ffb38a;
  /* waveforms (Surfer's taxonomy: default, undefined, high impedance, don't care, weak, event) */
  --wave-bg: #0b1220; --wave-alt: #0f1828; --wave-grid: #22324a; --wave-text: #e6edf5; --wave-muted: #9db0c4;
  --wave-signal: #7fd8c4; --wave-bus-fill: #111a2a;
  --wave-x: #f2b45e; --wave-x-bg: #3b3122; --wave-z: #a9bff0; --wave-z-bg: #1f2c4a;
  --wave-dontcare: #8e9cf5; --wave-weak: #8aa1ad; --wave-event: #9bd0f4;
  --wave-cursor: #ff8f7a; --wave-marker: #f2c26b; --wave-mismatch: #ff8f7a; --wave-mismatch-bg: rgb(255 143 122 / .16);
  --wave-expected: #c4b9ff;
  /* diagrams: call, value, return, shared resource; text on a filled token */
  --flow-call: #326289; --flow-data: #136a63; --flow-return: #5f51a0; --flow-resource: #85581c; --flow-on: #ffffff;
  /* track channels (SystemVerilog, assertions, coverage, UVM) on paper, and on a screen */
  --ch-sv: #136a63; --ch-sva: #5f51a0; --ch-cov: #a63a14; --ch-uvm: #326289;
  --scope-sv: #9ce2d3; --scope-sva: #c4b9ff; --scope-cov: #f0a78c; --scope-uvm: #9bc7ec;
}

/* ---------- navy (dark): the bluish bench ---------- */
[data-theme="navy"] {
  color-scheme: dark;
  --paper: #060b14; --paper-2: #0c1420; --card: #0d1623;
  --ink: #f2f6fb; --ink-2: #c9d4e2; --muted: #93a2b7;
  --rule: #1b2738; --rule-strong: #566a84;
  --accent: #ff8f5a; --accent-soft: #2b1a12; --on-accent: #1a0d05; --focus: #ffb38d; --link: #ffab82;
  --good: #9ce2d3; --good-soft: #0f2a2a; --bad: #ff9f8a; --bad-soft: #2e1818; --warn: #ebc06e;
  --case: #0d1623; --case-2: #1b2738; --case-ink: #f2f6fb;
  --screen: #03070d; --screen-2: #09111c; --screen-rule: #1d2a3b; --screen-ink: #e4ecf4; --screen-muted: #93a7bc;
  --screen-grid: rgb(159 188 203 / .06);
  --ok: #8fe0c8; --busy: #f2c26b; --hot: #ff9478;
  --syn-kw: #8cc8ff; --syn-str: #b8e3a4; --syn-com: #8fa9b6; --syn-num: #f2c57c; --syn-sys: #d9bcff; --syn-mac: #ffb38a;
  --wave-bg: #03070d; --wave-alt: #071019; --wave-grid: #1a2838; --wave-text: #e4ecf4; --wave-muted: #93a7bc;
  --wave-signal: #7fd8c4; --wave-bus-fill: #09111c;
  --wave-x: #f2b45e; --wave-x-bg: #3b3122; --wave-z: #a9bff0; --wave-z-bg: #1f2c4a;
  --wave-dontcare: #8e9cf5; --wave-weak: #7f97a3; --wave-event: #9bd0f4;
  --wave-cursor: #ff8f7a; --wave-marker: #f2c26b; --wave-mismatch: #ff8f7a; --wave-mismatch-bg: rgb(255 143 122 / .16);
  --wave-expected: #c4b9ff;
  --flow-call: #9bc7ec; --flow-data: #9ce2d3; --flow-return: #c4b9ff; --flow-resource: #ebbc6e; --flow-on: #10282f;
  --ch-sv: #9ce2d3; --ch-sva: #c4b9ff; --ch-cov: #f0a78c; --ch-uvm: #9bc7ec;
  --scope-sv: #9ce2d3; --scope-sva: #c4b9ff; --scope-cov: #f0a78c; --scope-uvm: #9bc7ec;
}

/* ---------- phosphor (dark): P31 trace on scope glass; Tektronix channel order ---------- */
[data-theme="phosphor"] {
  color-scheme: dark;
  --paper: #0a1611; --paper-2: #0f2019; --card: #11251c;
  --ink: #d6f5de; --ink-2: #b9e2c5; --muted: #8fbb9c;
  --rule: #234133; --rule-strong: #46755a;
  --accent: #ffd447; --accent-soft: #2f2b12; --on-accent: #1a1600; --focus: #ffd447; --link: #ffd447;
  --good: #7cf29a; --good-soft: #163a24; --bad: #ff8a78; --bad-soft: #3d1d18; --warn: #ffd447;
  --case: #13291f; --case-2: #24473a; --case-ink: #d6f5de;
  --screen: #040c08; --screen-2: #081710; --screen-rule: #1b3a29; --screen-ink: #bfffd0; --screen-muted: #84b996;
  --screen-grid: rgb(124 242 154 / .085);
  --ok: #7cf29a; --busy: #ffd447; --hot: #ff8a78;
  --syn-kw: #5fe3ff; --syn-str: #ffd447; --syn-com: #79a487; --syn-num: #ff9df0; --syn-sys: #9dffb8; --syn-mac: #ffb36b;
  --wave-bg: #040c08; --wave-alt: #07130d; --wave-grid: #173322; --wave-text: #bfffd0; --wave-muted: #84b996;
  --wave-signal: #7cf29a; --wave-bus-fill: #081710;
  --wave-x: #ff8a78; --wave-x-bg: #3a1712; --wave-z: #5fe3ff; --wave-z-bg: #0b2a31;
  --wave-dontcare: #a9a2ff; --wave-weak: #6f9a7e; --wave-event: #5fe3ff;
  --wave-cursor: #ffd447; --wave-marker: #ffd447; --wave-mismatch: #ff8a78; --wave-mismatch-bg: rgb(255 138 120 / .18);
  --wave-expected: #ff9df0;
  --flow-call: #5fe3ff; --flow-data: #7cf29a; --flow-return: #ff9df0; --flow-resource: #ffd447; --flow-on: #04140a;
  --ch-sv: #ffd447; --ch-sva: #5fe3ff; --ch-cov: #ff8a78; --ch-uvm: #7cf29a;
  --scope-sv: #ffd447; --scope-sva: #5fe3ff; --scope-cov: #ff8a78; --scope-uvm: #7cf29a;
}

/* ---------- datasheet (light): black ink on white, printed timing diagrams ---------- */
[data-theme="datasheet"] {
  color-scheme: light;
  --paper: #fbfbf8; --paper-2: #efefe9; --card: #ffffff;
  --ink: #151515; --ink-2: #2e2e2c; --muted: #575753;
  --rule: #cfcfc7; --rule-strong: #858580;
  --accent: #c0122c; --accent-soft: #fbe3e6; --on-accent: #ffffff; --focus: #c0122c; --link: #c0122c;
  --good: #1b6636; --good-soft: #dfeee3; --bad: #b0121f; --bad-soft: #fbe1e3; --warn: #6e5000;
  --case: #efefe9; --case-2: #cfcfc7; --case-ink: #151515;
  --screen: #f6f6f1; --screen-2: #ebebe4; --screen-rule: #cfcfc7; --screen-ink: #151515; --screen-muted: #575753;
  --screen-grid: rgb(21 21 21 / .05);
  --ok: #1b6636; --busy: #8a6400; --hot: #c0122c;
  --syn-kw: #0b3c8c; --syn-str: #7a3a00; --syn-com: #5a6359; --syn-num: #6a2b9c; --syn-sys: #0a6464; --syn-mac: #8a4300;
  --wave-bg: #ffffff; --wave-alt: #f6f6f1; --wave-grid: #e0e0d8; --wave-text: #151515; --wave-muted: #575753;
  --wave-signal: #151515; --wave-bus-fill: #ffffff;
  --wave-x: #8a5400; --wave-x-bg: #f3e7cc; --wave-z: #1f4fbf; --wave-z-bg: #e3eaf8;
  --wave-dontcare: #5b3fb5; --wave-weak: #7a7a74; --wave-event: #1f4fbf;
  --wave-cursor: #c0122c; --wave-marker: #c0122c; --wave-mismatch: #c0122c; --wave-mismatch-bg: rgb(192 18 44 / .10);
  --wave-expected: #6a2b9c;
  --flow-call: #1f4fbf; --flow-data: #1b6636; --flow-return: #6a2b9c; --flow-resource: #7a5400; --flow-on: #ffffff;
  --ch-sv: #0a6464; --ch-sva: #6a2b9c; --ch-cov: #c0122c; --ch-uvm: #1f4fbf;
  --scope-sv: #0a6464; --scope-sva: #6a2b9c; --scope-cov: #c0122c; --scope-uvm: #1f4fbf;
}

/* ---------- silkscreen (dark): white legend on green solder mask, ENIG gold ---------- */
[data-theme="silkscreen"] {
  color-scheme: dark;
  --paper: #0c3a29; --paper-2: #0f4431; --card: #114a35;
  --ink: #f5f2e7; --ink-2: #e2ddcc; --muted: #bccbbd;
  --rule: #2a6249; --rule-strong: #6a9d83;
  --accent: #e6bb52; --accent-soft: #3b4a26; --on-accent: #241a00; --focus: #f2cf72; --link: #f0c860;
  --good: #a6f0bf; --good-soft: #175a3b; --bad: #ffb4a3; --bad-soft: #5a3328; --warn: #f0c860;
  --case: #0a3223; --case-2: #24604a; --case-ink: #f5f2e7;
  --screen: #05231a; --screen-2: #0a2c20; --screen-rule: #1f5139; --screen-ink: #eef2e6; --screen-muted: #a3c2ad;
  --screen-grid: rgb(245 242 231 / .06);
  --ok: #a6f0bf; --busy: #f0c860; --hot: #ff9e8a;
  --syn-kw: #ffd77a; --syn-str: #b8f0c8; --syn-com: #91b5a2; --syn-num: #ffb59a; --syn-sys: #c8d8ff; --syn-mac: #ffb59a;
  --wave-bg: #05231a; --wave-alt: #082a1f; --wave-grid: #1a4a35; --wave-text: #eef2e6; --wave-muted: #a3c2ad;
  --wave-signal: #f0a868; --wave-bus-fill: #0a2c20;
  --wave-x: #ff9e8a; --wave-x-bg: #4a2620; --wave-z: #9cc8ff; --wave-z-bg: #0f3346;
  --wave-dontcare: #c8b8ff; --wave-weak: #86a896; --wave-event: #9cc8ff;
  --wave-cursor: #f2cf72; --wave-marker: #f2cf72; --wave-mismatch: #ff9e8a; --wave-mismatch-bg: rgb(255 158 138 / .18);
  --wave-expected: #e0b8ff;
  --flow-call: #9cc8ff; --flow-data: #a6f0bf; --flow-return: #e0b8ff; --flow-resource: #f0c860; --flow-on: #082a1f;
  --ch-sv: #a6f0bf; --ch-sva: #e0b8ff; --ch-cov: #ffb59a; --ch-uvm: #9cc8ff;
  --scope-sv: #a6f0bf; --scope-sva: #e0b8ff; --scope-cov: #ffb59a; --scope-uvm: #9cc8ff;
}

/* ---------- noir (dark): pitch black and white, lit like a film-noir set (chiaroscuro) ---------- */
[data-theme="noir"] {
  color-scheme: dark;
  --paper: #000000; --paper-2: #0d0d0d; --card: #0b0b0b;
  --ink: #ffffff; --ink-2: #e6e6e6; --muted: #a6a6a6;
  --rule: #262626; --rule-strong: #8c8c8c;
  --accent: #ffffff; --accent-soft: #1f1f1f; --on-accent: #000000; --focus: #ffffff; --link: #ffffff;
  --good: #e6e6e6; --good-soft: #1c1c1c; --bad: #ffffff; --bad-soft: #2b2b2b; --warn: #cfcfcf;
  --case: #0b0b0b; --case-2: #1f1f1f; --case-ink: #ffffff;
  --screen: #000000; --screen-2: #0f0f0f; --screen-rule: #333333; --screen-ink: #f2f2f2; --screen-muted: #a6a6a6;
  --screen-grid: rgb(255 255 255 / .06);
  --ok: #f0f0f0; --busy: #bfbfbf; --hot: #ffffff;
  --syn-kw: #ffffff; --syn-str: #c8c8c8; --syn-com: #8a8a8a; --syn-num: #e0e0e0; --syn-sys: #f2f2f2; --syn-mac: #bdbdbd;
  --wave-bg: #000000; --wave-alt: #0d0d0d; --wave-grid: #2e2e2e; --wave-text: #ffffff; --wave-muted: #b3b3b3;
  --wave-signal: #ffffff; --wave-bus-fill: #121212;
  --wave-x: #d9d9d9; --wave-x-bg: #2e2e2e; --wave-z: #a6a6a6; --wave-z-bg: #1c1c1c;
  --wave-dontcare: #8c8c8c; --wave-weak: #7a7a7a; --wave-event: #e0e0e0;
  --wave-cursor: #ffffff; --wave-marker: #bdbdbd; --wave-mismatch: #ffffff; --wave-mismatch-bg: rgb(255 255 255 / .16);
  --wave-expected: #a6a6a6;
  --flow-call: #ffffff; --flow-data: #d0d0d0; --flow-return: #a8a8a8; --flow-resource: #8f8f8f; --flow-on: #000000;
  --ch-sv: #ffffff; --ch-sva: #d9d9d9; --ch-cov: #bfbfbf; --ch-uvm: #a6a6a6;
  --scope-sv: #ffffff; --scope-sva: #d9d9d9; --scope-cov: #bfbfbf; --scope-uvm: #a6a6a6;
}

/* ---------- fallout (dark): a glowing green terminal on a post-apocalyptic computer ---------- */
[data-theme="fallout"] {
  color-scheme: dark;
  --paper: #020d05; --paper-2: #05170a; --card: #061a0c;
  --ink: #5dff9e; --ink-2: #4eea8c; --muted: #36c271;
  --rule: #0e3f1f; --rule-strong: #2a9a58;
  --accent: #8dffbd; --accent-soft: #0c3a1c; --on-accent: #021006; --focus: #c4ffdc; --link: #9dffc4;
  --good: #8dffbd; --good-soft: #0b3319; --bad: #e2ffee; --bad-soft: #1d3a26; --warn: #b8f7cf;
  --case: #061a0c; --case-2: #0f3a1e; --case-ink: #5dff9e;
  --screen: #010904; --screen-2: #04140a; --screen-rule: #11512a; --screen-ink: #7dffb0; --screen-muted: #3fbf74;
  --screen-grid: rgb(93 255 158 / .07);
  --ok: #7dffb0; --busy: #c8ffe0; --hot: #f0fff6;
  --syn-kw: #c4ffdc; --syn-str: #5be08f; --syn-com: #36a865; --syn-num: #9dffc4; --syn-sys: #e0fff0; --syn-mac: #7fd9a6;
  --wave-bg: #010904; --wave-alt: #031009; --wave-grid: #0f3d20; --wave-text: #9dffc4; --wave-muted: #3fbf74;
  --wave-signal: #4dff96; --wave-bus-fill: #04140a;
  --wave-x: #e0fff0; --wave-x-bg: #1a3d27; --wave-z: #3fd17f; --wave-z-bg: #062a15;
  --wave-dontcare: #36a865; --wave-weak: #2a8a52; --wave-event: #9dffc4;
  --wave-cursor: #f0fff6; --wave-marker: #b6ffd4; --wave-mismatch: #f0fff6; --wave-mismatch-bg: rgb(160 255 200 / .16);
  --wave-expected: #6fd9a0;
  --flow-call: #9dffc4; --flow-data: #5be08f; --flow-return: #c8ffe0; --flow-resource: #3fbf74; --flow-on: #021006;
  --ch-sv: #9dffc4; --ch-sva: #6dffa6; --ch-cov: #c8ffe0; --ch-uvm: #4fe08a;
  --scope-sv: #9dffc4; --scope-sva: #6dffa6; --scope-cov: #c8ffe0; --scope-uvm: #4fe08a;
}

/* ---------- remix (dark): youthful, loud and musical; neon on a purple-black club floor ---------- */
[data-theme="remix"] {
  color-scheme: dark;
  --paper: #12021f; --paper-2: #1c0630; --card: #1a0530;
  --ink: #ffffff; --ink-2: #f0e6ff; --muted: #cdb8ea;
  --rule: #3d1a5c; --rule-strong: #a77bd6;
  --accent: #c6ff00; --accent-soft: #26300a; --on-accent: #12021f; --focus: #c6ff00; --link: #ff8acb;
  --good: #b6ff3b; --good-soft: #1c3310; --bad: #ff7aa8; --bad-soft: #3d0f26; --warn: #ffd23f;
  --case: #1a0530; --case-2: #3d1a5c; --case-ink: #ffffff;
  --screen: #0b0014; --screen-2: #150526; --screen-rule: #3a1858; --screen-ink: #f5ecff; --screen-muted: #c4a6e8;
  --screen-grid: rgb(196 166 232 / .07);
  --ok: #b6ff3b; --busy: #ffd23f; --hot: #ff7aa8;
  --syn-kw: #ff8acb; --syn-str: #c6ff00; --syn-com: #a98bcf; --syn-num: #ffd23f; --syn-sys: #6ee7ff; --syn-mac: #ffa86b;
  --wave-bg: #0b0014; --wave-alt: #10021c; --wave-grid: #33134f; --wave-text: #f5ecff; --wave-muted: #c4a6e8;
  --wave-signal: #6ee7ff; --wave-bus-fill: #150526;
  --wave-x: #ff7aa8; --wave-x-bg: #3d0f26; --wave-z: #b99bff; --wave-z-bg: #24104a;
  --wave-dontcare: #a394ff; --wave-weak: #8f7aa8; --wave-event: #6ee7ff;
  --wave-cursor: #c6ff00; --wave-marker: #ffd23f; --wave-mismatch: #ff7aa8; --wave-mismatch-bg: rgb(255 122 168 / .18);
  --wave-expected: #ff8acb;
  --flow-call: #6ee7ff; --flow-data: #c6ff00; --flow-return: #ff8acb; --flow-resource: #ffd23f; --flow-on: #12021f;
  --ch-sv: #6ee7ff; --ch-sva: #ff8acb; --ch-cov: #ffd23f; --ch-uvm: #c6ff00;
  --scope-sv: #6ee7ff; --scope-sva: #ff8acb; --scope-cov: #ffd23f; --scope-uvm: #c6ff00;
}

/* ---------- riot (light): Beach Riot; punk zine meets a beach party in the sun ---------- */
[data-theme="riot"] {
  color-scheme: light;
  --paper: #fff1d2; --paper-2: #ffe2a8; --card: #ffffff;
  --ink: #130a1c; --ink-2: #2a1832; --muted: #573f5e;
  --rule: #e8c98a; --rule-strong: #6b5070;
  --accent: #c8005a; --accent-soft: #ffd3e6; --on-accent: #ffffff; --focus: #c8005a; --link: #b5004f;
  --good: #00704a; --good-soft: #cff3e1; --bad: #c0002e; --bad-soft: #ffdbe2; --warn: #7d5200;
  --case: #ffe2a8; --case-2: #e8c98a; --case-ink: #130a1c;
  --screen: #150a20; --screen-2: #21102f; --screen-rule: #43285a; --screen-ink: #fff4e8; --screen-muted: #d7bfdc;
  --screen-grid: rgb(255 210 63 / .08);
  --ok: #8dffb8; --busy: #ffd23f; --hot: #ff7aa2;
  --syn-kw: #ff7ab8; --syn-str: #ffd23f; --syn-com: #b39abd; --syn-num: #6fe3ff; --syn-sys: #b8ff5c; --syn-mac: #ffa25c;
  --wave-bg: #150a20; --wave-alt: #1a0d27; --wave-grid: #3d2552; --wave-text: #fff4e8; --wave-muted: #d7bfdc;
  --wave-signal: #6fe3ff; --wave-bus-fill: #21102f;
  --wave-x: #ff7aa2; --wave-x-bg: #47112a; --wave-z: #c4a8ff; --wave-z-bg: #2a1a52;
  --wave-dontcare: #a99bff; --wave-weak: #9a84a3; --wave-event: #6fe3ff;
  --wave-cursor: #ffd23f; --wave-marker: #b8ff5c; --wave-mismatch: #ff7aa2; --wave-mismatch-bg: rgb(255 122 162 / .18);
  --wave-expected: #ff7ab8;
  --flow-call: #0058a3; --flow-data: #00704a; --flow-return: #a3005a; --flow-resource: #8a4600; --flow-on: #ffffff;
  --ch-sv: #006d91; --ch-sva: #b5004f; --ch-cov: #9c3d00; --ch-uvm: #5d24a8;
  --scope-sv: #6fe3ff; --scope-sva: #ff7ab8; --scope-cov: #ffd23f; --scope-uvm: #b8ff5c;
}

/* ---------- halloween (dark): a full moon, pumpkins, bats and slime on a purple night ---------- */
[data-theme="halloween"] {
  color-scheme: dark;
  --paper: #0f0a14; --paper-2: #181022; --card: #1a1124;
  --ink: #f7efe6; --ink-2: #e6d8cc; --muted: #bba9c4;
  --rule: #3a2a48; --rule-strong: #8a72a0;
  --accent: #ff7a1a; --accent-soft: #3a1e10; --on-accent: #1a0d00; --focus: #ffb066; --link: #ffa04d;
  --good: #8fe36b; --good-soft: #1d2e14; --bad: #ff6b6b; --bad-soft: #3a1414; --warn: #ffd166;
  --case: #1a1124; --case-2: #3a2a48; --case-ink: #f7efe6;
  --screen: #0a0610; --screen-2: #140c1c; --screen-rule: #33244a; --screen-ink: #f3eadf; --screen-muted: #b9a3c9;
  --screen-grid: rgb(201 160 255 / .07);
  --ok: #8fe36b; --busy: #ffd166; --hot: #ff6b6b;
  --syn-kw: #ff9b3d; --syn-str: #9be36b; --syn-com: #a491b6; --syn-num: #ffd166; --syn-sys: #c9a0ff; --syn-mac: #ff8fb0;
  --wave-bg: #0a0610; --wave-alt: #0f0816; --wave-grid: #2e2040; --wave-text: #f3eadf; --wave-muted: #b9a3c9;
  --wave-signal: #9be36b; --wave-bus-fill: #140c1c;
  --wave-x: #ff6b6b; --wave-x-bg: #3a1414; --wave-z: #a9b8ff; --wave-z-bg: #1c1f3f;
  --wave-dontcare: #b39dff; --wave-weak: #8f7f9e; --wave-event: #c9a0ff;
  --wave-cursor: #ff7a1a; --wave-marker: #ffd166; --wave-mismatch: #ff6b6b; --wave-mismatch-bg: rgb(255 107 107 / .16);
  --wave-expected: #c9a0ff;
  --flow-call: #c9a0ff; --flow-data: #9be36b; --flow-return: #ff9b3d; --flow-resource: #ffd166; --flow-on: #12081a;
  --ch-sv: #ff9b3d; --ch-sva: #c9a0ff; --ch-cov: #9be36b; --ch-uvm: #ffd166;
  --scope-sv: #ff9b3d; --scope-sva: #c9a0ff; --scope-cov: #9be36b; --scope-uvm: #ffd166;
}

/* ---------- contrast (dark): maximum contrast ---------- */
[data-theme="contrast"] {
  color-scheme: dark;
  --paper: #000000; --paper-2: #121212; --card: #000000;
  --ink: #ffffff; --ink-2: #ffffff; --muted: #e2e2e2;
  --rule: #9a9a9a; --rule-strong: #ffffff;
  --accent: #ffe14d; --accent-soft: #2e2800; --on-accent: #000000; --focus: #ffe14d; --link: #ffe14d;
  --good: #6dff9b; --good-soft: #00300e; --bad: #ff9a9a; --bad-soft: #3d0000; --warn: #ffe14d;
  --case: #000000; --case-2: #ffffff; --case-ink: #ffffff;
  --screen: #000000; --screen-2: #141414; --screen-rule: #bdbdbd; --screen-ink: #ffffff; --screen-muted: #e2e2e2;
  --screen-grid: rgb(255 255 255 / .08);
  --ok: #6dff9b; --busy: #ffe14d; --hot: #ff9a9a;
  --syn-kw: #7dd3ff; --syn-str: #a6ff9e; --syn-com: #e2e2e2; --syn-num: #ffe14d; --syn-sys: #ffb0f7; --syn-mac: #ffc58a;
  --wave-bg: #000000; --wave-alt: #0d0d0d; --wave-grid: #5c5c5c; --wave-text: #ffffff; --wave-muted: #e2e2e2;
  --wave-signal: #a6ff9e; --wave-bus-fill: #000000;
  --wave-x: #ffe14d; --wave-x-bg: #3a3000; --wave-z: #7dd3ff; --wave-z-bg: #002a3d;
  --wave-dontcare: #c9b6ff; --wave-weak: #bdbdbd; --wave-event: #7dd3ff;
  --wave-cursor: #ff9a9a; --wave-marker: #ffe14d; --wave-mismatch: #ff9a9a; --wave-mismatch-bg: rgb(255 154 154 / .22);
  --wave-expected: #ffb0f7;
  --flow-call: #7dd3ff; --flow-data: #6dff9b; --flow-return: #ffb0f7; --flow-resource: #ffe14d; --flow-on: #000000;
  --ch-sv: #6dff9b; --ch-sva: #ffb0f7; --ch-cov: #ffc58a; --ch-uvm: #7dd3ff;
  --scope-sv: #6dff9b; --scope-sva: #ffb0f7; --scope-cov: #ffc58a; --scope-uvm: #7dd3ff;
  --bw-strong: 3px;
}

/* Legacy aliases kept for older rules and scripts: x is unknown, z is high impedance. */
:root, [data-theme] {
  --x: var(--wave-x); --x-bg: var(--wave-x-bg); --z: var(--wave-z);
}
