/* Hallmark · tokens · theme: studied-DNA (source: about.bitstash.tech, own site)
 * paper oklch(12% 0.016 150) dark / oklch(97% 0.012 150) light
 * accent oklch(86% 0.20 156) phosphor green (brand #00ff7f, disciplined to ≤5 %)
 * display: pixel (VT323) · body: mono (JetBrains Mono) · CJK fallback: Noto Sans HK
 */

:root {
  /* Surface — dark is the brand default */
  --color-paper: oklch(12% 0.016 150);
  --color-paper-2: oklch(16% 0.018 150);
  --color-paper-3: oklch(20% 0.02 150);
  --color-rule: oklch(28% 0.024 150);
  --color-rule-2: oklch(40% 0.03 150);
  --color-muted: oklch(68% 0.03 150);
  --color-neutral: oklch(78% 0.02 150);
  --color-ink-2: oklch(86% 0.02 150);
  --color-ink: oklch(94% 0.012 150);
  --color-accent: oklch(86% 0.2 156);
  --color-accent-ink: oklch(12% 0.016 150);
  --color-focus: oklch(86% 0.2 156);
  --color-error: oklch(72% 0.17 25);
  --color-scrim: oklch(8% 0.016 150 / 0.72);
  color-scheme: dark;

  /* Type — 2 families. VT323 carries display, JetBrains Mono carries body.
     Noto Sans HK only paints CJK glyphs when the page is in zh-Hant. */
  --font-display: "VT323", "Noto Sans HK", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-body: "JetBrains Mono", "Noto Sans HK", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* 1.25 scale from a 16 px body */
  --text-xs: 0.8rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5625rem;
  --text-2xl: 1.953rem;
  --text-3xl: 2.441rem;
  --text-display-s: clamp(2rem, 2.5vw + 1rem, 3.25rem);
  --text-display: clamp(2.75rem, 5vw + 1rem, 5.25rem);
  /* VT323 is a narrow pixel face; headings run one step larger than a sans would. */
  --display-boost: 1.18;
  --lh-display: 1.05;
  --lh-body: 1.6;
  --tracking-label: 0.12em;

  /* Space — 4 pt scale */
  --space-3xs: 0.125rem;
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --space-4xl: 9rem;

  --page-gutter: clamp(1rem, 4vw, 3rem);
  --page-max: 72rem;
  --measure: 62ch;
  --control-h: 2.75rem; /* 44 px — inputs and buttons share it */
  --nav-h: 3.25rem;

  --rule-hair: 1px;
  --radius: 0;
  --radius-sm: 2px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-micro: 120ms;
  --dur-short: 220ms;
  --dur-long: 420ms;

  --z-base: 1;
  --z-raised: 10;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-sticky-nav: 300;
  --z-modal: 400;
  --z-toast: 500;
}

[data-theme="light"] {
  --color-paper: oklch(97% 0.012 150);
  --color-paper-2: oklch(94% 0.016 150);
  --color-paper-3: oklch(90% 0.02 150);
  --color-rule: oklch(84% 0.02 150);
  --color-rule-2: oklch(70% 0.03 150);
  --color-muted: oklch(42% 0.03 150);
  --color-neutral: oklch(34% 0.03 150);
  --color-ink-2: oklch(26% 0.03 150);
  --color-ink: oklch(18% 0.03 150);
  --color-accent: oklch(48% 0.17 155);
  --color-accent-ink: oklch(97% 0.012 150);
  --color-focus: oklch(48% 0.17 155);
  --color-error: oklch(50% 0.19 25);
  --color-scrim: oklch(20% 0.02 150 / 0.55);
  color-scheme: light;
}

/* CJK fallback has no pixel face: pull display sizes in one step and add weight
   so the hierarchy survives the family change. */
:lang(zh) {
  --display-boost: 1;
  --text-display: clamp(2.25rem, 3.5vw + 1rem, 4rem);
  --text-display-s: clamp(1.75rem, 2vw + 1rem, 2.75rem);
  --lh-display: 1.2;
  --lh-body: 1.75;
  --tracking-label: 0.08em;
}
