/* ==========================================================================
   Base: reset, document defaults, accessibility primitives, layout helpers
   ========================================================================== */

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--step-0) / 1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 0 0 .5em;
  text-wrap: balance;
}

p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0; }

code, kbd, samp, pre { font-family: var(--font-mono); }

/* --- Focus ------------------------------------------------------------ */
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: 6px;
}

/* --- Skip link -------------------------------------------------------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--brand);
  color: var(--brand-ink);
  padding: var(--space-3) var(--space-5);
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { left: 0; }

/* --- Screen-reader only ----------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- Layout helpers --------------------------------------------------- */
.wrap {
  width: min(100% - 2.5rem, var(--maxw));
  margin-inline: auto;
}

section { scroll-margin-top: 84px; }

.band { padding: clamp(3.25rem, 7vw, 5.5rem) 0; }
.band-alt { background: var(--bg-alt); }
.band-alt + .band-alt { padding-top: 0; }

.head {
  max-width: 58ch;
  margin: 0 auto clamp(2.25rem, 4.5vw, 3.25rem);
  text-align: center;
}
.head h2 { font-size: var(--step-2); }
.head p { color: var(--muted); font-size: var(--step-1); margin: 0; }

.grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }

/* --- Motion opt-out --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
