/*
  Rubyfpv self-hosted fonts (2026-10-31, G1; sans switched to Instrument Sans 2026-10-31, font plan A). All four families
  are SIL OFL 1.1 (licence texts in this folder), latin subset. Every file is served from /assets/fonts/, so no page
  waits on a third-party font host (those hang in mainland China).

  Two voices only (font plan A, 评审/字体方案-20261031/方案说明.md):
    serif  "Instrument Serif" 400 normal + italic  + Chinese Song Bold ("ZH Title", below) — big titles and prices only
    sans   "Instrument Sans"  400–700 normal + italic (two variable files) + Chinese PingFang — everything else:
           body, buttons, card names, eyebrows (500, uppercase, .14em), pills / badges / nav / dock / labels
           (600, uppercase, .10em), footer, counters (tabular-nums)
  Code face (not a voice):
    "Space Mono"        400, 700   real code only: code / pre, file paths, timeline scale and read-outs; homepage TV canvas
    "Pixelify Sans"     500–700    only the homepage TV canvas
  Chinese:
    titles  "ZH Title" = Songti SC Bold on Apple computers; everywhere else (iPhone has no Songti, nor do Windows / Android)
            a subset of Source Han Serif CN Bold (思源宋体, OFL) holding only the characters the site's titles use.
            One face for every font-weight, so a title's weight can never switch its Chinese back to a thin cut
            (Ruby 2026-10-31: Chinese titles Song Bold 700, English Instrument Serif 400).
            title punctuation "ZH Title Punct" (local PingFang Semibold: half-width "halt" forms for ，。、！？：；)
    quotes  the big serif paragraphs that are not titles (About statement, blog ledes and quotes) keep regular Songti:
            --rf-face-serif-text, with "ZH Punct" (declared in /assets/brand.css; the homepage declares it inline)
    body    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif

  Preload only the critical files (homepage):
    <link rel="preload" href="/assets/fonts/instrument-serif-400.woff2" as="font" type="font/woff2" crossorigin>
    <link rel="preload" href="/assets/fonts/instrument-sans-var.woff2" as="font" type="font/woff2" crossorigin>

  Metric-matched fallbacks (to keep layout from jumping while the web font swaps in):
  "… Fallback" faces below are local system fonts rescaled with size-adjust / ascent-override so their average
  glyph width and line box match the web font (measured in Chrome 2026-10-31: sample of site copy at 100px).
  Put them right after the web font in a stack, before the Chinese font. Pages never spell the serif stacks out:
    font-family: var(--rf-face-serif);        titles and prices (stack at the bottom of this file)
    font-family: var(--rf-face-zh-title);     a Chinese-only title bit outside a serif stack (price 「起」, Chinese subtitle lines)
    font-family: var(--rf-face-sans), "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-family: var(--rf-face-code), ui-monospace, Menlo, monospace;
  /assets/brand.css exposes these stacks as --rf-serif, --rf-sans (and --rf-mono, now = --rf-sans), --rf-code.
*/

/* latin */
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/instrument-serif-400.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: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/instrument-serif-400-italic.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: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/instrument-sans-var.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: "Instrument Sans";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/instrument-sans-italic-var.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: "Space Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/space-mono-400.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: "Space Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/space-mono-700.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: "Pixelify Sans";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/assets/fonts/pixelify-sans-var.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;
}

/* Metric-matched local fallbacks (see header). Values = web font metric ÷ fallback metric, Chrome-measured.
   The sans and code fallbacks carry a unicode-range = the characters the web font really has (read from its cmap,
   2026-10-31). Without it, Arial / Courier New kept drawing the few characters the web font lacks (→ ↗ ▶ ─ …) even
   after the web font loaded, a stray extra face; now those characters fall through to PingFang SC. */
