@charset "UTF-8";
/* Design tokens. Light theme only (docs/ui-spec.md §3.6). Curve colours are Okabe–Ito based,
   darkened to >= 3:1 contrast on white. Group colours: text (fg) and muted text on the tinted
   background are >= 4.5:1 (asserted by tests/style/contrast.test.js). Canvas code reads these
   variables via getComputedStyle so there is a single source of truth. */
:root {
  color-scheme: light;

  --c-bg: #ffffff;
  --c-panel: #f7f8fa;
  --c-panel-strong: #eef1f4;
  --c-text: #1f2328;
  --c-text-muted: #555a60;
  --c-text-soft: #374151; /* secondary text (dialog changelog), as in the circuit-canvas about dialog */
  --c-border: #d0d7de;
  --c-border-strong: #aeb7c0;
  --c-grid: #d0d7de;
  --c-link: #0072b2;
  --c-focus: #0072b2;
  --c-highlight: #f0e442;

  /* Neutral "coming soon" badge and header controls */
  --c-badge-bg: #eef1f4;
  --c-badge-fg: #555a60;
  --c-pill-bg: #f7f8fa;
  --c-pill-bg-hover: #e4e8ec;
  --c-pill-border: #c9d1d9;
  --c-backdrop: rgb(31 35 40 / 0.4);
  /* Hint boxes (ui/hint.js): text uses --c-text (≥ 4.5:1 on both backgrounds), icons ≥ 3:1. */
  --c-hint-action-bg: #e8f2fb;
  --c-hint-action-border: #b7d4ec;
  --c-hint-action-icon: #0b5c8f;
  --c-hint-tip-bg: #fdf5d4;
  --c-hint-tip-border: #e6d27f;
  --c-hint-tip-icon: #7a5600;

  /* Chapter groups: tinted background, same-hue title text, left accent bar */
  --grp-foundation-bg: #eaf2fb; /* blue: signal basics, PLL overview */
  --grp-foundation-fg: #0b4f82;
  --grp-foundation-accent: #0072b2;
  --grp-blocks-bg: #e6f4ee; /* green: PFD, charge pump, loop filter, VCO, divider */
  --grp-blocks-fg: #00573f;
  --grp-blocks-accent: #00785a;
  --grp-dynamics-bg: #fcefe1; /* orange: locking process, parameter lab */
  --grp-dynamics-fg: #7f4300;
  --grp-dynamics-accent: #c26a00;
  --grp-spectral-bg: #f5eaf2; /* purple: frequency domain, noise & jitter */
  --grp-spectral-fg: #7e2f69;
  --grp-spectral-accent: #aa4499;
  --grp-practice-bg: #e9f0f1; /* grey-teal: quiz, glossary */
  --grp-practice-fg: #36575e;
  --grp-practice-accent: #5a7f87;

  /* Signal curves */
  --c-ref: #0072b2;
  --c-fb: #b36b00;
  --c-up: #00785a;
  --c-dn: #d55e00;
  --c-icp: #5f6368;
  --c-vctrl: #aa4499;
  --c-theta: #1f2328;
  --c-df: #2b83ba;
  /* loop-filter elements (1A-4b): C1 voltage / R–C1 current, R voltage, C2 current */
  --c-v1: #1b7f79;
  --c-vr: #8c564b;
  --c-ic2: #6a51a3;

  /* Font stacks: copied verbatim from the circuit-canvas project (src/i18n/fonts.ts, FONT_STACKS) so both sites
     render alike. Latin fonts first (Latin letters and digits use them; CJK fonts' Latin glyphs look
     worse), then the language's CJK fonts, then sans-serif. Japanese puts Meiryo UI first (Windows);
     Macs have no Meiryo and fall through to Hiragino Sans. System fonts only: no font files, no
     external requests. tests/fixtures/font-stacks.js holds the same strings (unit + browser tests). */
  --font-en: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-zh-hans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, "Helvetica Neue", Arial, "PingFang SC", "微软雅黑", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-zh-hant: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, "Helvetica Neue", Arial, "PingFang TC", "微軟正黑體", "Microsoft JhengHei", "Noto Sans CJK TC", sans-serif;
  --font-ja: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, "Helvetica Neue", Arial, "Meiryo UI", "メイリオ", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Noto Sans CJK JP", sans-serif;
  /* Monospace: the literal stack circuit-canvas uses in src/style.css. */
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Compact scale */
  --fs-base: 15px;
  --lh-base: 1.5;
  --lh-cjk: 1.65;
  --space-1: 3px;
  --space-2: 6px;
  --space-3: 9px;
  --space-4: 12px;
  --space-5: 18px;
  --space-6: 24px;
  --space-7: 36px;

  --radius: 6px;
  --header-h: 44px;
  --control-h: 32px;
  --pill-h: 28px;
  --gutter: 16px;
  --maxw-page: 1200px;
  --maxw-text: 1100px; /* paragraphs follow the text column but never exceed ~1100 px */
  --page-pad-wide: 18px; /* desktop chapter pages: side padding (sidebar sits at the left edge) */
  --transition: 0.15s ease;
}
