:root {
  /* Light theme (default) */
  --bg: #ffffff;
  --bg-2: #f5f8fc;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #5b6677;
  --accent: #0ea5e9;
  --accent-2: #6366f1;
  --good: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --shadow: rgba(2, 6, 23, 0.10);
  --radius: 16px;
  --maxw: 1080px;
}

/* Dark — explicit, and for system preference */
:root[data-theme="dark"] {
  --bg: #0f172a;
  --bg-2: #0b1120;
  --surface: #1e293b;
  --surface-2: #273449;
  --border: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --good: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --shadow: rgba(0, 0, 0, 0.5);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #0f172a;
    --bg-2: #0b1120;
    --surface: #1e293b;
    --surface-2: #273449;
    --border: #334155;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --accent: #38bdf8;
    --accent-2: #818cf8;
    --good: #4ade80;
    --warn: #fbbf24;
    --bad: #f87171;
    --shadow: rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 760px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 18px; border-radius: 10px;
  font-weight: 600; font-size: 15px; cursor: pointer;
  border: 1px solid transparent; transition: transform .08s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06121f; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.theme-toggle {
  background: none; border: 1px solid var(--border); color: var(--text);
  width: 38px; height: 38px; border-radius: 9px; cursor: pointer;
  font-size: 16px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .15s ease, color .15s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.nav-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; }
.nav-links { display: flex; gap: 22px; margin-left: 14px; flex: 1; }
.nav-links a { color: var(--muted); font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-cta { display: flex; gap: 10px; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 22px; cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(48px, 9vw, 110px) 0 clamp(40px, 7vw, 90px);
  background:
    radial-gradient(60% 60% at 80% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(50% 50% at 10% 10%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 55%);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(34px, 6vw, 60px); font-weight: 800; letter-spacing: -.02em; }
.lead { font-size: clamp(16px, 2.4vw, 20px); color: var(--muted); margin: 20px 0 28px; max-width: 36em; }
.lead strong { color: var(--text); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-actions.center { justify-content: center; }
.engines { display: flex; align-items: center; gap: 14px; margin-top: 28px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.engines ul { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0; flex-wrap: wrap; }
.engines li { padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; font-weight: 600; color: var(--text); font-size: 13px; background: var(--surface); }

/* ---------- Mock cards ---------- */
.mock-card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: 0 20px 60px -20px var(--shadow);
}
.glow { position: relative; }
.glow::before {
  content: ''; position: absolute; inset: -1px; border-radius: var(--radius);
  padding: 1px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 50%, transparent), transparent 40%, color-mix(in srgb, var(--accent-2) 40%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.mock-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.mock-title { font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.mock-metric { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.mock-metric .big { font-size: 40px; font-weight: 800; line-height: 1; }
.mock-metric .unit { color: var(--muted); font-size: 14px; }
.mock-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-top: 1px solid var(--border); font-size: 14px; }
.mock-row .label2 { display: flex; flex-direction: column; }
.mock-row .label2 small { color: var(--muted); font-size: 12px; }
.mock-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.pills { display: flex; gap: 6px; }

.bar { height: 9px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 4px 0 10px; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 700; }
.pill.good { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.pill.bad  { color: var(--bad);  background: color-mix(in srgb, var(--bad) 14%, transparent); }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 9vw, 100px) 0; }
.section.alt { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { font-size: clamp(26px, 4.4vw, 40px); font-weight: 800; letter-spacing: -.02em; text-align: center; }
.section-sub { text-align: center; color: var(--muted); font-size: 18px; margin: 14px auto 44px; max-width: 42em; }

.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; transition: border-color .2s ease, transform .2s ease;
}
.feature:hover { border-color: var(--accent); transform: translateY(-3px); }
.ficon { font-size: 28px; margin-bottom: 12px; }
.feature h3 { font-size: 19px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 15px; }
.feature em { color: var(--accent); font-style: normal; }

.byok {
  margin-top: 28px; text-align: center; background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); border-radius: var(--radius);
  padding: 18px; color: var(--muted); font-size: 16px;
}
.byok strong { color: var(--text); }

/* ---------- Quick start ---------- */
.quickstart { max-width: 820px; margin: 0 auto; }
.qs-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.qs-tab {
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .15s ease;
}
.qs-tab:hover { color: var(--text); }
.qs-tab.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06121f; border-color: transparent; }
.terminal { background: #0a0f1d; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: 0 20px 60px -25px rgba(0,0,0,.7); }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; background: #0d1424; border-bottom: 1px solid var(--border); }
.term-bar > span { width: 11px; height: 11px; border-radius: 50%; background: #334155; }
.term-bar > span:nth-child(1) { background: #f87171; }
.term-bar > span:nth-child(2) { background: #fbbf24; }
.term-bar > span:nth-child(3) { background: #4ade80; }
.copy { margin-left: auto; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: 12px; padding: 4px 10px; border-radius: 7px; cursor: pointer; }
.copy:hover { color: var(--text); border-color: var(--accent); }
.term-body {
  margin: 0; padding: 20px; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 14px; line-height: 1.7; color: #cbd5e1; white-space: pre-wrap; min-height: 200px; overflow-x: auto;
}
.term-body .cmd { color: #f1f5f9; }
.term-body .cmd::before { content: '$ '; color: var(--accent); }
.term-body .ok { color: var(--good); }
.term-body .dim { color: var(--muted); }
.term-body .hi { color: var(--accent); }

/* ---------- Showcase / Pricing ---------- */
.showcase-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 860px; margin: 0 auto; }
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 820px; margin: 0 auto; }
.pricing-grid.four { grid-template-columns: repeat(4, 1fr); max-width: 1080px; gap: 16px; }
.pricing-grid.four .price-card { padding: 24px 20px; }
.pricing-grid.four .check li { font-size: 14px; padding: 6px 0 6px 24px; }
.price-foot { text-align: center; margin-top: 18px; font-size: 14px; }

/* How-it-works numbered steps */
.steps .step-n {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; margin-bottom: 14px;
  color: #06121f; background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.price-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.price-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 20px 60px -25px rgba(56,189,248,.4); }
.price-badge { position: absolute; top: -12px; left: 24px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06121f; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.price-badge.muted { background: var(--surface-2); color: var(--muted); }
.price-card h3 { font-size: 22px; margin: 6px 0 10px; }
.price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.price .amount { font-size: 40px; font-weight: 800; }
.price .per { color: var(--muted); }
.price-note { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.check { list-style: none; padding: 0; margin: 0 0 22px; }
.check li { position: relative; padding: 7px 0 7px 26px; font-size: 15px; border-top: 1px solid var(--border); }
.check li::before { content: '✓'; position: absolute; left: 0; color: var(--good); font-weight: 700; }

/* ---------- FAQ ---------- */
.faq details { border: 1px solid var(--border); border-radius: 12px; padding: 4px 18px; margin-bottom: 10px; background: var(--surface); }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq summary::after { content: '+'; color: var(--accent); font-size: 22px; font-weight: 400; }
.faq details[open] summary::after { content: '−'; }
.faq details p { color: var(--muted); padding: 0 0 16px; margin: 0; }

/* ---------- CTA / Footer ---------- */
.cta { padding: clamp(60px, 10vw, 110px) 0; text-align: center; background: radial-gradient(60% 100% at 50% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%); }
.cta h2 { font-size: clamp(28px, 5vw, 44px); font-weight: 800; letter-spacing: -.02em; }
.cta p { color: var(--muted); font-size: 18px; margin: 16px auto 28px; max-width: 34em; }
/* Waitlist form */
.waitlist { display: flex; gap: 10px; max-width: 460px; margin: 28px auto 0; }
.waitlist input {
  flex: 1; min-width: 0; padding: 13px 16px; font-size: 16px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; outline: none;
}
.waitlist input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56,189,248,.18); }
.waitlist input::placeholder { color: var(--muted); }
.waitlist button { white-space: nowrap; }
.waitlist button[disabled] { opacity: .6; cursor: progress; }
.waitlist-msg { min-height: 22px; margin-top: 12px; font-size: 15px; font-weight: 600; }
.waitlist-msg.ok { color: var(--good); }
.waitlist-msg.err { color: var(--bad); }
@media (max-width: 480px) { .waitlist { flex-direction: column; } }

.footer { border-top: 1px solid var(--border); padding: 48px 0 28px; background: var(--bg-2); }
.footer-inner { display: grid; grid-template-columns: 1.4fr 2fr; gap: 32px; }
.foot-brand { display: flex; flex-direction: column; gap: 6px; }
.foot-brand span { font-weight: 700; }
.foot-brand img + span { display: inline; }
.foot-brand > :first-child + span, .foot-brand span { }
.foot-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.foot-cols h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }
.foot-cols a { display: block; color: var(--muted); font-size: 15px; padding: 4px 0; }
.foot-cols a:hover { color: var(--text); }
.foot-legal { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); flex-wrap: wrap; font-size: 14px; }

/* ---------- Reveal animation ---------- */
/* Only hide content when JS is present to reveal it again (no-JS + crawlers see all). */
html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html.js .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .cards-3 { grid-template-columns: 1fr; }
  .showcase-grid, .pricing-grid { grid-template-columns: 1fr; }
  .pricing-grid.four { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; }
  .nav-toggle { display: block; }
  .nav.open .nav-links {
    display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 14px 20px; gap: 6px;
  }
  .nav.open .nav-links a { padding: 8px 0; }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .nav-cta .btn-ghost { display: none; }
  .foot-cols { grid-template-columns: 1fr 1fr; }
  .pricing-grid.four { grid-template-columns: 1fr; }
}
