/*
 * Tarva typography — same-origin, self-hosted only.
 *
 * Primary ramp:
 *   Fraunces       site H1 and display stations only
 *   Instrument Sans body, subordinate headings, controls, and UI
 *   JetBrains Mono compact metadata, navigation numerals, and state
 *
 * Auxiliary faces ship with the approved system but never enter the default
 * ramp: Saira is wordmark-only; Inter requires an explicit opt-in ancestor.
 */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/Fraunces-latin-var-full-roman.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/Fraunces-latin-var-full-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
}

/* These static cuts replace the rejected latin-ext-only variable artifacts.
   Each cut contains all 95 Basic Latin printable code points. */
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/InstrumentSans-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/InstrumentSans-SemiBold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/InstrumentSans-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/JetBrainsMono-latin-var-roman.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: "Saira";
  src: url("/fonts/Saira-latin-var.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 50% 125%;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-latin-var-roman.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-latin-var-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --font-meta: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --font-wordmark: "Saira", "Instrument Sans", ui-sans-serif, sans-serif;
  --font-display-opt-in: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-display-tamed: "opsz" 60, "wght" 600, "SOFT" 0, "WONK" 0;
}

/* The extra html qualifier intentionally outranks the early scaffold fallback
   in site.css without widening this cohort into another file's ownership. */
html body {
  font-family: var(--font-body);
  font-synthesis: style;
}

html body :where(button, input, select, textarea) {
  font-family: var(--font-body);
}

html body .site-main h1,
html body .display-heading,
html body [data-type-role="display"] {
  font-family: var(--font-display);
  font-optical-sizing: none;
  font-variation-settings: var(--font-display-tamed);
  font-weight: 600;
  font-synthesis: none;
}

html body :where(
  .eyebrow,
  .meta,
  .metadata,
  .rail-main-number,
  .work-meta,
  .entry-stamp dt,
  [data-type-role="meta"]
) {
  font-family: var(--font-meta);
  font-feature-settings: "tnum" 1, "zero" 1;
}

/* Auxiliary family contracts. Neither selector matches the site by default. */
.serras-wordmark {
  font-family: var(--font-wordmark);
  font-stretch: 88%;
  font-variation-settings: "wght" 560, "wdth" 88;
  font-weight: 560;
}

[data-display-font="sans"] :where(.display-heading, [data-type-role="display"]) {
  font-family: var(--font-display-opt-in);
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 32, "wght" 600;
  font-weight: 600;
}
