/* Physics Atlas — design tokens. Light is the default; [data-theme="dark"] overrides.
   Chapter authors: use these variables (never raw colours) in any inline style; sims use simkit palette(). */

/* Canvas text: Greek letters from the (vendored) KaTeX maths fonts, so α, π, ν, ω never look like a, n, v, w
   (the UI font's geometric Greek does). Lowercase Greek is italic as in maths, except μ (also the micro
   prefix, which must stay upright); capitals (Δ, Ω, Σ) upright.
   Used first in simkit palette().font(); other characters fall through to the UI font. */
@font-face { font-family: "Atlas Greek"; font-style: normal; font-weight: 100 600; src: url("../vendor/katex/fonts/KaTeX_Math-Italic.woff2") format("woff2"); unicode-range: U+03B1-03BB, U+03BD-03C9, U+03D1, U+03D5, U+03F5; }
@font-face { font-family: "Atlas Greek"; font-style: normal; font-weight: 650 900; src: url("../vendor/katex/fonts/KaTeX_Math-BoldItalic.woff2") format("woff2"); unicode-range: U+03B1-03BB, U+03BD-03C9, U+03D1, U+03D5, U+03F5; }
@font-face { font-family: "Atlas Greek"; font-style: normal; font-weight: 100 600; src: url("../vendor/katex/fonts/KaTeX_Main-Regular.woff2") format("woff2"); unicode-range: U+0391-03A9; }
@font-face { font-family: "Atlas Greek"; font-style: normal; font-weight: 650 900; src: url("../vendor/katex/fonts/KaTeX_Main-Bold.woff2") format("woff2"); unicode-range: U+0391-03A9; }
:root {
  /* type */
  --font-prose: Charter, "Bitstream Charter", "Sitka Text", "Iowan Old Style", Cambria, Georgia, serif;
  --font-ui: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --fs-0: 0.8125rem;  /* small UI */
  --fs-1: 0.9375rem;  /* UI */
  --fs-2: 1.0625rem;  /* prose */
  --fs-3: 1.25rem;
  --fs-4: 1.6rem;
  --fs-5: 2.15rem;
  --lh-prose: 1.68;

  /* space & shape */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 72px;
  --radius-s: 6px; --radius: 10px; --radius-l: 16px;
  --measure: 46rem;      /* prose column */
  --wide: 60rem;         /* sims, labs */
  --sidebar: 296px;
  --topbar: 56px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* colour — light ("paper") */
  --bg: #f5f3ed;
  --surface: #fffdf8;
  --raised: #ffffff;
  --sunken: #eeebe3;
  --ink: #1e2329;
  --ink-2: #444c56;
  --muted: #636b77;   /* ≥ 4.5:1 on --bg and --surface */
  --line: #e2ddd1;
  --line-strong: #cbc4b4;
  --accent: #1d6b73;          /* deep teal */
  --accent-2: #144f55;
  --accent-soft: #dcefee;
  --on-accent: #ffffff;
  --focus: #e0a526;
  --good: #24835a; --good-soft: #e1f3e9;
  --bad: #c03c4f;  --bad-soft: #fbe6e8;
  --warn: #946010;   /* ≥ 4.5:1 as text */ --warn-soft: #fbf0d9;
  --shadow-1: 0 1px 2px rgba(40, 32, 16, .06), 0 1px 1px rgba(40, 32, 16, .04);
  --shadow-2: 0 6px 24px -8px rgba(40, 32, 16, .18), 0 2px 6px rgba(40, 32, 16, .06);

  /* units (A–E) */
  --unit-A: #2f6db5; --unit-A-soft: #e3edf9;
  --unit-B: #b8612a; --unit-B-soft: #f8e9dd;
  --unit-C: #6650b0; --unit-C-soft: #ece8f8;
  --unit-D: #2a8259; --unit-D-soft: #e0f1e8;
  --unit-E: #b13e5c; --unit-E-soft: #f7e3e8;
  --unit: var(--accent); --unit-soft: var(--accent-soft);

  /* callouts */
  --c-key: #1d6b73;     --c-key-soft: #e1f1f0;
  --c-exam: #a8681a;    --c-exam-soft: #fbf1df;
  --c-context: #2f6db5; --c-context-soft: #e5eef9;
  --c-nos: #2a8259;     --c-nos-soft: #e2f2e9;
  --c-tok: #6650b0;     --c-tok-soft: #eeeafa;
  --c-link: #6c7480;    --c-link-soft: #efede7;
  --c-warn: #c03c4f;    --c-warn-soft: #fbe8ea;

  /* simkit palette (read by lib/simkit/palette.js) */
  --sk-bg: #fbfaf6;
  --sk-surface: #fffefb;
  --sk-ink: #1e2329;
  --sk-muted: #5f6873;
  --sk-faint: #a9afb6;
  --sk-grid: #ebe7dd;
  --sk-axis: #59626d;
  --sk-accent: #1d6b73;
  --sk-good: #24835a; --sk-bad: #c03c4f; --sk-warn: #c7861f;
  --sk-fill: rgba(29, 107, 115, .13);
  --sk-c1: #2a6fdb; --sk-c2: #e07a1f; --sk-c3: #24935f; --sk-c4: #c2417a; --sk-c5: #7a5cc7; --sk-c6: #8a7a2a;
  --sk-sum: #1e2329;
  --sk-pos: #d1495b; --sk-neg: #2a6fdb; --sk-field: #7a5cc7;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #11151a;
  --surface: #171c22;
  --raised: #1d232a;
  --sunken: #0d1014;
  --ink: #e7e4dd;
  --ink-2: #bfc4ca;
  --muted: #8d959e;
  --line: #29313a;
  --line-strong: #3a444f;
  --accent: #5bb5bb;
  --accent-2: #86cdd1;
  --accent-soft: #173538;
  --on-accent: #0b1a1c;
  --focus: #f2c14e;
  --good: #5cc796; --good-soft: #15302a;
  --bad: #f07a8a;  --bad-soft: #3a1c22;
  --warn: #e8b552; --warn-soft: #382c14;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 10px 30px -10px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .3);

  --unit-A: #74a6e6; --unit-A-soft: #172537;
  --unit-B: #e3995f; --unit-B-soft: #33231a;
  --unit-C: #a593ea; --unit-C-soft: #241f3a;
  --unit-D: #66c495; --unit-D-soft: #15302a;
  --unit-E: #ea8098; --unit-E-soft: #371c25;

  --c-key: #5bb5bb;     --c-key-soft: #14292b;
  --c-exam: #e3ad5a;    --c-exam-soft: #2c2415;
  --c-context: #74a6e6; --c-context-soft: #16212f;
  --c-nos: #66c495;     --c-nos-soft: #142821;
  --c-tok: #a593ea;     --c-tok-soft: #1f1b33;
  --c-link: #a3abb4;    --c-link-soft: #1d2329;
  --c-warn: #f07a8a;    --c-warn-soft: #301a1f;

  --sk-bg: #141920;
  --sk-surface: #161b21;
  --sk-ink: #e7e4dd;
  --sk-muted: #9aa2ab;
  --sk-faint: #4f5862;
  --sk-grid: #232a32;
  --sk-axis: #8d959e;
  --sk-accent: #5bb5bb;
  --sk-good: #5cc796; --sk-bad: #f07a8a; --sk-warn: #e8b552;
  --sk-fill: rgba(91, 181, 187, .16);
  --sk-c1: #6ea8ff; --sk-c2: #ffa257; --sk-c3: #5cd39a; --sk-c4: #f37fb0; --sk-c5: #b49cff; --sk-c6: #d6c56a;
  --sk-sum: #f2efe8;
  --sk-pos: #ff7b8c; --sk-neg: #6ea8ff; --sk-field: #b49cff;

  color-scheme: dark;
}

[data-unit="A"] { --unit: var(--unit-A); --unit-soft: var(--unit-A-soft); }
[data-unit="B"] { --unit: var(--unit-B); --unit-soft: var(--unit-B-soft); }
[data-unit="C"] { --unit: var(--unit-C); --unit-soft: var(--unit-C-soft); }
[data-unit="D"] { --unit: var(--unit-D); --unit-soft: var(--unit-D-soft); }
[data-unit="E"] { --unit: var(--unit-E); --unit-soft: var(--unit-E-soft); }
