/*
 * Franie — static weights. The variable build (FranieVF) does not expose its
 * weight axis in browsers, so we self-host the two weights the design uses:
 * Regular (400) for body/light headings and SemiBold (600) for headings,
 * navigation and buttons. URLs are relative to this file; the SemiBold woff2 is
 * preloaded (see AssetServiceProvider).
 *
 * Two faces really is the whole set, despite what the design file appears to
 * say. Franie-Regular.woff carries `OS/2.usWeightClass: 500`, and Figma's REST
 * API copies that number straight into `style.fontWeight` — so every Regular
 * run in the design reads back as "500" and looks like a Medium that we are
 * missing. It is not: the face's typographic subfamily is "Regular" and its
 * postScriptName is "Franie-Regular". A full dump of the thirteen Corporate
 * screens contains exactly two `fontPostScriptName` values, Franie-Regular and
 * Franie-SemiBold; the string "Medium" appears nowhere in it.
 *
 * Declaring this file at 400 is therefore the correct mapping, not a
 * substitution — `font-weight: 400` in the theme asks for the very face the
 * design draws with. (tools/figma-spec.cjs resolves the weight from
 * fontPostScriptName for the same reason, so a sweep no longer reports 400 in
 * the DOM against a phantom 500 in the design.)
 */
@font-face {
	font-family: Franie;
	src:
		url(./Franie-Regular.woff2) format("woff2"),
		url(./Franie-Regular.woff) format("woff");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: Franie;
	src:
		url(./Franie-SemiBold.woff2) format("woff2"),
		url(./Franie-SemiBold.woff) format("woff");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

/*
 * Metric-matched fallback, so the page does not reflow when Franie arrives.
 *
 * Franie is 25.7% wider than Arial at the same size (measured on a mixed sample
 * of the strings this site actually renders). With `font-display: swap` that is
 * not a cosmetic difference: the breadcrumb row of an article hero fits on one
 * line in the fallback and two in Franie, so the whole hero moves down when the
 * font loads. Lighthouse scored the article screen at CLS 0.125 against a 0.1
 * threshold for exactly that, while every other screen stayed under 0.034 —
 * they simply had no line whose count flipped.
 *
 * size-adjust makes the fallback occupy Franie's width; the three vertical
 * overrides are Franie's own hhea metrics (1000 / −200 / 200 per 1000 upm)
 * divided by that same factor, because an override is a share of the adjusted em.
 * The result is a fallback that lays out where Franie will, so the swap changes
 * the shapes and nothing else.
 *
 * One face, not two. A weight-600 face would need a reliable local("Arial Bold")
 * and gets 120.8% rather than 125.7%; letting the browser synthesise bold off
 * this one costs about 4% of width on headings and needs no name lookup that
 * differs per platform.
 *
 * Where the descriptors are not supported — Safari before 17 — the face still
 * resolves to Arial and the page behaves exactly as it did before this block
 * existed. Nothing to fall back from.
 */
@font-face {
	font-family: "Franie Fallback";
	src:
		local("Arial"),
		local("Helvetica Neue"),
		local("Liberation Sans");
	size-adjust: 125.7%;
	ascent-override: 79.55%;
	descent-override: 15.91%;
	line-gap-override: 15.91%;
}
