:root {
  --bg: #0d1117;
  --bg-alt: #161b22;
  --bg-card: #1c2230;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --accent-glow: rgba(88, 166, 255, 0.15);
  --green: #3fb950;
  --purple: #bc8cff;
  --orange: #ffa657;
  --red: #ff7b72;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

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

html { scroll-behavior: smooth; }

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

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

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ── Nav ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 16px;
}
.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 24px; }
.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 96px 24px 72px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(88,166,255,0.08), transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-glow);
  border: 1px solid rgba(88,166,255,0.3);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 24px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.hero h1 .grad {
  background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #0d1117;
}
.btn-primary:hover { background: var(--accent-hover); color: #0d1117; text-decoration: none; }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.badges { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.badges img { height: 20px; }

/* ── Section ── */
section { padding: 72px 0; }
section + section { border-top: 1px solid var(--border); }
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.section-sub {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 540px;
  line-height: 1.7;
}

/* ── Features grid ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 48px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.15s, transform 0.15s;
}
.feature-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.feature-icon {
  font-size: 1.6rem;
  margin-bottom: 14px;
  display: block;
}
.feature-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.feature-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

/* ── Install section ── */
.install-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 48px;
}
@media (max-width: 680px) { .install-grid { grid-template-columns: 1fr; } }
.install-step {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.install-step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #0d1117;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.install-step-header span { font-size: 0.9rem; font-weight: 600; }

/* ── Code blocks ── */
pre, code {
  font-family: var(--mono);
  font-size: 0.85rem;
}
pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
  line-height: 1.6;
}
.install-step pre { border: none; border-radius: 0; background: var(--bg); }
code {
  background: rgba(110,118,129,0.1);
  border: 1px solid rgba(110,118,129,0.2);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.85em;
}
pre code { background: none; border: none; padding: 0; font-size: inherit; }

/* syntax tokens */
.tok-cmd  { color: var(--green); }
.tok-flag { color: var(--accent); }
.tok-str  { color: var(--orange); }
.tok-key  { color: var(--purple); }
.tok-val  { color: var(--orange); }
.tok-num  { color: var(--red); }
.tok-cmt  { color: var(--text-muted); font-style: italic; }
.tok-tag  { color: var(--green); }

/* ── Tools table ── */
.tools-table-wrap { overflow-x: auto; margin-top: 40px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th {
  text-align: left;
  padding: 10px 16px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(88,166,255,0.04); }
td:first-child code { color: var(--accent); background: var(--accent-glow); border-color: rgba(88,166,255,0.25); }
td:last-child { color: var(--text-muted); }

/* ── Demo section ── */
.demo-container {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 48px;
}
.demo-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.demo-dot { width: 12px; height: 12px; border-radius: 50%; }
.demo-dot:nth-child(1) { background: var(--red); }
.demo-dot:nth-child(2) { background: var(--orange); }
.demo-dot:nth-child(3) { background: var(--green); }
.demo-title { margin-left: 8px; font-size: 0.8rem; color: var(--text-muted); }
.demo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  gap: 16px;
  text-align: center;
}
.demo-placeholder .icon { font-size: 3rem; }
.demo-placeholder p { color: var(--text-muted); font-size: 0.9rem; }
.demo-placeholder a.btn { margin-top: 8px; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-inner p { font-size: 0.85rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 0.85rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--text); text-decoration: none; }

/* ── Demo page ── */
#mindmap-canvas {
  width: 100%;
  height: 520px;
  background: var(--bg);
}
.demo-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  margin-top: 48px;
}
@media (max-width: 860px) {
  .demo-layout { grid-template-columns: 1fr; }
}
.demo-panel {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-header {
  padding: 12px 18px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-header .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
}
.panel-body { padding: 18px; }
.panel-body pre {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 0.8rem;
}
.node-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.node-info strong { color: var(--text); }
#node-detail { display: none; }
#node-detail.visible { display: block; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .hero { padding: 64px 0 48px; }
  .nav-links { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
