/* Jost, self-hosted. THE ONE PLACE THE TYPEFACE IS DEFINED.
 *
 * It used to be three places that did not agree: templates/portal/login.html
 * pulled Jost from Google, templates/portal/base.html set a system stack, and
 * proq/static/proq/admin.css set Century Gothic on the brand text. Three
 * answers to one question is how a site ends up looking almost consistent.
 * Everything now reads --pq-font-sans from here.
 *
 * WHY SELF-HOSTED AND NOT GOOGLE. Site-wide, the Google link costs a
 * third-party round trip before any text can render — DNS, TLS and a
 * render-blocking stylesheet on fonts.googleapis.com, and only then the font
 * itself from a second host, fonts.gstatic.com. That is two extra connections
 * on every cold page load, for crew opening a shift on a phone in a van with
 * one bar. It also sends their IP address to Google on every page view, for a
 * file we are allowed to serve ourselves.
 *
 * ONE VARIABLE FILE, NOT FIVE STATIC FACES. It carries the whole 100-900 axis
 * in 26,576 bytes, against 51,380 for the five instances it replaced — half
 * the bytes and, more to the point on a phone with one bar, four fewer
 * requests on a cold load.
 *
 * EVERY WEIGHT IS REAL, INCLUDING THE TWO THAT WERE NOT. 800 matters because
 * templates/portal/base.html sets font-weight:800 eight times and 700 eleven
 * times, on the report time and the job number — text crew read at arm's
 * length in a van — and a browser asked for an 800 it does not have fakes it
 * by smearing the bold. 300 matters because Django's own admin CSS asks for it
 * on h1, #site-name and #user-tools; with only five static faces it fell back
 * to 400 and rendered heavier than Django drew it. The axis answers both, and
 * anything between.
 *
 * IT IS THE SAME FILE GOOGLE WAS ALREADY SERVING. The old link fetched
 * 92zatBhPNqw73oTd4g.woff2 from fonts.gstatic.com, and requesting wght@100..900
 * returns that identical URL — Google never clamped it to the four weights the
 * CSS asked for. Verified before adopting it, because a clamped 400-700
 * instance would have given us neither 300 nor 800 and looked fine.
 *
 * LATIN ONLY, deliberately. Google also serves latin-ext and cyrillic subsets
 * of this face; nothing here is written in either, and employee names are now
 * restricted to English letters (employees/name_rules). Adding them would
 * multiply the download for glyphs no screen in this application can produce.
 *
 * THE URLS BELOW ARE RELATIVE ON PURPOSE. ManifestStaticFilesStorage rewrites
 * the references inside CSS to the hashed filename at collectstatic time, and
 * resolves them against this file's own location. A leading-slash or {% static %}
 * URL would not be rewritten and would 404 against the hashed name in
 * production. Verified with a real collectstatic run, not just DEBUG.
 *
 * EMAIL IS NOT INCLUDED AND MUST NOT BE. templates/emails/* stay on Arial.
 * Mail clients either strip @font-face outright (Gmail, Outlook desktop) or
 * download nothing, so a webfont there buys a fallback flash at best and a
 * broken stack at worst. The inconsistency between the app and the mail is
 * deliberate — please do not "fix" it. */

@font-face {
    font-family: 'Jost';
    font-style: normal;

    /* THE RANGE, NOT A VALUE, AND THIS IS THE WHOLE POINT OF THE FILE.
     *
     * `font-weight: 100 900` tells the browser this one face answers every
     * weight in that span. Declare a variable font as `font-weight: 400` and
     * the browser takes it as a single 400 instance and SYNTHESISES the rest —
     * which is precisely the defect this replaced five static faces to remove,
     * only now with a smaller download and no way to notice.
     *
     * A weight audit does not necessarily catch that on its own: asked "is
     * there a face for 700", both answer yes. The distinguishing question is
     * whether the weights RENDER differently, which is why the check that
     * signed this off measured rendered text widths at every 100 step rather
     * than asking whether a face was found. All nine were distinct and
     * monotonic: 447.69, 456.00, 464.39, 475.53, 496.84, 512.14, 528.72,
     * 544.72, 561.09 at 64px. */
    font-weight: 100 900;

    font-display: swap;
    src: url("fonts/jost-v20-latin-variable.928f4210aa48.woff2") format('woff2');
}

:root {
    /* THE STACK, and the fallbacks are a real one rather than a bare
       sans-serif. font-display:swap means the fallback is what renders for the
       first moment of every cold load, so it has to be a face that already
       looks like the page rather than whatever the browser defaults to. */
    --pq-font-sans: 'Jost', ui-sans-serif, system-ui, -apple-system,
                    BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
                    sans-serif;
}
