/* Roasta Raw — design tokens. Single theme, two modes.
   Light = warm roast paper. Dark = ExDark slate.
   Colour law (Agent.md §4, authoritative):
     1. purple is competition / test across every level. Nothing else may take it.
     2. non-competition descends red > blue > yellow > green; take the first N.
     3. SQ / BP / DL are never told apart by colour — line style does that
        (SQ solid, BP 6-3 dash, DL 2.5-3 dot).
   Coffee brown is a neutral only: paper tone, hairlines, footer. Never a semantic colour. */

/* Light is the default document theme; the card also asks for it explicitly
   ([data-theme="light"]) so an exported image never follows the reader's dark mode. */
:root, [data-theme="light"] {
  color-scheme: light;

  --paper: #F2EEE6;
  --paper-2: #E9E2D5;
  --card: #FFFCF5;
  --card-2: #F7F2E8;
  --ink: #141311;
  --ink-2: #574F45;
  --ink-3: #877E71;
  --rule: rgba(20, 19, 17, .62);
  --hair: rgba(88, 62, 42, .22);
  --hair-2: rgba(88, 62, 42, .10);

  --brown: #6B4630;
  --brown-2: #A5805F;

  --red: #C21A12;
  --blue: #1147D1;
  --yellow: #B57C05;
  --green: #1E6B34;
  --purple: #6A2F9E;

  --red-wash: rgba(194, 26, 18, .10);
  --blue-wash: rgba(17, 71, 209, .09);
  --yellow-wash: rgba(181, 124, 5, .12);
  --green-wash: rgba(30, 107, 52, .10);
  --purple-wash: rgba(106, 47, 158, .10);
  /* "planned but not logged" chunk in Fig. W1. On cream paper the wash already
     reads; on the dark card a 13% amber wash blends to olive-brown and reads as
     grey, so dark uses solid amber instead — same colour as its 11/13 label. */
  --gap-fill: var(--yellow-wash);

  /* Capacity status law (P7): under-MRV and over-MRV have one token pair
     each, shared by the W body map, the W leaf rows and the C week board —
     same data, same colour on every page. */
  --under: var(--yellow);
  --under-soft: var(--yellow-wash);
  --over: var(--red);
  --over-soft: var(--red-wash);

  --shadow: 4px 4px 0 rgba(20, 19, 17, .78);
  --shadow-sm: 2px 2px 0 rgba(20, 19, 17, .70);

  --display: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Helvetica, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Roboto Mono", Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --r: 6px;
  --r-sm: 3px;
  --gut: 14px;
  --max: 480px;
  --tap: 44px;
  /* Topbar pair (owner ruling): share and TODAY are one 34px square each — a
     deliberate exception to the 44px touch raise, and the single source of the
     size. share.css reads these tokens instead of repeating a literal, so no
     file has to win a specificity race over the other. */
  --topbar-btn: 34px;
  --topbar-btn-icon: 15px;
  /* The rest day owns no hue, so it reads in the quiet ink — but at the step
     that is still legible. --ink-3 measured 3.9:1 on the card in light and
     4.0:1 on paper in dark, both under AA for 7.5px caps, and a tag nobody can
     read is not a mood. --ink-2 clears 7.8:1 / 7.0:1; the border is
     currentColor, so it lifts with the text. One definition, because
     data-theme and :root are the same element and the chain resolves per
     theme. */
  --tone-rest: var(--ink-2);
}

[data-theme="dark"] {
  color-scheme: dark;

  --paper: #0F1216;
  --paper-2: #151A20;
  --card: #1A1F26;
  --card-2: #1F252D;
  --ink: #EDEBE4;
  --ink-2: #A7A9A5;
  --ink-3: #767A78;
  --rule: rgba(237, 235, 228, .55);
  --hair: rgba(210, 186, 160, .20);
  --hair-2: rgba(210, 186, 160, .09);

  --brown: #C29A77;
  --brown-2: #7E5E45;

  --red: #E8544A;
  --blue: #6E93F5;
  --yellow: #E0AC3C;
  --green: #5FB87A;
  --purple: #B48CE0;

  --red-wash: rgba(232, 84, 74, .13);
  --blue-wash: rgba(110, 147, 245, .12);
  --yellow-wash: rgba(224, 172, 60, .13);
  --green-wash: rgba(95, 184, 122, .12);
  --purple-wash: rgba(180, 140, 224, .13);
  --gap-fill: var(--yellow);

  --under: var(--yellow);
  --under-soft: var(--yellow-wash);
  --over: var(--red);
  --over-soft: var(--red-wash);

  --shadow: 4px 4px 0 rgba(0, 0, 0, .72);
  --shadow-sm: 2px 2px 0 rgba(0, 0, 0, .64);
}
