/* ==================================================================
   NeuroStats landing — product-first, Apple/Tesla-grade restraint.
   One idea (the probability fan), one accent (the colormap), huge
   type, generous negative space. No frameworks, no external requests.

   Two variants, same DOM (KB rule: show several options, never one):
     Obsidian (default)   — near-black, Tesla product-page mood
     Ivory (?theme=ivory) — Apple.com white gallery mood
   The instrument card stays dark in BOTH — the canvas owns its own
   chrome (#0b0e1a), and a dark device frame on light ground is the
   Apple product-shot convention anyway.
   ================================================================== */

/* ----------------------------- Fonts ----------------------------- */
/* Numerals & readouts only. Display/body use the platform grotesk
   (SF Pro on Apple hardware, Segoe UI Variable on Windows) — the
   fastest route to "not a template": zero webfont for prose. */

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("./fonts/jetbrains-mono-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono-fb";
  src: local("Consolas");
  size-adjust: 109%;
  ascent-override: 94%;
  descent-override: 24%;
  line-gap-override: 0%;
}

/* ----------------------------- Tokens ----------------------------- */

:root {
  --bg: #050507;
  --bg-soft: #0b0b0f;
  --card: #0e0e14;
  --well: #0b0e1a;          /* instrument well — matches surface.js BG */
  --text: #f5f5f7;
  --text-2: #a7a7ad;
  --text-3: #7d7d86;
  --hair: rgba(255, 255, 255, 0.10);
  --hair-2: rgba(255, 255, 255, 0.06);
  --indigo: #1e2a6e;
  --cyan: #19b6c9;
  --amber: #ffd166;
  --grad: linear-gradient(100deg, #4353b8 0%, var(--cyan) 52%, var(--amber) 100%);
  --pill-bg: #f5f5f7;
  --pill-text: #050507;
  --ghost-hair: rgba(255, 255, 255, 0.22);
  --input-bg: rgba(255, 255, 255, 0.055);
  --input-hair: rgba(255, 255, 255, 0.30);
  --mast-bg: rgba(5, 5, 7, 0.72);
  --glow: radial-gradient(60% 50% at 50% 0%, rgba(25, 182, 201, 0.10), transparent 70%);
  --shadow-card: 0 30px 80px rgba(0, 0, 0, 0.55), 0 2px 10px rgba(0, 0, 0, 0.4);
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "JetBrains Mono-fb", Consolas, "SF Mono", Menlo, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="ivory"] {
  --bg: #fbfbfd;
  --bg-soft: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --text-2: #515154;
  --text-3: #6e6e76;
  --hair: rgba(0, 0, 0, 0.12);
  --hair-2: rgba(0, 0, 0, 0.06);
  --grad: linear-gradient(100deg, #2b3a9e 0%, #0e97a8 52%, #d9a520 100%);
  --pill-bg: #1d1d1f;
  --pill-text: #fbfbfd;
  --ghost-hair: rgba(0, 0, 0, 0.28);
  --input-bg: rgba(0, 0, 0, 0.035);
  --input-hair: rgba(0, 0, 0, 0.34);
  --mast-bg: rgba(251, 251, 253, 0.78);
  --glow: radial-gradient(60% 50% at 50% 0%, rgba(25, 182, 201, 0.08), transparent 70%);
  --shadow-card: 0 30px 70px rgba(29, 29, 31, 0.18), 0 2px 10px rgba(29, 29, 31, 0.08);
}

/* ----------------------------- Reset ----------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, canvas { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: rgba(25, 182, 201, 0.35); }

.n { font-family: var(--mono); font-weight: 500; font-size: 0.92em; letter-spacing: -0.01em; }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--pill-bg); color: var(--pill-text);
  padding: 10px 18px; border-radius: 999px; text-decoration: none;
}
.skip:focus { left: 16px; top: 16px; }

/* --------------------------- Masthead ---------------------------- */

.masthead {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(22px, 4vw);
  height: 52px;
  background: var(--mast-bg);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--hair-2);
}

.wordmark {
  font-weight: 650; font-size: 16px; letter-spacing: -0.02em;
  text-decoration: none;
}

.mast-cta {
  font-size: 13px; font-weight: 500; text-decoration: none;
  color: var(--pill-text); background: var(--pill-bg);
  padding: 6px 14px; border-radius: 999px;
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.mast-cta:hover { opacity: 0.85; }
.mast-cta:active { transform: scale(0.97); }

/* ----------------------------- Hero ------------------------------ */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 120px 22px 96px;
  overflow: hidden;
  isolation: isolate;
}

#surface-ambient {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%;
  opacity: 0.55;
}
[data-theme="ivory"] #surface-ambient { opacity: 0.32; }

