/* Leakplate v2 — tokens (dark)
 *
 * Link this immediately after `tokens.css`. It overrides only the colour tokens; type, spacing,
 * shape, grid and motion are the same in both modes.
 *
 * Checked on its own so the measurements are real:
 *   node bin/contrast.mjs design/leakplate-v2/tokens-dark.css
 * (`contrast.mjs` keeps one flat token map, so light and dark values cannot share a file without
 * the later one silently shadowing the earlier one. See the header of tokens.css.)
 *
 * The idea: in dark mode the plate is read under the cold room's own light. Same roles, same one
 * accent, inverted ground. The ice cyan gets lighter rather than changing hue — it is still the
 * only colour on the page that means "a value that was measured".
 */

@media (prefers-color-scheme: dark) {
  :root {
    /* --------------------------------------------------- Ground — the cold room, plate side up */
    --frost-050: #0B1114; /* page ground */
    --frost-100: #141D22; /* the plate: hero panel, record rows, form field */
    --frost-200: #1F2B31; /* blueprint grid majors, section rules, plate edge */
    --frost-300: #2C3B43; /* DECORATIVE hairlines and grid minors only */

    /* ------------------------------------------------------------------ Graphite — inverted ink */
    --graphite-900: #EDF3F4; /* display headings, and the CTA fill inverts to this */
    --graphite-700: #D3DEE2; /* body text, filled record values */
    --graphite-500: #9DB0B8; /* captions, field labels, citation chips */
    --graphite-400: #6E8089; /* idle gauge arc and empty record slots. NON-TEXT only */

    /* ------------------------------------------------------------- Measure — the same one hue */
    --ice-700: #9EDCEB; /* the leak-rate readout and accent TEXT */
    --ice-500: #7FD2E6; /* link text, focus ring */
    --ice-400: #27B3D1; /* NON-TEXT: live gauge arc, threshold tick, chart marks */
    --ice-150: #9EDCEB;

    /* ---- Chart ramp — ordinal, one hue, the rule's three lines: 10 / 20 / 30 percent (§6)
       node scripts/validate_palette.js "#9EDCEB,#4FB8D4,#1A7E99" --ordinal --mode dark --surface "#141D22"
       → ALL CHECKS PASS (monotone L, ΔL gaps >= 0.06, light end 3.65:1 vs surface, hue spread 7°) */
    --ice-ramp-1: #9EDCEB; /* 10 percent */
    --ice-ramp-2: #4FB8D4; /* 20 percent */
    --ice-ramp-3: #1A7E99; /* 30 percent */

    /* ----------------------------------- The one inverted band inverts too: it becomes the light band */
    --vault-900: #F2F6F7;
    --vault-800: #E7EDEF;
    --vault-700: #D5DEE1;
    --steam-050: #0F1619;
    --steam-300: #4C5B63;

    --shadow-plate: 0 1px 0 0 var(--frost-200), 0 24px 48px -32px rgb(0 0 0 / 0.6);

    /* @contrast graphite-900 on frost-050 >= 4.5  display headings
     * @contrast graphite-700 on frost-050 >= 4.5  body text and record values
     * @contrast graphite-500 on frost-050 >= 4.5  captions, field labels, citation chips
     * @contrast graphite-700 on frost-100 >= 4.5  values on the plate face
     * @contrast graphite-500 on frost-100 >= 4.5  labels on the plate face
     * @contrast ice-700 on frost-050 >= 4.5       the leak-rate readout
     * @contrast ice-700 on frost-100 >= 4.5       the leak-rate readout on the plate
     * @contrast ice-500 on frost-050 >= 4.5       links and focus ring
     * @contrast ice-500 on frost-100 >= 4.5       links on the plate
     * @contrast ice-400 on frost-050 >= 3         NON-TEXT: live arc, threshold tick, chart marks
     * @contrast ice-400 on frost-100 >= 3         the same marks on the plate face
     * @contrast graphite-400 on frost-050 >= 3    NON-TEXT: idle arc and empty record slots
     * @contrast graphite-400 on frost-100 >= 3    the same, on the plate face
     * @contrast frost-050 on graphite-900 >= 4.5  the CTA label on its inverted fill
     * @contrast steam-050 on vault-900 >= 4.5     text in the inverted band
     * @contrast steam-300 on vault-900 >= 4.5     captions in the inverted band
     * @contrast frost-300 on frost-050 < 3        decorative on purpose, as in light mode
     */
  }
}
