/* ── Daybreak design tokens ───────────────────────────────────────────────
   Dark-first, because this gets opened at 6am and at 11pm. Light theme is a
   full re-definition rather than a filter, so both are deliberate.
   ─────────────────────────────────────────────────────────────────────── */

:root {
  color-scheme: dark;

  /* Surfaces */
  --bg:            #0b0c10;
  --bg-glow-1:     hsl(24 90% 55% / 0.16);
  --bg-glow-2:     hsl(285 80% 60% / 0.13);
  --surface:       #14161d;
  --surface-2:     #1b1e27;
  --surface-3:     #232733;
  --hairline:      hsl(230 15% 100% / 0.09);
  --hairline-firm: hsl(230 15% 100% / 0.16);

  /* Ink */
  --ink:        #f2f4f8;
  --ink-2:      hsl(225 12% 82%);
  --ink-3:      hsl(225 10% 72%);
  --ink-4:      hsl(225 10% 58%);

  /* Brand — sunrise */
  --sun-1: #ff9d4d;
  --sun-2: #ff6b6b;
  --sun-3: #c86bff;
  --brand: var(--sun-1);
  --brand-ink: #1a1004;
  --gradient-sun: linear-gradient(115deg, var(--sun-1), var(--sun-2) 48%, var(--sun-3));
  --gradient-dawn: linear-gradient(180deg, hsl(24 90% 60% / 0.22), transparent 70%);

  /* Semantic */
  --ok:    #3ddc97;
  --ok-dim: hsl(157 68% 55% / 0.16);
  --warn:  #ffc247;
  --danger:#ff6b6b;

  /* Label colours are split from the brand ramp because the brand oranges
     and violets are tuned to sit on dark surfaces or inside a filled
     gradient. Used as small bold text on a light background they fall to
     1.9:1. These are the accessible equivalents, verified against both the
     page background and card surfaces. */
  --label-anchor: var(--sun-1);
  --label-spark:  var(--sun-3);
  --label-win:    var(--ok);
  --cat-text-l: 70%;

  /* Radius */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 999px;

  /* Spacing scale */
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 22px;
  --s-6: 30px;
  --s-7: 42px;

  /* Elevation */
  --shadow-1: 0 1px 2px hsl(0 0% 0% / 0.4);
  --shadow-2: 0 6px 22px -8px hsl(0 0% 0% / 0.65);
  --shadow-3: 0 20px 50px -20px hsl(0 0% 0% / 0.8);
  --shadow-glow: 0 8px 32px -10px hsl(24 90% 55% / 0.45);

  /* Motion — springy but never sluggish */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 140ms;
  --t-med: 260ms;
  --t-slow: 420ms;

  /* Layout */
  --app-max: 560px;
  --nav-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
          system-ui, sans-serif;
  --font-num: ui-rounded, 'SF Pro Rounded', var(--font);
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg:            #f6f4f1;
  --bg-glow-1:     hsl(24 95% 60% / 0.22);
  --bg-glow-2:     hsl(285 80% 65% / 0.14);
  --surface:       #ffffff;
  --surface-2:     #f2efeb;
  --surface-3:     #e8e4de;
  --hairline:      hsl(30 12% 10% / 0.10);
  --hairline-firm: hsl(30 12% 10% / 0.20);
  --ink:        #14161d;
  --ink-2:      hsl(228 10% 22%);
  --ink-3:      hsl(228 8% 30%);
  --ink-4:      hsl(228 8% 41%);
  --brand-ink:  #2a1600;
  /* Solved against every surface in this theme at 4.6:1 — these are read as
     text (chip labels, button labels, panel headings), not decoration. */
  --ok:    hsl(157 80% 25%);
  --ok-dim: hsl(157 80% 35% / 0.14);
  --warn:  hsl(45 100% 25%);
  --danger:hsl(0 70% 45%);
  --shadow-1: 0 1px 2px hsl(30 20% 30% / 0.12);
  --shadow-2: 0 6px 20px -8px hsl(30 20% 25% / 0.22);
  --shadow-3: 0 20px 46px -20px hsl(30 20% 25% / 0.30);
  --shadow-glow: 0 8px 30px -12px hsl(24 90% 50% / 0.4);

  /* ≥4.5:1 against every surface in this theme. */
  --label-anchor: hsl(24 90% 34%);
  --label-spark:  hsl(285 70% 45%);
  --label-win:    hsl(157 70% 27%);

  /* Lightness for text tinted by a goal's category hue, solved across all
     nine hues so the worst of them still clears. */
  --cat-text-l: 27%;
}

/* Category accents live in src/data/library.js, as the `hue` on each entry,
   and reach the DOM as an inline `--hue` on the card. There used to be a
   second copy of every value here that nothing read — two sources for one
   fact, waiting to disagree. */
