:root {
  --bg: #0c0d0f;
  --bg-raised: #141619;
  --bg-panel: #191c20;
  --bg-inset: #0a0b0d;
  --border: #24282e;
  --border-bright: #33393f;
  --text: #c8cdd3;
  --text-bright: #eaecef;
  --text-muted: #6b7280;
  --accent: #18e2a0;
  --accent-dim: #0fb880;
  --accent-glow: rgba(24, 226, 160, 0.12);
  --red: #f87171;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

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

img, svg { display: block; max-width: 100%; }

/* ---- layout ---- */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- nav ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 13, 15, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text-bright);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.nav-brand svg { width: 28px; height: 28px; }

.nav-links {
  display: flex;
  gap: 1.6rem;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 160ms;
}

.nav-links a:hover,
.nav-links a.active { color: var(--text-bright); }

/* ---- hero ---- */
.hero {
  padding: 6rem 0 4.5rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-bright);
  margin: 0 auto;
  max-width: 720px;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent), #5ee8c0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  margin: 1.2rem auto 0;
  max-width: 560px;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.65;
}

/* terminal */
.terminal {
  margin: 2.4rem auto 0;
  max-width: 580px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 0.9rem;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}

.terminal-dot.r { background: #f87171; }
.terminal-dot.y { background: #fbbf24; }
.terminal-dot.g { background: #34d399; }

.terminal-body {
  padding: 1rem 1.1rem;
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow-x: auto;
  min-height: 2.6rem;
}

.terminal-body .prompt { color: var(--accent); }
.terminal-body .cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.4rem;
  flex-wrap: wrap;
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 140ms, box-shadow 140ms;
}

.btn:hover { transform: translateY(-1px); text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-bright);
}

.btn-outline:hover { border-color: var(--accent-dim); color: var(--text-bright); }

.btn-ghost {
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border);
}

/* ---- sections ---- */
.section {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}

.section-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 0.4rem;
}

.section h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  font-weight: 700;
  color: var(--text-bright);
  margin: 0 0 0.6rem;
  line-height: 1.18;
}

.section-desc {
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 0 2rem;
}

/* feature grid */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.feat {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem;
  transition: border-color 200ms;
}

.feat:hover { border-color: var(--accent-dim); }

.feat-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
  color: var(--accent);
  font-size: 1.15rem;
}

.feat h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-bright);
  margin: 0 0 0.35rem;
}

.feat p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* stats strip */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.stat {
  text-align: center;
  padding: 1.6rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-raised);
}

.stat-val {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* code panel */
.code-panel {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
}

.code-panel .ln {
  color: var(--text-muted);
  user-select: none;
  display: inline-block;
  width: 2.5ch;
  text-align: right;
  margin-right: 1.2rem;
}

.code-panel .kw { color: var(--accent); }
.code-panel .cm { color: var(--text-muted); font-style: italic; }
.code-panel .str { color: #fbbf24; }

/* comparison table */
.cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.cmp-table th,
.cmp-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.cmp-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--bg-panel);
}

.cmp-table td:first-child {
  font-weight: 600;
  color: var(--text-bright);
}

.cmp-table .val-none { color: var(--text-muted); font-style: italic; }
.cmp-table .val-yes { color: var(--accent); font-weight: 600; }

/* docs list */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.doc-card {
  display: block;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.3rem;
  text-decoration: none;
  transition: border-color 200ms;
}

.doc-card:hover { border-color: var(--accent-dim); text-decoration: none; }

.doc-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-bright);
  margin: 0 0 0.3rem;
}

.doc-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* architecture flow */
.flow {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.flow-step {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
}

.flow-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 36px;
}

.flow-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 0.35rem;
}

.flow-line {
  width: 2px;
  flex: 1;
  background: var(--border);
  min-height: 28px;
}

.flow-content {
  padding-bottom: 1.6rem;
}

.flow-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-bright);
  margin: 0 0 0.25rem;
}

.flow-content p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* tiers visual */
.tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.tier {
  padding: 1.4rem;
  border-right: 1px solid var(--border);
}

.tier:last-child { border-right: none; }

.tier-bar {
  height: 6px;
  border-radius: 3px;
  margin-bottom: 1rem;
}

.tier:nth-child(1) .tier-bar { background: var(--accent); width: 100%; }
.tier:nth-child(2) .tier-bar { background: #5ee8c0; width: 60%; }
.tier:nth-child(3) .tier-bar { background: var(--text-muted); width: 40%; }

.tier h3 {
  font-size: 0.95rem;
  color: var(--text-bright);
  margin: 0 0 0.1rem;
  font-weight: 700;
}

.tier .pct {
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  display: block;
  margin-bottom: 0.5rem;
}

.tier p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--text-bright); }

/* scroll reveal */
.sr {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.sr.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- responsive ---- */
@media (max-width: 880px) {
  .feat-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .tiers { grid-template-columns: 1fr; }
  .tier { border-right: none; border-bottom: 1px solid var(--border); }
  .tier:last-child { border-bottom: none; }
}

@media (max-width: 600px) {
  .hero { padding: 3.5rem 0 2.5rem; }
  .nav-links { gap: 0.9rem; }
  .nav-links a { font-size: 0.82rem; }
  .stats { grid-template-columns: 1fr 1fr; }
  .cmp-table { font-size: 0.82rem; }
  .cmp-table th, .cmp-table td { padding: 0.55rem 0.6rem; }
}

/* ---- version badge ---- */
.nav-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none !important;
  border: 1px solid var(--border);
  margin-left: 0.4rem;
  flex-shrink: 0;
  transition: border-color 160ms;
}

.nav-badge:hover {
  border-color: var(--accent-dim);
  text-decoration: none !important;
}

.nav-badge-label {
  display: inline-flex;
  align-items: center;
  padding: 0 0.5rem;
  height: 100%;
  background: var(--bg-panel);
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.nav-badge-value {
  display: inline-flex;
  align-items: center;
  padding: 0 0.55rem;
  height: 100%;
  background: var(--accent);
  color: var(--bg);
  letter-spacing: 0.01em;
}
