/* Final Dark / Final Light typography, on every public page.
 *
 * Sora sets the headings, Manrope the running text and UI, JetBrains Mono the code. Every rule is
 * scoped to Final Dark / Final Light: html:not([data-theme="studio"]), plus html[data-final]
 * (Final Light outside the homepage is the Studio adapter + data-final, see final-theme.css). The
 * hidden Studio keeps Inter and the hidden premium themes keep Geist / Instrument Serif.
 * Type only — no colours, no geometry. Swapping a family is a one-line change to the tokens. */

:is(html:not([data-theme="studio"]), html[data-final]) {
  --ft-sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ft-display: 'Sora', 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ft-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --mono: var(--ft-mono);   /* coming-soon and aircode-connect read their code face from --mono */
}

/* Text: pages set Inter on body (inline styles) and on .font-sans (Tailwind); both are re-pointed,
   and everything else inherits. Manrope's 400 is a touch light on dark grounds, hence 450. */
:is(html:not([data-theme="studio"]), html[data-final]) :is(body, .font-sans) {
  font-family: var(--ft-sans);
}
:is(html:not([data-theme="studio"]), html[data-final]) body {
  font-weight: 450;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
}

/* Headings, plus the pages that had a Space Grotesk display face (.font-display). */
:is(html:not([data-theme="studio"]), html[data-final]) :is(h1, h2, h3, h4, .font-display) {
  font-family: var(--ft-display);
}
/* Sora is broad: a bold heading reads heavy, so headings settle at 600. No h1/h2 on the site asks
   for less (the legal pages ask for 700 through .lhero h1); an h3 only changes when it asks for bold. */
:is(html:not([data-theme="studio"]), html[data-final]) :is(h1, h2),
:is(html:not([data-theme="studio"]), html[data-final]) h3:is(.font-bold, .font-extrabold, .font-black) {
  font-weight: 600;
}
/* Default tracking only. :where() keeps it at element specificity, so a heading's own tracking-*
   class (or an uppercase eyebrow's tracking-wider) still wins. */
:where(html:not([data-theme="studio"]), html[data-final]) h1 { letter-spacing: -.03em; }
:where(html:not([data-theme="studio"]), html[data-final]) h2 { letter-spacing: -.025em; }
:where(html:not([data-theme="studio"]), html[data-final]) h3 { letter-spacing: -.015em; }
/* Big numerals and display lines outside headings (stat tiles): Manrope's figures run wider than
   Inter's, and "100%" in a phone-width 2-up grid spilled its cell. Zero specificity, so it only
   replaces inherited tracking; headings and any tracking-* class still win. */
:where(:is(html:not([data-theme="studio"]), html[data-final]) :is(.text-4xl, .text-5xl, .text-6xl, .text-7xl, .text-8xl)) { letter-spacing: -.02em; }
:is(html:not([data-theme="studio"]), html[data-final]) :is(h1, h2, h3) { text-wrap: balance; }
:is(html:not([data-theme="studio"]), html[data-final]) p { text-wrap: pretty; }

/* Code. Same specificity as the heading rule and later, so a mono heading stays mono. */
:is(html:not([data-theme="studio"]), html[data-final]) :is(code, pre, kbd, samp, .font-mono) {
  font-family: var(--ft-mono);
}
