/* Grain Design System — Dark (Night) Theme
 * The night register — footers, dark surfaces, logo-on-dark of the daylight
 * brand; not a separate palette. Same property names as the light theme —
 * overridden under [data-theme="dark"]. Every GRAIN role below points at the
 * NIGHT --sol-* names directly (--sol-night, --sol-night-raised,
 * --sol-daylight-on-night, --sol-accent-on-night, --sol-accent-ink-on-night):
 * text roles ride --sol-accent-ink-on-night (AA-safe on every night surface),
 * rings/graphics ride --sol-accent-on-night.
 *
 * WHAT THIS FILE CANNOT DO, stated rather than assumed. It re-points grain's
 * OWN names. It cannot re-point the spine's --sol-* names for the night
 * register: check-alias-inert.mjs assertion (f) forbids a barrel sibling from
 * declaring any --sol-* name, and assertion (c) confines the spine itself to
 * :root / .sol-* selectors, so neither file may carry a [data-theme="dark"]
 * --sol-* block. Only grain-solleva-compat.css re-points them — and
 * build-grain-css.mjs deliberately leaves compat OUT of the CDN bundle.
 *
 * The consequence, measured on dist/grain.css: under [data-theme="dark"] the
 * spine's DAYLIGHT --sol-accent-ink (#AB3415), --sol-accent-deep and
 * --sol-focus-ring survive unchanged. Any component that reads one of those
 * spine names DIRECTLY, instead of a grain role this file overrides, paints
 * daylight ink on night ground — #AB3415 on --background #151E29 is 2.59:1,
 * below AA. 14 component files under src/ do exactly that. This predates the
 * palette repoint (0.4.4 shipped the same split) and closing it needs a grain
 * -namespace accent-text role plus the component rewire — a separate change.
 * Do not read this file as proof that the bundle's night register is AA.
 */

[data-theme="dark"] {
  /* ── Surfaces ─────────────────────────────────────────── */
  --background: var(--sol-night);
  --background-sunken: color-mix(in oklab, var(--sol-night) 88%, var(--sol-night-raised));
  --background-deep: color-mix(in oklab, var(--sol-night) 94%, var(--sol-daylight-on-night));
  --surface: var(--sol-night-raised);
  --surface-sunken: var(--sol-night);
  --surface-elevated: color-mix(in oklab, var(--sol-night-raised) 92%, var(--sol-daylight-on-night));
  --surface-overlay: color-mix(in oklab, var(--sol-night-raised) 88%, transparent);
  --bg-gradient: linear-gradient(var(--sol-night), var(--sol-night));

  /* ── Text / Ink ───────────────────────────────────────── */
  --ink: var(--sol-daylight-on-night);
  --ink-secondary: color-mix(in oklab, var(--sol-daylight-on-night) 76%, transparent);
  --ink-tertiary: color-mix(in oklab, var(--sol-daylight-on-night) 62%, transparent);
  --ink-emphasis: var(--sol-daylight-on-night);
  --text-main: var(--sol-daylight-on-night);
  --text-muted: color-mix(in oklab, var(--sol-daylight-on-night) 76%, transparent);
  /* body-faint ink; matches --ink-tertiary by construction (both 62% on night) */
  --text-faint: color-mix(in oklab, var(--sol-daylight-on-night) 62%, transparent);

  /* ── Borders ──────────────────────────────────────────── */
  --border: color-mix(in oklab, var(--sol-daylight-on-night) 22%, transparent);
  --border-light: color-mix(in oklab, var(--sol-daylight-on-night) 14%, transparent);
  --border-hairline: color-mix(in oklab, var(--sol-daylight-on-night) 22%, transparent);
  --border-faint: color-mix(in oklab, var(--sol-daylight-on-night) 14%, transparent);

  /* ── Primary accent (night register) ──────────────────── */
  --on-accent: var(--sol-night);
  /* The forge-blue family is DELETED here too — a name retired in one
     register and kept in the other is still shipped. See cream.css for the
     measurement. The night roles keep their own names: --ink, then
     --background-sunken for the wash and --border for the boundary. */

  /* ── Sage → lifted ────────────────────────────────────── */
  --sage: var(--sol-daylight-on-night);
  --sage-bg: color-mix(in oklab, var(--sol-daylight-on-night) 10%, var(--sol-night));
  --sage-border: color-mix(in oklab, var(--sol-daylight-on-night) 25%, transparent);
  --sage-vivid: var(--sol-daylight-on-night);

  /* ── Amber → holding (TEXT role: the night accent-ink, AA-safe) ── */
  --amber: var(--sol-accent-ink-on-night);
  --amber-bg: color-mix(in oklab, var(--sol-accent-on-night) 12%, var(--sol-night));
  --amber-border: color-mix(in oklab, var(--sol-accent-on-night) 25%, transparent);
  --amber-vivid: var(--sol-accent-on-night);

  /* ── Danger → fault (TEXT role: the night accent-ink, AA-safe) ── */
  --danger-red: var(--sol-accent-ink-on-night);
  --danger-red-bg: color-mix(in oklab, var(--sol-accent-on-night) 12%, var(--sol-night));
  --danger-red-border: color-mix(in oklab, var(--sol-accent-on-night) 25%, transparent);

  /* ── Shadows / elevation — daylight lift, same in both registers ── */
  --shadow-sunken: none;
  --shadow-elevated: var(--sol-lift-1);
  --shadow-float: var(--sol-lift-2);
  --shadow-subtle: var(--sol-lift-1);
  --elevation-0: var(--sol-lift-0);
  --elevation-1: var(--sol-lift-1);
  --elevation-2: var(--sol-lift-1);
  --elevation-3: var(--sol-lift-2);
  --elevation-4: var(--sol-lift-2);
}
