/* ==========================================================================
   BASE
   Element defaults only. Everything with a class lives in components.css
   or sections.css.
   ========================================================================== */

/* clip rather than hidden: it stops a stray transform from ever producing a
   sideways scrollbar, without turning the element into a scroll container,
   which would break every position: sticky on the page. */
html { overflow-x: clip; }

body {
  overflow-x: clip;
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 300;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  line-height: 1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { text-wrap: pretty; }

/* Focus is never removed, only replaced. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* Anchored headings clear the fixed header when linked to directly. */
[id] { scroll-margin-top: calc(var(--header-h) + 2rem); }
