:root {
  --bg: #0A0A0A;
  --surface-1: #141414;
  --surface-2: #1A1A1A;
  --border: #232323;
  --border-strong: #2E2E2E;
  --text: #F5F5F5;
  --text-2: #A3A3A3;
  --text-3: #6B6B6B;
  --accent: oklch(0.66 0.12 150);
  --accent-soft: oklch(0.66 0.12 150 / 0.14);
  --accent-ink: #0A0A0A;
  --danger: oklch(0.65 0.16 25);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 0 rgba(255,255,255,0.02), 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 2px 0 rgba(255,255,255,0.02), 0 12px 32px rgba(0,0,0,0.45);

  --nav-h: 64px;
  --container: 1180px;
  --easing: cubic-bezier(0.2, 0.7, 0.2, 1);
}

html[data-theme="light"] {
  --bg: #FAFAFA;
  --surface-1: #FFFFFF;
  --surface-2: #F2F2F2;
  --border: #E5E5E5;
  --border-strong: #D4D4D4;
  --text: #0A0A0A;
  --text-2: #404040;
  --text-3: #6B6B6B;
  --accent-ink: #FAFAFA;
  --shadow-sm: 0 1px 0 rgba(0,0,0,0.02), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 0 rgba(0,0,0,0.02), 0 12px 32px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.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;
}

.skip-link {
  position: absolute; left: 12px; top: -40px;
  background: var(--accent); color: var(--accent-ink);
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-weight: 600; z-index: 100;
  transition: top 0.2s var(--easing);
}
.skip-link:focus { top: 12px; outline: 2px solid var(--text); outline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0;
  height: var(--nav-h);
  background: transparent;
  border-bottom: 1px solid transparent;
  z-index: 50;
  transition: background-color 0.25s var(--easing), border-color 0.25s var(--easing), backdrop-filter 0.25s var(--easing);
}
.nav.is-stuck {
  background: color-mix(in oklch, var(--bg) 78%, transparent);
  border-bottom-color: var(--border);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}
.nav__inner {
  height: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text);
}
.brand__mark { width: 28px; height: 28px; color: var(--text); }
.brand__mark-bg { fill: var(--surface-2); }
.brand__mark-glyph { fill: var(--text); }
.brand__wordmark {
  font-weight: 600; letter-spacing: -0.01em; font-size: 15px;
}
.nav__links {
  display: flex; gap: 4px; justify-content: center;
}
.nav__links a {
  padding: 8px 12px;
  color: var(--text-2);
  font-size: 14px; font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color 0.15s var(--easing), background-color 0.15s var(--easing);
}
.nav__links a:hover { color: var(--text); background: var(--surface-1); }
.nav__actions { display: inline-flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  transition: background-color 0.15s var(--easing), color 0.15s var(--easing);
}
.icon-btn:hover { background: var(--surface-1); color: var(--text); }
.icon { width: 18px; height: 18px; }
.icon--sun { display: none; }
html[data-theme="light"] .icon--moon { display: none; }
html[data-theme="light"] .icon--sun { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500; font-size: 14px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color 0.15s var(--easing), border-color 0.15s var(--easing), color 0.15s var(--easing), transform 0.1s var(--easing);
}
.btn--lg { padding: 13px 18px; font-size: 15px; border-radius: 8px; }
.btn--primary {
  background: var(--accent); color: var(--accent-ink);
}
.btn--primary:hover { background: oklch(0.72 0.12 150); }
.btn--primary:active { transform: translateY(1px); }
.btn--ghost {
  color: var(--text);
  background: var(--surface-1);
  border-color: var(--border);
}
.btn--ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn__icon { width: 16px; height: 16px; }
.btn__arrow { transition: transform 0.2s var(--easing); }
.btn:hover .btn__arrow { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) {
  .btn, .btn__arrow { transition: none; }
  .btn:hover .btn__arrow { transform: none; }
}

/* ---------- Hero ---------- */
main { padding-top: var(--nav-h); }

.hero { padding: 96px 0 80px; position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 50% 0%, var(--accent-soft), transparent 70%),
    linear-gradient(to bottom, transparent, var(--bg) 70%);
  pointer-events: none;
}
.hero__inner { position: relative; max-width: 880px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 24px;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.02em;
  color: var(--text-2);
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-1);
}
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.display {
  font-size: clamp(40px, 7.2vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0 0 24px;
}
.accent { color: var(--accent); }

.lead {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--text-2);
  max-width: 60ch;
  margin: 0 0 32px;
}

