/* Base: font, reset, typography, shared utilities. */

@font-face {
  font-family: 'Space Grotesk Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url('/fonts/space-grotesk-latin-wght-normal.woff2') format('woff2-variations');
}

@layer base {

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(1100px 480px at 50% -160px, var(--hero-glow), transparent 70%);
  background-repeat: no-repeat;
  transition: background-color var(--dur-med) var(--ease-out), color var(--dur-med) var(--ease-out);
}

::selection { background: var(--selection); }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: var(--fs-hero); font-weight: 640; }
h2 { font-size: var(--fs-h2); font-weight: 620; }
h3 { font-size: var(--fs-h3); font-weight: 600; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent-ink);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover { text-decoration: underline; }

code, pre, kbd {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

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

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

/* Layout helpers */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

.section { padding-block: clamp(56px, 5vw + 32px, 112px); }
.section-tight { padding-block: clamp(36px, 3vw + 20px, 72px); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: var(--sp-4);
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
}

.lead {
  font-size: var(--fs-lead);
  color: var(--text-muted);
  max-width: 46rem;
  text-wrap: pretty;
}

.center { text-align: center; }
.center .lead, .center .eyebrow { margin-inline: auto; }

.muted { color: var(--text-muted); }
.small { font-size: var(--fs-sm); }

/* Scroll reveals: hidden only when JS is present; no-JS sees everything. */
html.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--rd, 0s);
}
html.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
}
.skip-link:focus { left: var(--sp-4); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  html.js .reveal { opacity: 1; transform: none; }
}

}
