/* Type for the scripts the Latin brand files do not cover. The server links
   this on non-English pages only (i18n_serve.go), so an English visitor
   downloads exactly what they did before it existed.

   Every face here carries a unicode-range, and a browser fetches a face only
   when text on the page needs a character in its range: a Russian page pulls
   the Cyrillic cut and nothing else, a Polish page the Latin Extended cut.

   What covers what (Google Fonts subsets, checked 2026-09-24):
   - IBM Plex Mono and Merriweather both publish cyrillic, latin-ext and
     vietnamese cuts of the same font revisions as the Latin files in
     style.css, so those scripts get the brand faces themselves.
   - Neither family has Greek. Greek comes from Noto Sans Mono (the same
     600/1000 advance as Plex Mono, so a Greek label keeps the column grid of
     its digits) and Noto Serif.
   - CJK is far too large to self-host a cut of, and the CSP refuses Google's
     own CDN, so Chinese, Japanese and Korean name the system faces each
     platform ships, per language, after the brand face: the Latin in those
     pages stays Plex and Merriweather.

   See web/assets/fonts/README.md for the files and their licences. */

/* --- IBM Plex Mono: Latin Extended, Vietnamese, Cyrillic ---
   The order matters. Where ranges overlap (a, d with a breve or stroke are in
   both Latin Extended and Vietnamese; U+0301 in Vietnamese and Cyrillic) the
   face declared LAST is tried first, so the small Vietnamese cut serves a
   Vietnamese page instead of the Latin Extended one, which is six times its
   size in Merriweather. */
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/plex-mono-400-latin-ext.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  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: "IBM Plex Mono";
  src: url("/assets/fonts/plex-mono-500-latin-ext.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
  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: "IBM Plex Mono";
  src: url("/assets/fonts/plex-mono-400-vietnamese.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  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: "IBM Plex Mono";
  src: url("/assets/fonts/plex-mono-500-vietnamese.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
  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: "IBM Plex Mono";
  src: url("/assets/fonts/plex-mono-400-cyrillic.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/plex-mono-500-cyrillic.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* --- Merriweather: Latin Extended, Vietnamese, Cyrillic (same order, same reason) ---
   Variable like the Latin files, so each keeps the 300-900 weight range. */
@font-face {
  font-family: "Merriweather";
  src: url("/assets/fonts/merriweather-300-900-latin-ext.woff2") format("woff2");
  font-weight: 300 900; font-style: normal; font-display: swap;
  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: "Merriweather";
  src: url("/assets/fonts/merriweather-italic-300-900-latin-ext.woff2") format("woff2");
  font-weight: 300 900; font-style: italic; font-display: swap;
  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: "Merriweather";
  src: url("/assets/fonts/merriweather-300-900-vietnamese.woff2") format("woff2");
  font-weight: 300 900; font-style: normal; font-display: swap;
  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: "Merriweather";
  src: url("/assets/fonts/merriweather-italic-300-900-vietnamese.woff2") format("woff2");
  font-weight: 300 900; font-style: italic; font-display: swap;
  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: "Merriweather";
  src: url("/assets/fonts/merriweather-300-900-cyrillic.woff2") format("woff2");
  font-weight: 300 900; font-style: normal; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Merriweather";
  src: url("/assets/fonts/merriweather-italic-300-900-cyrillic.woff2") format("woff2");
  font-weight: 300 900; font-style: italic; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* --- Greek, which neither brand family has ---
   Both files are variable (wght 100-900) and hold the Greek block only. */
@font-face {
  font-family: "Noto Sans Mono";
  src: url("/assets/fonts/noto-sans-mono-greek.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: "Noto Serif";
  src: url("/assets/fonts/noto-serif-greek.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: "Noto Serif";
  src: url("/assets/fonts/noto-serif-italic-greek.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

:root:lang(el) {
  --mono:       "IBM Plex Mono", "Noto Sans Mono", monospace;
  --mono-code:  "IBM Plex Mono", "Noto Sans Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --serif:      "Merriweather", "Noto Serif", Georgia, serif;
  --serif-body: "Merriweather", "Noto Serif", Georgia, "Times New Roman", Times, serif;
}

/* --- Chinese, Japanese, Korean ---
   The brand face stays first, so Latin words, numbers and units keep it; the
   ideographs and kana come from the platform's own UI face for the language
   (Windows, then macOS/iOS, then Android and Linux). Han characters are drawn
   differently in each of the four, so each language names its own. The
   generic at the end is sans-serif, not serif: a serif CJK fallback is a
   Song/Mincho face, hairline-thin at the 9-11px the labels are set in. */
:root:is(:lang(zh), :lang(ja), :lang(ko)) {
  --cjk:        "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC";
  --mono:       "IBM Plex Mono", var(--cjk), monospace;
  --mono-code:  "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, var(--cjk), monospace;
  --serif:      "Merriweather", Georgia, var(--cjk), sans-serif;
  --serif-body: "Merriweather", Georgia, "Times New Roman", Times, var(--cjk), sans-serif;
}
:root:lang(zh-TW) { --cjk: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Source Han Sans TC"; }
:root:lang(ja)    { --cjk: "Yu Gothic", YuGothic, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", Meiryo; }
:root:lang(ko)    { --cjk: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Source Han Sans K"; }

/* The engraved labels are tracked out 0.08-0.34em, which reads as engraving
   on Latin capitals and as a row of unrelated characters in Chinese and
   Japanese, where there are no word spaces to hold a phrase together. Those
   labels are set solid in CJK. Their uppercase transform is left alone: it
   does nothing to ideographs, kana or hangul, and still capitalises a Latin
   unit or name inside them. :is() takes its most specific argument, so this
   outranks every rule it overrides in style.css and i18n.css. */
:root:is(:lang(zh), :lang(ja), :lang(ko)) :is(
  .skip, .chip-mono, .rail-nav a, .console-legend, .master-btn, .meter-legend,
  .eyebrow, .display-strip, .stat span, .btn, .btn small, .btn-lg, .btn-sm,
  .panel-title, .tab, .shot-pick, .stamp, .chip, .tag, .plate-label,
  .stable, .devel, .alpha, .acc-tag, .tracker-col h4, .pill, .tag-status,
  .beta-head h3, .tile i, .beta-fields label > span, .portal-report h3,
  .portal-mine h3, .foot-links a, .dataplate b, .dataplate span, .consent b,
  .news-prompt-eyebrow, .doc .back, .doc h2, .doc th,
  .lang-note, .lang-pick button
) {
  letter-spacing: normal;
}

/* No CJK face has a drawn italic, so the hero's second line would be a
   browser-slanted Gothic. Its colour already sets it apart; keep it upright. */
:root:is(:lang(zh), :lang(ja), :lang(ko)) .hero h1 em { font-style: normal; }
