/* ============================================================================
 *  IntMap · THE TYPEFACE, FOR EVERY CHARACTER THE APP DRAWS   (#R242)
 * ----------------------------------------------------------------------------
 *  「IntMap内のすべての文字は以下にしろ。すべての文字をこうしろ。地名ラベルも例外ではない。（恒久的に）
 *     Latin / Cyrillic      → Inter
 *     日本語                 → Noto Sans JP
 *     简体中文               → Noto Sans SC
 *     繁體中文               → Noto Sans TC
 *     한국어                 → Pretendard」
 *
 *  ══ THERE ARE TWO SURFACES AND THIS FILE IS ONE OF THEM ══════════════════════════════════════
 *  · THE UI — every element in index.html, admin.html and the two reading pages. That is this file:
 *    one custom property, `--im-font`, set per language on <html lang>, and read by the `body,
 *    input, select` and `button` rules in css/intmap.css (and by css/pages.css). Nothing else in the
 *    app may declare a `font-family` for prose; the two that remain are deliberate and named there
 *    (the tabular rank numerals and the API-key monospace box).
 *  · THE MAP LABELS — a MapLibre symbol layer does not read CSS. Latin and Cyrillic place names come
 *    from SDF glyph atlases (`fonts/Inter Regular/{range}.pbf`, generated by scripts/build-glyphs.mjs
 *    from the bundled Inter and served from this origin), and CJK/Hangul names are rasterised in the
 *    browser from the font families below via MapLibre's `localIdeographFontFamily`. Both are wired
 *    in js/app-body.js; the note there is the other half of this one.
 *
 *  ══ WHERE THE FILES COME FROM ════════════════════════════════════════════════════════════════
 *  · Inter (SIL OFL 1.1) and Pretendard (SIL OFL 1.1) are BUNDLED — `fonts/*.woff2` in this repo, so
 *    the Latin/Cyrillic face and the Korean face cost no third-party request at all.
 *  · Noto Sans JP / SC / TC (SIL OFL 1.1) are served by Google Fonts, which splits each of them into
 *    ~120 unicode-range subsets — a Japanese page fetches the ~30 KB its own glyphs need instead of
 *    a 5 MB font. Bundling them whole would put ~25 MB in this repo and 5–10 MB on every CJK reader.
 *    ⚠ That is a third-party request and it is declared: see sources.html and PRIVACY in
 *    docs/, updated in the same round (CONSTITUTION 4).
 *
 *  ⚠ `unicode-range` IS WHAT MAKES THIS FREE. Pretendard is 766 KB and it is only fetched when the
 *  page actually paints Hangul; Inter's Cyrillic subset is only fetched when it paints Cyrillic. So
 *  every language carries the same stack and pays only for the scripts on its own screen.
 * ========================================================================== */

/* ── Inter — Latin, Latin-Ext, Cyrillic, Cyrillic-Ext, Greek (variable, 100–900) ─────────────── */
@font-face{ font-family:'Inter'; font-style:normal; font-weight:100 900; font-display:swap;
  src:url('../fonts/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; }
@font-face{ font-family:'Inter'; font-style:normal; font-weight:100 900; font-display:swap;
  src:url('../fonts/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-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-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-greek.woff2') format('woff2');
  unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF; }

/* ── Pretendard — Hangul (and the Latin it carries is never reached: Inter is ahead of it) ───── */
@font-face{ font-family:'Pretendard'; font-style:normal; font-weight:400; font-display:swap;
  src:url('../fonts/pretendard.woff2') format('woff2');
  unicode-range:U+1100-11FF,U+3130-318F,U+A960-A97F,U+AC00-D7A3,U+D7B0-D7FF; }

/* ── the stack, per language ─────────────────────────────────────────────────────────────────
   Inter is ALWAYS first: a Japanese screen still writes its numbers, units and Latin names in Inter,
   and a CJK family only ever answers for the codepoints Inter does not carry. The system fallbacks
   after it are what a reader gets for the third of a second before the webfont lands (font-display
   is `swap`) and for any script none of these five cover. */
:root{ --im-font:'Inter',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif; }
/* ⚠ the `i` flag is not decoration: js/lang-registry.js writes `zh-Hant` and `zh-Hans` with capital
   letters, and a CSS attribute selector matches the VALUE case-sensitively without it. */
html[lang="ja" i]{      --im-font:'Inter','Noto Sans JP',system-ui,-apple-system,'Hiragino Sans','Yu Gothic','Meiryo',sans-serif; }
html[lang="zh" i]{      --im-font:'Inter','Noto Sans TC',system-ui,-apple-system,'PingFang TC','Microsoft JhengHei',sans-serif; }
html[lang="zh-Hant" i]{ --im-font:'Inter','Noto Sans TC',system-ui,-apple-system,'PingFang TC','Microsoft JhengHei',sans-serif; }
html[lang="zh-Hans" i]{ --im-font:'Inter','Noto Sans SC',system-ui,-apple-system,'PingFang SC','Microsoft YaHei',sans-serif; }
html[lang="ko" i]{      --im-font:'Inter','Pretendard',system-ui,-apple-system,'Apple SD Gothic Neo','Malgun Gothic',sans-serif; }
