:root {
  --bg: #07080d;
  --bg-elevated: #0f1118;
  --bg-card: #141720;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f4f5f7;
  --muted: #9aa3b2;
  --accent: #4f8cff;
  --accent-2: #00d4aa;
  --accent-glow: rgba(79, 140, 255, 0.35);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(79, 140, 255, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(0, 212, 170, 0.06), transparent);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #7eb0ff; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  background: rgba(7, 8, 13, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: white;
  box-shadow: 0 4px 24px var(--accent-glow);
}

.btn-primary:hover { box-shadow: 0 8px 32px var(--accent-glow); color: white; }

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

.btn-ghost:hover { border-color: rgba(255,255,255,0.2); color: var(--text); }

/* Hero */
.hero {
  padding: 140px 0 100px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 28px;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 820px;
  margin: 0 auto 24px;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.hero-visual {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.hero-visual img,
.hero-visual svg {
  width: 100%;
  display: block;
}

.network-svg { height: 360px; background: #0a0c12; }

/* Hero interactive network */
.hero-visual { position: relative; }

.hero-panel {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 2;
  background: rgba(14, 17, 24, 0.92);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  text-align: left;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

.hero-panel.visible { opacity: 1; transform: translateY(0); }

.hero-panel strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
  color: var(--accent-2);
}

.hero-panel p {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.hero-links line {
  stroke: rgba(79, 140, 255, 0.2);
  stroke-width: 1;
}

.hero-node { cursor: pointer; transition: opacity 0.2s; }
.hero-node .hn-circle {
  fill: #141720;
  stroke: rgba(255,255,255,0.15);
  stroke-width: 1.5;
  transition: stroke 0.2s, fill 0.2s, filter 0.2s;
}
.hero-node .hn-circle.core {
  fill: url(#glow);
  stroke: var(--accent);
  stroke-width: 2;
}
.hero-node .hn-circle.you {
  stroke: var(--accent-2);
  stroke-width: 2;
}
.hero-node.hovered .hn-circle,
.hero-node.pinned .hn-circle {
  stroke: var(--accent);
  fill: rgba(79, 140, 255, 0.15);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}
.hero-node.hovered .hn-circle.you,
.hero-node.pinned .hn-circle.you {
  stroke: var(--accent-2);
  fill: rgba(0, 212, 170, 0.15);
}

.hn-label {
  text-anchor: middle;
  fill: #f4f5f7;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
}
.hn-sub {
  text-anchor: middle;
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}
.hn-label-sm {
  text-anchor: middle;
  fill: #f4f5f7;
  font-family: var(--mono);
  font-size: 9px;
}
.you-text { fill: var(--accent-2); }
.hero-caption {
  fill: #555;
  font-family: var(--mono);
  font-size: 9px;
}

.hero-badge a { color: var(--accent); }
.nav-github {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Interactive flow diagram */
.flow-wrap {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-card);
  margin-bottom: 28px;
}

.flow-controls {
  padding: 24px 20px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.flow-progress {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.flow-progress-bar {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.5s ease;
  border-radius: 2px;
}

.flow-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flow-tab {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}

.flow-tab:hover { color: var(--text); background: rgba(255,255,255,0.03); }

.flow-tab.active {
  color: var(--text);
  background: rgba(79, 140, 255, 0.1);
  border-color: rgba(79, 140, 255, 0.3);
}

.flow-info h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  line-height: 1.3;
}

.flow-info p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

.flow-canvas svg { width: 100%; display: block; min-height: 360px; }

.flow-link {
  stroke: rgba(255,255,255,0.08);
  stroke-width: 1.5;
  transition: stroke 0.3s;
}
.flow-link.active {
  stroke: rgba(79, 140, 255, 0.55);
  stroke-width: 2;
}

.flow-packet {
  fill: var(--accent-2);
  filter: drop-shadow(0 0 4px var(--accent-2));
}

.flow-packet.animate {
  animation: packet-move 1.2s ease-in-out infinite;
}

@keyframes packet-move {
  0% { cx: var(--x1); cy: var(--y1); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { cx: var(--x2); cy: var(--y2); opacity: 0; }
}

.flow-node .node-circle {
  fill: #141720;
  stroke: rgba(255,255,255,0.12);
  stroke-width: 1.5;
  transition: all 0.3s;
}
.flow-node .node-circle.core {
  fill: rgba(79, 140, 255, 0.15);
  stroke: var(--accent);
  stroke-width: 2;
}
.flow-node .node-circle.you {
  stroke: var(--accent-2);
}
.flow-node.active .node-circle {
  stroke: var(--accent);
  fill: rgba(79, 140, 255, 0.2);
  filter: drop-shadow(0 0 10px var(--accent-glow));
}
.flow-node.active .node-circle.you {
  stroke: var(--accent-2);
  fill: rgba(0, 212, 170, 0.15);
}
.flow-node.dim { opacity: 0.35; }

.node-label {
  text-anchor: middle;
  fill: #f4f5f7;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
}
.node-sub {
  text-anchor: middle;
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
}

.link-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.link-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.85rem;
  transition: border-color 0.2s, background 0.2s;
}

.link-chip:hover {
  border-color: rgba(79, 140, 255, 0.4);
  background: rgba(79, 140, 255, 0.08);
  color: var(--text);
}

.social-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.social-row a {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.social-row a:hover { color: var(--text); }

.compare-table tr.row-hover td { background: rgba(79, 140, 255, 0.06); }

.footer-links { margin-top: 10px; }
.footer-links a { margin: 0 4px; }

/* Stats bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 80px 0;
}

.stat-item {
  background: var(--bg-card);
  padding: 24px 20px;
  text-align: center;
}

.stat-item strong {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  font-family: var(--mono);
}

.stat-item span {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Sections */
section {
  padding: 80px 0;
}

.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 16px;
  max-width: 600px;
}

.section-desc {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin-bottom: 48px;
  line-height: 1.7;
}

/* Problem / Solution grid */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  transition: border-color 0.2s;
}

.card:hover { border-color: rgba(255, 255, 255, 0.14); }

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.card-icon.red { background: rgba(239, 68, 68, 0.15); }
.card-icon.green { background: rgba(0, 212, 170, 0.15); }
.card-icon.blue { background: rgba(79, 140, 255, 0.15); }

.card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.card p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* How it works */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.step-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
}

.step-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 16px;
}

.step-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.step-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Comparison */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.compare-table th,
.compare-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.compare-table th {
  background: var(--bg-elevated);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.compare-table td {
  background: var(--bg-card);
  font-size: 0.95rem;
}

.compare-table tr:last-child td { border-bottom: none; }

.compare-table .highlight {
  color: var(--accent-2);
  font-weight: 600;
}

/* Roadmap */
.roadmap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.roadmap-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
  background: var(--bg-card);
}

.roadmap-item.done { border-color: rgba(0, 212, 170, 0.3); }
.roadmap-item.active { border-color: rgba(79, 140, 255, 0.4); box-shadow: 0 0 0 1px rgba(79, 140, 255, 0.1); }

.roadmap-phase {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.roadmap-item h4 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.roadmap-item p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

/* CTA */
.cta-section {
  text-align: center;
  padding: 100px 0;
}

.cta-box {
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.12), rgba(0, 212, 170, 0.08));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 64px 40px;
}

.cta-box h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 16px;
}

.cta-box p {
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 28px;
  font-size: 1.05rem;
}

.cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

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

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

/* Mobile nav toggle */
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; }

@media (max-width: 900px) {
  .two-col, .steps, .roadmap, .flow-wrap { grid-template-columns: 1fr; }
  .flow-controls { border-right: none; border-bottom: 1px solid var(--border); }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    padding: 20px;
    border-bottom: 1px solid var(--border);
  }
  .nav-toggle { display: block; }
  .hero { padding-top: 120px; }
}
