:root {
  --bg: #0b0d12;
  --bg-elev: #11141b;
  --bg-elev-2: #161a23;
  --fg: #e7eaf0;
  --fg-strong: #ffffff;
  --muted: #8b93a7;
  --muted-2: #5d6478;
  --border: #1f2430;
  --border-strong: #2a3142;
  --pane-bg: #0f1219;
  --pane-header-bg: #141823;
  --code: #161a23;
  --accent: #7c8cff;
  --accent-2: #5eead4;
  --accent-3: #c084fc;
  --grad: linear-gradient(135deg, #7c8cff 0%, #c084fc 50%, #5eead4 100%);
  --grad-soft: linear-gradient(135deg, rgba(124,140,255,.15), rgba(192,132,252,.1) 60%, rgba(94,234,212,.12));
  --shadow-lg: 0 20px 60px -10px rgba(0,0,0,.6), 0 8px 20px -8px rgba(124,140,255,.15);
  --shadow-md: 0 8px 24px -6px rgba(0,0,0,.5);
  --green: #22c55e;
  --blue: #60a5fa;
  --purple: #c084fc;
  --red: #ef4444;
  --yellow: #eab308;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafbff;
    --bg-elev: #ffffff;
    --bg-elev-2: #ffffff;
    --fg: #1a1d29;
    --fg-strong: #0a0c14;
    --muted: #5d6478;
    --muted-2: #8b93a7;
    --border: #e6e9f2;
    --border-strong: #d2d7e3;
    --pane-bg: #ffffff;
    --pane-header-bg: #f3f5fb;
    --code: #f3f5fb;
    --accent: #5b6cf2;
    --accent-2: #0d9488;
    --accent-3: #9333ea;
    --grad: linear-gradient(135deg, #5b6cf2 0%, #9333ea 50%, #0d9488 100%);
    --grad-soft: linear-gradient(135deg, rgba(91,108,242,.08), rgba(147,51,234,.06) 60%, rgba(13,148,136,.08));
    --shadow-lg: 0 20px 60px -10px rgba(91,108,242,.18), 0 8px 20px -8px rgba(147,51,234,.1);
    --shadow-md: 0 8px 24px -6px rgba(91,108,242,.12);
  }
}

* { box-sizing: border-box; }

html, body { overflow-x: hidden; }

body {
  margin: 0;
  font: 16px/1.6 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* ---------- Backdrop ---------- */

.bg-grid {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, #000 30%, transparent 80%);
  opacity: .35;
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(124,140,255,.18), transparent 60%),
    radial-gradient(ellipse 50% 35% at 80% 10%, rgba(192,132,252,.14), transparent 60%),
    radial-gradient(ellipse 70% 40% at 50% 100%, rgba(94,234,212,.08), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

@media (prefers-color-scheme: light) {
  .bg-grid { opacity: .6; }
  .bg-glow {
    background:
      radial-gradient(ellipse 60% 40% at 20% 0%, rgba(91,108,242,.10), transparent 60%),
      radial-gradient(ellipse 50% 35% at 80% 10%, rgba(147,51,234,.08), transparent 60%);
  }
}

/* ---------- Top nav ---------- */

.topnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
}

.brand {
  display: inline-flex; align-items: baseline; gap: 2px;
  font: 600 18px/1 "JetBrains Mono", ui-monospace, monospace;
  color: var(--fg-strong);
  text-decoration: none;
}
.brand-mark {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}
.brand-name { letter-spacing: -0.01em; }

.topnav-links {
  display: flex; align-items: center; gap: 24px;
}
.topnav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .15s;
}
.topnav-links a:hover { color: var(--fg-strong); }

.star-mini {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--fg) !important;
}
.star-mini:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
  transform: translateY(-1px);
}
.star-mini svg { color: #eab308; }

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

.hero {
  position: relative; z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px 60px;
  text-align: center;
}
.hero-inner { max-width: 880px; margin: 0 auto; }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 28px;
  transition: border-color .15s, color .15s;
}
.badge:hover { border-color: var(--accent); color: var(--fg); }

.badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(34,197,94,.18);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
  50%      { box-shadow: 0 0 0 6px rgba(34,197,94,.05); }
}

