:root {
  /* ---- Typography ------------------------------------------------------- */
  /* No web fonts are loaded. Skill-preferred faces come first, then system
     fallbacks, then explicit Traditional Chinese faces — the content is
     bilingual and CJK fallback must not be left to chance. */
  --font-sans: 'SF Pro Text', 'Geist Sans', 'Helvetica Neue', system-ui, 'PingFang TC',
    'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  --font-serif: 'Instrument Serif', 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia,
    'Songti TC', 'Noto Serif TC', serif;
  --font-mono: 'Geist Mono', 'SF Mono', 'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;

  /* Type scale: 1.25 ratio from 1rem, with an extra small step for meta text. */
  --text-2xs: 0.6875rem; /* 11px — tag pills, kbd */
  --text-xs: 0.75rem; /* 12px — dates, captions */
  --text-sm: 0.875rem; /* 14px — nav, footer, meta */
  --text-base: 1rem; /* 16px — body */
  --text-lg: 1.125rem; /* 18px — lead paragraph, h4 */
  --text-xl: 1.375rem; /* 22px — h3 */
  --text-2xl: 1.75rem; /* 28px — h2 */
  --text-3xl: 2.25rem; /* 36px — note h1 */
  --text-4xl: 3rem; /* 48px — homepage h1 (serif) */

  --leading-tight: 1.1; /* serif display headings */
  --leading-snug: 1.3; /* sans headings, list items */
  --leading-body: 1.65; /* prose */
  --tracking-tight: -0.02em; /* serif display */
  --tracking-wide: 0.06em; /* uppercase micro-labels, tag pills */
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  /* ---- Spacing: 4px base ----------------------------------------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem; /* macro section rhythm, per skill §8.1 */

  /* ---- Layout ----------------------------------------------------------- */
  --width-prose: 44rem; /* 704px reading column */
  --width-shell: 68rem; /* outer page shell */
  --gutter: var(--space-6);

  /* ---- Colour: warm monochrome ------------------------------------------ */
  --color-canvas: #fbfbfa;
  --color-surface: #ffffff;
  --color-surface-subtle: #f7f6f3;
  --color-border: #eaeaea; /* the ONE border colour, per skill §8.4 */
  --color-border-strong: rgba(0, 0, 0, 0.12);
  --color-text: #2f3437; /* never #000 */
  --color-text-strong: #111111;
  --color-text-muted: #787774;
  --color-link: #1f6c9f;
  --color-link-hover: #111111;
  --color-focus: #1f6c9f;
  --color-selection: #e1f3fe;

  /* Muted pastel accents — the only colour in the design. */
  --accent-red-bg: #fdebec;
  --accent-red-fg: #9f2f2d;
  --accent-blue-bg: #e1f3fe;
  --accent-blue-fg: #1f6c9f;
  --accent-green-bg: #edf3ec;
  --accent-green-fg: #346538;
  --accent-yellow-bg: #fbf3db;
  --accent-yellow-fg: #956400;

  /* ---- Shape and depth -------------------------------------------------- */
  --radius-sm: 4px; /* buttons, kbd, inline code */
  --radius-md: 8px; /* cards, callouts, code blocks */
  --radius-lg: 12px; /* large surfaces only */
  --radius-pill: 9999px; /* tags and badges ONLY, never containers */
  --border-hairline: 1px solid var(--color-border);
  --shadow-none: 0 0 0 rgba(0, 0, 0, 0);
  --shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.04); /* max permitted depth */

  /* ---- Motion ----------------------------------------------------------- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 200ms; /* hover, focus */
  --dur-base: 600ms; /* scroll entry */
  --stagger-step: 80ms;
}
