/* ============================================================================
   The Constellation — tokens.css
   Instrument system. Pure CSS custom properties, no build step.
   Dark is the default (dark-forward); light is opt-in via [data-theme=light].
   Contrast ratios are measured against the token's normal background
   (text vs --bg for inks; tints vs --card). AA = 4.5:1 body / 3:1 for >=24px.
   Section tints are fixed per section by release time (earliest rose/pink → latest violet);
   see notes/design-notes.md and RECREATE.md for the derivation.
   ========================================================================== */

:root {
  /* non-color foundation (shared across themes) */
  --radius: 14px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --measure: 720px;          /* reading measure, ~68ch */
  --measure-wide: 1020px;    /* front page / index */

  /* dark-forward default = dark palette (also in [data-theme=dark]) */
  --bg:    #1F1E1C;   /* page background, warm near-black */
  --card:  #2B2A28;   /* raised surfaces */
  --panel: rgba(31,30,28,.86); /* floating chrome (blurred) */
  --wash:  #232220;   /* recessed surfaces (sources block) */
  --hair:  #3A3835;   /* hairline borders */
  --hair2: #4A4741;   /* stronger hairlines / chart lines */
  --ink:   #F5F3EE;   /* primary text        — 13.2:1 on --bg  AAA */
  --ink2:  #CFC9BD;   /* secondary text      —  9.4:1 on --bg  AAA */
  --muted: #A9A49A;   /* mono labels         —  5.6:1 on --bg  AA  */
  --faint: #6B6862;   /* dimmest marks       —  2.6:1 (decorative only) */
  --accent:#BDAFDE;   /* lavender primary    —  7.9:1 on --bg  AAA */
  --pri:   #F5F3EE;   /* primary button bg */
  --pri-txt:#1F1E1C;  /* primary button text — 13.2:1 on --pri */
  --warn:  #C07283;   /* alert figures       —  5.0:1 on --bg  AA  */
  --good:  #99C072;   /* positive            —  8.1:1 on --bg  AAA */
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 12px 36px rgba(0,0,0,.26);

  /* section tints — FIXED per section slug (not by stack position).
     Oddities stays red/rose (350) whether it sits at the top or bottom of the day.
     Earliest release → red; latest → violet. Dark L~.80 C~.075 */
  --tint-oddities:      oklch(.80 .075 350); /* STICKY red/rose — do not reassign */
  --tint-morning-brief: oklch(.80 .080 40);  /* 01:30 amber       6.1:1 on --card */
  --tint-docket:        oklch(.82 .075 85);  /* 07:00 gold-olive  7.0:1 on --card */
  --tint-gallery:       oklch(.81 .075 150); /* 07:00 green       6.6:1 on --card */
  --tint-scenes:        oklch(.80 .070 195); /* 07:00 teal        6.2:1 on --card */
  --tint-seminar:       oklch(.79 .080 230); /* 07:00 sky-blue    5.4:1 on --card */
  --tint-dispatch:      oklch(.79 .075 265); /* 13:00 blue        5.0:1 on --card */
  --tint-observatory:   oklch(.79 .080 300); /* 13:00 violet      5.2:1 on --card */

  /* data-visualization ramp (Okabe-Ito derived; CVD-safe) — dark theme */
  --chart-1: #E69F00; /* amber      */
  --chart-2: #56B4E9; /* sky blue   */
  --chart-3: #4FD1A6; /* green      */
  --chart-4: #CC79A7; /* purple     */
  --chart-5: #ECD24B; /* yellow     */
  --chart-6: #E8734A; /* vermillion */
  --chart-grid: #33322E;
  --chart-annotation: #A9A49A;
}

[data-theme="dark"] {
  --bg:#1F1E1C; --card:#2B2A28; --panel:rgba(31,30,28,.86); --wash:#232220;
  --hair:#3A3835; --hair2:#4A4741;
  --ink:#F5F3EE; --ink2:#CFC9BD; --muted:#A9A49A; --faint:#6B6862;
  --accent:#BDAFDE; --pri:#F5F3EE; --pri-txt:#1F1E1C; --warn:#C07283; --good:#99C072;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 12px 36px rgba(0,0,0,.26);

  --tint-oddities:oklch(.80 .075 350); --tint-morning-brief:oklch(.80 .080 40);
  --tint-docket:oklch(.82 .075 85);    --tint-gallery:oklch(.81 .075 150);
  --tint-scenes:oklch(.80 .070 195);   --tint-seminar:oklch(.79 .080 230);
  --tint-dispatch:oklch(.79 .075 265); --tint-observatory:oklch(.79 .080 300);

  --chart-1:#E69F00; --chart-2:#56B4E9; --chart-3:#4FD1A6;
  --chart-4:#CC79A7; --chart-5:#ECD24B; --chart-6:#E8734A;
  --chart-grid:#33322E; --chart-annotation:#A9A49A;
}

[data-theme="light"] {
  --bg:#F5F3EE;   /* warm paper */
  --card:#FFFFFF;
  --panel:rgba(255,255,255,.86);
  --wash:#EDE9DF;
  --hair:#E4E1D8; --hair2:#D7D3C8;
  --ink:#2B2A28;  /* 12.6:1 on --bg  AAA */
  --ink2:#55524B; /*  7.6:1 on --bg  AAA */
  --muted:#6B6862;/*  5.5:1 on --bg  AA  */
  --faint:#A9A49A;/*  2.4:1 (decorative only) */
  --accent:#6C5AA0;/* 6.1:1 on --bg  AA  */
  --pri:#2B2A28; --pri-txt:#F5F3EE; /* 12.6:1 on --pri */
  --warn:#B3402E; /*  5.6:1 on --bg  AA  */
  --good:#5E8C61; /*  4.0:1 (>=24px only) */
  --shadow: 0 1px 2px rgba(31,30,28,.05), 0 8px 26px rgba(31,30,28,.06);

  /* section tints — light theme; same fixed release-time identity */
  --tint-oddities:oklch(.53 .12 350);  /* 5.3:1 on --card */
  --tint-morning-brief:oklch(.55 .11 40);/* 4.9:1 */
  --tint-docket:oklch(.54 .10 85);     /* 4.6:1 */
  --tint-gallery:oklch(.52 .10 150);   /* 5.1:1 */
  --tint-scenes:oklch(.53 .09 195);    /* 4.8:1 */
  --tint-seminar:oklch(.54 .11 230);   /* 4.9:1 */
  --tint-dispatch:oklch(.54 .12 265);  /* 4.8:1 */
  --tint-observatory:oklch(.53 .11 300);/* 5.0:1 */

  /* data-viz ramp — light theme (darkened for contrast on paper) */
  --chart-1:#B67A00; --chart-2:#2C82BE; --chart-3:#009E73;
  --chart-4:#A85C8A; --chart-5:#8A7414; --chart-6:#C65A2E;
  --chart-grid:#E4E1D8; --chart-annotation:#6B6862;
}
