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

  * { margin: 0; }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + var(--space-4));
    scrollbar-gutter: stable;
  }

  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }

  body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  main { flex: 1 0 auto; container: page / inline-size; }

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

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

  p, li, dd { text-wrap: pretty; }

  h1, h2, h3, h4, h5, h6 {
    line-height: var(--leading-tight);
    font-weight: var(--weight-bold);
    letter-spacing: -0.015em;
    text-wrap: balance;
    color: var(--color-text);
  }

  h1 { font-size: var(--text-4xl); font-weight: var(--weight-black); letter-spacing: -0.025em; }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-2xl); }
  h4 { font-size: var(--text-xl); }
  h5 { font-size: var(--text-lg); }
  h6 { font-size: var(--text-base); }

  a {
    color: var(--color-link);
    text-decoration: none;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
  }

  a:hover, a:focus-visible { color: var(--color-link-hover); text-decoration: underline; }

  :where(p, .prose li, .alert__body, figcaption) a:not([class]) { text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: color-mix(in oklab, currentColor 40%, transparent); }
  :where(p, .prose li, .alert__body, figcaption) a:not([class]):hover, :where(p, .prose li, .alert__body, figcaption) a:not([class]):focus-visible { text-decoration-color: currentColor; }

  strong, b { font-weight: var(--weight-semibold); }

  small { font-size: var(--text-sm); }

  code, kbd, pre { font-family: var(--font-mono); font-size: 0.9em; }

  hr { border: 0; border-top: 1px solid var(--color-border); }

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

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

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

  [hidden] { display: none !important; }

  @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 !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  .skip-link {
    position: absolute;
    inset-inline-start: var(--space-4);
    top: var(--space-2);
    z-index: calc(var(--z-dialog) + 1);
    padding: var(--space-3) var(--space-4);
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-weight: var(--weight-semibold);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateY(-200%);
  }

  .skip-link:focus { transform: none; color: var(--color-on-primary); }

  .text-muted { color: var(--color-text-muted); }
  .text-sm { font-size: var(--text-sm); }
  .text-lg { font-size: var(--text-lg); }
  .text-center { text-align: center; }
  .stack > * + * { margin-block-start: var(--stack-gap, var(--space-4)); }
  .cluster { display: flex; flex-wrap: wrap; gap: var(--cluster-gap, var(--space-3)); align-items: center; }
  .mt-0 { margin-block-start: 0; }
}
