/* Element defaults. Everything here reads from tokens.css, so changing
   the palette or the typefaces changes the whole site from one file. */

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

  body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }

  h1,
  h2,
  h3,
  h4 {
    margin: 0;
    font-family: var(--font-display);
    line-height: 1.1;
    text-wrap: balance;
  }

  h1 { font-size: var(--step-4); }
  h2 { font-size: var(--step-3); }
  h3 { font-size: var(--step-2); }
  h4 { font-size: var(--step-1); }

  p {
    margin: 0;
    max-width: var(--measure);
    text-wrap: pretty;
  }

  a {
    color: inherit;
    text-underline-offset: 0.2em;
  }

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

  /* Keyboard users need to see where they are. Never remove this
     without putting something at least as visible in its place. */
  :focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
  }

  .skip-link {
    position: absolute;
    left: var(--space-s);
    top: var(--space-s);
    z-index: 10;
    padding: var(--space-2xs) var(--space-s);
    border-radius: var(--radius);
    background: var(--color-accent);
    color: var(--color-on-accent);
    transform: translateY(-200%);
  }

  .skip-link:focus-visible {
    transform: translateY(0);
  }

  /* Respecting this is not optional: for some people motion causes
     nausea and migraine. Animate freely, but leave this in place. */
  @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;
    }
  }
}
