/* =============================================================================
   Typography — self-hosted Inter (UI) + Source Serif 4 (public article text).
   Files restored by LibMan (unpkg @fontsource) — no CDN at runtime. font-display: optional (with the Inter weights
   preloaded in _Head): the page paints in the web font when it is ready, and never swaps fonts in front of the reader.
   ============================================================================= */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: optional; src: url("../lib/inter/files/inter-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: optional; src: url("../lib/inter/files/inter-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: optional; src: url("../lib/inter/files/inter-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: optional; src: url("../lib/inter/files/inter-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400; font-display: optional; src: url("../lib/source-serif-4/files/source-serif-4-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 400; font-display: optional; src: url("../lib/source-serif-4/files/source-serif-4-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: optional; src: url("../lib/source-serif-4/files/source-serif-4-latin-600-normal.woff2") format("woff2"); }

:root {
  --bs-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-font-family: var(--bs-font-sans-serif);
  /* Cambria first: Windows ships it hinted for ClearType, so body text stays sharp at 125 % and 150 % display scaling,
     where the web font's strokes fall between pixels and read soft. Elsewhere (macOS, iOS, Android) Source Serif 4. */
  --jms-font-serif: Cambria, "Source Serif 4", Georgia, "Times New Roman", serif;
  --jms-font-mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;
  --bs-font-monospace: var(--jms-font-mono);
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.5;
}

/* No font-smoothing override: forcing greyscale antialiasing thins and softens text. */
html { font-size: 16px; text-rendering: optimizeLegibility; }
body { font-feature-settings: "cv11", "ss01"; }
/* Those are Inter's alternates; the serif keeps its own glyphs. */
:is(h1, h2, .h1, .h2, .text-page-title, .text-section-title, .prose-article, .article-title, .article-abstract, .toc-title, .article-highlights__body) { font-feature-settings: normal; }

/* ---- Headings: a classic academic voice — page and section headings are set in the serif, the interface in Inter ---- */
h1, .h1 { font-family: var(--jms-font-serif); font-size: 1.5rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
h2, .h2 { font-family: var(--jms-font-serif); font-size: 1.25rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; }
h3, .h3 { font-size: 1.0625rem; font-weight: 600; line-height: 1.4; }
h4, .h4 { font-size: 1rem;     font-weight: 600; line-height: 1.4; }
h5, .h5, h6, .h6 { font-size: 0.875rem; font-weight: 600; line-height: 1.4; }
/* "pretty" only avoids a lone last word; "balance" split titles into even halves and left half the line empty. */
h1, h2, h3, h4, h5, h6 { text-wrap: pretty; color: var(--jms-heading); margin-bottom: 0.5rem; }

/* ---- Type roles ---- */
.text-page-title    { font-family: var(--jms-font-serif); font-size: 1.5rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; color: var(--jms-heading); }
.text-section-title { font-family: var(--jms-font-serif); font-size: 1.1875rem; font-weight: 600; line-height: 1.35; color: var(--jms-heading); }
.text-card-title    { font-family: var(--bs-font-sans-serif); font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: var(--jms-heading); }
.text-eyebrow       { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--jms-muted-fg); }
.text-meta          { font-size: 0.8125rem; line-height: 1.45; color: var(--jms-muted-fg); }
.text-label         { font-size: 0.875rem; font-weight: 500; color: var(--jms-heading); }
.text-help          { font-size: 0.8125rem; color: var(--jms-muted-fg); }
.text-caption       { font-size: 0.75rem; color: var(--jms-muted-fg); }
.text-code          { font-family: var(--jms-font-mono); font-size: 0.8125rem; }
.tabular            { font-variant-numeric: tabular-nums; }

/* ---- Public article reading surface (serif) ---- */
.prose-article { font-family: var(--jms-font-serif); font-size: 1.0625rem; line-height: 1.75; color: var(--jms-text); max-width: 70ch; }
.prose-article p { margin-bottom: 1.1em; }
.article-title   { font-family: var(--jms-font-serif); font-size: clamp(1.375rem, 1.25rem + 0.5vw, 1.625rem); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; color: var(--jms-heading); }
.article-abstract { font-family: var(--jms-font-serif); font-size: 1.0625rem; line-height: 1.7; }
.toc-title { font-family: var(--jms-font-serif); font-size: 1.0625rem; font-weight: 600; line-height: 1.35; }
