/* Self-hosted webfonts for the three app pages (#573): index.html (Owner
 * Portal), admin.html (Admin Portal), and docs/wireframes/deal-inbox.html.
 *
 * This is a SEPARATE file from assets/docs/fonts.css rather than an extension
 * of it. That file's own header says it is scoped to documentation pages
 * (Inter + Roboto Mono, chosen for those guides); this one covers the
 * three app-side pages and their three families (JetBrains Mono, Cabinet
 * Grotesk, Satoshi). Two files, two audiences -- if you are looking for the
 * public-docs fonts, they are in assets/docs/fonts.css, not here.
 *
 * WHY COMMITTED RATHER THAN LINKED. Until now these three pages pulled their
 * fonts from fonts.googleapis.com / fonts.gstatic.com (JetBrains Mono) and
 * api.fontshare.com (Cabinet Grotesk, Satoshi) at render time. A third-party
 * fetch on every page load is not reproducible -- it depends on that host
 * being up, fast, and unchanged, none of which this repo controls -- and it
 * is a third-party dependency this app does not need merely to render its own
 * chrome. #392 already made this exact call for the /docs* pages and for the
 * same underlying reason: an in-repo file is served by the same process from
 * the same commit that expects it, every time, everywhere (local dev, CI,
 * Vercel prod).
 *
 * THE BYTES. All seven woff2 files in assets/fonts/ are the CDNs' own bytes,
 * taken unmodified -- deliberately NOT re-subsetted or re-encoded. #392's
 * warning is that a wrong subset silently reintroduces the exact
 * fallback/reflow non-determinism it was fighting (a glyph outside a
 * hand-rolled subset quietly falls back to a system font, which reflows
 * around whatever is on screen). Vendoring the identical payload means the
 * rendered result is byte-for-byte what ships today from the CDNs, so the
 * existing docs-shot visual baselines (assets/docs/*.png, checked by
 * tests/docsShots.unit.js) cannot move because of this change.
 *
 * JETBRAINS MONO IS TWO FILES, NOT FOUR, AND EACH IS A WEIGHT RANGE. This is
 * verified against the actual Google Fonts response, not assumed: Google
 * serves one file per subset (latin, latin-ext) that covers all four weights
 * this app asks for (400, 500, 600, 700) because JetBrains Mono is a variable
 * font on Google Fonts -- the URLs Google returns for 400, 500, 600 and 700
 * are byte-identical. So there are two files here, not eight, and each
 * @font-face below declares `font-weight: 400 700` (a range) rather than one
 * face per weight. assets/docs/fonts.css does the same thing for Roboto Mono,
 * for the same reason -- mirror that pattern if you're adding a third variable
 * font here.
 *
 * unicode-range on the two JetBrains Mono blocks is copied verbatim from
 * Google's own CSS response for this family, so a Latin Extended character
 * (e.g. in a name with diacritics) still resolves to JetBrains Mono via the
 * second block instead of falling out to a system mono font.
 *
 * FONTSHARE (CABINET GROTESK, SATOSHI) FACES CARRY NO unicode-range. Unlike
 * Google, Fontshare does not offer subsets -- each weight is one static file
 * covering its full character set, so there is nothing to split and no range
 * to declare. Tony confirmed the ITF Free Font Licence these ship under
 * permits self-hosting (the licensing question that gated #573 is closed --
 * do not re-litigate it here).
 *
 * font-display: BLOCK, not swap -- a deliberate change from the CDN links
 * this replaces, which used `display=swap`. That is a real tradeoff, not a
 * free upgrade: `block` gives the browser a short invisible-text window
 * (spec allows up to ~3s, though a same-origin cached file resolves far
 * faster in practice) before it will paint a fallback glyph, whereas `swap`
 * paints the fallback immediately and re-flows the line when the real font
 * lands. We are choosing the invisible-text window on purpose. These fonts
 * are now same-origin and cache forever (served from /assets, immutable
 * bytes keyed by filename), so that window is negligible after the first
 * load and near-zero on every load after. `swap`'s fallback-then-reflow is
 * exactly the visual drift the docs-shot capture gate (tests/docsShots.unit.js)
 * exists to catch, and matches the choice assets/docs/fonts.css already made
 * for the /docs* pages -- both families of pages now make the same call for
 * the same reason.
 *
 * THE src URLs ARE RELATIVE TO THIS STYLESHEET, not absolute. assets/docs/fonts.css
 * uses absolute `/assets/fonts/...` and is right to, because every page that
 * links it is served over HTTP from the app root. This file is not in that
 * position: docs/wireframes/deal-inbox.html is NOT served by any route --
 * server.js allowlists five explicit /docs/* pages and none of them is the
 * wireframes directory, and vercel.json's includeFiles ships root *.html and
 * assets/** but not docs/** -- so that page is only ever opened off disk. An
 * absolute /assets/... URL resolves to the filesystem root there and silently
 * loads nothing, which is how the page would end up in a fallback face while
 * every test still passed. A URL relative to the stylesheet resolves correctly
 * in BOTH positions: /assets/fonts/... when served, <repo>/assets/fonts/...
 * when opened locally. Keep them relative; do not "tidy" them to absolute to
 * match the docs stylesheet.
 *
 * NO BUILD STEP. express.static mounts assets/ at /assets (server.js), and
 * vercel.json's `functions.api/index.js.includeFiles` glob already includes
 * `assets/**`, so these woff2 files ship to Vercel exactly like every other
 * file already in assets/docs/ -- nothing new to wire up there.
 */

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: block;
  src: url('fonts/jetbrains-mono-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: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: block;
  src: url('fonts/jetbrains-mono-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: 'Cabinet Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: block;
  src: url('fonts/cabinet-grotesk-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Cabinet Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url('fonts/cabinet-grotesk-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Satoshi';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('fonts/satoshi-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Satoshi';
  font-style: normal;
  font-weight: 500;
  font-display: block;
  src: url('fonts/satoshi-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Satoshi';
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url('fonts/satoshi-700.woff2') format('woff2');
}
