/* AUTO-GENERATED by scripts/generate-font-bundle.mjs — DO NOT EDIT.
 * Edit the source files in src/styles/fonts/ instead and re-run the script
 * (it also runs on every predev/prebuild/pretest). */
/* ==== inter.css ==== */
/*
 * Inter Variable, served from /public/fonts/inter/ with a `unicode-range` per
 * subset. Shared across the entire site — every locale picks the subset(s) it
 * needs via the unicode-range mechanism.
 *
 * The 7 @font-face declarations let the browser fetch only the subset(s)
 * matched by the rendered HTML. The matching <link rel=preload> for each
 * locale is emitted directly in the <head> from layout.tsx so the cascade
 * is: HTML parsed → preload of the correct subset starts → first paint
 * already with Inter (no FOUT for the locale's primary alphabet).
 *
 * Subsets and unicode-ranges are taken verbatim from Google Fonts' CSS for
 * Inter v20 to preserve identical behavior. The WOFF2 binaries themselves
 * are the v20 release served by fonts.gstatic.com (downloaded once into
 * /public/fonts/inter/; update them when bumping Inter to a new major
 * version).
 *
 * The `--font-inter` CSS variable replaces the one that next/font used to
 * inject when this lived in next/font/google. Theme.ts already references
 * `var(--font-inter)` and falls back to system fonts.
 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter/inter-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter/inter-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter/inter-greek-ext.woff2") format("woff2");
  unicode-range: U+1F00-1FFF;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter/inter-greek.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter/inter-vietnamese.woff2") format("woff2");
  unicode-range:
    U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309,
    U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter/inter-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;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter/inter-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;
}

:root {
  --font-inter: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ==== noto.css ==== */
/*
 * Per-locale font-stack overrides for non-Latin scripts (TODO §1.3).
 *
 * Inter covers only latin/cyrillic/greek/vietnamese. On CJK locales the
 * @font-face declarations in noto-sans-{sc,tc,jp,kr}.css (generated by
 * scripts/download-self-hosted-fonts.mjs) supply the ideograph glyphs as
 * lazy unicode-range slices. Here we select WHICH Noto family each locale uses
 * by overriding `--font-inter` per `:root[lang]`. This per-locale split is
 * REQUIRED: Han unification means zh/ja/ko share codepoints but want different
 * regional glyph shapes, so a single global stack would render the wrong forms.
 *
 * Inter stays FIRST, so Latin text, the brand name and numerals keep rendering
 * in Inter; only non-Latin codepoints fall through to the Noto family (and only
 * the 1-3 slices a page actually uses are fetched). Named OS CJK fonts
 * (PingFang/YaHei/Hiragino…) sit between Noto and system-ui as a metric-close
 * fallback so the swap from OS font → Noto causes ~zero CLS.
 *
 * `:root[lang]` (specificity 0,2,0) intentionally outranks the `:root` default
 * in inter.css — this file MUST be imported AFTER inter.css.
 *
 * Hand-maintained. The generated noto-sans-*.css files hold the @font-face
 * rules; this file holds only the locale → family selection.
 */

:root[lang="zh-CN"] {
  --font-inter: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

:root[lang="zh-TW"],
:root[lang="zh-HK"] {
  --font-inter: "Inter", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

:root[lang="ja-JP"] {
  --font-inter: "Inter", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", Meiryo, system-ui, sans-serif;
}

:root[lang="ko-KR"] {
  --font-inter: "Inter", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

/* ── Phase 2: Arabic / Hebrew / Devanagari / Bengali / Thai ──────────────
 * Single-slice named-subset families (no Han-unification clash). RTL locales
 * (ar-*, ur-PK, he-IL) get dir="rtl" from localeConfig in layout.tsx; the font
 * stack is independent of direction. Named OS fonts follow each Noto family as
 * the metric-close fallback. */

:root[lang="ar-SA"],
:root[lang="ar-EG"],
:root[lang="ar-AE"],
:root[lang="ur-PK"] {
  --font-inter: "Inter", "Noto Sans Arabic", "Geeza Pro", Tahoma, system-ui, sans-serif;
}

:root[lang="he-IL"] {
  --font-inter: "Inter", "Noto Sans Hebrew", "Arial Hebrew", system-ui, sans-serif;
}

:root[lang="hi-IN"],
:root[lang="mr-IN"] {
  --font-inter: "Inter", "Noto Sans Devanagari", "Kohinoor Devanagari", "Nirmala UI", system-ui, sans-serif;
}

:root[lang="bn-BD"] {
  --font-inter: "Inter", "Noto Sans Bengali", "Nirmala UI", system-ui, sans-serif;
}

:root[lang="th-TH"] {
  --font-inter: "Inter", "Noto Sans Thai", "Thonburi", "Leelawadee UI", system-ui, sans-serif;
}
