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

* {
  margin: 0;
}

html {
  scroll-padding-top: 5rem; /* keep anchored content clear of the sticky header */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--color-ivory);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: var(--leading-heading);
  letter-spacing: -0.005em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

em,
i {
  font-style: italic;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

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

::selection {
  background: color-mix(in srgb, var(--color-ochre) 35%, transparent);
}

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

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 20;
  padding: var(--space-2) var(--space-4);
  background: var(--color-paper);
  border-radius: var(--radius);
  transform: translateY(-200%);

  &:focus {
    transform: none;
  }
}

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