@font-face {
  font-family: "Instrument Serif Fallback";
  font-style: normal;
  src: local("Georgia");
  size-adjust: 75.52%;
  ascent-override: 131.1%;
  descent-override: 41.05%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Instrument Serif Fallback";
  font-style: italic;
  src: local("Georgia Italic"), local("Georgia-Italic");
  size-adjust: 77.68%;
  ascent-override: 127.45%;
  descent-override: 39.91%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Instrument Sans Fallback";
  font-style: normal;
  src: local("Arial"), local("ArialMT"), local("Helvetica");
  size-adjust: 100.27%;
  ascent-override: 96.74%;
  descent-override: 24.93%;
  line-gap-override: 0%;
  unicode-range: U+0020-007E, U+00A0-00A3, U+00A5, U+00A7-00AB, U+00AE-00B0, U+00B4, U+00B6-00B8, U+00BA-00BB, U+00BF-00FF, U+0102, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+0300-0301, U+0303-0304, U+0308, U+2013-2014, U+2018-201A, U+201C-201E, U+2022, U+2026, U+2039-203A, U+20AC, U+2122, U+2191, U+2193, U+2212;
}
@font-face {
  font-family: "Instrument Sans Fallback";
  font-style: italic;
  src: local("Arial Italic"), local("Arial-ItalicMT"), local("Helvetica Oblique");
  size-adjust: 100.19%;
  ascent-override: 96.82%;
  descent-override: 24.95%;
  line-gap-override: 0%;
  unicode-range: U+0020-007E, U+00A0-00A3, U+00A5, U+00A7-00AB, U+00AE-00B0, U+00B4, U+00B6-00B8, U+00BA-00BB, U+00BF-00FF, U+0102, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+0300-0301, U+0303-0304, U+0308, U+2013-2014, U+2018-201A, U+201C-201E, U+2022, U+2026, U+2039-203A, U+20AC, U+2122, U+2191, U+2193, U+2212;
}

/* The one switch for the sans voice (and the code face). Every UI stack on the site reads these two variables
   (brand.css --rf-sans / --rf-code, scripts/site-nav.mjs SANS / CODE, the homepage's own :root), so trying another
   sans = swap its @font-face above + its metric-matched fallback + the names on the next line. Nothing else. */
:root {
  --rf-face-sans: "Instrument Sans", "Instrument Sans Fallback";
  --rf-face-code: "Space Mono", "Space Mono Fallback";
  /* The one switch for the serif voice: Latin Instrument Serif, Chinese titles "ZH Title" (Song Bold, see header). */
  --rf-face-serif: "Instrument Serif", "ZH Title Punct", "Instrument Serif Fallback", "ZH Title", "Songti SC", "STSong", serif;
  --rf-face-zh-title: "ZH Title Punct", "ZH Title", "Songti SC", "STSong", serif;
  --rf-face-serif-text: "Instrument Serif", "ZH Punct", "Instrument Serif Fallback", "Songti SC", "STSong", serif;
}

/* Chinese titles: Song Bold for every weight (1–1000) and both styles, so neither a title's weight nor an <em> can
   pick another cut or fake a slant. Apple computers draw it with their own Songti SC Bold and never download the file;
   iPhone (no Songti), Windows and Android get the subset (zh-title-bold.woff2, scripts/zh-title-subset.py).
   Punctuation first goes to PingFang Semibold, which has half-width "halt" forms; without PingFang it falls to the subset. */
@font-face { font-family: "ZH Title"; font-style: normal; font-weight: 1 1000; font-display: swap; src: local("STSongti-SC-Bold"), local("Songti SC Bold"), url("/assets/fonts/zh-title-bold.woff2") format("woff2"); }
@font-face { font-family: "ZH Title"; font-style: italic; font-weight: 1 1000; font-display: swap; src: local("STSongti-SC-Bold"), local("Songti SC Bold"), url("/assets/fonts/zh-title-bold.woff2") format("woff2"); }
@font-face { font-family: "ZH Title Punct"; font-style: normal; font-weight: 1 1000; src: local("PingFangSC-Semibold"), local("PingFang SC Semibold"); unicode-range: U+3001-3002, U+FF01, U+FF0C, U+FF1A, U+FF1B, U+FF1F; }
@font-face { font-family: "ZH Title Punct"; font-style: italic; font-weight: 1 1000; src: local("PingFangSC-Semibold"), local("PingFang SC Semibold"); unicode-range: U+3001-3002, U+FF01, U+FF0C, U+FF1A, U+FF1B, U+FF1F; }
@font-face {
  font-family: "Space Mono Fallback";
  font-style: normal;
  src: local("Courier New"), local("CourierNewPSMT");
  size-adjust: 101.98%;
  ascent-override: 109.82%;
  descent-override: 35.3%;
  line-gap-override: 0%;
  unicode-range: U+0020-007E, U+00A0-00AC, U+00AE-00FF, U+0102, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+2013-2014, U+2018-201A, U+201C-201E, U+2022, U+2026, U+2032-2033, U+2039-203A, U+2044, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