.hero__cta {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-bottom: 40px;
}

.chips {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  font-family: var(--font-mono); font-size: 12px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
}
.chip__k { color: var(--text-3); }
.chip__v { color: var(--text); }

/* ---------- Section heads ---------- */
.section-head { max-width: 720px; margin-bottom: 48px; }
.kicker {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.04em;
  color: var(--accent);
  text-transform: uppercase;
  margin: 0 0 12px;
}
.kicker--on-dark { color: var(--accent); }
.section-head h2 {
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.1; letter-spacing: -0.02em;
  margin: 0 0 12px; font-weight: 600;
}
.section-sub {
  color: var(--text-2);
  margin: 0; font-size: 16px;
  max-width: 60ch;
}

section { padding: 96px 0; }
section + section { border-top: 1px solid var(--border); }

/* ---------- Quickstart / Terminal ---------- */
.terminal {
  margin: 0;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.terminal__chrome {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.terminal__dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border-strong);
}
.terminal__dot:nth-child(1) { background: #3a3a3a; }
.terminal__dot:nth-child(2) { background: #2f2f2f; }
.terminal__dot:nth-child(3) { background: #262626; }
html[data-theme="light"] .terminal__dot:nth-child(1) { background: #ff5f56; }
html[data-theme="light"] .terminal__dot:nth-child(2) { background: #ffbd2e; }
html[data-theme="light"] .terminal__dot:nth-child(3) { background: #27c93f; }
.terminal__title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 12px; color: var(--text-3);
  flex: 1;
  text-align: center;
}
.terminal__copy {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: color 0.15s var(--easing), border-color 0.15s var(--easing);
}
.terminal__copy:hover { color: var(--text); border-color: var(--border-strong); }
.terminal__copy.is-copied { color: var(--accent); border-color: var(--accent); }
.terminal__copy .icon { width: 14px; height: 14px; }

.terminal__body {
  margin: 0;
  padding: 22px 22px 26px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  background: var(--surface-1);
  overflow-x: auto;
  white-space: pre;
}
.terminal__body .ln { display: block; }
.terminal__body .prompt { color: var(--accent); user-select: none; margin-right: 10px; }
.terminal__body .cmd { color: var(--text); }

.fineprint {
  margin: 24px 0 0;
  font-size: 13px; color: var(--text-3);
}
.fineprint code {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--surface-1);
  padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-2);
}

/* ---------- Grids & cards ---------- */
.grid { display: grid; gap: 16px; }
.grid--engine { grid-template-columns: repeat(2, 1fr); }
.grid--showcase { grid-template-columns: 1.4fr 1fr; }
.grid--two { grid-template-columns: 1fr 1fr; }

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex; flex-direction: column; gap: 18px;
  transition: border-color 0.2s var(--easing), background-color 0.2s var(--easing);
}
.card:hover { border-color: var(--border-strong); }
.card__head { display: flex; align-items: baseline; gap: 14px; }
.card__index {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-3); letter-spacing: 0.04em;
}
.card__title {
  margin: 0; font-size: 18px; font-weight: 600;
  letter-spacing: -0.01em;
}
.card p { margin: 0; color: var(--text-2); font-size: 15px; }
.card__cta {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--accent);
  margin-top: auto;
}

.kv {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  gap: 6px;
}
.kv > div { display: flex; justify-content: space-between; gap: 12px; }
.kv dt {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-3);
  letter-spacing: 0.02em;
}
.kv dd {
  margin: 0; font-family: var(--font-mono); font-size: 12px; color: var(--text);
}

.autonauts {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
}
.autonauts li {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--text);
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.autonauts li::before { content: "▸ "; color: var(--accent); }

