/* ==========================================================================
   Daftar — typography

   Four families, which breaks the usual two-family rule for a stated reason:
   the product is trilingual by design, and each writing system needs a face
   drawn for it. Latin set in a Nastaliq-adjacent face looks fake; Urdu set
   in a Naskh face reads as Arabic, not Urdu.

     Fraunces               display Latin  — variable, has real character
     Inter                  UI / body Latin
     Noto Nastaliq Urdu     Urdu           — the correct calligraphic style
     Tiro Devanagari Hindi  Hindi          — calligraphic, pairs with a serif
   ========================================================================== */

:root {
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif;
  --font-hindi: "Tiro Devanagari Hindi", "Nirmala UI", serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
}

/* --font-body-local is set by js/i18n/core.js to a stack that actually
   contains the active language's script. It falls back to the Latin stack
   before the i18n layer has run, so there is no flash of tofu. */
body {
  font-family: var(--font-body-local, var(--font-body));
  font-size: var(--text-base);
  line-height: 1.6;
  font-feature-settings: "cv05" 1, "cv11" 1;
}

/* Indic scripts carry taller ascenders and deeper matras than Latin; at the
   same line-height they read cramped. */
:root:not([lang="en"]) body { line-height: 1.75; }

/* --- Display -------------------------------------------------------------
   WONK on, SOFT low: the flared, slightly odd cut. This is what stops the
   page reading as another Playfair template. */
.display {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 20, "WONK" 1, "opsz" 90;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 20, "WONK" 1, "opsz" 48;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  text-wrap: balance;
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }

/* --- Script-specific -----------------------------------------------------
   Nastaliq has an enormous vertical envelope — descenders sweep far below
   the baseline. It needs roughly double the line-height of Latin or the
   glyphs collide with whatever sits under them. */
[lang="ur"],
.ur {
  font-family: var(--font-urdu);
  direction: rtl;
  unicode-bidi: isolate;
  line-height: 2.1;
  font-weight: 500;
}

[lang="hi"],
.hi {
  font-family: var(--font-hindi);
  line-height: 1.7;
}

/* --- Editorial utilities ------------------------------------------------- */

/* Small tracked caps. Used for section eyebrows and the "THE OFFICE" line. */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.lede {
  font-size: var(--text-lg);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: var(--measure);
  text-wrap: pretty;
}

/* Ledger figures must align in a column, so tabular + a display face. */
.figure {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 20, "WONK" 0, "opsz" 60;
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.tnum { font-variant-numeric: tabular-nums lining-nums; }

.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
