/* ============================================================
 * base.css — reset, typography baseline, page shell.
 * Depends on tokens.css. Keep this lean; components.css owns the look.
 * ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol, fieldset {
  margin: 0;
  padding: 0;
}

ul, ol { list-style: none; }

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
}

button { cursor: pointer; }

a {
  color: inherit;
  text-decoration: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

hr { border: 0; }

/* ---------- Document baseline ---------- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  /* faint engineering paper texture — drafting graph at 32px */
  background-image:
    linear-gradient(to right, rgba(58, 70, 81, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(58, 70, 81, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ---------- Headings ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-text);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 600;
}

h1 { font-size: var(--fs-24); }
h2 { font-size: var(--fs-20); }
h3 { font-size: var(--fs-16); }
h4 { font-size: var(--fs-14); }

p { line-height: var(--lh-normal); }

code, kbd, samp, pre, .mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1, "zero" 1;
}

/* ---------- Page shell ---------- */
.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--space-32) var(--gutter) var(--space-64);
}

.page > * + * { margin-top: var(--space-32); }

/* Kicker — small uppercase label, used above section headings */
.kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ---------- Focus ---------- */
:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--color-electric-500);
  outline-offset: 2px;
  border-radius: var(--radius-2);
}

/* ---------- Selection ---------- */
::selection {
  background: var(--color-electric-bloom);
  color: var(--color-text);
}

/* ---------- Reduced motion ---------- */
@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;
  }
}

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