/*
 * Self-hosted brand fonts (SIL Open Font License, see LICENSE-*.txt).
 * Fraunces: variable weight + optical size. DM Sans: variable weight.
 * Latin subset from Fontsource 5.3.0.
 *
 * The "Fallback" faces are system fonts resized to the brand fonts'
 * metrics (values from @capsizecss/metrics), so text keeps its size and
 * line breaks when the brand font arrives: no layout shift on swap.
 * Use: font-family: 'Fraunces', 'Fraunces Fallback', 'Fraunces Fallback Android', Georgia, serif;
 */

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

@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans-latin-var.woff2') format('woff2');
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

/* Fraunces → Georgia (Apple, Windows): regular and bold matched separately */
@font-face {
  font-family: 'Fraunces Fallback';
  src: local('Georgia');
  font-weight: 100 549;
  size-adjust: 105.20%; ascent-override: 92.96%; descent-override: 24.24%; line-gap-override: 0%;
}
@font-face {
  font-family: 'Fraunces Fallback';
  src: local('Georgia Bold'), local('Georgia-Bold');
  font-weight: 550 900;
  size-adjust: 96.42%; ascent-override: 101.43%; descent-override: 26.45%; line-gap-override: 0%;
}

/* Fraunces → Noto Serif (Android) */
@font-face {
  font-family: 'Fraunces Fallback Android';
  src: local('Noto Serif'), local('NotoSerif');
  font-weight: 100 549;
  size-adjust: 97.51%; ascent-override: 100.30%; descent-override: 26.15%; line-gap-override: 0%;
}
@font-face {
  font-family: 'Fraunces Fallback Android';
  src: local('Noto Serif Bold'), local('NotoSerif-Bold');
  font-weight: 550 900;
  size-adjust: 97.66%; ascent-override: 100.15%; descent-override: 26.11%; line-gap-override: 0%;
}

/* DM Sans → Arial (Apple, Windows) and Roboto (Android) */
@font-face {
  font-family: 'DM Sans Fallback';
  src: local('Arial'), local('ArialMT');
  size-adjust: 104.53%; ascent-override: 94.90%; descent-override: 29.66%; line-gap-override: 0%;
}
@font-face {
  font-family: 'DM Sans Fallback Android';
  src: local('Roboto');
  size-adjust: 104.76%; ascent-override: 94.69%; descent-override: 29.59%; line-gap-override: 0%;
}

:root {
  --font-display: 'Fraunces', 'Fraunces Fallback', 'Fraunces Fallback Android', Georgia, serif;
  --font-body: 'DM Sans', 'DM Sans Fallback', 'DM Sans Fallback Android', -apple-system, BlinkMacSystemFont, sans-serif;
}
