/* Reset, typography, focus and motion defaults. Depends on tokens.css. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Keep focused/anchored targets clear of the sticky header (WCAG 2.2 SC 2.4.11). The header
     is ~4rem tall on desktop and taller when the small-screen menu wraps. */
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  color: var(--text-strong);
  line-height: var(--lh-tight);
  margin: 0 0 var(--s-4);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  letter-spacing: -0.015em;
}

h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  line-height: 1.25;
}

p,
ul,
ol,
dl {
  margin: 0 0 var(--s-4);
}

p {
  max-width: 68ch;
}

a {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--teal-deep);
  text-decoration-thickness: 2px;
}

strong {
  color: var(--text-strong);
}

img,
svg {
  max-width: 100%;
}

/* Focus: always visible, never removed. */
:focus-visible {
  outline: 3px solid var(--focus-light);
  outline-offset: 2px;
}

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

main:focus {
  outline: none;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

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