/* ─────────────────────────────────────────────────────────────
   Next Wave — Landing
   Design tokens lifted from app/globals.css of the source repo,
   extended with editorial display type + magazine layout vars.
   ───────────────────────────────────────────────────────────── */

:root {
  --bg:               #ffffff;
  --bg-tint:          #fbfaf7;          /* warm paper tint for editorial */
  --surface:          #fafafa;
  --surface-raised:   #f4f4f5;
  --surface-overlay:  #e4e4e7;

  --accent:           #7c3aed;
  --accent-hover:     #6d28d9;
  --accent-active:    #5b21b6;
  --accent-glow:      rgba(124, 58, 237, 0.25);
  --accent-subtle:    rgba(124, 58, 237, 0.08);
  --accent-ink:       #ffffff;

  --text:             #0a0a0f;
  --text-muted:       #52525b;
  --text-subtle:      #71717a;
  --text-faint:       #a1a1aa;

  --border-subtle:    rgba(0, 0, 0, 0.06);
  --border:           rgba(0, 0, 0, 0.10);
  --border-strong:    rgba(0, 0, 0, 0.16);

  --success:          #10b981;
  --info:             #3b82f6;
  --warning:          #f59e0b;
  --danger:           #ef4444;

  --body-gradient:
    radial-gradient(ellipse 60% 50% at 20% 0%,   rgba(124, 58, 237, 0.05), transparent 60%),
    radial-gradient(ellipse 40% 30% at 80% 100%, rgba(59, 130, 246, 0.03), transparent 60%);

  --scrollbar-thumb:       rgba(0, 0, 0, 0.18);
  --scrollbar-thumb-hover: rgba(0, 0, 0, 0.32);
}

.dark {
  --bg:               #0a0a0f;
  --bg-tint:          #08080d;
  --surface:          #13131a;
  --surface-raised:   #1a1a24;
  --surface-overlay:  #24242e;

  --accent:           #8b5cf6;
  --accent-hover:     #a78bfa;
  --accent-active:    #7c3aed;
  --accent-glow:      rgba(139, 92, 246, 0.35);
  --accent-subtle:    rgba(139, 92, 246, 0.12);
  --accent-ink:       #ffffff;

  --text:             #fafafa;
  --text-muted:       #a1a1aa;
  --text-subtle:      #71717a;
  --text-faint:       #52525b;

  --border-subtle:    rgba(255, 255, 255, 0.06);
  --border:           rgba(255, 255, 255, 0.10);
  --border-strong:    rgba(255, 255, 255, 0.16);

  --body-gradient:
    radial-gradient(ellipse 60% 50% at 20% 0%,   rgba(139, 92, 246, 0.10), transparent 60%),
    radial-gradient(ellipse 40% 30% at 80% 100%, rgba(59, 130, 246, 0.06), transparent 60%);

  --scrollbar-thumb:       rgba(255, 255, 255, 0.16);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.32);
}

/* ── Typography stacks ─────────────────────────────────────── */
:root {
  --font-display: "Instrument Serif", "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans:    "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:    "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --container:    1240px;
  --gutter:       clamp(20px, 4vw, 56px);

  --shadow-subtle:   0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-medium:   0 6px 24px rgba(15, 15, 30, 0.06), 0 1px 0 rgba(255,255,255,0.6) inset;
  --shadow-elevated: 0 24px 64px -16px rgba(15, 15, 30, 0.18), 0 1px 0 rgba(255,255,255,0.5) inset;
  --shadow-glow:     0 0 40px var(--accent-glow);
}
.dark {
  --shadow-medium:   0 6px 24px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255,255,255,0.04) inset;
  --shadow-elevated: 0 24px 64px -16px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255,255,255,0.04) inset;
}

/* ── Reset-ish ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: light; scroll-behavior: smooth; }
html.dark { color-scheme: dark; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--body-gradient), var(--bg);
  background-attachment: fixed;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

/* Selection */
::selection { background: var(--accent); color: var(--accent-ink); }

