/* styles/tokens.css — the design tokens (B1, design §4). Every colour, radius, elevation and motion value in the app
   comes from here; nothing else declares a raw colour except the scene marks (which do not change with the theme).
   Default theme = dark; [data-theme=light]; [data-theme=auto] follows prefers-color-scheme.
   tests/e2e/e2e_shell.mjs samples computed styles against design §4.1.

   TEXT COMPANIONS (--*-text). Design §4.1 and §10 disagree: several §4.1 values used as small text fall below the §10
   floor of 4.5:1 on --panel / --hud-solid / --panel-2 (light --ink-3 3.40, light "text on accent" #B86E10 3.83, light
   --ok 3.78, --warn 4.06; dark --ink-3 on --panel-2 4.20). The §4.1 tokens stay exact (fills, dots, marks, borders,
   and the token check); TEXT uses the companion, which is the same hue moved just far enough to clear 4.6:1 on all three
   surfaces and on its own soft tint (active chips, pills), and equals the base wherever the base already passes). Builders: colour text with --ink-3-text,
   --accent-text, --ok-text, --warn-text, --bad-text, --info-text; never the base token. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/inter-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  /* fractions, primes, ≤ ≥, arrows and key glyphs (⌘ ⌥ ⇧ ⌫ ↵ ⌃) */
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/inter-symbols-var.woff2") format("woff2");
  unicode-range: U+B0-B2, U+B7, U+BC-BE, U+D7, U+2013-2014, U+2026, U+2032-2033, U+2153-2154, U+215B-215E, U+2190-2193,
    U+21B5, U+21E7, U+2264-2265, U+2303, U+2318, U+2325, U+232B;
}

