/* ============================================================
   Our Story Movement — Base: reset, typography, primitives, a11y
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem; /* clears sticky nav on anchor jumps */
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Cinematic film grain across the whole page (screen-blend, reads on black) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Aurora atmosphere: fixed, drifting bioluminescent light ----
   Sits behind all content (z:0). Transparent sections reveal it;
   solid "deep beat" sections cover it for cinematic tonal rhythm.
   Motion is slow + gentle, and fully removed for reduced-motion. */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: var(--z-atmosphere);
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(130% 80% at 50% -12%, rgba(53, 240, 160, 0.06), transparent 58%),
    radial-gradient(120% 70% at 50% 118%, rgba(34, 199, 230, 0.06), transparent 60%);
}
.atmosphere::before,
.atmosphere::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  will-change: transform;
}
.atmosphere::before {
  width: 62vw; height: 62vw;
  left: -12vw; top: 6vh;
  background: radial-gradient(circle, rgba(53, 240, 160, 0.26), transparent 66%);
  animation: auroraA 46s var(--ease-io) infinite alternate;
}
.atmosphere::after {
  width: 56vw; height: 56vw;
  right: -14vw; top: 42vh;
  background: radial-gradient(circle, rgba(34, 199, 230, 0.2), transparent 66%);
  animation: auroraB 58s var(--ease-io) infinite alternate;
}
@keyframes auroraA { to { transform: translate3d(20vw, 12vh, 0) scale(1.22); } }
@keyframes auroraB { to { transform: translate3d(-18vw, -9vh, 0) scale(1.16); } }

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

a { color: inherit; text-decoration: none; }

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

/* ---- Headings ---- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 460;
  line-height: var(--lh-tight);
  letter-spacing: var(--track-tight);
  margin: 0 0 0.5em;
  font-optical-sizing: auto;
  text-wrap: balance;
  color: var(--ink);
}
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); font-weight: 520; letter-spacing: -0.01em; }

em, .ital { font-style: italic; }

/* ---- Selection & focus ---- */
::selection { background: var(--neon); color: var(--ink-on-neon); }

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

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 1.1rem;
  border-radius: 0 0 var(--r-sm) 0;
  font-weight: 600;
  font-size: var(--t-small);
}
.skip-link:focus { left: 0; }

/* ---- Layout primitives ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: 2;
}
.container--narrow { max-width: var(--container-narrow); }
.container--text   { max-width: var(--container-text); }

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

.measure { max-width: 62ch; }
.center  { text-align: center; margin-inline: auto; }

/* ---- Eyebrow / kicker ---- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--amber-text);
  margin: 0 0 1.2rem;
}
.eyebrow::before {
  content: "";
  width: 2.2rem;
  height: 3px;
  border-radius: 2px;
  background: var(--grad-spectrum);
  opacity: 0.95;
}
.eyebrow.center { justify-content: center; }
.eyebrow--ondark { color: var(--gold-glow); }

/* ---- Lead paragraph ---- */
.lead {
  font-size: var(--t-lead);
  line-height: 1.55;
  color: var(--ink-soft);
}

.muted { color: var(--ink-mute); }

/* Inline emphasis link inside prose */
.link-accent {
  color: var(--amber-text);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  text-decoration-color: var(--gold-soft);
  transition: text-decoration-color var(--dur-fast) var(--ease);
}
.link-accent:hover { text-decoration-color: var(--gold-deep); }

/* ---- Section divider (gradient fade rule) ---- */
.rule {
  border: 0;
  height: 2px;
  background: var(--grad-rule);
  opacity: 0.75;
  margin: 0;
}

/* ---- Scroll reveal (progressive enhancement) ---- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease),
              transform var(--dur-slow) var(--ease);
}
/* will-change is applied transiently by JS only while a reveal is pending,
   so we don't promote every reveal element to its own layer at load. */
.reveal:not(.is-visible) { will-change: opacity, transform; }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 80ms; }
.reveal.d2 { transition-delay: 160ms; }
.reveal.d3 { transition-delay: 240ms; }
.reveal.d4 { transition-delay: 320ms; }
.reveal.d5 { transition-delay: 400ms; }
.reveal.d6 { transition-delay: 480ms; }

/* JS sets .js on <html>; without JS, never hide content */
html:not(.js) .reveal { opacity: 1; transform: none; }

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

/* Visually-hidden (for accessible labels) */
.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;
}
