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

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    margin: 0;
    background: var(--surface-page);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: var(--size-body);
    font-weight: var(--weight-light);
    line-height: var(--leading-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
    margin: 0;
  }

  h1, h2, h3, h4, h5, h6 {
    font-weight: var(--weight-medium);
    line-height: var(--leading-tight);
    text-wrap: balance;
  }

  h1 {
    font-size: var(--size-display);
    line-height: var(--leading-display);
  }
  h2 { font-size: var(--size-h2); }
  h3 { font-size: var(--size-h3); }
  h4 { font-size: var(--size-h4); }
  h5 { font-size: var(--size-h5); }
  h6 { font-size: var(--size-h6); }

  p { text-wrap: pretty; }

  ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
  }

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

  a {
    color: inherit;
    text-decoration-thickness: var(--hairline);
    text-underline-offset: var(--underline-offset);

    &:hover {
      color: var(--link-hover);
    }
  }

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

  /* The hero's one control is an anchor to the band below it. Already reset to
     `auto` by the reduced-motion block further down. */
  html { scroll-behavior: smooth; }

  :focus-visible {
    outline: var(--focus-width) solid var(--focus-color);
    outline-offset: var(--focus-offset);
  }

  :where(:focus:not(:focus-visible)) {
    outline: none;
  }

  ::selection {
    background: var(--color-primary);
    color: var(--text-on-dark);
  }

  @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;
    }
  }
}

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

  /* The skip link is the first thing a keyboard user reaches, and it was 1x1
     even while focused — so their first Tab landed on nothing visible. Any
     .visually-hidden element that can take focus now reveals itself. The
     honeypot is exempt: it is tabindex="-1" and never focusable. */
  .visually-hidden:focus-visible {
    position: fixed;
    inset-block-start: var(--space-3);
    inset-inline-start: var(--space-3);
    z-index: 100;
    width: auto;
    height: auto;
    margin: 0;
    padding: var(--space-3) var(--space-5);
    overflow: visible;
    clip-path: none;
    border-radius: var(--radius-pill);
    background: var(--color-black);
    color: var(--color-white);
    font-size: var(--size-body-sm);
    text-decoration: none;
  }

  .container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--gutter);
  }

  .measure { max-width: var(--measure); }

  .text-secondary { color: var(--text-secondary); }
  .text-caption {
    font-size: var(--size-caption);
    color: var(--text-secondary);
  }
  .text-body-sm { font-size: var(--size-body-sm); }
  .text-label {
    font-size: var(--size-h6);
    font-weight: var(--weight-medium);
    line-height: var(--leading-tight);
  }
}