.phases {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.phases li {
  display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 13px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.phases li span {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
  font-size: 11px;
}

.meter { display: flex; flex-direction: column; gap: 8px; }
.meter__track {
  height: 6px; background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px; overflow: hidden;
}
.meter__fill {
  height: 100%; background: var(--accent);
}
.meter__legend {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-3);
}

/* ---------- Showcase ---------- */
.prism {
  position: relative;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  background: linear-gradient(160deg, var(--surface-1), var(--bg));
  overflow: hidden;
  min-height: 360px;
  transition: border-color 0.2s var(--easing), transform 0.2s var(--easing);
}
.prism:hover { border-color: var(--accent); }
.prism__bg { position: absolute; inset: 0; pointer-events: none; opacity: 0.55; }
.prism__beam {
  position: absolute;
  width: 2px; height: 140%;
  top: -20%; left: 18%;
  background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  transform: rotate(18deg);
  filter: blur(0.5px);
  opacity: 0.6;
}
.prism__beam--2 { left: 48%; opacity: 0.35; transform: rotate(18deg) translateX(20px); }
.prism__beam--3 { left: 78%; opacity: 0.2; transform: rotate(18deg) translateX(40px); }
.prism__content { position: relative; display: flex; flex-direction: column; gap: 16px; height: 100%; }
.prism__title {
  margin: 0;
  font-size: clamp(36px, 4vw, 52px);
  letter-spacing: -0.03em; line-height: 1; font-weight: 700;
}
.prism__sub { color: var(--text-2); margin: 0; max-width: 40ch; }
.prism__stats {
  list-style: none; padding: 0; margin: 16px 0 0;
  display: flex; gap: 28px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.prism__stats li { display: flex; flex-direction: column; gap: 2px; }
.prism__stats span {
  font-family: var(--font-mono);
  font-size: 22px; font-weight: 500; color: var(--text);
  letter-spacing: -0.01em;
}
.prism__stats small {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em;
}
.prism__cta {
  margin-top: auto;
  display: inline-flex; gap: 8px;
  font-family: var(--font-mono); font-size: 13px;
  color: var(--accent);
}

.card--showcase { padding: 28px; }
.badge {
  display: inline-block;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-3);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-right: 10px;
}

/* ---------- Open-core ---------- */
.pillar {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex; flex-direction: column; gap: 22px;
}
.pillar--commercial { border-color: var(--border-strong); }
.pillar__head h3 {
  margin: 8px 0 0;
  font-size: 22px; letter-spacing: -0.015em;
  font-weight: 600;
}
.pillar__tag {
  display: inline-block;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-3);
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.pillar__tag--accent {
  color: var(--accent);
  border-color: color-mix(in oklch, var(--accent) 50%, var(--border));
  background: var(--accent-soft);
}
.checklist {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.checklist li {
  position: relative;
  padding-left: 24px;
  color: var(--text-2);
  font-size: 15px;
}
.checklist li::before {
  content: "";
  position: absolute; left: 0; top: 9px;
  width: 14px; height: 8px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface-1);
  margin-top: 0;
}
.footer__inner {
  padding: 64px 24px 40px;
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 48px;
}
.footer__tag {
  margin: 16px 0 0;
  color: var(--text-3);
  font-size: 14px;
  line-height: 1.6;
  max-width: 36ch;
}
.footer__cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.footer__col h4 {
  margin: 0 0 14px;
  font-size: 12px; font-weight: 600;
  color: var(--text);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-family: var(--font-mono);
}
.footer__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer__col a {
  font-size: 14px; color: var(--text-2);
  transition: color 0.15s var(--easing);
}
.footer__col a:hover { color: var(--text); }
.footer__base {
  border-top: 1px solid var(--border);
  padding: 18px 0;
}
.footer__base-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.footer__base small { color: var(--text-3); font-size: 12px; }
.footer__base code { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-family: var(--font-mono);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--easing), transform 0.2s var(--easing);
  z-index: 100;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Reveal-on-scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--easing), transform 0.5s var(--easing);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .toast { transition: opacity 0.01s; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav__links { display: none; }
  .nav__inner { grid-template-columns: auto 1fr auto; }
  .grid--engine { grid-template-columns: 1fr; }
  .grid--showcase { grid-template-columns: 1fr; }
  .grid--two { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 640px) {
  section { padding: 72px 0; }
  .hero { padding: 80px 0 56px; }
  .hero__cta { width: 100%; }
  .hero__cta .btn { width: 100%; justify-content: center; }
  .pillar, .card { padding: 22px; }
  .prism { padding: 28px; min-height: 320px; }
  .prism__stats { flex-wrap: wrap; gap: 18px; }
  .footer__cols { grid-template-columns: 1fr 1fr; gap: 24px; }
  .terminal__body { font-size: 12.5px; padding: 18px; }
  .terminal__title { display: none; }
}
@media (max-width: 380px) {
  .footer__cols { grid-template-columns: 1fr; }
  .nav__actions .btn--primary span:not(.btn__icon) { display: none; }
}