/*
 * VENDORED from packages/cc-ui/src/brand/fonts.css. Do not edit here.
 *
 * The gateway is a Python container with no npm and no cc-ui build, so it
 * cannot import the kit the way a generated app does -- same compromise as
 * tokens.css next door. tests/test_console_fonts.py is what stops this copy
 * becoming a second source of truth.
 *
 * ONE documented difference from the source, applied mechanically: the
 * `src: url()` paths are rewritten from `./fonts/` to `/static/fonts/`,
 * because the gateway serves these from a mounted StaticFiles route rather
 * than from a bundler that rewrites relative URLs. The drift test applies the
 * same substitution before comparing, so every OTHER change is caught.
 *
 * Re-copy with: python scripts/vendor-fonts-css.py
 */
/*
 * Pymble brand faces, self-hosted.
 *
 * GT Pressura for headings, Museo Sans for body. These are the College's real
 * marketing faces; until 2026-08-17 cc-ui shipped Inter and Libre Caslon Text
 * as open-licence stand-ins, which is why every app has been rendering in a
 * serif heading nobody chose.
 *
 * WHY SELF-HOSTED AND NOT A CDN. The gateway's sign-in page runs
 * `default-src 'none'` with `script-src 'self'` precisely so it trusts no
 * third-party origin (see intake.py). Separately, the College firewall blocks
 * jsdelivr -- that is still why CCSpinner's Lottie WASM fails to load. A font
 * on an external CDN would fail the same way, on the sign-in screen, which is
 * the first thing anyone sees.
 *
 * LICENCE POSTURE -- ACCEPTED, NOT RESOLVED. Read this before adding a face.
 *
 *   GT Pressura (Grilli Type). Clean. The College holds a webfont licence
 *   permitting self-hosting with no visitor cap, and clause 4.7 expressly
 *   permits subsetting the character set. That clause equally forbids altering
 *   the FONT NAME TABLES, which ordinary subsetting silently does -- see the
 *   subsetting note below, it is the whole reason this is not a one-liner.
 *
 *   Museo Sans (exljbris, via MyFonts). NOT clean, and shipped anyway by the
 *   College's decision on 2026-08-17. The licence held is the exljbris
 *   Standard License Agreement, a desktop agreement. Clause 4.b.IV permits
 *   `@font-face` embedding "ONLY for FREE fonts ($0.00 license fee)"; the web
 *   mechanisms it does allow are Flash, sIFR and Cufon. Clause 5 forbids
 *   creating derivative works from the font, which is what converting the
 *   .otf to .woff2 is. Clause 4.c forbids embedding into software products.
 *
 *   The reasoning accepted was that use is internal to the College with no
 *   third-party distribution. Note honestly that this addresses WHO SEES the
 *   fonts, not the clauses themselves: 4.b.IV restricts the @font-face
 *   mechanism and 5 restricts the conversion, and neither is scoped by
 *   audience. Do not write a doc implying the licence permits this. The
 *   accurate line is "shipped by decision, and here is what the decision was".
 *   Buying an exljbris webfont licence through MyFonts is what would actually
 *   resolve it.
 *
 * WHY woff2 ONLY, NO woff. Every browser the College runs has taken woff2
 * since 2016, and woff2 is roughly 30% smaller. The order folder carries both;
 * the .woff files are for IE11 and are not worth the bytes in the tarball.
 *
 * SUBSETTING. All four faces are subset to Latin-1 plus Latin Extended-A --
 * WIDER than the range the old Inter/Caslon files used, deliberately: student
 * and staff names carry macrons, carons and Polish/Czech diacritics that
 * U+0000-00FF does not cover, and an out-of-range letter renders in the
 * fallback face mid-word. The `unicode-range` on each face below matches what
 * was actually subset, so a character outside it falls back per-glyph rather
 * than rendering as tofu.
 *
 * REPRODUCING THESE FILES. `scripts/subset-brand-fonts.py`. It passes
 * `--name-IDs='*' --name-legacy --name-languages='*'` to fontTools, because
 * pyftsubset drops most name records BY DEFAULT and that would breach Grilli
 * Type clause 4.7. The script asserts the name table survived record-for-record
 * rather than trusting the flags. Sources are the licensed originals in
 * OneDrive, not anything checked in here.
 */

/*
 * GT PRESSURA -- headings.
 *
 * Regular and Bold only. The family also ships Light, Italics, and a full Mono
 * subfamily; nothing in cc-ui selects any of them, and an unrequested face is
 * pure payload. GT Pressura Mono is the obvious answer for `--app-font-mono`
 * (still a system stack in deriveTheme.ts) the day a component displays code or
 * fixed-width data -- the licensed files are in the same order folder.
 *
 * No italic. Worth stating because the MARKETING design system leans hard on a
 * Caslon italic as its signature device, but that is pymble-design-system with
 * its own assets. No cc-ui component has ever set an italic heading.
 */