:root {
  color-scheme: dark;
  /* ── colour (design §4.1, dark) */
  --bg: #0A0D12;
  --panel: rgba(16, 19, 25, .95);
  --panel-2: #161B23;
  --hud: rgba(14, 17, 23, .72);
  --hud-solid: rgba(14, 17, 23, .92);
  --hud-blur: blur(20px) saturate(160%);
  --well: rgba(0, 0, 0, .22);
  --fill-1: rgba(255, 255, 255, .05);
  --fill-2: rgba(255, 255, 255, .085);
  --fill-3: rgba(255, 255, 255, .14);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .15);
  --ink: #EEF1F5;
  --ink-2: #A9B2BF;
  --ink-3: #737E8D;
  --ink-4: #4A525E;
  --accent: #F6B34C;
  --accent-hi: #FFCB73;
  --accent-text: #F6B34C;         /* accent used as text (companion; see the header) */
  --ink-3-text: #8690A0;          /* --ink-3 as text: ≥4.6:1 on --panel, --panel-2 and a raised --fill-1 tile or row on either (the base is 4.20 on --panel-2) */
  --ok-text: #3DD68C;
  --warn-text: #F5A524;
  --bad-text: #FF6B6B;
  --info-text: #8BBAFF;
  --on-accent-text: #1C1206;      /* text on an --accent fill (primary button) */
  --on-accent: #1C1206;
  --accent-soft: rgba(246, 179, 76, .16);
  --accent-line: rgba(246, 179, 76, .45);
  --sel: #4C8DFF;
  --sel-fill: rgba(76, 141, 255, .16);
  --ok: #3DD68C;
  --warn: #F5A524;
  --bad: #FF6B6B;
  --info: #8BBAFF;
  --ok-soft: rgba(61, 214, 140, .13);
  --warn-soft: rgba(245, 165, 36, .14);
  --bad-soft: rgba(255, 107, 107, .13);
  --info-soft: rgba(139, 186, 255, .14);
  --scrim: rgba(4, 6, 10, .55);
  --shade: rgba(0, 0, 0, .08);    /* §10: the canvas's top and bottom shade under the HUD glass */
  --on-warn: #1C1206;             /* text on a --warn badge (≥4.5:1 in both themes) */
  /* the day track before the environment paints that day's own sky colours into --scrub-sky (B3, design §5.8) */
  --sky-track: linear-gradient(90deg, #0c1424 0%, #1b2742 20%, #d88a4b 25%, #7aa6d8 32%, #8fb8e6 50%, #7aa6d8 68%, #d88a4b 75%, #1b2742 80%, #0c1424 100%);

  /* ── scene marks (WebGL / projected DOM; the same in both themes) */
  --mark-measure: #FFE14D;
  --mark-halo: #1A1A1A;
  --mark-mid: #CFD3D8;
  --edge-ridge: #F26B6B;
  --edge-hip: #F59E42;
  --edge-valley: #5B9BFF;
  --edge-eave: #2FC99A;
  --edge-rake: #A6D94A;
  --edge-step: #B98CFF;
  --edge-chimney: #E879C6;

  /* ── type (design §4.2) */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-serif: "Iowan Old Style", "Palatino", "Charter", Georgia, serif;
  --fs-eyebrow: 10.5px;  --fw-eyebrow: 650;
  --fs-meta: 11.5px;
  --fs-control: 12.5px;
  --fs-body: 13px;
  --fs-value: 15px;
  --fs-title: 19px;
  --fs-tile: 23px;
  --fs-clock: 30px;
  --fs-caption: 34px;
  --fs-recap: 44px;

  /* ── spacing: the 4-pt grid (design §4.4) */
  --s-1: 4px; --s-1h: 6px; --s-2: 8px; --s-2h: 10px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px;
  --control-h: 32px;
  --control-h-dense: 28px;
  --touch: 44px;

  /* ── radius (design §4.4) */
  --r-kbd: 6px;
  --r-input: 8px;
  --r-chip: 10px;
  --r-card: 14px;
  --r-hud: 18px;
  --r-panel: 20px;
  --r-caption: 24px;
  --r-recap: 28px;
  --r-pill: 999px;

  /* ── elevation (design §4.4) */
  --e1: 0 0 0 1px var(--line), 0 14px 34px rgba(0, 0, 0, .34);
  --e2: 0 0 0 1px var(--line), 0 10px 30px rgba(0, 0, 0, .40);
  --e3: 0 0 0 1px var(--line-2), 0 30px 80px rgba(0, 0, 0, .5);

  /* ── motion (design §4.4) */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 140ms;
  --t-panel: 240ms;
  --t-fade: 420ms;

  /* ── layout grid (design §3; the desktop reference, breakpoints in shell.css) */
  --gutter: 12px;
  --rail-w: 64px;
  --rail-item: 52px;
  --top-h: 44px;
  --tray-h: 64px;
  --insp-w: 344px;
  --layers-w: 300px;
  --drawer-h: 280px;
  --cube: 72px;
  --tabbar-h: 64px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ECEAE5;
  --panel: rgba(252, 251, 249, .96);
  --panel-2: #FFFFFF;
  --hud: rgba(250, 249, 246, .80);
  --hud-solid: rgba(250, 249, 246, .95);
  --well: rgba(0, 0, 0, .04);
  --fill-1: rgba(0, 0, 0, .045);
  --fill-2: rgba(0, 0, 0, .07);
  --fill-3: rgba(0, 0, 0, .12);
  --line: rgba(0, 0, 0, .09);
  --line-2: rgba(0, 0, 0, .16);
  --ink: #14171C;
  --ink-2: #4F5864;
  --ink-3: #808995;
  --ink-4: #B3BAC4;
  --accent: #D9861C;
  --accent-hi: #F2A93B;
  --accent-text: #94590C;         /* the spec's #B86E10 is 3.83:1 on --panel; this is 5.5 there and 4.8 on --accent-soft */
  --ink-3-text: #606974;          /* the spec's #808995 is 3.40:1 on --panel; this is ≥4.7 on --panel, --panel-2 and a raised --fill-1 tile */
  --ok-text: #0C7746;             /* ≥4.6:1 on --panel and on the --ok-soft pill */
  --warn-text: #955800;
  --bad-text: #BF2D2D;
  --info-text: #2963C8;
  --on-accent-text: #1C1206;      /* white on #D9861C is 2.85:1; dark text is 6.4:1 */
  --on-accent: #FFFFFF;
  --accent-soft: rgba(217, 134, 28, .14);
  --accent-line: rgba(184, 110, 16, .45);
  --sel: #1F6FEB;
  --sel-fill: rgba(31, 111, 235, .12);
  --ok: #11935A;
  --warn: #B36A00;
  --bad: #D23C3C;
  --info: #2F6FD6;
  --ok-soft: rgba(17, 147, 90, .11);
  --warn-soft: rgba(179, 106, 0, .12);
  --bad-soft: rgba(210, 60, 60, .10);
  --info-soft: rgba(47, 111, 214, .11);
  --scrim: rgba(20, 23, 28, .35);
  --shade: rgba(0, 0, 0, .0);
  --e1: 0 0 0 1px var(--line), 0 14px 34px rgba(40, 32, 18, .16);
  --e2: 0 0 0 1px var(--line), 0 10px 30px rgba(40, 32, 18, .18);
  --e3: 0 0 0 1px var(--line-2), 0 30px 80px rgba(40, 32, 18, .28);
}

