/* Reset + base element styles */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  min-height: 100dvh;
  background: rgb(var(--color-background));
  color: rgb(var(--color-text));
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, picture, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
h1, h2, h3, h4, h5, h6 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
p { text-wrap: pretty; }

h1 { font-size: var(--text-h1); letter-spacing: -0.03em; }
h2 { font-size: var(--text-h2); letter-spacing: -0.025em; }
h3 { font-size: var(--text-h3); letter-spacing: -0.015em; font-weight: 700; }
h4 { font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; }

.grid > * { min-width: 0; }

::selection { background: rgb(var(--color-accent) / 0.45); }

:focus-visible {
  outline: 3px solid rgb(var(--color-primary));
  outline-offset: 3px;
  border-radius: 6px;
}
.on-dark :focus-visible, .section--dark :focus-visible { outline-color: rgb(var(--color-accent)); }

.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 200;
  background: rgb(var(--color-primary-dark));
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top 0.2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* generic utility helpers used sparingly across pages */
.text-sm { font-size: 0.875rem; }
.text-lead { font-size: var(--text-lead); line-height: 1.6; color: rgb(var(--color-muted)); }
.text-muted { color: rgb(var(--color-muted)); }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mb-sm { margin-bottom: var(--space-sm); }
.ml-xs { margin-left: var(--space-3xs); }
.link-underline { text-decoration: underline; text-underline-offset: 3px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.stack-lg { display: flex; flex-direction: column; gap: var(--space-lg); }
.badge-block { display: inline-flex; margin-bottom: var(--space-sm); }

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