@font-face {
  font-family: "GT Pressura";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/gt-pressura-latin-regular.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0100-017F, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "GT Pressura";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/gt-pressura-latin-bold.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0100-017F, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/*
 * MUSEO SANS -- body.
 *
 * THE WEIGHT NUMBERS DO NOT LINE UP, AND THAT IS DELIBERATE. Museo Sans
 * numbers its weights 100/300/500/700/900 -- there is no 400 and no 600. The
 * foundry's "500" is the book weight, so it is declared here as CSS
 * `font-weight: 400` and the 700 as 700. The FILES keep their foundry numbers
 * so provenance stays readable; the declarations do the mapping.
 *
 * CONSEQUENCE WORTH KNOWING. Inter was a VARIABLE font covering 100-900
 * continuously, so `font-weight: 650` (CCAppShell nav, CCBadge) rendered as a
 * true 650. Museo Sans is static, so 600 and 650 now both resolve upward to
 * the 700 face -- CSS matches toward heavier first above 500. Semibold and
 * bold are therefore the same weight on screen. If that flattening matters,
 * the fix is to add MuseoSans-300 for a lighter step rather than to invent a
 * synthetic weight, which the browser fakes by smearing outlines.
 */
@font-face {
  font-family: "Museo Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/museo-sans-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0100-017F, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Museo Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/museo-sans-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0100-017F, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/*
 * `font-display: swap` on every face: text paints immediately in the fallback
 * and re-renders when the brand face arrives. The alternative (`block`) leaves
 * the first paint invisible for up to three seconds, which on the sign-in
 * screen means a blank card.
 *
 * The token defaults in deriveTheme.ts keep a full system stack behind each
 * family name, so an app that somehow does not load this stylesheet degrades
 * to a competent sans rather than to Times.
 */

/*
 * TYPOGRAPHY FLOOR. Declaring the faces is only half the job -- something has
 * to APPLY them, and until this block existed nothing did: the document body
 * had no font-family rule at all, so it computed to the UA default (Times New
 * Roman) while individual components that happened to set `--app-font-body`
 * themselves rendered in the brand face. Half a page in the brand face and half
 * in a browser serif is a worse outcome than neither.
 *
 * Element selectors, so specificity stays at the floor: an app or component
 * overrides these with any class-based rule, without needing `!important` or
 * a cascade-layer argument. This sets the default, it does not win.
 */
body {
  font-family: var(--app-font-body);
}

/*
 * Headings take the DISPLAY face everywhere, rather than each component having
 * to remember to ask for it -- which is the kind of thing that gets remembered
 * in nine components and forgotten in the tenth.
 */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--app-font-heading);
}

/*
 * THE UI HEADING RAMP -- 32/26/22/18/16/14px. The DEFAULT.
 *
 * Until now nothing sized a heading at all: h1-h6 fell through to the BROWSER's
 * defaults, which are `em`-based and compound inside `<section>` and `<article>`
 * -- the same `<h2>` rendered at a different size depending on how deeply it was
 * nested. That is why two apps could set the same markup and disagree.
 *
 * WHY THIS RAMP AND NOT THE COLLEGE'S 54px ONE. Because most headings in this
 * kit are app chrome, and chrome has to sit with its neighbours. The first
 * attempt shipped only the editorial scale here, which made every app's page
 * title 54px above a 22.4px app shell brand -- the page read upside down. These
 * sizes are chosen to land on the kit's existing heading tokens: h1 meets
 * `display-sm` (32px), h3 meets `heading-sm` (22.4px), h4 meets `body-xl` (18px).
 *
 * Element selectors, so this is the floor and not the ceiling: any component
 * class overrides it without `!important`. `.cc-signin-card__title`,
 * `.cc-app-shell__brand` and `.cc-modal__title` all keep their own sizes for
 * exactly that reason -- and `.cc-page-header__title` deliberately does NOT,
 * because a page title taking the h1 size is the whole point of having one.
 *
 * NO line-height in either ramp. The browser's `normal` is font-relative and
 * lands around 1.2 for these faces, which is serviceable; a display face at 54px
 * usually wants tighter leading, but picking a number is a design decision
 * rather than a size change, so it is not smuggled in here.
 */
h1 {
  font-size: var(--app-font-size-h1);
}
h2 {
  font-size: var(--app-font-size-h2);
}
h3 {
  font-size: var(--app-font-size-h3);
}
h4 {
  font-size: var(--app-font-size-h4);
}
h5 {
  font-size: var(--app-font-size-h5);
}
h6 {
  font-size: var(--app-font-size-h6);
}

/*
 * THE PROSE RAMP -- 54/40/30/24/18/14px, the College's editorial scale.
 *
 * OPT IN, never automatic. Wrap long-form content in `.cc-prose`: a report, a
 * policy page, a newsletter, rich text somebody wrote. Do not put it on an app
 * screen, which is what the UI ramp above is for.
 *
 *   <article class="cc-prose">
 *     <h1>Wellbeing policy</h1>
 *     ...
 *
 * `.cc-prose h1` is (0,1,1) against the bare `h1`'s (0,0,1), so it wins on
 * specificity without `!important` and without depending on source order.
 *
 * Deliberately NOT applied to CCRichText's editor content. That component sizes
 * its own h2 (`--app-font-size-subheading`) because an editor box is a small
 * viewport showing a fragment, not a page of prose. An app that wants the
 * editorial scale in its rendered output can wrap the OUTPUT in `.cc-prose`,
 * which is a different surface from the editing box.
 */
.cc-prose h1 {
  font-size: var(--app-font-size-prose-h1);
}
.cc-prose h2 {
  font-size: var(--app-font-size-prose-h2);
}
.cc-prose h3 {
  font-size: var(--app-font-size-prose-h3);
}
.cc-prose h4 {
  font-size: var(--app-font-size-prose-h4);
}
.cc-prose h5 {
  font-size: var(--app-font-size-prose-h5);
}
.cc-prose h6 {
  font-size: var(--app-font-size-prose-h6);
}
