/* ==========================================================================
   StoryOps landing page — self-contained, no build step, no dependencies.
   ========================================================================== */

:root {
  --bg: #060810;
  --bg-elevated: #0b0f1c;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-soft: rgba(255, 255, 255, 0.06);

  --text: #eef1fb;
  --text-muted: #9aa3bc;
  --text-faint: #6b7590;

  --indigo: #6366f1;
  --indigo-dark: #4338ca;
  --violet: #8b5cf6;
  --blue: #38bdf8;
  --rose: #fb7185;
  --amber: #f59e0b;
  --emerald: #34d399;
  --slate: #94a3b8;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow-soft: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.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;
}

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

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

/* ---------- background decor ---------- */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
}
.blob-indigo {
  width: 620px; height: 620px;
  top: -220px; left: -160px;
  background: radial-gradient(circle, var(--indigo), transparent 70%);
  animation: drift1 26s ease-in-out infinite;
}
.blob-violet {
  width: 520px; height: 520px;
  top: 260px; right: -220px;
  background: radial-gradient(circle, var(--violet), transparent 70%);
  animation: drift2 32s ease-in-out infinite;
}
.blob-blue {
  width: 480px; height: 480px;
  bottom: -260px; left: 30%;
  background: radial-gradient(circle, var(--blue), transparent 70%);
  opacity: 0.2;
  animation: drift1 38s ease-in-out infinite reverse;
}
@keyframes drift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.08); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 40px) scale(1.05); }
}
.grain {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 3px 3px;
}

@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 18px 0;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), padding .3s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(6, 8, 16, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border-soft);
  padding: 12px 0;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: white;
  box-shadow: 0 6px 18px -6px rgba(99, 102, 241, 0.65);
}
.nav-links {
  display: flex;
  gap: 32px;
  font-size: 14.5px;
  color: var(--text-muted);
}
.nav-links a { transition: color .2s; }
.nav-links a:hover { color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: 14px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 34px; height: 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 16px; height: 1.5px;
  margin: 0 auto;
  background: var(--text);
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 14px 24px 6px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s var(--ease);
}
.nav-mobile.open { max-height: 320px; }
.nav-mobile a {
  padding: 12px 4px;
  font-size: 15px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-soft);
}
.nav-mobile .btn { margin-top: 12px; justify-content: center; }

/* ---------- buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  padding: 13px 22px;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s var(--ease);
  white-space: nowrap;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, var(--indigo), var(--indigo-dark));
  color: white;
  box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.7), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-sm { padding: 9px 16px; font-size: 13.5px; }
.btn-block { width: 100%; }

.btn[disabled] { pointer-events: none; opacity: 0.85; }
.btn-spinner {
  display: none;
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  animation: spin .7s linear infinite;
}
.btn.loading .btn-label { opacity: 0; }
.btn.loading .btn-spinner {
  display: block;
  position: absolute;
  left: 50%; top: 50%;
  margin: -8.5px 0 0 -8.5px;
}
.btn.loading .btn-label { visibility: hidden; }
@keyframes spin { to { transform: rotate(360deg); } }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color .2s, gap .2s;
}
.link-arrow:hover { color: var(--text); gap: 10px; }

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--indigo);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.grad-text {
  background: linear-gradient(100deg, var(--indigo), var(--violet) 55%, var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  padding: 88px 24px 60px;
}
.hero h1 {
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.08;
}
.hero-sub {
  margin-top: 22px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 520px;
}
.hero-form {
  display: flex;
  gap: 10px;
  margin-top: 32px;
  max-width: 460px;
}
.hero-form input {
  flex: 1;
  min-width: 0;
}
.hero-form-note {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-faint);
}
.hero-links { margin-top: 30px; }

/* Netlify Forms honeypot field — must exist in the DOM for bot-detection to
   work, but should never be visible or reachable by a real visitor. */
.hp-field { display: none; }

input[type="email"], select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 11px;
  padding: 13px 16px;
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, background .2s;
}
input[type="email"]::placeholder { color: var(--text-faint); }
input[type="email"]:focus, select:focus {
  border-color: rgba(99, 102, 241, 0.6);
  background: rgba(99, 102, 241, 0.06);
}
input.field-error { border-color: rgba(251, 113, 133, 0.7); }

/* ---------- hero visual / dashboard mock ---------- */
.hero-visual { position: relative; }
.mock {
  background: linear-gradient(180deg, var(--bg-elevated), #070a14);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  transform: perspective(1200px) rotateY(-4deg) rotateX(2deg);
}
.mock-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-soft);
}
.mock-dots { display: flex; gap: 6px; }
.mock-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-faint); opacity: .5;
}
.mock-title { font-size: 12.5px; color: var(--text-faint); font-weight: 600; }