.hero::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, var(--bg) 0%, transparent 26%, transparent 62%, var(--bg) 100%);
  pointer-events: none;
}

.hero-inner { max-width: 1060px; }

.kicker {
  margin: 0 0 22px;
  font-family: var(--mono);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-3);
}

h1 {
  margin: 0;
  font-size: clamp(44px, 8.2vw, 108px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 26px auto 0;
  max-width: 640px;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.5;
  color: var(--text-2);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.hero-cta-row {
  margin: 38px 0 0;
  display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap;
}

.cta {
  display: inline-block;
  background: var(--pill-bg); color: var(--pill-text);
  font-size: 16px; font-weight: 550;
  letter-spacing: -0.01em;
  padding: 13px 26px; border-radius: 999px;
  text-decoration: none; border: 0; cursor: pointer;
  transition: opacity 0.22s var(--ease-out), transform 0.22s var(--ease-out);
}
.cta:hover { opacity: 0.86; }
.cta:active { transform: scale(0.97); }

.cta-ghost {
  display: inline-block;
  font-size: 16px; font-weight: 500;
  color: var(--text);
  padding: 12px 24px; border-radius: 999px;
  border: 1px solid var(--ghost-hair);
  text-decoration: none;
  transition: border-color 0.22s var(--ease-out), transform 0.22s var(--ease-out);
}
.cta-ghost:hover { border-color: var(--text-2); }
.cta-ghost:active { transform: scale(0.97); }

.hero-foot {
  position: absolute; left: 0; right: 0; bottom: 26px;
  text-align: center;
  font-size: 12px; color: var(--text-3);
  font-family: var(--mono); letter-spacing: 0.06em;
}

/* --------------------------- Sections ---------------------------- */

.moment {
  position: relative;
  padding: clamp(88px, 12vw, 160px) 22px;
}

.wrap { max-width: 1120px; margin: 0 auto; }

.sec-kicker {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-3);
  text-align: center;
}

h2 {
  margin: 0 auto;
  max-width: 820px;
  font-size: clamp(32px, 5vw, 62px);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.035em;
  text-align: center;
  text-wrap: balance;
}

.sec-sub {
  margin: 18px auto 0;
  max-width: 620px;
  text-align: center;
  color: var(--text-2);
  font-size: clamp(16px, 1.6vw, 19px);
}

/* --------------------------- Instrument --------------------------- */

.moment-instrument { background: var(--glow), var(--bg); }

.demo {
  margin: clamp(40px, 6vw, 72px) auto 0;
  max-width: 1120px;
  background: var(--well);
  border: 1px solid var(--hair);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.demo-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

#surface-tabs {
  display: inline-flex; gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px; padding: 4px;
}

#surface-tabs .tab {
  appearance: none; border: 0; cursor: pointer;
  background: transparent; color: rgba(245, 245, 247, 0.6);
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  letter-spacing: 0.02em;
  padding: 7px 16px; border-radius: 999px;
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
#surface-tabs .tab:hover { color: rgba(245, 245, 247, 0.9); }
#surface-tabs .tab.active {
  background: rgba(245, 245, 247, 0.92); color: #0b0e1a;
}

#surface-download {
  appearance: none; cursor: pointer;
  background: transparent; color: rgba(245, 245, 247, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  padding: 7px 14px; border-radius: 999px;
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
#surface-download:hover { color: rgba(245, 245, 247, 0.9); border-color: rgba(255, 255, 255, 0.35); }

#surface-canvas { width: 100%; height: auto; outline-offset: -3px; }

#surface-readout {
  min-height: 40px;
  padding: 10px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.5;
  color: rgba(245, 245, 247, 0.66);
}
#surface-readout.readout-active { color: rgba(245, 245, 247, 0.92); }

.demo-caption {
  margin: 18px auto 0;
  max-width: 860px;
  text-align: center;
  font-size: 13.5px; line-height: 1.6;
  color: var(--text-2);
}

/* ------------------------- Receipts band -------------------------- */

.receipts {
  margin: clamp(56px, 8vw, 96px) auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 4vw, 56px);
  max-width: 980px;
  text-align: center;
}

