/* ============================================================
   Base — reset, typography, utilities
   ============================================================ */

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

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-reg);
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  position: relative;
}

/* warm paper grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul, ol { list-style: none; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-semi);
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--ink);
  font-optical-sizing: auto;
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }

::selection { background: var(--clay); color: var(--bone); }

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

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--space-7); position: relative; }
.section--tight { padding-block: var(--space-6); }

/* ---------- Eyebrow / kicker ---------- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--clay);
}
.kicker::before {
  content: "";
  width: 26px;
  height: 1.5px;
  background: var(--clay);
  display: inline-block;
}
.kicker--center { justify-content: center; }
.kicker--sea { color: var(--sea); }
.kicker--sea::before { background: var(--sea); }

/* ---------- Display headings ---------- */
.display {
  font-family: var(--font-display);
  line-height: 1.0;
  letter-spacing: -0.02em;
}
.display em {
  font-style: italic;
  font-weight: var(--fw-light);
  color: var(--clay);
}
.lead {
  font-size: var(--fs-md);
  color: var(--ink-soft);
  line-height: 1.55;
  font-weight: var(--fw-reg);
}

/* ---------- Reveal on scroll ----------
   Only hidden when JS is active (html.js). Without JS, content shows
   normally so the page is never blank for crawlers or no-JS users. */
.js .reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  will-change: opacity, transform;
}
.js .reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.4s; }

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

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.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;
}
