/*
 * Self-hosted faces for the font-family tokens.
 *
 * Linked from BOTH .storybook/preview-head.html (the story/docs iframe) and
 * .storybook/manager-head.html (the sidebar and toolbar chrome). Storybook
 * builds those two as separate documents with separate stylesheets, and the
 * manager can only take CSS by URL — so this lives in public/ (served at
 * /fonts/ via `staticDirs` in .storybook/main.ts) and one file serves both
 * rather than the @font-face block being written twice.
 *
 * Before this, `--font-family-sans` and friends named faces nothing loaded:
 * they rendered on a machine with the desktop fonts installed and fell back to
 * Helvetica everywhere else, including the deployed build.
 *
 * Files are the vendors' own webfont kits, filenames as shipped so provenance
 * stays legible (only Monaspace loses its spaces, which have no business in a
 * URL). woff2 only — every browser this system targets supports it, and the
 * kits' .woff twins would double the payload for no reach.
 */

/* ─── PP Neue Montreal — `--font-family-sans` ─────────────────── */

/*
 * The family has no Bold: it runs Hairline, Light, Book, Regular, Medium,
 * Semibold, Extrabold, Black. `--font-weight-bold` (700) is served by Semibold
 * rather than Extrabold, so bold text sits beside a semibold heading instead of
 * a step above it — left to the browser, a request for 700 would snap up to 800.
 * `--font-weight-extralight` (200) likewise has no face of its own; Hairline is
 * the lightest cut the family ships.
 */

@font-face {
  font-family: 'PP Neue Montreal';
  src: url('/fonts/PPNeueMontreal-Hairline.woff2') format('woff2');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Neue Montreal';
  src: url('/fonts/PPNeueMontreal-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Neue Montreal';
  src: url('/fonts/PPNeueMontreal-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Neue Montreal';
  src: url('/fonts/PPNeueMontreal-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Neue Montreal';
  src: url('/fonts/PPNeueMontreal-Semibold.woff2') format('woff2');
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Neue Montreal';
  src: url('/fonts/PPNeueMontreal-Extrabold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Neue Montreal';
  src: url('/fonts/PPNeueMontreal-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'PP Neue Montreal';
  src: url('/fonts/PPNeueMontreal-SemiboldItalic.woff2') format('woff2');
  font-weight: 600 700;
  font-style: italic;
  font-display: swap;
}

/* ─── PP Editorial Old — `--font-family-serif` ────────────────── */

@font-face {
  font-family: 'PP Editorial Old';
  src: url('/fonts/PPEditorialOld-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Editorial Old';
  src: url('/fonts/PPEditorialOld-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ─── PP Museum — `--font-family-hybrid` ──────────────────────── */

@font-face {
  font-family: 'PP Museum';
  src: url('/fonts/PPMuseum-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Museum';
  src: url('/fonts/PPMuseum-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ─── PP NeueBit — `--font-family-pixel` ──────────────────────── */

@font-face {
  font-family: 'PP NeueBit';
  src: url('/fonts/PPNeueBit-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP NeueBit';
  src: url('/fonts/PPNeueBit-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ─── Monaspace Neon — `--font-family-mono` ───────────────────── */

/*
 * One variable file for the whole family (wght 200-800, plus wdth and slnt axes
 * nothing here drives), which is why it outweighs any single static face and
 * still costs less than the seven it replaces. The weight range matters: the
 * file's own default instance is ExtraLight, so without it every code chip on
 * the site would render at 200.
 *
 * The face's internal name is "Monaspace Neon Var"; `font-family` below is what
 * the cascade matches, so `--font-family-mono` naming "Monaspace Neon" resolves.
 */

@font-face {
  font-family: 'Monaspace Neon';
  /* Two sources, one file. `woff2-variations` is the legacy keyword some
     engines still match on; per the @font-face spec a UA must skip a source
     whose format() it does not recognise, and with only that one entry the
     face would silently never load — every code chip falling back to
     ui-monospace. A plain woff2 container is valid for a variable font, so
     the second entry is the one that always resolves. */
  src:
    url('/fonts/MonaspaceNeonVar.woff2') format('woff2-variations'),
    url('/fonts/MonaspaceNeonVar.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
