/* =============================================================================
   base.css - Reset + base element styling (C0 · Spec §1, §2, §19)
   Depends on tokens.css (must load first). Uses TOKENS ONLY - no raw hex.
   ============================================================================= */

/* ---- Modern reset --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, picture, svg, video, canvas {
  display: block; max-width: 100%; height: auto;
}
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
:where(a) { color: inherit; }

/* ---- Document ------------------------------------------------------------- */
html {
  font-family: var(--font-body);
  font-size: 100%;
  line-height: var(--leading-body);
  background: var(--bg);
  color: var(--text);
}
body {
  min-height: 100svh;
  font-size: var(--step-0);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01";
  transition: background-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
}

/* ---- Headings: display face ----------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-variation-settings: var(--display-opsz);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
  color: var(--text);
}
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); line-height: var(--leading-snug); }
h4 { font-size: var(--step-1); line-height: var(--leading-snug); }

p { text-wrap: pretty; max-width: 68ch; }
strong, b { font-weight: 600; }

/* ---- Links ---------------------------------------------------------------- */
a { color: var(--primary); text-decoration: none; transition: color var(--dur-fast) var(--ease); }
a:hover { color: var(--primary-hover); }

/* ---- Eyebrow / mono label (the "authority voice" - §1) -------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---- Focus ring (§19 a11y) ------------------------------------------------ */
:focus-visible {
  outline: var(--ring-width) solid var(--ring);
  outline-offset: var(--ring-offset);
  border-radius: 3px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---- Selection ------------------------------------------------------------ */
::selection { background: var(--accent-tint); color: var(--text); }

/* ---- Skip link (§5) ------------------------------------------------------- */
.skip-link {
  position: absolute; left: var(--space-sm); top: var(--space-sm);
  z-index: var(--z-skip);
  padding: var(--space-2xs) var(--space-sm);
  background: var(--primary); color: var(--primary-ink);
  border-radius: var(--radius-sm);
  transform: translateY(-150%);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus { transform: translateY(0); color: var(--primary-ink); }

/* ---- Utility: blueprint grid atmosphere (§1) ------------------------------ */
.bp-grid {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
}

/* ---- Reduced motion at the base level ------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  body { transition: none; }
}
