/* =============================================================================
 * base.css
 * Reset, typography defaults, element styling. Loaded after tokens.css.
 * ========================================================================== */

/* Font face ----------------------------------------------------------------- */
/* Source Serif 4 variable font, Latin subset. SIL Open Font License 1.1.
 * Self-hosted at /assets/fonts/source-serif-4-latin.woff2. The OFL.txt file
 * ships in the same directory to retain the copyright notice per clause 2.
 * A single variable font file serves both the 400 and 600 weights the site
 * uses; the font-weight range is declared below and the browser interpolates
 * along the weight axis. */

@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  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;
}

/* Reset --------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body,
h1, h2, h3, h4, h5, h6,
p, blockquote, figure, ul, ol, dl, dd {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

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

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

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

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-inline-size: 0;
}

/* Base typography ----------------------------------------------------------- */

body {
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--c31-ink);
  background: var(--c31-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 600;
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-display);
  color: var(--c31-navy);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: 1.0625rem; }

p {
  max-width: var(--measure-reading);
}

p + p {
  margin-top: var(--sp-4);
}

.lede {
  font-size: var(--fs-lede);
  color: var(--c31-ink);
  max-width: var(--measure-reading);
}

/* Links --------------------------------------------------------------------- */

a {
  color: var(--c31-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-1) var(--ease-1);
}

a:hover {
  color: var(--c31-accent-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--c31-focus);
  outline-offset: 2px;
  border-radius: var(--radius-1);
}

/* Selection ----------------------------------------------------------------- */

::selection {
  background: var(--c31-accent);
  color: var(--c31-on-accent);
}

/* Skip link ----------------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--sp-4);
  background: var(--c31-invert-bg);
  color: var(--c31-invert-fg);
  padding: var(--sp-3) var(--sp-4);
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: var(--sp-4);
}

/* Horizontal rule ----------------------------------------------------------- */

hr {
  border: 0;
  border-top: var(--rule-weight) solid var(--c31-rule);
  margin: var(--sp-8) 0;
}

/* Code ---------------------------------------------------------------------- */

code, kbd, pre {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Source Code Pro", monospace;
  font-size: 0.875em;
}
