/*
 * fonts.css — typography stack for Simplified Chinese pages.
 *
 *   Body / labels (workhorse)   → system Chinese (PingFang SC / YaHei / Noto)
 *   Brand / hero (display)      → OPPO Sans 4.0  (self-hosted WOFF2)
 *   Emotional accent (handwritten) → LXGW WenKai (霞鹜文楷, Simplified)
 *
 * The shared.css tokens --font-display / --font-serif / --font-hand are
 * remapped on `html[lang^="zh"]` so every page that already consumes those
 * tokens (event.html, profile.html, onboarding.html) picks up the Chinese
 * stack automatically. English (/en) pages do NOT link this stylesheet
 * and continue to use Inter / Newsreader / Caveat.
 *
 * Files are subset (GB2312 level-1 + Latin + CJK punctuation + content
 * audit; ~3.9K glyphs) and converted to WOFF2 via scripts/subset_chinese_fonts.py.
 * Raw TTFs live in website/public/fonts/_raw/ (gitignored). Regenerate after
 * substantive marketing-copy edits to keep glyph coverage current.
 */

/* ── @font-face ─────────────────────────────────────────────────────── */

/* OPPO Sans 4.0 — single Regular face. The wide `font-weight` range
   suppresses synthetic-bolding artifacts when a callsite asks for 500/600
   (e.g. hero titles use font-weight: 500). */
@font-face {
  font-family: 'OPPO Sans';
  src: url('/fonts/OPPOSans-Regular.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007F, U+00A0-00FF, U+2000-206F, U+2E80-2EFF,
                 U+3000-303F, U+4E00-9FFF, U+FF00-FFEF;
}

@font-face {
  font-family: 'LXGW WenKai';
  src: url('/fonts/LXGWWenKai-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007F, U+00A0-00FF, U+2000-206F, U+2E80-2EFF,
                 U+3000-303F, U+4E00-9FFF, U+FF00-FFEF;
}
@font-face {
  font-family: 'LXGW WenKai';
  src: url('/fonts/LXGWWenKai-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007F, U+00A0-00FF, U+2000-206F, U+2E80-2EFF,
                 U+3000-303F, U+4E00-9FFF, U+FF00-FFEF;
}
@font-face {
  font-family: 'LXGW WenKai';
  src: url('/fonts/LXGWWenKai-Medium.woff2') format('woff2');
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007F, U+00A0-00FF, U+2000-206F, U+2E80-2EFF,
                 U+3000-303F, U+4E00-9FFF, U+FF00-FFEF;
}

/* ── Zh token mapping ───────────────────────────────────────────────── */

html[lang^="zh"] {
  /* System Chinese stack — fastest, zero download, proven for long-form
     Simplified body copy. Apple → PingFang SC; Windows → YaHei; Linux → Noto. */
  --font-system-zh: -apple-system, BlinkMacSystemFont, "PingFang SC",
                    "Microsoft YaHei", "Hiragino Sans GB", "Heiti SC",
                    "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;

  /* Body/UI default. */
  --font-display: var(--font-system-zh);

  /* Brand/hero. The token slot is named "serif" historically (it held
     Newsreader); on zh pages it carries the modern sans display face. */
  --font-serif: 'OPPO Sans', var(--font-system-zh);

  /* Emotional accent. */
  --font-hand: 'LXGW WenKai', "Kaiti SC", "STKaiti", var(--font-system-zh);
}
