/* ---------------------------------------------------------------------------
   Fonts used on habitpause.com. Every family here is licensed under the
   SIL Open Font License 1.1; the full licence text ships beside the font.

   Cinzel              fonts/OFL-cinzel.txt              github.com/google/fonts/tree/main/ofl/cinzel
   Plus Jakarta Sans   fonts/OFL-plusjakartasans.txt     github.com/google/fonts/tree/main/ofl/plusjakartasans
   Noto Naskh Arabic   fonts/OFL-notonaskharabic.txt     github.com/google/fonts/tree/main/ofl/notonaskharabic
   Noto Nastaliq Urdu  fonts/OFL-notonastaliqurdu.txt    github.com/google/fonts/tree/main/ofl/notonastaliqurdu
   Noto Sans Devanagari fonts/OFL-notosansdevanagari.txt github.com/google/fonts/tree/main/ofl/notosansdevanagari
   Noto Sans Tamil     fonts/OFL-notosanstamil.txt       github.com/google/fonts/tree/main/ofl/notosanstamil

   Legacy faces, still served to archived guide pages and games/:
   Bricolage Grotesque fonts/OFL-bricolagegrotesque.txt   github.com/google/fonts/tree/main/ofl/bricolagegrotesque
   Figtree             fonts/OFL-figtree.txt             github.com/google/fonts/tree/main/ofl/figtree
   JetBrains Mono      fonts/OFL-jetbrainsmono.txt       github.com/google/fonts/tree/main/ofl/jetbrainsmono
   --------------------------------------------------------------------------- */

/* Sitewide typography tokens — Cinzel + Plus Jakarta Sans.
   Loaded after each page's own CSS so it wins the cascade for shared elements.
   Page-specific layout rules stay in the page; this file only sets type. */

/* Metric-matched fallbacks so the swap to the web fonts does not shift layout. */
@font-face {
  font-family: 'Cinzel Fallback';
  src: local('Georgia'), local('Times New Roman'), local('Times');
  size-adjust: 112%;
  ascent-override: 92%;
  descent-override: 22%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Jakarta Fallback';
  src: local('Helvetica Neue'), local('Helvetica'), local('Arial');
  size-adjust: 105%;
  ascent-override: 96%;
  descent-override: 24%;
  line-gap-override: 0%;
}

:root {
  --f-display: 'Cinzel', 'Trajan Pro', 'Cinzel Fallback', Georgia, 'Times New Roman', serif;
  --f-body: 'Plus Jakarta Sans', 'Jakarta Fallback', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-label: 'Plus Jakarta Sans', 'Jakarta Fallback', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-code: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --f-arabic: 'Noto Naskh Arabic', 'Segoe UI', system-ui, sans-serif;
  --f-urdu: 'Noto Nastaliq Urdu', 'Noto Naskh Arabic', 'Segoe UI', system-ui, sans-serif;
  --f-hindi: 'Noto Sans Devanagari', 'Nirmala UI', system-ui, sans-serif;
  --f-tamil: 'Noto Sans Tamil', 'Latha', system-ui, sans-serif;

  /* App type scale (sp → rem) */
  --t-display-xl: clamp(2.5rem, 6vw, 4.5rem);
  --t-h1: clamp(2rem, 4vw, 3rem);
  --t-h2: clamp(1.625rem, 3vw, 2.25rem);
  --t-h3: clamp(1.375rem, 2.2vw, 1.625rem);
  --t-title-lg: 1.25rem;
  --t-title-md: 1rem;
  --t-title-sm: 0.875rem;
  --t-body-lg: 1.0625rem;
  --t-body-md: 1rem;
  --t-body-sm: 0.875rem;
  --t-label-lg: 0.9375rem;
  --t-label-md: 0.8125rem;
  --t-label-sm: 0.75rem;
}

body {
  font-family: var(--f-body);
  font-feature-settings: 'kern' 1, 'liga' 1;
  letter-spacing: 0.2px;
}

/* Cinzel is display-only: headings, never UI copy. */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3 {
  font-family: var(--f-display);
  font-weight: 700;
  font-style: normal;
  text-transform: none;
  font-feature-settings: 'kern' 1, 'liga' 1;
  text-wrap: balance;
}
h1 { font-size: var(--t-h1); line-height: 1.25; letter-spacing: 0.5px; }
h2 { font-size: var(--t-h2); line-height: 1.28; letter-spacing: 0.4px; }
h3 { font-size: var(--t-h3); line-height: 1.33; letter-spacing: 0.3px; }

p, li, dd, figcaption { text-wrap: pretty; }
p, li { max-width: 75ch; }

/* Labels, eyebrows, nav, buttons and small caps all use Jakarta. */
.mono, .eyebrow, .label, nav, .nav, button, .btn, input, select, textarea,
th, .toc b, .site-foot, footer {
  font-family: var(--f-label);
}
.mono, .eyebrow {
  font-family: var(--f-label);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.mono, .eyebrow { font-size: var(--t-label-sm); }

/* Numbers that should not dance: times, counters, prices. */
.tn, .num, time, [data-count] { font-variant-numeric: tabular-nums; }

/* Non-Latin scripts — only applied once a page opts in, so English pages never
   pay for the Noto files. */
[data-scripts="on"] [lang="ar"] { font-family: var(--f-arabic); }
[data-scripts="on"] [lang="ur"] { font-family: var(--f-urdu); }
[data-scripts="on"] [lang="hi"] { font-family: var(--f-hindi); }
[data-scripts="on"] [lang="ta"] { font-family: var(--f-tamil); }

/* RTL: keep numerals and Latin product names in the right order. */
[dir="rtl"] .bdi, [dir="rtl"] bdi { unicode-bidi: isolate; }

/* Code samples stay monospaced even though labels moved to Jakarta. */
code, kbd, samp, pre, .ph { font-family: var(--f-code); font-variant-ligatures: none; }
