/* ============================================================
   base.css
   Reset, body defaults, base typography.
   No component styling here — that lives in components.css.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  background: var(--surface-0);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  /* Prevent fixed-nav from cropping the top of any scroll-to-anchor target */
  scroll-padding-top: calc(var(--nav-height) + var(--space-4));
}

body {
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: var(--font-body-family);
  font-size: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

ul, ol { list-style: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

input, select, textarea {
  font: inherit;
  color: inherit;
}

/* -------- Headlines -------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.display-xl {
  font-family: var(--font-display);
  font-size: var(--font-display-xl);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--text-primary);
}
.display-lg {
  font-family: var(--font-display);
  font-size: var(--font-display-lg);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
}
.display-md {
  font-family: var(--font-display);
  font-size: var(--font-display-md);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
}
.heading {
  font-family: var(--font-display);
  font-size: var(--font-heading);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text-primary);
}
.subheading {
  font-family: var(--font-display);
  font-size: var(--font-subheading);
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-primary);
}

/* -------- Body text -------- */

.lead {
  font-size: var(--font-body-lg);
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 64ch;
}

p {
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 68ch;
}

.text-primary    { color: var(--text-primary); }
.text-secondary  { color: var(--text-secondary); }
.text-tertiary   { color: var(--text-tertiary); }
.text-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* -------- Selection & focus -------- */

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

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

/* -------- Reduced motion -------- */

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

/* -------- Visually hidden (a11y) -------- */
.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;
}