.hero-title {
  font-size: clamp(40px, 6.4vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 0 0 24px;
  color: var(--fg-strong);
}

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

.cli-list { display: inline-block; }
.cli-cursor {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.cli-cursor::after {
  content: "";
  display: inline-block;
  width: .55em; height: 1em;
  background: var(--accent);
  vertical-align: -0.12em;
  margin-left: 6px;
  animation: blink 1.05s steps(2, start) infinite;
  border-radius: 1px;
}

@keyframes blink {
  to { background: transparent; }
}

.hero-sub {
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.6;
  color: var(--muted);
  max-width: 680px;
  margin: 0 auto 36px;
}
.hero-sub strong { color: var(--fg); font-weight: 600; }
.nowrap { white-space: nowrap; }

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s, border-color .15s;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: var(--grad);
  color: #ffffff;
  box-shadow: 0 8px 24px -8px rgba(124,140,255,.6), inset 0 1px 0 rgba(255,255,255,.12);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -8px rgba(124,140,255,.7), inset 0 1px 0 rgba(255,255,255,.18);
}

.btn-ghost {
  background: var(--bg-elev);
  color: var(--fg-strong);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn-ghost svg { color: #eab308; }

.btn-link {
  background: transparent;
  color: var(--muted);
  padding: 13px 14px;
}
.btn-link:hover { color: var(--fg-strong); }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  font-size: 13px;
  color: var(--muted);
}
.hero-meta .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.dot-green  { background: var(--green); }
.dot-blue   { background: var(--blue); }
.dot-purple { background: var(--purple); }

/* ---------- Section heads ---------- */

section { position: relative; z-index: 1; }

.section-head {
  max-width: 880px;
  margin: 0 auto 36px;
  text-align: center;
  padding: 0 24px;
}
.section-head h2 {
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--fg-strong);
}
.section-sub {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

/* ---------- Install / Terminal card ---------- */

.install {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
}

.terminal-card {
  max-width: 820px;
  margin: 0 auto;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.terminal-chrome {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: var(--bg-elev-2);
  border-bottom: 1px solid var(--border);
}
.mac-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.mac-red    { background: #ff5f56; }
.mac-yellow { background: #ffbd2e; }
.mac-green  { background: #27c93f; }
.terminal-title {
  margin-left: 12px;
  font: 12px/1 "JetBrains Mono", monospace;
  color: var(--muted-2);
}

.terminal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0 8px;
  background: var(--bg-elev-2);
  border-bottom: 1px solid var(--border);
}
.tab {
  padding: 11px 16px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font: 500 13px/1 "JetBrains Mono", monospace;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--fg); }
.tab.active {
  color: var(--fg-strong);
  border-bottom-color: var(--accent);
}

.terminal-body {
  position: relative;
  background: var(--bg);
}
.terminal-pane {
  display: none;
  margin: 0;
  padding: 22px 24px;
  font: 14px/1.7 "JetBrains Mono", ui-monospace, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--fg);
}
.terminal-pane.active { display: block; }
.terminal-pane .prompt { color: var(--accent-2); user-select: none; }
.terminal-pane .cmd { color: var(--fg-strong); }
.terminal-pane .comment { color: var(--muted-2); }

.copy-cmd {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--muted);
  font: 500 12px "Inter", sans-serif;
  cursor: pointer;
  transition: all .15s;
}
.copy-cmd:hover { color: var(--accent); border-color: var(--accent); }
.copy-cmd.copied { color: var(--green); border-color: var(--green); }

.terminal-foot {
  padding: 12px 20px;
  background: var(--bg-elev-2);
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.terminal-foot code {
  font-family: "JetBrains Mono", monospace;
  background: var(--code);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--fg);
  font-size: 0.9em;
}

/* ---------- Demo ---------- */

.demo {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
}

.controls label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
}
.controls input[type="checkbox"] { accent-color: var(--accent); }
.controls code {
  font-family: "JetBrains Mono", monospace;
  background: var(--code);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

.controls button {
  margin-left: auto;
  padding: 7px 14px;
  background: var(--bg-elev-2);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  cursor: pointer;
  font: 500 13px "Inter", sans-serif;
  transition: all .15s;
}
.controls button:hover { border-color: var(--accent); color: var(--accent); }

.panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .panes { grid-template-columns: 1fr; }
}

.pane {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--pane-bg);
  min-height: 460px;
  box-shadow: var(--shadow-md);
  transition: border-color .2s, box-shadow .2s;
}
.pane:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,140,255,.12), var(--shadow-md);
}

.pane > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--pane-header-bg);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  max-width: none;
  margin: 0;
}
.pane-icon {
  display: inline-block;
  margin-right: 6px;
  color: var(--accent);
}

.pane button {
  padding: 5px 12px;
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  cursor: pointer;
  font: 500 12px "Inter", sans-serif;
  transition: all .15s;
}
.pane button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pane button:disabled { opacity: 0.4; cursor: not-allowed; }

textarea {
  flex: 1;
  width: 100%;
  border: 0;
  padding: 14px;
  resize: none;
  background: var(--pane-bg);
  color: var(--fg);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
}
textarea:focus { outline: none; }
textarea::placeholder { color: var(--muted-2); }

.stats {
  margin: 16px 0 0;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  font: 12px/1.7 "JetBrains Mono", monospace;
  color: var(--muted);
  white-space: pre-wrap;
  min-height: 1.5em;
}
.stats:empty { display: none; }

/* ---------- Features ---------- */

.features {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1080px;
  margin: 0 auto;
}

@media (max-width: 820px) {
  .feature-grid { grid-template-columns: 1fr; }
}

.feature {
  padding: 28px 24px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.feature:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--grad-soft);
  color: var(--accent);
  margin-bottom: 16px;
}

.feature h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--fg-strong);
  letter-spacing: -0.01em;
}
.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ---------- CTA band ---------- */

.cta-band {
  max-width: 1200px;
  margin: 40px auto;
  padding: 60px 24px;
  text-align: center;
  background: var(--grad-soft);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
}
.cta-band h2 {
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--fg-strong);
}
.cta-band p {
  max-width: 540px;
  margin: 0 auto 28px;
  color: var(--muted);
}
.cta-band code {
  font-family: "JetBrains Mono", monospace;
  background: var(--code);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--fg);
}

/* ---------- Footer ---------- */

footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  border-top: 1px solid var(--border);
  position: relative; z-index: 1;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
}
.footer-brand {
  font: 700 18px/1 "JetBrains Mono", monospace;
  margin-bottom: 10px;
}
.footer-blurb {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 460px;
}
.footer-blurb code {
  font-family: "JetBrains Mono", monospace;
  background: var(--code);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}
.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .15s;
}
.footer-links a:hover { color: var(--fg-strong); }

@media (max-width: 600px) {
  .topnav-links a:not(.star-mini) { display: none; }
  .hero { padding-top: 48px; }
  .features, .install, .demo { padding-left: 16px; padding-right: 16px; }
}
