/* The three typefaces of the public site, served from this origin.
 *
 * The page used to pull them from fonts.googleapis.com, which meant a passenger loading
 * the front door made two DNS lookups, two TLS handshakes and five requests to Google
 * before a word of the page could be set in its own type. These files are served by the
 * same express.static mount that serves everything else in public/, so the page makes no
 * third-party request at all. The licence that permits this is in public/fonts/licenses/,
 * one file per family, and docs/FONTS.md records where each binary came from and the
 * name-table evidence that it is the font it says it is.
 *
 * WHAT THE PAGE ASKS FOR, AND WHY THAT MATTERS MORE THAN IT LOOKS
 *
 * docs/design/berline-home.html sets Work Sans at 300, 400, 500 and 700; Source Serif 4
 * at 400 and 500; IBM Plex Mono at 400 and 500. Every one of those is a real outline
 * below. The failure this is written to avoid is FAUX BOLD: when a page asks for a weight
 * no @font-face supplies, the browser does not fall back to another family - it takes the
 * weight it has and smears it, algorithmically thickening or slanting the glyphs. The
 * result is not an error anywhere. It is type that looks slightly wrong, on some machines
 * and not others, and it reads as a rendering bug rather than as a missing file.
 *
 * Work Sans and Source Serif 4 are shipped as VARIABLE fonts: one file each, carrying a
 * weight axis, so a single face answers all four weights and all two. The declared
 * font-weight is therefore a RANGE, and it is the range the file's own fvar table reports
 * rather than only the weights the page happens to use today. That is deliberate: if
 * somebody later sets a caption at 600, a declared range of 100-900 gives them a real 600,
 * where a range of 300-700 would silently clamp it to 700.
 *
 * IBM Plex Mono has no variable build in Google Fonts, so 400 and 500 are two static
 * files, declared exactly.
 *
 * ABOUT unicode-range
 *
 * Every file here is the LATIN SUBSET. The whole page is ASCII - checked, not assumed -
 * and the Latin subset covers U+0000-00FF plus the punctuation, currency and arrows
 * listed below, so nothing on it needs a larger file. The cost of being wrong about that
 * is worth naming because it is quiet: a character outside the range does not 404 and
 * does not fall back to a thicker face, it falls through to the NEXT family in the CSS
 * stack for that one character. A single Cyrillic name in a testimonial would be set in
 * Georgia in the middle of a Source Serif sentence, and nothing would report it. If the
 * page ever carries non-Latin text, swap in the fuller subset - docs/FONTS.md has the
 * URLs and what each one costs.
 *
 * font-display: swap on every face, for the same reason it was on the Google URL: the
 * fallback is shown immediately and replaced when the font arrives, so no passenger ever
 * waits on a blank heading.
 */

/* ---------------------------------------------------------------- Work Sans (display)
 * One variable file, weight axis 100-900 per its own fvar table. Covers the 300, 400,
 * 500 and 700 the page sets, each as a true interpolated instance.
 */
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/work-sans-latin-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;
}

/* ---------------------------------------------------------------- Source Serif 4 (body)
 * One variable file, weight axis 200-900. Covers the 400 and 500 the page sets.
 *
 * The upstream family also carries an optical-size axis (opsz 8-60), and this file does
 * NOT: the two-axis Latin subset is 122,360 bytes against 50,936 for this one, and the
 * 71,424-byte difference buys optical sizing the page cannot use. Source Serif is applied
 * at exactly one size here - 17px body text, from `body { font-family: var(--body) }` -
 * and the axis default this file is pinned at, opsz 20, IS the optical size intended for
 * text at that size. If the serif is ever set at display sizes, the two-axis file is the
 * swap and docs/FONTS.md has its URL.
 */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('/fonts/source-serif-4-latin-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;
}

/* ---------------------------------------------------------------- IBM Plex Mono (data)
 * Two static files. There is no variable build of IBM Plex Mono in Google Fonts - the
 * CSS API returns a different URL per weight, and google/fonts carries only statics - so
 * these are declared one weight each. 400 and 500 are what the page sets and both are
 * here; a mono weight the page does not ask for is not worth another request.
 *
 * Note for anyone re-verifying these: the 500 file's own name ID 1 reads "IBM Plex Mono
 * Medium", not "IBM Plex Mono". That is how IBM ships the static Medium - the family name
 * in the file carries the style - and it is irrelevant to matching, because the family a
 * browser matches on is the one named here in CSS. See docs/FONTS.md.
 */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin-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: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin-500.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;
}

/* =====================================================================================
 * THREE MORE FAMILIES, ADDED 14 November 2026 so the Content-Security-Policy can stop
 * allowing fonts.googleapis.com and fonts.gstatic.com at all (audit item M17).
 *
 * The audit said the policy "still allows Google Fonts, which are no longer used". That
 * was wrong, and it is the reason this block exists rather than a one-line policy edit:
 * three families were still being fetched from Google at the time.
 *
 *   Montserrat   the app shell - /rider.html, /driver.html, /admin.html, /share.html.
 *                app.css sets it as --font, so it is the type a chauffeur and a
 *                dispatcher read all day. These were the only pages still making the
 *                request on the live site.
 *   Archivo      the www/ marketing pages and site/index.html. Not served today - the
 *                launch gate is shut and those routes 404 - which is exactly why it is
 *                here now. Dropping the sources while those pages still linked Google
 *                would have left a trap that sprang on launch day, in the typography of
 *                the pages a first customer sees.
 *   Newsreader   the same pages, for body text.
 *
 * All three are SIL Open Font License 1.1, licences in public/fonts/licenses/. Each file
 * is the latin subset of the Google variable build, and each name table was read before
 * it shipped - see docs/FONTS.md section 5 for the method and the reader.
 *
 * THE DECLARED RANGES ARE THE RANGES THE FILES ACTUALLY CARRY, not the weights the pages
 * happen to use today. Read out of each file's own fvar table:
 *
 *   Montserrat   wght 100..900          (default instance 100, "Montserrat Thin")
 *   Archivo      wght 100..900, wdth 62..125   (default instance 600)
 *   Newsreader   wght 200..800, opsz 6..72     (default instance 400)
 *
 * The default instances are worth knowing and are NOT a problem: a variable font's
 * default applies only when nothing sets the axis, and every rule in this codebase sets
 * a weight. Declaring the true range is what prevents faux bold - a browser asked for a
 * weight outside the declared range smears the nearest outline rather than failing, and
 * the result reads as a rendering bug rather than a missing file.
 *
 * NO unicode-range HERE. The three families above carry one because they are subsets
 * sharing a family name with other subsets that are not shipped. These are the only
 * Montserrat, Archivo and Newsreader faces declared anywhere, so narrowing them would
 * only mean a character outside latin falls back to a system font - which is what
 * happens anyway, one declaration later.
 * ===================================================================================== */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/montserrat-latin-var.woff2') format('woff2');
}

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('/fonts/archivo-latin-var.woff2') format('woff2');
}

@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/newsreader-latin-var.woff2') format('woff2');
}
