/*
 * base.css: reset, self-hosted fonts and element defaults.
 * Fonts: Newsreader (serif, swap) and Manrope (sans, optional), latin subsets
 * of the variable woff2 files from @fontsource-variable 5.3.0 (SIL OFL 1.1),
 * committed under /assets/fonts/. The two "Fallback" faces are metric-matched
 * to Georgia / Arial (values from @capsizecss/core createFontStack) so the
 * swap from fallback to web font does not shift the layout.
 */

@font-face {
  font-family: 'Newsreader Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('/assets/fonts/newsreader-latin-wght-normal.woff2') format('woff2-variations');
  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: 'Newsreader Variable';
  font-style: italic;
  font-display: swap;
  font-weight: 200 800;
  src: url('/assets/fonts/newsreader-latin-wght-italic.woff2') format('woff2-variations');
  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: 'Manrope Variable';
  font-style: normal;
  font-display: optional;
  font-weight: 200 800;
  src: url('/assets/fonts/manrope-latin-wght-normal.woff2') format('woff2-variations');
  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: 'Newsreader Fallback';
  src: local('Georgia');
  ascent-override: 76.4676%;
  descent-override: 27.5699%;
  size-adjust: 96.1192%;
}

@font-face {
  font-family: 'Manrope Fallback';
  src: local('Arial'), local('ArialMT');
  ascent-override: 103.3095%;
  descent-override: 29.074%;
  line-gap-override: 0%;
  size-adjust: 103.1851%;
}

/* ── Reset ────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  min-height: 100vh;
  background: var(--bone);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-weight: 200;
  font-size: 16px;
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

iframe {
  max-width: 100%;
  border: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 200;
  color: var(--ink);
  overflow-wrap: break-word;
}

p,
li,
figcaption,
dd,
dt {
  overflow-wrap: break-word;
}

em {
  font-style: italic;
}

strong {
  font-weight: 500;
}

a {
  color: var(--sage);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color var(--dur-press) var(--ease);
}

a:hover {
  color: var(--text-dark);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
}

a,
button,
summary,
label[for],
[role="button"] {
  cursor: pointer;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--moss);
  color: var(--ink);
}

/* Dark sections invert the defaults. */
[data-bg="ink"],
[data-bg="ink-mid"] {
  color: var(--bone);
}

[data-bg="ink"] h1,
[data-bg="ink"] h2,
[data-bg="ink"] h3,
[data-bg="ink-mid"] h1,
[data-bg="ink-mid"] h2,
[data-bg="ink-mid"] h3 {
  color: var(--white);
}

[data-bg="ink"] a,
[data-bg="ink-mid"] a {
  color: var(--moss);
}

[data-bg="ink"] a:hover,
[data-bg="ink-mid"] a:hover {
  color: var(--white);
}

[data-bg="ink"] ::selection,
[data-bg="ink-mid"] ::selection {
  background: var(--moss);
  color: var(--ink);
}
