/* ==========================================================================
   Base — reset, document defaults, typography, accessibility primitives.
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + var(--space-4)); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; color: var(--ink); line-height: var(--leading-tight); font-weight: var(--weight-bold); letter-spacing: -0.015em; }
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-lg); letter-spacing: -0.01em; }
h4 { font-size: var(--text-base); }
p { margin: 0; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code, kbd, pre { font-family: var(--font-mono); font-size: 0.9em; }
code { background: var(--surface-sunken); border-radius: var(--radius-sm); padding: 0.1em 0.4em; color: var(--ink); overflow-wrap: anywhere; }
hr { border: 0; border-top: var(--border-width) solid var(--border); margin: var(--space-6) 0; }
dl, dd { margin: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }

/* Focus — always visible for keyboard users */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: var(--radius-sm); }

.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: var(--z-toast);
  background: var(--ink); color: #fff; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  font-weight: var(--weight-semibold); text-decoration: none;
}
.skip-link:focus { top: var(--space-4); color: #fff; }

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

.icon { width: 1.25em; height: 1.25em; flex: none; }

/* Text utilities */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.mono { font-family: var(--font-mono); font-size: var(--text-sm); overflow-wrap: anywhere; }
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary);
}
.highlight { background: linear-gradient(transparent 62%, var(--sun-400) 62%, var(--sun-400) 92%, transparent 92%); padding: 0 0.08em; }

@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; }
}
