/** Element defaults; component presentation is defined in components/. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 2rem;
}

body {
  margin: 0;
  color: var(--color-text);
  background: var(--color-paper);
  font-family: var(--font-body);
  font-size: var(--font-body-size);
  line-height: 1.6;
}

h1,
h2,
h3 {
  margin-block: 0 1.25rem;
  font-weight: 500;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

h1 {
  font-size: var(--font-display);
  letter-spacing: var(--tracking-open);
}

h2 {
  font-size: var(--font-heading);
}

h3 {
  font-size: clamp(1.4rem, 2.083vw, 2.5rem);
}

p {
  margin-block: 0 1.25em;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Keep underlines for links within running text. */
:where(p, figcaption, dd, .prose :is(li, td, th)) a:not(:where(.button-link)):is(:hover, :focus-visible) {
  text-decoration-line: underline;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 3px solid var(--color-ink);
  outline-offset: 5px;
}

.surface--dark :focus-visible {
  outline-color: var(--color-paper);
}

img,
video,
svg {
  max-inline-size: 100%;
  block-size: auto;
}

img,
video {
  display: block;
}

figure,
blockquote {
  margin: 0;
}

figcaption {
  margin-block-start: 0.75rem;
  font-size: var(--font-small);
  line-height: 1.4;
}

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

[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    animation-duration: 0.01ms;
    transition-duration: 0.01ms;
  }
}