@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    color-scheme: light;
    --bg: #ECEAE5;
    --panel: rgba(252, 251, 249, .96);
    --panel-2: #FFFFFF;
    --hud: rgba(250, 249, 246, .80);
    --hud-solid: rgba(250, 249, 246, .95);
    --well: rgba(0, 0, 0, .04);
    --fill-1: rgba(0, 0, 0, .045);
    --fill-2: rgba(0, 0, 0, .07);
    --fill-3: rgba(0, 0, 0, .12);
    --line: rgba(0, 0, 0, .09);
    --line-2: rgba(0, 0, 0, .16);
    --ink: #14171C;
    --ink-2: #4F5864;
    --ink-3: #808995;
    --ink-4: #B3BAC4;
    --accent: #D9861C;
    --accent-hi: #F2A93B;
    --accent-text: #94590C;         /* the spec's #B86E10 is 3.83:1 on --panel; this is 5.5 there and 4.8 on --accent-soft */
  --ink-3-text: #606974;          /* the spec's #808995 is 3.40:1 on --panel; this is ≥4.7 on --panel, --panel-2 and a raised --fill-1 tile */
  --ok-text: #0C7746;             /* ≥4.6:1 on --panel and on the --ok-soft pill */
  --warn-text: #955800;
  --bad-text: #BF2D2D;
  --info-text: #2963C8;
  --on-accent-text: #1C1206;      /* white on #D9861C is 2.85:1; dark text is 6.4:1 */
    --on-accent: #FFFFFF;
    --accent-soft: rgba(217, 134, 28, .14);
    --accent-line: rgba(184, 110, 16, .45);
    --sel: #1F6FEB;
    --sel-fill: rgba(31, 111, 235, .12);
    --ok: #11935A;
    --warn: #B36A00;
    --bad: #D23C3C;
    --info: #2F6FD6;
    --ok-soft: rgba(17, 147, 90, .11);
    --warn-soft: rgba(179, 106, 0, .12);
    --bad-soft: rgba(210, 60, 60, .10);
    --info-soft: rgba(47, 111, 214, .11);
    --scrim: rgba(20, 23, 28, .35);
    --shade: rgba(0, 0, 0, .0);
    --e1: 0 0 0 1px var(--line), 0 14px 34px rgba(40, 32, 18, .16);
    --e2: 0 0 0 1px var(--line), 0 10px 30px rgba(40, 32, 18, .18);
    --e3: 0 0 0 1px var(--line-2), 0 30px 80px rgba(40, 32, 18, .28);
  }
}

/* Performance tier Balanced / Battery: no backdrop blur, HUD falls back to --hud-solid (design §4.1, §11). */
:root[data-quality="balanced"], :root[data-quality="battery"] { --hud: var(--hud-solid); --hud-blur: none; }
@media (prefers-reduced-motion: reduce) {
  :root { --t-fast: 0ms; --t-panel: 0ms; --t-fade: 0ms; }
}
/* Display › Reduce motion (this browser only; the OS setting above also applies) */
:root[data-motion="reduce"] { --t-fast: 0ms; --t-panel: 0ms; --t-fade: 0ms; }
