/* ═══════════════════════════════════════════════════════════════
   BASE — reset, typography, page ground

   The page background is painted here, in CSS, before any JS
   runs. That's what prevents a flash on first paint.
   ═══════════════════════════════════════════════════════════════ */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--surface-page);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-secondary);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Page-level auras. Blurred, ≤7% — the gradient at its faintest,
   giving the white modules something to sit against. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60% 42% at 12% 0%,   rgba(28, 87, 237, 0.07) 0%, transparent 62%),
    radial-gradient(52% 38% at 92% 14%,  rgba(81, 184, 232, 0.07) 0%, transparent 65%),
    radial-gradient(70% 48% at 50% 100%, rgba(28, 90, 184, 0.05) 0%, transparent 68%);
}

#app { position: relative; z-index: 1; }

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

h1, h2, h3, h4 {
  color: var(--text-primary);
  line-height: var(--lh-tight);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); font-weight: 680; letter-spacing: -0.035em; }
h2 { font-size: var(--fs-h2); font-weight: 660; }
h3 { font-size: var(--fs-h3); font-weight: 640; line-height: var(--lh-snug);
     letter-spacing: -0.02em; }
h4 { font-size: var(--fs-body); font-weight: 640; line-height: var(--lh-snug);
     letter-spacing: -0.015em; }

p { text-wrap: pretty; }

a {
  color: var(--brand-indigo);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--brand-deep); }

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

ul, dl { list-style: none; padding: 0; }

/* Never removed. Every interactive element, both themes of surface. */
:focus-visible {
  outline: 2px solid var(--brand-indigo);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

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

/* ── UTILITIES ───────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Gradient-clipped text. Only ever a word or two — see rules §2. */
.grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mono-label {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

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

.prose > p { max-width: 68ch; }
.prose > p + p { margin-top: var(--sp-3); }

/* ── PLACEHOLDER COPY ────────────────────────────────────────
   Invisible by default so the page reads as a visitor would see
   it. Add ?draft to light every remaining hole. */
body.draft .ph {
  outline: 1px dashed rgba(28, 87, 237, 0.45);
  outline-offset: 2px;
  background: rgba(28, 87, 237, 0.05);
  border-radius: 2px;
  cursor: help;
}

body.draft .ph::after {
  content: ' [' attr(data-words) 'w]';
  font-family: var(--font-mono);
  font-size: 0.7em;
  color: var(--brand-indigo);
  opacity: 0.75;
}

/* ── NOSCRIPT ────────────────────────────────────────────────── */
.noscript {
  max-width: 40rem;
  margin: var(--sp-9) auto;
  padding: var(--sp-6);
  text-align: center;
}
.noscript h1 { margin-bottom: var(--sp-4); }
