/* ── Stir design tokens ───────────────────────────────────────────────────
   This is an Average Ideas project and the accent is not its own. The family
   — Daybreak, Outset, The Guard's Ledger, averageideas.dev — lands on a warm
   ochre in light and a warm amber in dark, and these are those values
   verbatim rather than approximated. A colour that is *nearly* a sibling's is
   worse than one that is obviously different: it reads as a mistake instead
   of a decision.

   Two rules the siblings paid for and this file inherits:

   1. A palette is a ladder, and contrast checking cannot see the rungs. Every
      text ratio below can pass while three surfaces sit 1.8 L* apart and the
      whole page reads as one flat field with no objects on it. The three
      surfaces are held ≥2.5 L* apart and the real separations are recorded
      beside them.

   2. Depth reads in opposite directions on paper and on a screen. A recess is
      darker on paper; on a near-black screen there is nothing underneath to
      recede into, so an inset has to catch light instead. --sunk is therefore
      *below* --bg in light and *above* it in dark.

   Every ratio in a comment here is re-derived from these values by
   tools/check-contrast.mjs, which fails when a number and the colours beside
   it disagree. A colour comment is a measurement, so it is checked.
   ────────────────────────────────────────────────────────────────────── */

:root {
  color-scheme: light;

  /* Surfaces — L* 91.2 · 95.6 · 100.0, so 4.4 between each rung. */
  --sunk:    #ece5d9;
  --bg:      #f6f2ea;
  --surface: #ffffff;

  /* Ink. Each ratio is against the *worst* of the three surfaces above,
     which is --sunk, not --bg. Prose sits inside sunk panels. */
  --ink:   #23201a; /* 12.97 */
  --ink-2: #4a463c; /* 7.51 */
  --ink-3: #6b6558; /* 4.62 */

  /* Brand. --accent is the family ochre and is used for fills, rules and
     marks, where 3:1 is the bar. --accent-ink is the same colour taken down
     to a text weight, because the brand value reads at 3.79 on --sunk and
     small bold labels are the main thing it gets used for. Daybreak splits
     its label colours off its brand ramp for exactly this reason. */
  --accent:     #8a6f3e; /* 3.79 — non-text only */
  --accent-ink: #755c2e; /* 5.04 */

  /* The alert rung of the bout ramp. Deliberately a rust rather than a red:
     a bout running long is a fact about the day, not a failure, and there is
     nothing in this app that a person should be told off by. */
  --alert: #9a4b2f; /* 4.90 */

  /* Hairlines. Never text — there is no fourth ink rung, because a fourth
     rung on these surfaces cannot clear 4.5:1 and the temptation to set a
     label in it is exactly how a palette rots. */
  --line:      hsl(40 12% 12% / 0.13);
  --line-firm: hsl(40 12% 12% / 0.24);

  --shade: hsl(40 20% 20% / 0.05);
  --lift-1: 0 1px 2px hsl(40 20% 25% / 0.07), 0 2px 8px -4px hsl(40 20% 25% / 0.10);
  --lift-2: 0 2px 4px hsl(40 20% 25% / 0.08), 0 12px 28px -12px hsl(40 20% 25% / 0.22);
}

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

  /* Surfaces — L* 5.5 · 9.9 · 14.9, so 4.4 and 4.9 between the rungs, and
     --sunk is now the brightest of the three. The floor is deliberately off
     the bottom: most of this page is bare ground between cards, and
     near-black ground under bright text is the combination that reads harsh. */
  --bg:      #14120e;
  --surface: #1e1b16;
  --sunk:    #2a2519;

  /* Against the worst surface, which in this theme is --sunk. */
  --ink:   #f0ebe1; /* 12.84 */
  --ink-2: #cdc6b8; /* 8.98 */
  --ink-3: #a49c8c; /* 5.60 */

  /* The family amber clears every surface here, so there is no split to make:
     one value does both jobs. */
  --accent:     #c8a464; /* 6.50 */
  --accent-ink: #c8a464; /* 6.50 */
  --alert:      #e08a63; /* 5.80 */

  --line:      hsl(40 15% 92% / 0.10);
  --line-firm: hsl(40 15% 92% / 0.20);

  --shade: hsl(40 15% 92% / 0.05);
  /* A shadow is a darkening, and there is nothing left to darken at the
     bottom of this ramp. These carry a hairline of light along the top edge
     instead: a card on a dark page is lit from above, it does not cast onto
     black. */
  --lift-1: inset 0 1px 0 hsl(40 15% 92% / 0.05), 0 1px 3px hsl(0 0% 0% / 0.4);
  --lift-2: inset 0 1px 0 hsl(40 15% 92% / 0.08), 0 14px 34px -14px hsl(0 0% 0% / 0.7);
}

:root {
  /* Type. Three stacks with unmixed jobs, the way the sibling planner splits
     them: serif for headings and any number a reader looks *up*, sans for
     running prose and nothing else, mono for every label, kicker, pill,
     button and status line. Self-hosted, because font-src is 'self' and
     nothing here may reach a third-party host. */
  --serif: 'DM Serif Display', 'Iowan Old Style', 'Palatino Linotype', 'Noto Serif', Georgia, serif;
  --sans:  'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --mono:  'DM Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  /* Nine steps. The siblings both landed here after finding twelve sizes
     crammed into a 6px band, which reads as drift rather than as a system. */
  --t-0: 11.5px;
  --t-1: 13px;
  --t-2: 14.5px;
  --t-3: 16px;
  --t-4: 19px;
  --t-5: 23px;
  --t-6: 30px;
  --t-7: 42px;
  --t-8: 76px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 18px;
  --s-5: 26px;
  --s-6: 38px;
  --s-7: 56px;

  --r-1: 6px;
  --r-2: 10px;
  --r-3: 16px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 120ms;
  --t-med: 240ms;

  --page: 980px;
  --bar-h: 58px;
}