.mock-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.mock-stat {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mock-stat-label { font-size: 10.5px; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.mock-stat-value { font-size: 19px; font-weight: 700; }
.mock-stat-delta { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.mock-stat-delta.up { color: var(--emerald); }
.mock-stat-delta.warn { color: var(--amber); }

.mock-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.mock-feed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-emerald { background: var(--emerald); box-shadow: 0 0 0 3px rgba(52,211,153,0.15); }
.dot-amber { background: var(--amber); box-shadow: 0 0 0 3px rgba(245,158,11,0.15); }
.dot-slate { background: var(--slate); box-shadow: 0 0 0 3px rgba(148,163,184,0.15); }

.mock-feed-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.mock-feed-source { font-size: 10.5px; color: var(--text-faint); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.mock-feed-headline {
  font-size: 12.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mock-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.badge-emerald { background: rgba(52,211,153,0.14); color: var(--emerald); }
.badge-amber { background: rgba(245,158,11,0.14); color: var(--amber); }
.badge-slate { background: rgba(148,163,184,0.14); color: var(--slate); }

.mock-narrative {
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.08));
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
}
.mock-narrative-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--violet);
  margin-bottom: 6px;
}
.mock-narrative-title { font-size: 13.5px; font-weight: 650; margin-bottom: 4px; }
.mock-narrative-meta { font-size: 11.5px; color: var(--text-muted); }

.mock-float {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid rgba(251,113,133,0.3);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  box-shadow: var(--shadow-soft);
  animation: float 5s ease-in-out infinite;
}
.mock-float-risk {
  bottom: -20px;
  left: -28px;
  color: var(--rose);
}
.mock-float-title { display: block; font-size: 12px; font-weight: 700; color: var(--text); }
.mock-float-sub { display: block; font-size: 11px; color: var(--text-muted); }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ---------- sources ticker ---------- */
.sources {
  position: relative;
  z-index: 1;
  padding: 34px 0 18px;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.sources-label {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.ticker {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}
.ticker-track {
  display: flex;
  gap: 46px;
  width: max-content;
  animation: ticker 28s linear infinite;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-faint);
  padding-bottom: 20px;
}
.ticker-track span { white-space: nowrap; }
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

/* ---------- stat strip ---------- */
.stat-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 56px 24px;
}
.stat-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 4px;
  border-left: 1px solid var(--border-soft);
  padding-left: 20px;
}
.stat-num {
  font-size: 26px;
  font-weight: 750;
  background: linear-gradient(100deg, var(--text), var(--text-muted));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-desc { font-size: 13px; color: var(--text-muted); line-height: 1.4; }

/* ---------- section head ---------- */
.section-head {
  max-width: 620px;
  margin: 0 auto 48px;
  text-align: center;
}
.section-head .eyebrow { margin-bottom: 14px; }
.section-head h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  margin-bottom: 12px;
}
.section-head p { color: var(--text-muted); font-size: 16px; }

/* ---------- features ---------- */
.features { position: relative; z-index: 1; padding: 96px 24px; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px 24px;
  transition: transform .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99,102,241,0.35);
  background: var(--surface-hover);
}
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  margin-bottom: 18px;
}
.icon-indigo { background: rgba(99,102,241,0.14); color: var(--indigo); }
.icon-blue { background: rgba(56,189,248,0.14); color: var(--blue); }
.icon-amber { background: rgba(245,158,11,0.14); color: var(--amber); }
.icon-rose { background: rgba(251,113,133,0.14); color: var(--rose); }
.icon-violet { background: rgba(139,92,246,0.14); color: var(--violet); }
.icon-emerald { background: rgba(52,211,153,0.14); color: var(--emerald); }

.feature-card h3 { font-size: 17.5px; margin-bottom: 9px; }
.feature-card p { font-size: 14.5px; color: var(--text-muted); line-height: 1.6; }

/* ---------- how it works ---------- */
.how { position: relative; z-index: 1; padding: 40px 24px 100px; }
.how-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.how-step {
  position: relative;
  padding: 26px 22px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--surface), transparent);
}
.how-num {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--indigo);
  margin-bottom: 14px;
  letter-spacing: .05em;
}
.how-step h3 { font-size: 16.5px; margin-bottom: 8px; }
.how-step p { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; }

/* ---------- lead capture ---------- */
.lead { position: relative; z-index: 1; padding: 40px 24px 120px; }
.lead-card {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
  padding: 56px 44px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(99,102,241,0.07), rgba(255,255,255,0.02));
  overflow: hidden;
}
.lead-glow {
  position: absolute;
  top: -140px; left: 50%;
  transform: translateX(-50%);
  width: 480px; height: 320px;
  background: radial-gradient(circle, rgba(99,102,241,0.35), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}
.lead-card .eyebrow { position: relative; }
.lead-card h2 { position: relative; font-size: clamp(26px, 3.4vw, 34px); margin-bottom: 14px; }
.lead-card > p { position: relative; color: var(--text-muted); font-size: 15.5px; max-width: 440px; margin: 0 auto; }

.lead-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 30px;
}
.lead-form select { appearance: none; -webkit-appearance: none; text-align: left; color: var(--text-muted); }
.lead-form select:valid:not(:invalid) { color: var(--text); }

.lead-success {
  position: relative;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--emerald);
}
.lead-success h3 { color: var(--text); font-size: 20px; margin-top: 4px; }
.lead-success p { color: var(--text-muted); font-size: 14.5px; }
.lead-success strong { color: var(--text); }

.lead-privacy {
  position: relative;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.5;
}

/* ---------- footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-soft);
  padding: 36px 24px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-tagline { font-size: 13.5px; color: var(--text-muted); }
.footer-copy { font-size: 12.5px; color: var(--text-faint); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 60px; }
  .hero-visual { order: -1; max-width: 480px; margin: 0 auto; }
  .mock-float-risk { left: 8px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .how-steps { grid-template-columns: repeat(2, 1fr); }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-actions .btn { display: none; }
  .nav-toggle { display: flex; }
  .nav-mobile { display: flex; }

  .hero { padding-top: 40px; }
  .hero-form { flex-direction: column; }
  .hero-form .btn { width: 100%; }

  .feature-grid { grid-template-columns: 1fr; }
  .how-steps { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: 1fr; gap: 24px; }
  .stat-item { border-left: none; border-top: 1px solid var(--border-soft); padding-left: 4px; padding-top: 18px; }

  .lead-card { padding: 40px 24px; }
}
