/* ============================================================
   BASE — design tokens
   Merged from TRAMÉE, SURGIE, TABLO and 25-50_timeline (YMD).
   Direction: "sèche" — achromatic instrument panel, IBM Plex Mono,
   radius 0, 1px hairlines, one signal colour spent only on the living.
   Dark is the root mode; light is html[data-mode="clair"].
   The same tokens can be scoped to a subtree with .mode-sombre / .mode-clair.
   ============================================================ */

:root,
.mode-sombre {
  color-scheme: dark;

  /* --- surfaces ------------------------------------------------ */
  --bg: #000;                 /* app canvas / wells                */
  --chrome: #050505;          /* bars, dialog cards, popups        */
  --card: #080808;            /* content cards (tablo)             */
  --card-hover: #0b0b0b;
  --panel: #0d0d0d;           /* row hover, selected palette row   */
  --field: #101010;           /* boxed inputs (rare)               */

  /* --- ink ramp (light → dark) --------------------------------- */
  --ink: #fff;                /* primary text, active states       */
  --body: #d0d0d0;            /* body copy, readouts               */
  --sec: #7a7a7a;             /* section titles, status text       */
  --lab: #6a6a6a;             /* uppercase micro labels            */
  --val: #6a6a6a;             /* values, ghost actions             */
  --hud: #5f5f5f;             /* HUD readouts, hints               */
  --inactive: #4f4f4f;        /* inactive segments, stored slots   */
  --dim: #3f3f3f;             /* placeholders, disabled, dots      */
  --dimmer: #2a2a2a;          /* separators, empty lamps           */

  /* --- structure ----------------------------------------------- */
  --line: #1a1a1a;            /* ALL hairlines                     */
  --line-2: #242424;          /* dialog/popup borders, underlines  */
  --ring: rgba(255, 255, 255, 0.04);        /* paper-thin card ring */
  --ring-hover: rgba(255, 255, 255, 0.10);
  --pill: rgba(255, 255, 255, 0.05);        /* subtle hover plates  */
  --track: #1c1c1c;           /* slider / gauge tracks             */
  --fill: #4a4a4a;            /* achromatic fills, ready lamps     */
  --pborder: #1a1a1a;         /* print / render frame ring         */

  /* --- signal -------------------------------------------------- */
  --accent: #e7d52e;          /* THE yellow. live, transient, hot  */
  --accent-fill: #e7d52e;     /* fills stay yellow in both modes   */
  --onacc: #000;
  --rec: #d18585;             /* record / error lamp               */

  /* --- semantic (rationed; text / wash / edge) ------------------ */
  --ok: #5fc58b;      --ok-wash: #1a3a2a;      --ok-edge: #28523c;
  --warn: #d6b65c;    --warn-wash: #2a2108;    --warn-edge: #8b681a;
  --danger: #e07070;  --danger-wash: #180f0f;  --danger-edge: #6a2e2e;
  --info: #a9d3ff;    --info-wash: #1d2c3a;    --info-edge: #426384;

  /* --- elevation (floating surfaces only) ----------------------- */
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.7);
  --pshadow: 0 12px 26px -14px rgba(0, 0, 0, 0.9);
  --scrim: rgba(0, 0, 0, 0.45);

  /* --- typography ---------------------------------------------- */
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", "SF Mono",
    Consolas, "Liberation Mono", monospace;
  /* one voice: serif and sans alias to mono, on purpose */
  --font-sans: var(--font-mono);
  --font-serif: var(--font-mono);

  /* scale (px, absolute). tracking grows as size shrinks. */
  --fs-micro: 8px;      /* seg buttons        400  .06em  UPPER   */
  --fs-label: 8.5px;    /* row labels         400  .06em  UPPER   */
  --fs-section: 9px;    /* section titles     600  .18em  UPPER   */
  --fs-hint: 9.5px;     /* hints, keycaps     400                 */
  --fs-value: 10px;     /* values, combos, ghost actions  400     */
  --fs-menu: 10.5px;    /* menu items, dialog buttons     400/500 */
  --fs-body: 11.5px;    /* reading copy       400  lh 1.5–1.6     */
  --fs-base: 12px;      /* root                                    */
  --fs-input: 12.5px;   /* palette input, wordmark 600 .2em       */
  --fs-title: 15px;     /* dialog H1          600  .14em  UPPER   */

  /* --- metrics -------------------------------------------------- */
  --row-h: 20px;        /* control row                             */
  --row-h-dialog: 26px;
  --bar-masthead: 44px;
  --bar-transport: 34px;
  --bar-status: 20px;
  --edge: 28px;         /* outer horizontal margin                 */
  --inset: 16px;        /* floating-element inset                  */
  --pad-dialog: 34px 40px 30px;
  --label-col: 84px;    /* row label column                        */
  --value-col: 36px;    /* row value column                        */
  --lamp: 6px;          /* status lamp — always square             */
  --radius: 0;          /* non-negotiable                          */

  /* --- motion --------------------------------------------------- */
  --fdin: 0.12s;        /* wake / hover in                         */
  --fdback: 0.7s;       /* fade back to rest                       */
  --wake: 0.1;          /* rest opacity of woken chrome            */
  --xfade: 0.35s;       /* theme crossfade                         */
  --gaugefade: 0.4s;    /* gauge fill width                        */
}

html[data-mode="clair"],
.mode-clair {
  color-scheme: light;

  --bg: #fff;
  --chrome: #fafafa;
  --card: #f7f7f7;
  --card-hover: #f2f2f2;
  --panel: #f2f2f2;
  --field: #efefef;

  --ink: #000;
  --body: #2c2c2c;
  --sec: #6a6a6a;
  --lab: #8a8a8a;
  --val: #8a8a8a;
  --hud: #8a8a8a;
  --inactive: #b0b0b0;
  --dim: #b0b0b0;
  --dimmer: #d0d0d0;

  --line: #ededed;
  --line-2: #e0e0e0;
  --ring: rgba(0, 0, 0, 0.05);
  --ring-hover: rgba(0, 0, 0, 0.12);
  --pill: rgba(0, 0, 0, 0.04);
  --track: #ececec;
  --fill: #b4b4b4;
  --pborder: #e4e4e4;

  --accent: #8a7a00;          /* olive: yellow darkened for text on white */
  --accent-fill: #e7d52e;     /* fills keep the true yellow               */
  --onacc: #fff;
  --rec: #c74a4a;

  --ok: #2e7d4f;      --ok-wash: #e4f2e9;      --ok-edge: #a8cdb6;
  --warn: #8a6414;    --warn-wash: #f5eeda;    --warn-edge: #d4bc7a;
  --danger: #b04444;  --danger-wash: #f7e9e9;  --danger-edge: #d9a3a3;
  --info: #3d5a80;    --info-wash: #e8eff7;    --info-edge: #a3bcd9;

  --shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
  --pshadow: 0 12px 30px -16px rgba(0, 0, 0, 0.35);
  --scrim: rgba(0, 0, 0, 0.35);
}
