/* Reset, typography and layout primitives. Components live in components.css,
   page-specific rules in pages.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--sp-4)); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
main { flex: 1; }
img, svg, video, canvas { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { line-height: var(--lh-tight); margin: 0 0 var(--sp-4); }
h1, h2 {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -0.005em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
p { margin: 0 0 var(--sp-4); }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
:root[data-theme="light"] a:hover { color: var(--text); }
code, kbd, pre { font-family: var(--font-mono); font-size: 0.88em; font-variant-ligatures: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: var(--radius-sm); }
::selection { background: var(--straw); color: var(--accent-text); }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--sp-24); }
.section--tight { padding-block: var(--sp-12); }
.lead { font-size: var(--fs-lg); color: var(--text-muted); max-width: 60ch; }
.muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); }
.grid { display: grid; gap: var(--sp-6); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.stack > * + * { margin-top: var(--sp-4); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: var(--sp-4); top: -100px; z-index: 100;
  background: var(--accent); color: var(--accent-text); padding: var(--sp-2) var(--sp-4); border-radius: var(--radius);
}
.skip-link:focus { top: var(--sp-4); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
