:root {
  --bg: #070b14;
  --bg-alt: #0a1020;
  --panel: #0d1526;
  --panel-2: #111a2e;
  --line: rgba(148, 178, 255, 0.10);
  --line-2: rgba(148, 178, 255, 0.18);
  --text: #e8edf8;
  --text-dim: #93a1bd;
  --text-faint: #5c6a87;
  --accent: #4f8cff;
  --accent-soft: rgba(79, 140, 255, 0.12);
  --bid: #2fd08c;
  --bid-soft: rgba(47, 208, 140, 0.10);
  --ask: #ff5d73;
  --ask-soft: rgba(255, 93, 115, 0.10);
  --amber: #f5b74e;
  --mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

::selection { background: rgba(79, 140, 255, 0.35); }

/* ---------- Nav ---------- */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(7, 11, 20, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 28px;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.brand {
  font-family: var(--mono); font-weight: 700; font-size: 15px;
  color: var(--text); text-decoration: none; letter-spacing: -0.01em;
}
.brand-mark { color: var(--accent); margin-right: 2px; }
.brand-dim { color: var(--text-faint); }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a {
  color: var(--text-dim); text-decoration: none; font-size: 13.5px; font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }
.nav-gh { color: var(--accent) !important; }
@media (max-width: 720px) { .nav-links a:not(.nav-gh) { display: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; padding: 168px 0 96px; overflow: hidden;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 75%);
}
.hero .container { position: relative; }
.hero-kicker {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  color: var(--accent); letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(38px, 6vw, 64px); font-weight: 600; line-height: 1.08;
  letter-spacing: -0.03em; margin-bottom: 24px;
}
.hero .accent { color: var(--accent); }
.hero-sub {
  max-width: 640px; color: var(--text-dim); font-size: 17.5px; margin-bottom: 36px;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 72px; }

.btn {
  display: inline-block; padding: 12px 24px; border-radius: 10px;
  font-size: 14.5px; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; font-family: var(--sans);
  transition: all 0.18s;
}
.btn-primary { background: var(--accent); color: #051025; }
.btn-primary:hover { background: #6ba0ff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-small { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

.hero-metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.metric { background: var(--panel); padding: 22px 24px; }
.metric-value {
  display: block; font-family: var(--mono); font-size: 32px; font-weight: 700;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.metric-label { font-size: 13px; color: var(--text-dim); }
.proj {
  font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--amber);
  border: 1px solid rgba(245, 183, 78, 0.35); border-radius: 4px;
  padding: 1px 5px; margin-left: 6px; vertical-align: 1px;
}

/* ---------- Sections ---------- */
.section { padding: 104px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-kicker {
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  color: var(--accent); letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 14px;
}
.section h2 {
  font-size: clamp(28px, 4vw, 40px); font-weight: 600; letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.section-sub { max-width: 660px; color: var(--text-dim); margin-bottom: 44px; }
.section-sub strong { color: var(--text); }
code {
  font-family: var(--mono); font-size: 0.86em;
  background: var(--accent-soft); color: #9ec2ff;
  padding: 1.5px 6px; border-radius: 5px;
}

/* ---------- Demo ---------- */
.demo-shell {
  border: 1px solid var(--line-2); border-radius: 16px;
  background: var(--panel); overflow: hidden;
}
.demo-toolbar {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.speed-ctl {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--text-dim); font-weight: 500;
}
.speed-ctl input { accent-color: var(--accent); width: 110px; }
.demo-stats {
  margin-left: auto; display: flex; gap: 18px;
  font-family: var(--mono); font-size: 12.5px; color: var(--text-faint);
}
.demo-stats b { color: var(--text); font-weight: 500; margin-left: 4px; font-variant-numeric: tabular-nums; }

.demo-grid {
  display: grid; grid-template-columns: 1.15fr 1fr; min-height: 520px;
}
@media (max-width: 860px) { .demo-grid { grid-template-columns: 1fr; } }

.panel-title {
  font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint); padding: 16px 20px 10px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.panel-hint { font-family: var(--mono); font-size: 11px; text-transform: none; letter-spacing: 0; }

.ladder-panel { border-right: 1px solid var(--line); }
@media (max-width: 860px) { .ladder-panel { border-right: none; border-bottom: 1px solid var(--line); } }

.ladder { padding: 0 12px 16px; font-family: var(--mono); font-size: 13.5px; }
.ladder-row {
  display: grid; grid-template-columns: 90px 1fr 70px; gap: 12px;
  padding: 4px 10px; border-radius: 6px; position: relative;
  font-variant-numeric: tabular-nums; align-items: center;
}
.ladder-row .lr-price { font-weight: 500; }
.ladder-row .lr-qty { text-align: right; color: var(--text-dim); }
.lr-bar { display: block; height: 14px; border-radius: 3px; opacity: 0.85; transition: width 0.25s ease; }
.row-ask .lr-price { color: var(--ask); }
.row-ask .lr-bar { background: var(--ask-soft); border-right: 2px solid var(--ask); margin-left: auto; }
.row-bid .lr-price { color: var(--bid); }
.row-bid .lr-bar { background: var(--bid-soft); border-left: 2px solid var(--bid); }
.ladder-row.flash-bid { animation: flashB 0.5s; }
.ladder-row.flash-ask { animation: flashA 0.5s; }
@keyframes flashB { 0% { background: rgba(47, 208, 140, 0.22); } 100% { background: transparent; } }
@keyframes flashA { 0% { background: rgba(255, 93, 115, 0.22); } 100% { background: transparent; } }
.spread-row {
  display: flex; justify-content: center; gap: 10px;
  padding: 8px 0; margin: 4px 0; font-size: 11.5px; color: var(--text-faint);
  border-top: 1px dashed var(--line-2); border-bottom: 1px dashed var(--line-2);
}
.spread-row b { color: var(--amber); font-weight: 500; }

.demo-right { display: flex; flex-direction: column; }
.ticket-panel { border-bottom: 1px solid var(--line); padding-bottom: 20px; }
#ticket { padding: 0 20px; }
.side-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.side-toggle button {
  padding: 9px 0; border-radius: 8px; font-family: var(--mono); font-weight: 700;
  font-size: 13px; letter-spacing: 0.08em; cursor: pointer;
  background: transparent; border: 1px solid var(--line-2); color: var(--text-faint);
  transition: all 0.15s;
}
.side-toggle .side-buy.active { background: var(--bid-soft); border-color: var(--bid); color: var(--bid); }
.side-toggle .side-sell.active { background: var(--ask-soft); border-color: var(--ask); color: var(--ask); }
.ticket-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.ticket-row label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11.5px; font-weight: 600; color: var(--text-faint);
  letter-spacing: 0.05em; text-transform: uppercase;
}
.ticket-row input, .ticket-row select {
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px;
  color: var(--text); font-family: var(--mono); font-size: 14px;
  padding: 8px 10px; width: 100%; outline: none;
  transition: border-color 0.15s;
}
.ticket-row input:focus, .ticket-row select:focus { border-color: var(--accent); }
.ticket-row input:disabled { opacity: 0.35; }
.ticket-result {
  font-family: var(--mono); font-size: 12px; margin-top: 12px; min-height: 34px;
  color: var(--text-dim); line-height: 1.5;
}
.ticket-result .ok { color: var(--bid); }
.ticket-result .warn { color: var(--amber); }
.ticket-result .bad { color: var(--ask); }

.tape-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tape {
  flex: 1; overflow-y: auto; max-height: 240px; padding: 0 20px 16px;
  font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.tape::-webkit-scrollbar { width: 8px; }
.tape::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
.tape-row {
  display: grid; grid-template-columns: 88px 1fr 60px 20px; gap: 10px;
  padding: 3.5px 0; color: var(--text-dim);
  border-bottom: 1px solid rgba(148, 178, 255, 0.05);
  animation: tapein 0.3s ease;
}
@keyframes tapein { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; } }
.tape-row .tp-time { color: var(--text-faint); }
.tape-row .tp-price { font-weight: 500; }
.tape-row.t-buy .tp-price, .tape-row.t-buy .tp-arrow { color: var(--bid); }
.tape-row.t-sell .tp-price, .tape-row.t-sell .tp-arrow { color: var(--ask); }
.tape-row .tp-qty { text-align: right; }

.fine-print { font-size: 12.5px; color: var(--text-faint); margin-top: 14px; }

/* ---------- Pipeline ---------- */
.pipeline {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  gap: 14px; align-items: stretch; margin-bottom: 52px;
}
@media (max-width: 960px) {
  .pipeline { grid-template-columns: 1fr; }
  .stage-arrow { transform: rotate(90deg); justify-self: center; }
}
.stage {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px;
  padding: 22px; transition: border-color 0.2s, transform 0.2s;
}
.stage:hover { border-color: var(--accent); transform: translateY(-3px); }
.stage-num {
  font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--accent);
  margin-bottom: 10px;
}
.stage h3 { font-size: 16.5px; font-weight: 600; margin-bottom: 8px; }
.stage p { font-size: 13.5px; color: var(--text-dim); margin-bottom: 14px; }
.stage-arrow { align-self: center; color: var(--text-faint); font-size: 20px; }
.chip {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  color: var(--accent); background: var(--accent-soft);
  padding: 3px 9px; border-radius: 20px;
}

.arch-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.arch-note {
  border-left: 2px solid var(--accent); padding: 4px 0 4px 20px;
}
.arch-note h4 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.arch-note p { font-size: 13.5px; color: var(--text-dim); }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px; transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.card h3 { font-size: 15.5px; font-weight: 600; margin-bottom: 9px; }
.card p { font-size: 13.5px; color: var(--text-dim); }

/* ---------- Benchmarks ---------- */
.badge-proj {
  font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--amber);
  border: 1px solid rgba(245, 183, 78, 0.4); border-radius: 6px;
  padding: 3px 10px; vertical-align: 6px; margin-left: 10px;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.bench-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px; margin-bottom: 24px;
}
.bench-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px;
}
.bench-value {
  display: block; font-family: var(--mono); font-size: 34px; font-weight: 700;
  letter-spacing: -0.02em; margin-bottom: 4px; font-variant-numeric: tabular-nums;
}
.bench-label { font-size: 12.5px; color: var(--text-dim); }

.latency-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding-bottom: 22px;
}
.latency-bars { padding: 6px 24px 0; }
.lat-row {
  display: grid; grid-template-columns: 76px 1fr 90px; gap: 16px;
  align-items: center; padding: 9px 0;
  font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums;
}
.lat-row .lat-name { color: var(--text-dim); }
.lat-track { background: rgba(148, 178, 255, 0.06); border-radius: 4px; height: 18px; overflow: hidden; }
.lat-fill {
  display: block; height: 100%; border-radius: 4px; width: 0;
  background: linear-gradient(90deg, var(--accent), #7fb0ff);
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.lat-row .lat-val { text-align: right; font-weight: 500; }

/* ---------- Roadmap ---------- */
.roadmap-progress { display: flex; align-items: center; gap: 16px; margin-bottom: 36px; max-width: 560px; }
.roadmap-bar { flex: 1; height: 8px; background: rgba(148, 178, 255, 0.08); border-radius: 6px; overflow: hidden; }
.roadmap-fill { height: 100%; background: var(--bid); border-radius: 6px; width: 0; transition: width 1s ease; }
.roadmap-pct { font-family: var(--mono); font-size: 13px; color: var(--text-dim); white-space: nowrap; }

.roadmap { list-style: none; display: grid; gap: 10px; }
.roadmap li {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 18px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 15px 20px;
}
.rm-num {
  font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--text-faint);
  width: 34px; height: 34px; border: 1px solid var(--line-2); border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.roadmap li.st-done .rm-num { color: var(--bid); border-color: var(--bid); }
.roadmap li.st-now .rm-num { color: var(--amber); border-color: var(--amber); }
.rm-body h3 { font-size: 14.5px; font-weight: 600; }
.rm-body p { font-size: 12.5px; color: var(--text-faint); }
.rm-status {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 4px 11px; border-radius: 20px;
}
.st-done .rm-status { color: var(--bid); background: var(--bid-soft); }
.st-now .rm-status { color: var(--amber); background: rgba(245, 183, 78, 0.1); }
.st-todo .rm-status { color: var(--text-faint); background: rgba(148, 178, 255, 0.06); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 52px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-title { font-family: var(--mono); font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.footer-sub { font-size: 13px; color: var(--text-faint); }
.footer-links { display: flex; gap: 22px; align-items: center; }
.footer-links a { color: var(--text-dim); text-decoration: none; font-size: 13.5px; }
.footer-links a:hover { color: var(--text); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
