/* ==========================================================================
   Base — reset, elements, typography defaults
   ========================================================================== */

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

  * {
    margin: 0;
  }

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

  html:focus-within {
    scroll-behavior: smooth;
  }

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

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

  button {
    background: none;
    border: none;
    cursor: pointer;
  }

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

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

  table {
    border-collapse: collapse;
  }

  @media (prefers-reduced-motion: reduce) {
    html:focus-within {
      scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

@layer base {
  body {
    font-family: var(--font-body);
    font-size: var(--step-body);
    line-height: 1.6;
    color: var(--text-on-light);
    background: var(--surface-light);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  h1,
  h2,
  h3,
  h4 {
    font-family: var(--font-body);
    line-height: 1.15;
    letter-spacing: -0.01em;
    text-wrap: balance;
    font-weight: 700;
  }

  h1 {
    font-size: var(--step-h1);
  }

  h2 {
    font-size: var(--step-h2);
  }

  h3 {
    font-size: var(--step-h3);
  }

  p {
    max-width: 65ch;
    text-wrap: pretty;
  }

  p.lead {
    font-size: var(--step-lead);
    color: var(--text-on-light-muted);
  }

  :where(body) {
    hyphens: auto;
  }

  ::selection {
    background: var(--orange-400);
    color: var(--ink-900);
  }

  :focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
    border-radius: 4px;
  }

  ::-webkit-scrollbar {
    width: 12px;
  }

  ::-webkit-scrollbar-track {
    background: var(--sand-50);
  }

  ::-webkit-scrollbar-thumb {
    background: var(--navy-800);
    border-radius: var(--radius-pill);
    border: 3px solid var(--sand-50);
  }

  html {
    scrollbar-color: var(--navy-800) var(--sand-50);
  }

  .skip-link {
    position: fixed;
    top: -100%;
    left: var(--space-3);
    z-index: 200;
    background: var(--navy-950);
    color: var(--white);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: top var(--dur-ui) var(--ease-standard);
  }

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

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