/*
  光の勘定 — design tokens
  Palette per LOCK.md §5 (H265 / violet). All pairs measured against source
  hex values — see build report for the ratio table. Do not edit hex values
  here without re-running the contrast check; several are load-bearing
  (step-label colours are chosen PER STEP, not globally — see §5 rule 2).

  --ledger-cols is the single source of the exposure scale's five tracks.
  It is consumed by .exposure-scale (the master ruler in the hero), by
  .ledger-page (every section's leaf grid) and by .ledger-spine (the
  full-height column rules). This is intentional: delete this variable and
  the leaf offsets, the spine rules and the master ruler all collapse to a
  single default column — see build report "load-bearing test".
*/

:root {
  color-scheme: light dark;

  /* ---- role colours: light (default) ---- */
  --ground:     #2e2340; /* 見本帳を置く台 — NEVER put body text directly on this */
  --card:       #efecf3; /* 見本カードの地 — body text lives here */
  --ink:        #1c1526; /* 本文 */
  --faint:      #4a4157; /* 副次テキスト */
  --link:       #5b1f4e;
  --on-ground:  #d6cee2; /* 台の上の文字 */

  /* ---- exposure scale swatches: light ---- */
  --step0: #4b2a7a;
  --stepA: #6d4f95;
  --stepB: #9382b0;
  --stepC: #bcb3ca;
  --stepD: #d9d5df;

  /* ---- exposure scale label colours: chosen per step (measured) ---- */
  --step0-label: var(--card); /* 9.40:1 */
  --stepA-label: var(--card); /* 5.61:1 */
  --stepB-label: var(--ink);  /* 5.12:1 */
  --stepC-label: var(--ink);  /* 8.81:1 */
  --stepD-label: var(--ink);  /* 12.27:1 */

  /* ---- type ---- */
  --font-display: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --rule: rgba(28, 21, 38, 0.14);      /* ledger rule lines on card */
  --rule-on-ground: rgba(214, 206, 226, 0.22);

  --radius-sm: 2px;
  --radius-md: 4px;

  --space-1: 0.4rem;
  --space-2: 0.8rem;
  --space-3: 1.4rem;
  --space-4: 2.4rem;
  --space-5: 4rem;
  --space-6: 6.4rem;

  /* ---- the shared ledger grid: 5 named tracks, 0 / A / B / C / D ---- */
  --ledger-cols:
    [c0] minmax(3.4rem, 11rem)
    [cA] minmax(3.4rem, 11rem)
    [cB] minmax(3.4rem, 11rem)
    [cC] minmax(3.4rem, 11rem)
    [cD] minmax(3.4rem, 11rem)
    [cEnd];
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground:     #120e19;
    --card:       #241c31;
    --ink:        #ded7e8;
    --faint:      #a99cbb;
    --link:       #e4a9cf;
    --on-ground:  #bdb2ce;
    --hilite:     #f4f0f9;

    --step0: #290e4e;
    --stepA: #4e2684;
    --stepB: #754baf;
    --stepC: #a18ebb;
    --stepD: #cbc7d1;

    --step0-label: var(--hilite); /* 14.74:1 */
    --stepA-label: var(--hilite); /* 9.66:1 */
    --stepB-label: var(--hilite); /* 5.52:1 */
    --stepC-label: var(--card);   /* 5.52:1 */
    --stepD-label: var(--card);   /* 9.82:1 */

    --rule: rgba(222, 215, 232, 0.14);
    --rule-on-ground: rgba(189, 178, 206, 0.18);
  }
}
