/* base.css — reset, typography primitives, focus/selection, accessibility helpers. Depends on tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-x: clip;
}
body.is-loading { overflow: hidden; }

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }

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

:focus { outline: none; }
:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

/* ---------- Type primitives ---------- */
.display, .h1, .h2, .h3 {
  font-family: var(--font-sans);
  font-weight: 300;
  color: var(--text);
  letter-spacing: var(--track-display);
  line-height: 0.96;
}
.h1 { font-size: var(--fs-h1); }
.h2 { font-size: var(--fs-h2); line-height: 1; }
.h3 { font-size: var(--fs-h3); line-height: 1.12; letter-spacing: -0.03em; }
.upper { text-transform: uppercase; }

.lead {
  font-size: var(--fs-lead);
  font-weight: 300;
  line-height: 1.45;
  color: var(--text);
  letter-spacing: -0.015em;
}
.body { max-width: 62ch; color: var(--text-body); }
.body + .body { margin-top: 1.4em; }
.mute { color: var(--text-mute); }

.label {
  font-family: var(--font-sans);
  font-size: var(--fs-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--track-label);
  line-height: 1.4;
  color: var(--text-mute);
}

.serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ---------- Accessibility ---------- */
.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;
}
.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 1000;
  padding: 12px 18px;
  background: var(--text-warm);
  color: var(--bg);
  font-size: 0.85rem;
  border-radius: var(--r-btn);
  transform: translateY(-200%);
  transition: transform 0.4s var(--ease-out);
}
.skip-link:focus-visible { transform: none; }

.noscript {
  position: fixed; inset: 0; z-index: 2000;
  display: grid; place-content: center; gap: 32px;
  padding: var(--margin);
  background: var(--bg);
  color: var(--text-body);
  max-width: 62ch; margin: 0 auto;
}
.noscript a { text-decoration: underline; color: var(--text); }

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

/* Desktop-only manual line breaks in display headlines (see K.brk) */
.br-d { display: none; }
@media (min-width: 1024px) { .br-d { display: inline; } }

/* Crawler-readable copy baked into each page's HTML (tools/build-pages.js). With JavaScript on,
   the live view replaces it on boot; hiding it first stops it flashing unstyled. */
.js .seo-text { display: none; }
.seo-text { max-width: 62ch; margin: 0 auto; padding: calc(var(--nav-h) + 48px) var(--margin) 96px; }
.seo-text h1, .seo-text h2 { color: var(--text); font-weight: 300; line-height: 1.1; margin: 1.4em 0 0.5em; }
.seo-text a { text-decoration: underline; }
