/* Reset, typography, focus, layout primitives and utilities. Uses tokens.css only. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background-color: var(--bg-2); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--fg);
  /* The ground gradient scrolls with the page: a fixed background repeats per viewport in
     full-page captures and is ignored on iOS, which left a dark band under long pages. */
  background-color: var(--bg-2);
  background-image: var(--ground);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
p, h1, h2, h3, h4, h5, h6, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { margin: 0; padding: 0; list-style: none; }
code, kbd, pre, samp { font-family: var(--font-mono); font-size: 0.92em; }
hr { border: 0; border-top: 1px solid var(--hair-soft); margin: var(--space-5) 0; }
[hidden] { display: none !important; }
::selection { background: var(--primary-soft); }

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

.skip {
  position: absolute; left: 12px; top: -80px; z-index: 200;
  padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--solid); color: var(--on-solid); font-weight: 700; font-size: 14px;
}
.skip:focus, .skip:focus-visible { top: 12px; }
.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;
}

/* Icons: <svg class="i"><use href="/icons.svg#name"/></svg>, rendered on the server */
.i {
  width: 1em; height: 1em; flex: none;
  stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Layout */
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: calc(760px + var(--gutter) * 2); }
.stack { display: grid; gap: var(--space-4); align-content: start; }
.stack-sm { display: grid; gap: var(--space-2); align-content: start; }
.stack-lg { display: grid; gap: var(--space-6); align-content: start; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.grid-2, .grid-3, .grid-4 { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .grid-4 { grid-template-columns: minmax(0, 1fr); } }
.grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }

/* Typography */
.display {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: lowercase;
  letter-spacing: -0.035em;
  line-height: 0.96;
  color: var(--fg);
}
.dim, .display .dim { color: var(--fg-dim); }
.h1 { font-size: clamp(44px, 6.2vw, 84px); }
.h1-sm { font-size: clamp(40px, 5.4vw, 72px); }
.h2 { font-size: clamp(34px, 4.4vw, 62px); }
.h3 { font-size: clamp(26px, 2.8vw, 38px); letter-spacing: -0.032em; line-height: 0.98; }
.h4 { font-size: 22px; letter-spacing: -0.03em; line-height: 1.05; }
.title { font-size: 20px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.25; }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--primary-ink); margin-bottom: 18px;
}
.lead { font-size: 19px; line-height: 1.5; color: var(--fg-muted); }
.body { color: var(--fg-muted); }
.small { font-size: 13px; line-height: 1.45; color: var(--fg-subtle); }
.caption { font-size: 12px; letter-spacing: 0.02em; color: var(--fg-subtle); }
.muted { color: var(--fg-muted); }
.subtle { color: var(--fg-subtle); }
.strong { color: var(--fg); font-weight: 700; }
.mono { font-family: var(--font-mono); letter-spacing: 0.01em; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.center { text-align: center; }
.link { color: var(--primary); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link .i { width: 14px; height: 14px; }
.prose { max-width: 720px; color: var(--fg-muted); font-size: 16px; line-height: 1.7; }
.prose h2 { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.3; color: var(--fg); margin: 36px 0 10px; }
.prose h3 { font-size: 17px; font-weight: 700; color: var(--fg); margin: 24px 0 6px; }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 12px; }
.prose ul { padding-left: 20px; margin: 8px 0 0; }
.prose li + li { margin-top: 6px; }
.prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--fg); }

/* Spacing utilities (CSP forbids inline style attributes) */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mt-7 { margin-top: var(--space-7); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-7 { margin-bottom: var(--space-7); }
.pt-0 { padding-top: 0; }
.pt-5 { padding-top: var(--space-5); }
.pt-6 { padding-top: 40px; }
.w-full { width: 100%; }
.justify-center { justify-content: center; }
.max-480 { max-width: 480px; }
.max-560 { max-width: 560px; }
.max-620 { max-width: 620px; }
.mx-auto { margin-left: auto; margin-right: auto; }

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