/* Page-level layout: reset, base type, container, section rhythm, focus.
   Breakpoints used across the site: 600px (tablet), 1024px (desktop). */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem; /* clears the sticky header */
}

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

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

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: var(--display-stretch);
  font-weight: 800;
  line-height: 1.1;
  color: var(--spruce);
  text-wrap: balance;
}

p,
dl,
dd {
  margin: 0;
}

a {
  color: inherit;
}

/* Container with a side gutter of at least 16px that also clears notches. */
.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(16px, 4vw, env(safe-area-inset-left, 0px));
  padding-right: max(16px, 4vw, env(safe-area-inset-right, 0px));
}

/* Focus: a volt ring with an ink outline so it shows on paper and on spruce. */
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--volt);
}

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -100px;
  z-index: 20;
  padding: var(--space-2) var(--space-3);
  background: var(--volt);
  color: var(--ink);
  font-weight: 600;
  border-radius: var(--radius);
}

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

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

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
