/* ─────────────────────────────────────────────
   WonderBear Typography Tokens
   ───────────────────────────────────────────── */

/*
 * Fredoka — self-hosted variable font (v17).
 * Latin subset: ~30 KB. Latin-ext (PL/RO diacritics): ~5 KB.
 * These files live in assets/fonts/ — NO Google Fonts network dep.
 * Note: Fredoka covers Latin only. CJK falls through to LXGW WenKai.
 */
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../assets/fonts/fredoka-v17-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../assets/fonts/fredoka-v17-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/*
 * LXGW WenKai — handwritten kai-style CJK font, free/OFL.
 * Loaded dynamically via Chinese Fonts CDN; only chars rendered on-screen
 * are downloaded (~50 KB/page). For production/offline devices, replace
 * with a locally-subsetted woff2.
 * ⚠ This CDN will not work behind GFW — see README §Fonts for offline plan.
 */
@import url('https://chinese-fonts-cdn.deno.dev/packages/lxgwwenkai/dist/LXGWWenKai-Regular/result.css');

:root {
  /*
   * Display font stack:
   * Latin glyphs → Fredoka (warm, rounded, friendly)
   * CJK glyphs   → LXGW WenKai (handwritten kai, warm + child-friendly)
   * Fallbacks    → system CJK stacks
   */
  --wb-font-display:
    'Fredoka',
    'LXGW WenKai',
    'HanziPen SC',
    'STHupo', 'ST Hupo',
    'PingFang SC',
    'Hiragino Sans GB',
    'Microsoft YaHei',
    'Helvetica Neue', sans-serif;

  /* Body / UI font (same stack — Fredoka is the default throughout) */
  --wb-font-body: var(--wb-font-display);

  /* ── TV font scale (1920×1080, viewed at 2–3 m) ── */
  --wb-tv-fs-xs:       16px;   /* dev console only */
  --wb-tv-fs-sm:       28px;   /* captions, hints */
  --wb-tv-fs-md:       32px;   /* body — TV minimum readable */
  --wb-tv-fs-lg:       40px;   /* buttons, emphasised body */
  --wb-tv-fs-xl:       56px;   /* section titles */
  --wb-tv-fs-2xl:      72px;   /* large headings */
  --wb-tv-fs-display:  96px;   /* hero display */

  /* ── H5 font scale (mobile, 375–414 px wide) ── */
  --wb-h5-fs-xs:       11px;
  --wb-h5-fs-sm:       12px;
  --wb-h5-fs-base:     14px;
  --wb-h5-fs-md:       16px;
  --wb-h5-fs-lg:       18px;
  --wb-h5-fs-xl:       22px;
  --wb-h5-fs-title:    24px;

  /* ── Shared weights ── */
  --wb-fw-regular:     400; /* @kind font */
  --wb-fw-medium:      500; /* @kind font */
  --wb-fw-semibold:    600; /* @kind font */
  --wb-fw-bold:        700; /* @kind font */

  /* ── Line heights ── */
  --wb-lh-tight:  1.15; /* @kind other */
  --wb-lh-snug:   1.3;  /* @kind other */
  --wb-lh-base:   1.5;  /* @kind other */
  --wb-lh-loose:  1.7;  /* @kind other */
}