.receipt-num {
  display: block;
  font-family: var(--mono);
  font-size: clamp(44px, 6vw, 76px);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.receipt-zero { font-family: var(--body); font-weight: 700; }

.receipt-cap {
  display: block;
  margin-top: 12px;
  font-size: 13.5px; line-height: 1.5;
  color: var(--text-2);
  max-width: 260px;
  margin-left: auto; margin-right: auto;
}

/* ------------------------ Asymmetric split ------------------------ */

.split { display: grid; gap: 40px; }
.split .split-head h2 { text-align: left; margin-left: 0; }
.split .split-head .sec-kicker { text-align: left; }
.split .pain-list, .split .split-body { margin-top: 0; }
.split .method-body { text-align: left; margin-top: 0; margin-left: 0; }
.split .trust-points { margin-left: 0; }

@media (min-width: 880px) {
  .split { grid-template-columns: 5fr 7fr; gap: 72px; align-items: start; }
  .split .split-head { position: sticky; top: 96px; }
}

/* ---------------------------- Pains ------------------------------ */

.pain-list {
  margin: clamp(44px, 6vw, 72px) auto 0;
  max-width: 880px;
  display: grid;
  gap: 18px;
}

.pain {
  background: var(--card);
  border: 1px solid var(--hair-2);
  border-radius: 20px;
  padding: clamp(26px, 4vw, 40px);
}

.pain h3 {
  margin: 0 0 8px;
  font-size: clamp(19px, 2.4vw, 24px);
  font-weight: 650; letter-spacing: -0.025em;
}
.pain p { margin: 0; color: var(--text-2); font-size: 16px; max-width: 640px; }

/* --------------------------- Method ------------------------------ */

.method-body {
  margin: 26px auto 0;
  max-width: 640px;
  color: var(--text-2);
  font-size: clamp(16px, 1.6vw, 19px);
  text-align: center;
}
.method-body p { margin: 0 0 18px; }

.trust-points {
  margin: 36px auto 0; padding: 0;
  list-style: none;
  max-width: 640px;
}
.trust-points li {
  padding: 16px 4px;
  border-top: 1px solid var(--hair-2);
  font-size: 16px; font-weight: 500; letter-spacing: -0.01em;
  display: flex; align-items: baseline; gap: 14px;
  text-align: left;
}
.trust-points li:last-child { border-bottom: 1px solid var(--hair-2); }
.trust-points .tp-idx {
  font-family: var(--mono); font-size: 12px; color: var(--text-3);
  flex: 0 0 auto;
}

/* ---------------------------- Offer ------------------------------ */

.offer-card {
  margin: clamp(44px, 6vw, 72px) auto 0;
  max-width: 720px;
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 28px;
  padding: clamp(36px, 5vw, 60px);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.offer-card::before {
  content: "";
  position: absolute; inset: -1px; z-index: 0;
  background: radial-gradient(70% 60% at 50% 0%, rgba(25, 182, 201, 0.09), transparent 70%);
  pointer-events: none;
}
.offer-card > * { position: relative; z-index: 1; }

.price-line > span[aria-hidden] { display: inline-flex; align-items: baseline; gap: 4px; }
.price-line {
  display: flex; align-items: baseline; justify-content: center;
  margin: 6px 0 2px;
}
.price-cur {
  font-family: var(--mono);
  font-size: clamp(26px, 3.4vw, 38px); font-weight: 600;
  color: var(--text);
  align-self: flex-start; margin-top: 0.16em;
}
.price-num {
  font-family: var(--mono);
  font-size: clamp(64px, 9vw, 104px);
  font-weight: 650; letter-spacing: -0.05em; line-height: 1;
}
.price-per { font-size: 17px; color: var(--text-3); }

.price-note { margin: 10px 0 0; font-size: 14px; color: var(--text-3); }
.price-note-strong { color: var(--text-2); font-weight: 550; margin-top: 16px; }

.offer-points {
  margin: 30px auto 34px; padding: 0;
  list-style: none;
  max-width: 480px;
  text-align: left;
}
.offer-points li {
  padding: 13px 2px;
  border-top: 1px solid var(--hair-2);
  font-size: 15.5px; color: var(--text-2);
}
.offer-points li:last-child { border-bottom: 1px solid var(--hair-2); }
.offer-points strong { color: var(--text); font-weight: 600; }

/* ---------------------------- Intake ------------------------------ */

.intake { margin-top: clamp(48px, 7vw, 84px); }

.intake-label {
  margin: 0 0 22px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-3);
}

/* honeypot: invisible to humans, present for bots */
.hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }

