:root {
  --bg: #f7f8fa;
  --bg-alt: #eef1f6;
  --surface: #ffffff;
  --text: #16202e;
  --muted: #566275;
  --border: #d9dee7;
  --accent: #1d66c9;
  --accent-strong: #154f9e;
  --accent-soft: rgba(44, 123, 229, 0.1);
  --term-bg: #0f1724;
  --term-bar: #1a2435;
  --term-text: #c9d4e3;
  --term-dim: #7c8ba1;
  --term-ok: #7fd1a0;
  --term-prompt: #5ea3ff;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --radius: 12px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b111b;
    --bg-alt: #101827;
    --surface: #141d2c;
    --text: #e3e9f2;
    --muted: #9aa7ba;
    --border: #243147;
    --accent: #5ea3ff;
    --accent-strong: #8bbcff;
    --accent-soft: rgba(94, 163, 255, 0.12);
    --term-bg: #070c14;
    --term-bar: #111a28;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, kbd, pre { font-family: var(--mono); font-size: 0.88em; }

p code, li code, h3 code {
  background: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 5px;
  word-break: break-word;
}

kbd {
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.05em 0.4em;
  background: var(--surface);
}

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

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text); }
.brand:hover { text-decoration: none; }
nav { display: flex; gap: 22px; align-items: center; font-size: 0.95rem; }
nav a { color: var(--muted); }
nav a:hover { color: var(--text); text-decoration: none; }
nav .nav-gh {
  color: var(--text);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 8px;
}

/* Hero */
.hero {
  padding: 88px 0 96px;
  background:
    radial-gradient(900px 420px at 85% 10%, var(--accent-soft), transparent 70%),
    radial-gradient(600px 300px at 0% 100%, var(--accent-soft), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.eyebrow {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
}
h1 em { font-style: normal; color: var(--accent); }
.lede { font-size: 1.15rem; color: var(--muted); margin: 0 0 32px; max-width: 34em; }
.lede strong { color: var(--text); }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.98rem;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); }
@media (prefers-color-scheme: dark) { .btn-primary { color: #06101f; } }
.btn-ghost { border: 1px solid var(--border); color: var(--text); background: var(--surface); }

/* Terminal */
.terminal {
  background: var(--term-bg);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -20px rgba(10, 30, 70, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: hidden;
  min-width: 0;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  background: var(--term-bar);
}
.terminal-bar span { width: 11px; height: 11px; border-radius: 50%; background: #3a465a; }
.terminal-bar span:nth-child(1) { background: #ff5f57; }
.terminal-bar span:nth-child(2) { background: #febc2e; }
.terminal-bar span:nth-child(3) { background: #28c840; }
.terminal-bar b { margin-left: auto; margin-right: auto; font: 500 0.78rem var(--mono); color: var(--term-dim); padding-right: 40px; }
.terminal pre {
  margin: 0;
  padding: 18px 20px 22px;
  color: var(--term-text);
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
}
.terminal .p { color: var(--term-prompt); user-select: none; }
.terminal .o { color: var(--term-dim); }
.terminal .ok { color: var(--term-ok); }
.terminal .j { color: #e8c67a; }
.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--term-text);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
  html { scroll-behavior: auto; }
}

/* Sections */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { font-size: clamp(1.6rem, 3vw, 2.1rem); letter-spacing: -0.01em; margin: 0 0 40px; text-align: center; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 18px; }
h3 { margin: 0 0 8px; font-size: 1.08rem; }
.section p { color: var(--muted); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.feature:hover { border-color: var(--accent); transform: translateY(-2px); }
.feature p { margin: 0; font-size: 0.97rem; }
.icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  margin-bottom: 16px;
}
.icon svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 64px; align-items: center; }
.split-reverse > :first-child { order: 2; }

.checks { list-style: none; padding: 0; margin: 24px 0 0; }
.checks li { position: relative; padding-left: 30px; margin-bottom: 12px; color: var(--muted); }
.checks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.35em;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%231d66c9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* Diagram */
.diagram { display: flex; flex-direction: column; align-items: stretch; }
.node {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  text-align: center;
}
.node-accent { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.node-label { display: block; font: 600 0.98rem var(--mono); }
.node-sub { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.arrow {
  position: relative;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.arrow::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 50%;
  border-left: 2px dashed var(--accent);
}
.arrow::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: calc(50% - 5px);
  border: 6px solid transparent;
  border-top-color: var(--accent);
  border-bottom: 0;
}
.arrow span {
  position: relative;
  background: var(--bg-alt);
  padding: 2px 10px;
  font: 0.78rem var(--mono);
  color: var(--muted);
}

.terminal-small pre { font-size: 0.85rem; }

/* Notes */
.notes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.note { border-top: 2px solid var(--accent); padding-top: 16px; }
.note p { margin: 0; font-size: 0.95rem; }
.caveat {
  margin: 40px auto 0;
  max-width: 46em;
  text-align: center;
  font-size: 0.95rem;
}

/* Install */
.install { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 48px; }
.install-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  min-width: 0;
}
.install-card p { margin: 0 0 18px; }
.sub { font-size: 1.3rem; margin-bottom: 16px; }
pre.code {
  margin: 0;
  background: var(--term-bg);
  color: var(--term-text);
  border-radius: 10px;
  padding: 16px 20px;
  overflow-x: auto;
  line-height: 1.7;
}
pre.code .c { color: var(--term-dim); }
.more { margin-top: 32px; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: 0.9rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 960px) {
  .hero-grid, .split { grid-template-columns: 1fr; gap: 44px; }
  .split-reverse > :first-child { order: 0; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .notes { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .wrap { padding: 0 16px; }
  nav a:not(.nav-gh) { display: none; }
  .hero { padding: 56px 0 64px; }
  .section { padding: 64px 0; }
  .features, .notes, .install { grid-template-columns: 1fr; }
  .terminal pre { font-size: 0.74rem; }
}
