html {
  scroll-behavior: smooth;
}

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

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
}

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

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

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

::selection {
  background: var(--color-white);
  color: var(--color-black);
}

/* Any element focused via keyboard gets a visible ring; mouse focus stays quiet */
:focus {
  outline: none;
}

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

.section--dark :focus-visible {
  outline-color: var(--color-focus-ring-inverse);
}

/* Section headings become programmatic focus targets after a nav jump;
   they shouldn't show a focus ring themselves since the jump is visual enough */
[data-section-target]:focus-visible {
  outline: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-2);
  z-index: 1000;
  background: var(--color-black);
  color: var(--color-white);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: 4px;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-2);
}