.founding-form {
  max-width: 640px; margin: 0 auto;
  display: grid; gap: 16px;
}

.field { display: grid; gap: 7px; }

.field label {
  font-size: 13.5px; font-weight: 550; letter-spacing: -0.01em;
}
.field .optional, .field .req { color: var(--text-3); font-weight: 400; }

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit; font-size: 15.5px;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-hair);
  border-radius: 14px;
  padding: 13px 16px;
  transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}
.field textarea { resize: vertical; min-height: 78px; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(25, 182, 201, 0.38);
}
[data-theme="ivory"] .field input:focus-visible,
[data-theme="ivory"] .field select:focus-visible,
[data-theme="ivory"] .field textarea:focus-visible {
  box-shadow: 0 0 0 3px rgba(14, 151, 168, 0.30);
}
.field select:invalid { color: var(--text-3); }

.submit-btn { width: 100%; margin-top: 6px; font-size: 17px; padding: 15px 26px; }

.more-questions { margin-top: 4px; }
.more-questions summary {
  cursor: pointer; list-style: none;
  font-size: 13.5px; font-weight: 550; color: var(--text-2);
  padding: 10px 2px;
  display: flex; align-items: center; gap: 10px;
}
.more-questions summary::-webkit-details-marker { display: none; }
.more-questions summary::before {
  content: "+";
  font-family: var(--mono); color: var(--text-3);
  transition: transform 0.25s var(--ease-out);
}
.more-questions[open] summary::before { transform: rotate(45deg); }
.more-questions .field { margin-top: 14px; }

.microcopy {
  margin: 4px 0 0; text-align: center;
  font-size: 13px; color: var(--text-3);
}
.form-error { color: var(--amber); }
[data-theme="ivory"] .form-error { color: #a06000; }

/* ----------------------------- FAQ ------------------------------- */

.faq { margin: clamp(40px, 6vw, 64px) auto 0; max-width: 720px; }

.faq details { border-top: 1px solid var(--hair-2); }
.faq details:last-child { border-bottom: 1px solid var(--hair-2); }

.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 20px 2px;
  font-size: 16.5px; font-weight: 550; letter-spacing: -0.015em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--mono); font-weight: 400; font-size: 20px;
  color: var(--text-3);
  transition: transform 0.25s var(--ease-out);
  flex: 0 0 auto;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p {
  margin: 0; padding: 0 2px 22px;
  color: var(--text-2); font-size: 15.5px; max-width: 660px;
}

/* --------------------------- Colophon ----------------------------- */

footer { padding: 0 22px; }

.colophon {
  max-width: 1120px;
  margin: 0 auto;
  padding: 44px 0 56px;
  border-top: 1px solid var(--hair-2);
}

.disclaimer {
  margin: 0 0 14px;
  font-size: 12.5px; line-height: 1.65;
  color: var(--text-2);
  max-width: 860px;
}

.footer-meta { margin: 0; font-size: 12.5px; color: var(--text-3); }
.footer-meta a { color: var(--text-2); }

/* --------------------------- Reveals ------------------------------ */
/* motion.js adds .has-motion on <html> only for real, motion-OK
   visitors; automation and reduced-motion get the static page. */

.has-motion [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.has-motion [data-reveal].is-in { opacity: 1; transform: none; }

.has-motion [data-reveal="scale"] {
  transform: translateY(30px) scale(0.965);
}
.has-motion [data-reveal="scale"].is-in { transform: none; }

.has-motion .stagger > * {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.has-motion .stagger.is-in > * { opacity: 1; transform: none; }
.has-motion .stagger.is-in > *:nth-child(2) { transition-delay: 0.09s; }
.has-motion .stagger.is-in > *:nth-child(3) { transition-delay: 0.18s; }
.has-motion .stagger.is-in > *:nth-child(4) { transition-delay: 0.27s; }

/* -------------------------- Breakpoints --------------------------- */

@media (max-height: 620px) {
  .hero-foot { display: none; }
  .hero { padding-top: 90px; padding-bottom: 60px; }
}

@media (max-width: 720px) {
  .receipts { grid-template-columns: 1fr; gap: 40px; }
  .demo { border-radius: 18px; }
  .demo-bar { flex-wrap: wrap; }
  .hero { padding-top: 96px; }
  .hero-cta-row { flex-direction: column; }
}