/* Scrollbar */
::-webkit-scrollbar          { width: 8px; height: 8px; }
::-webkit-scrollbar-track    { background: transparent; }
::-webkit-scrollbar-thumb    { background: var(--scrollbar-thumb); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

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

/* ── Container ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.container-wide {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ── Type utilities ────────────────────────────────────────── */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-subtle);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-subtle);
}
.eyebrow-accent { color: var(--accent); }

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.98;
}
.display em {
  font-style: italic;
  color: var(--accent);
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }

.heading-xl {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(64px, 10vw, 148px);
  line-height: 0.92;
  letter-spacing: -0.035em;
}
.heading-xl em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

.heading-l {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.0;
  letter-spacing: -0.025em;
}
.heading-l em { font-style: italic; color: var(--accent); }

.heading-m {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.lede {
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.55;
  color: var(--text-muted);
  font-weight: 400;
}

.mono { font-family: var(--font-mono); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 22px;
  height: 46px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  background: var(--text);
  color: var(--bg);
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:hover  { transform: translateY(-1px); box-shadow: 0 8px 22px -8px rgba(0,0,0,0.25); }
.btn:active { transform: translateY(0); }

.btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 8px 24px -10px var(--accent-glow);
}
.btn-accent:hover { background: var(--accent-hover); box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 12px 28px -10px var(--accent-glow); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface); }

.btn-sm { height: 36px; padding: 0 16px; font-size: 13.5px; }
.btn-lg { height: 54px; padding: 0 28px; font-size: 15.5px; }

/* ── Card primitive ────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  box-shadow: var(--shadow-subtle);
}
.card-raised {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-elevated);
}

/* ── Section spacing ───────────────────────────────────────── */
section { position: relative; }
.section { padding-block: clamp(56px, 7vw, 110px); }
.section-tight { padding-block: clamp(40px, 5vw, 80px); }

/* ── Hairline divider ──────────────────────────────────────── */
.hairline {
  height: 1px;
  background: var(--border-subtle);
  width: 100%;
}

/* ── Reveal animation ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.06s; }
.reveal-delay-2 { transition-delay: 0.12s; }
.reveal-delay-3 { transition-delay: 0.18s; }
.reveal-delay-4 { transition-delay: 0.24s; }
.reveal-delay-5 { transition-delay: 0.30s; }
.reveal-delay-6 { transition-delay: 0.36s; }

/* ── Keyframes ─────────────────────────────────────────────── */
@keyframes shimmer {
  from { background-position: -200% center; }
  to   { background-position:  200% center; }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}
@keyframes pulse-ring {
  0%   { transform: scale(1);   opacity: 0.5; }
  100% { transform: scale(2.6); opacity: 0; }
}
@keyframes float-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes count-up {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes drift {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(0, -6px); }
  100% { transform: translate(0, 0); }
}
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Background texture (noise) ────────────────────────────── */
.noise::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.025;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.dark .noise::before { opacity: 0.06; mix-blend-mode: screen; }

/* ── Pill chip ─────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.chip .dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--accent);
}

/* ── Grid lines (editorial background) ─────────────────────── */
.grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--border-subtle) 1px, transparent 1px);
  background-size: calc(100% / 12) 100%;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
}

/* ── Score bar ─────────────────────────────────────────────── */
.score-track {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-overlay);
  overflow: hidden;
}
.score-fill {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--accent), #c4b5fd);
  border-radius: 999px;
  transform-origin: left;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Marquee row ───────────────────────────────────────────── */
.marquee {
  display: flex;
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}
.marquee-track {
  display: flex;
  gap: 56px;
  white-space: nowrap;
  animation: ticker-scroll 38s linear infinite;
  padding-right: 56px;
}

/* ── Utilities ─────────────────────────────────────────────── */
.row     { display: flex; align-items: center; }
.row.gap { gap: 12px; }
.col     { display: flex; flex-direction: column; }
.between { justify-content: space-between; }
.center  { justify-content: center; align-items: center; }
.muted   { color: var(--text-muted); }
.subtle  { color: var(--text-subtle); }
.accent  { color: var(--accent); }
.tabular { font-variant-numeric: tabular-nums; }

.cap   { text-transform: uppercase; letter-spacing: 0.12em; }

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