:root {
  --bg: #0b0d10;
  --bg-2: #11141a;
  --bg-3: #161a22;
  --panel: #141821;
  --panel-2: #1a1f2a;
  --line: #232a36;
  --line-2: #2c3441;
  --text: #e6e9ef;
  --muted: #9aa3b2;
  --dim: #6b7383;
  --accent: #7aa2ff;
  --accent-2: #a07bff;
  --accent-3: #5dd0a7;
  --warn: #f0b95c;
  --code-bg: #0d1017;
  --code-fg: #d6dcea;
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1180px;
  --shadow-1: 0 1px 0 rgba(255,255,255,.04) inset, 0 8px 24px rgba(0,0,0,.35);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(122,162,255,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(160,123,255,.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

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

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

code {
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 6px;
  color: #cfd6e4;
}

pre code { background: transparent; border: none; padding: 0; }

kbd {
  display: inline-block;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 12px;
  color: #d6dcea;
}

.skip-link {
  position: absolute; left: -9999px; top: auto;
  background: var(--accent); color: #0b0d10; padding: 8px 12px; border-radius: 8px;
}
.skip-link:focus { left: 16px; top: 12px; z-index: 1000; }

/* ─────────── Topbar ─────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  background: rgba(11,13,16,.72);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 700; letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--muted); font-size: 14px; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.ghost {
  color: var(--text);
  border: 1px solid var(--line-2);
  padding: 6px 12px;
  border-radius: 999px;
}
.nav a.ghost:hover { background: var(--panel); }

@media (max-width: 760px) {
  .nav a:not(.ghost) { display: none; }
}

/* ─────────── Hero ─────────── */
.hero { padding: 72px 0 56px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
  background: var(--panel);
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line);
}
.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 12px var(--accent-3);
}
h1 {
  font-size: clamp(36px, 5.6vw, 64px);
  line-height: 1.04;
  margin: 18px 0 18px;
  letter-spacing: -.025em;
  font-weight: 750;
}
.grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2) 70%, var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede {
  color: var(--muted);
  font-size: 18px;
  max-width: 60ch;
  margin: 0 0 28px;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 550;
  font-size: 14px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--panel-2); border-color: #3a4252; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, #4f7df5, #3961d8);
  border-color: #3961d8;
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 10px 24px rgba(57,97,216,.35);
}
.btn.primary:hover { background: linear-gradient(180deg, #5a87f7, #3f68df); }

.hero-meta {
  list-style: none; padding: 0; margin: 28px 0 0;
  display: flex; gap: 10px; flex-wrap: wrap;
  color: var(--dim);
}

/* Terminal */
.hero-term {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.term-chrome {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: #0a0d13;
  border-bottom: 1px solid var(--line);
}
.term-chrome span {
  width: 12px; height: 12px; border-radius: 50%;
  background: #3a414e;
}
.term-chrome span:nth-child(1) { background: #ff5f57; }
.term-chrome span:nth-child(2) { background: #febc2e; }
.term-chrome span:nth-child(3) { background: #28c840; }
.term-chrome em { font-style: normal; color: var(--dim); font-size: 12px; margin-left: 8px; font-family: var(--mono); }
.term-body {
  margin: 0; padding: 18px 18px 22px;
  color: var(--code-fg);
  font-size: 13px; line-height: 1.65;
  overflow-x: auto;
}
.term-body .p { color: var(--accent-3); user-select: none; }
.term-body .c { color: #f0b95c; }
.term-body .s { color: #9ad5a4; }
.term-body .k { color: var(--accent); }
.term-body .dim { color: var(--dim); }

/* ─────────── Sections ─────────── */
.section { padding: 88px 0; border-top: 1px solid var(--line); }
.section-alt { background: linear-gradient(180deg, rgba(255,255,255,.012), transparent), var(--bg-2); }
.section-title {
  font-size: clamp(28px, 3.4vw, 38px);
  letter-spacing: -.02em;
  margin: 0 0 10px;
  font-weight: 700;
}
.section-sub {
  color: var(--muted);
  max-width: 70ch;
  margin: 0 0 36px;
  font-size: 17px;
}

/* Feature grid */
.feature-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .feature-grid { grid-template-columns: 1fr; } }

.feature {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.feature:hover { transform: translateY(-2px); border-color: var(--line-2); background: var(--panel-2); }
.ficon {
  font-size: 22px; line-height: 1;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 14px;
}
.feature h3 { margin: 0 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ─────────── Demo ─────────── */
.demo {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 36px;
  align-items: start;
}
@media (max-width: 1000px) { .demo { grid-template-columns: 1fr; } }

.demo-stage {
  position: relative;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 11;
  width: 100%;
  min-width: 0;
  box-shadow: var(--shadow-1);
}
.demo-stage img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  opacity: 0;
  transition: opacity .55s ease, transform 6s ease;
  transform: scale(1.02);
}
.demo-stage img.active {
  opacity: 1;
  transform: scale(1.06);
}
.demo-progress {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px; background: rgba(255,255,255,.06);
}
.demo-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  width: 0%;
  transition: width .12s linear;
}

.demo-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.demo-list li {
  display: flex; gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.demo-list li:hover { background: var(--panel-2); }
.demo-list li.active {
  background: linear-gradient(180deg, rgba(122,162,255,.10), rgba(160,123,255,.06)), var(--panel);
  border-color: rgba(122,162,255,.45);
  box-shadow: 0 0 0 1px rgba(122,162,255,.15) inset;
}
.demo-list .step {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px 8px;
  align-self: flex-start;
  height: 22px; display: inline-flex; align-items: center;
}
.demo-list li.active .step { color: var(--accent); border-color: rgba(122,162,255,.5); }
.demo-list h4 { margin: 0 0 2px; font-size: 15px; }
.demo-list p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ─────────── Install / Code ─────────── */
.step-h {
  margin: 28px 0 12px;
  font-size: 14px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.step-h:first-of-type { margin-top: 8px; }

.code {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  color: var(--code-fg);
  overflow-x: auto;
  margin: 0 0 12px;
  line-height: 1.7;
}
.code .c { color: #f0b95c; }
.code .s { color: #9ad5a4; }
.code .k { color: var(--accent); }
.code .dim { color: var(--dim); }

.tabs {
  display: inline-flex;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  gap: 2px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.tabs button {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] {
  background: var(--bg-3);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--line-2) inset;
}

.tabpanels [data-panel][hidden] { display: none; }

.two-col {
  display: grid; gap: 22px;
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
}
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
.two-col h4 { margin: 0 0 8px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.aside { color: var(--muted); font-size: 14px; margin: 0; }

/* ─────────── Architecture ─────────── */
.diagram {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  overflow-x: auto;
  color: #b6c0d4;
  font-size: 12.5px;
  line-height: 1.55;
  margin: 0 0 30px;
}

.arch-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 1000px) { .arch-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .arch-grid { grid-template-columns: 1fr; } }

.arch-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.arch-card h3 { margin: 0 0 10px; font-size: 16px; }
.arch-card p, .arch-card li { color: var(--muted); font-size: 14.5px; }
.arch-card ul, .arch-card ol { padding-left: 20px; margin: 0; }
.arch-card li + li { margin-top: 6px; }
.mini {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--code-fg);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  margin: 6px 0 10px;
}

/* ─────────── API ─────────── */
.api-grid {
  display: grid; gap: 10px;
}
.api-row {
  display: grid;
  grid-template-columns: 70px 320px 1fr;
  align-items: center; gap: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}
@media (max-width: 800px) {
  .api-row { grid-template-columns: 60px 1fr; }
  .api-row p { grid-column: 1 / -1; margin-top: 4px; }
}
.api-row code { background: transparent; border: 0; padding: 0; color: var(--text); }
.api-row p { margin: 0; color: var(--muted); font-size: 14px; }
.api-verb {
  font-family: var(--mono);
  font-size: 11px; font-weight: 700;
  letter-spacing: .1em;
  text-align: center;
  padding: 5px 0;
  border-radius: 6px;
  color: #0b0d10;
}
.api-verb.get  { background: #7aa2ff; }
.api-verb.post { background: #5dd0a7; }
.api-verb.put  { background: #f0b95c; }
.api-verb.del  { background: #f06a6a; }

/* ─────────── CTA + Footer ─────────── */
.cta-section { padding: 56px 0; }
.cta-wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.cta-wrap h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.02em; }
.cta-wrap p  { margin: 0; color: var(--muted); }

.footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 40px;
  color: var(--muted);
  font-size: 14px;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* ─────────── Reduced motion ─────────── */
@media (prefers-reduced-motion: reduce) {
  .demo-stage img { transition: opacity .15s linear; transform: none; }
  .demo-stage img.active { transform: none; }
  html { scroll-behavior: auto; }
}
