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

html {
  scroll-behavior: smooth;

  /* stylelint-disable-next-line property-no-vendor-prefix -- Safari text autosizing. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-weight: 400;
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  padding-bottom: var(--consent-height, 0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

h1, h2, h3 {
  color: var(--color-heading);
}

h1 {
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  font-weight: 600;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h3 {
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.25;
}

/* Offset anchor jumps so targeted sections clear the sticky header */

section[id],
footer[id] {
  scroll-margin-top: calc(var(--site-top-height, 7.5rem) + var(--space-4));
}

@media (width >= 768px) {
  h3 {
    font-size: 1.35rem;
  }
}

@media (width >= 1024px) {
  h3 {
    font-size: 1.75rem;
  }
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  top: var(--space-2);
  left: var(--gutter-left);
  width: auto;
  height: auto;
  padding: var(--space-4);
  margin: 0;
  clip-path: none;
  background: var(--color-bg-alt);
  z-index: var(--z-dialog);
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
