/* ==========================================================================
   Base — reset, typography, layout primitives, focus states.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 { margin: 0; font-weight: 600; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
table { border-collapse: collapse; }

::selection { background: var(--accent); color: var(--accent-ink); }

/* Anchor targets clear the sticky nav */
[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }

/* Focus visibility — never remove without a replacement */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Layout primitives */
.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--side-pad);
}
.container--wide { max-width: var(--maxw-wide); }

.section {
  padding-block: var(--section-pad);
}
.section--alt { background: var(--bg-alt); }
.section-head {
  max-width: 640px;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.section-head--center {
  margin-inline: auto;
  text-align: center;
}
.section-head--center .eyebrow { justify-content: center; }
.section-head--center p { margin-inline: auto; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  flex: none;
}
h1, h2 { font-weight: 650; }
h2 { font-size: var(--fs-h2); line-height: var(--lh-tight); letter-spacing: var(--ls-tight); }
h3 { font-size: var(--fs-h3); line-height: var(--lh-tight); }
.section-head p {
  margin-top: var(--s-3);
  color: var(--text-secondary);
  font-size: var(--fs-body);
  max-width: 58ch;
}

.visually-hidden {
  position: absolute;
  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;
  left: var(--s-4);
  top: -60px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: var(--fs-small);
  z-index: 100;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus-visible {
  top: var(--s-4);
}

/* Reduced motion — global override. Content must render identical and
   fully visible: nothing may be left at opacity 0. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, [data-parallax] { opacity: 1 !important; transform: none !important; }
}
