:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #151d2e;
  --bg-code: #0d1117;
  --border: #1e2a3a;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --accent-cyan: #00d4ff;
  --accent-green: #00e87b;
  --accent-gradient: linear-gradient(135deg, #00d4ff, #00e87b);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', Menlo, Consolas, monospace;
  --max-width: 1200px;
  --nav-height: 64px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-height) + 24px); }

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

img { max-width: 100%; height: auto; }

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 14, 23, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-inner {
  width: 100%;
  max-width: var(--max-width);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.nav-logo img { height: 36px; width: auto; }
.nav-logo:hover { text-decoration: none; }

.nav-links { display: flex; gap: 32px; list-style: none; }

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

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

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ── Main content push ── */
main { flex: 1; margin-top: var(--nav-height); }

/* ── Container ── */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ── Section spacing ── */
.section { padding: 80px 0; }
.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 48px;
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 100px 0 80px;
  background: radial-gradient(ellipse at 50% 0%, rgba(0, 212, 255, 0.08) 0%, transparent 60%);
}

.hero-logo { height: 80px; margin-bottom: 32px; }

.hero h1 {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero h1 .gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .tagline {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 24px;
}

.badge-beta {
  display: inline-block;
  background: rgba(0, 212, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 212, 255, 0.3);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 32px;
}

.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border: none;
  text-decoration: none;
}

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

.btn-primary {
  background: var(--accent-gradient);
  color: #0a0e17;
}
.btn-primary:hover { box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--text-secondary); }

/* ── Feature cards ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

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

.feature-icon {
  font-size: 1.6rem;
  margin-bottom: 16px;
  display: block;
}

.feature-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ── How it works ── */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  counter-reset: step;
}

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

.step::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent-gradient);
  color: #0a0e17;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 50%;
  margin-bottom: 12px;
}

.step h4 { margin-bottom: 4px; }
.step p { color: var(--text-secondary); font-size: 0.9rem; }
.step code {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-green);
}

/* ── Tables ── */
.table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

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

th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td { color: var(--text-primary); }

/* ── Code blocks ── */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.code-block .cmd { color: var(--accent-cyan); }
.code-block .comment { color: #6e7681; }

/* ── Quick start section ── */
.quickstart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.quickstart-text h3 { font-size: 1.3rem; margin-bottom: 12px; }
.quickstart-text p { color: var(--text-secondary); margin-bottom: 12px; }

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links { display: flex; gap: 24px; list-style: none; }
.footer-links a { color: var(--text-secondary); }
.footer-links a:hover { color: var(--text-primary); }

/* ── Documentation page ── */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  max-height: calc(100vh - var(--nav-height) - 48px);
  overflow-y: auto;
  padding-right: 16px;
}

.docs-sidebar-toggle {
  display: none;
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  margin-bottom: 16px;
}

.docs-toc { list-style: none; }

.docs-toc li { margin-bottom: 2px; }

.docs-toc a {
  display: block;
  padding: 4px 12px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  border-radius: 4px;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}

.docs-toc a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
}

.docs-toc a.active {
  color: var(--accent-cyan);
  border-left-color: var(--accent-cyan);
}

.docs-toc .toc-h3 { padding-left: 28px; font-size: 0.82rem; }

.docs-content {
  min-width: 0;
  overflow-wrap: break-word;
}

.docs-content h1 { font-size: 2rem; margin: 0 0 8px; }
.docs-content h2 { font-size: 1.5rem; margin: 48px 0 16px; padding-top: 24px; border-top: 1px solid var(--border); }
.docs-content h3 { font-size: 1.15rem; margin: 32px 0 12px; }
.docs-content h4 { font-size: 1rem; margin: 24px 0 8px; }
.docs-content p { margin-bottom: 16px; color: var(--text-secondary); }
.docs-content ul, .docs-content ol { margin-bottom: 16px; padding-left: 24px; color: var(--text-secondary); }
.docs-content li { margin-bottom: 4px; }
.docs-content strong { color: var(--text-primary); }
.docs-content hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.docs-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.docs-content pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 16px;
}
.docs-content pre code {
  background: none;
  padding: 0;
  border: none;
  font-size: 0.85rem;
  line-height: 1.7;
}
.docs-content table { margin-bottom: 16px; }
.docs-content blockquote {
  border-left: 3px solid var(--accent-cyan);
  padding: 12px 20px;
  margin-bottom: 16px;
  background: rgba(0, 212, 255, 0.04);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
}

/* ── Download page ── */
.download-hero {
  text-align: center;
  padding: 60px 0 40px;
}

.version-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 32px;
}

.version-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.version-header h2 { font-size: 1.5rem; margin: 0; }

.download-table td a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.os-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

/* ── About page ── */
.about-hero {
  text-align: center;
  padding: 60px 0 40px;
}

.about-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  margin-bottom: 32px;
}

.about-card h2 { font-size: 1.4rem; margin-bottom: 16px; }
.about-card p { color: var(--text-secondary); margin-bottom: 12px; }
.about-card p:last-child { margin-bottom: 0; }

/* ── Loading spinner ── */
.loading {
  text-align: center;
  padding: 80px 0;
  color: var(--text-secondary);
}

.loading::after {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  margin: 16px auto 0;
  border: 3px solid var(--border);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utility classes ── */
.section--alt { background: var(--bg-secondary); }
.section--center { text-align: center; }
.section--flush-top { padding-top: 0; }
.mb-12 { margin-bottom: 12px; }
.mb-0 { margin-bottom: 0; }
.about-hero-logo { height: 64px; margin-bottom: 24px; }
.mt-8 { margin-top: 8px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .docs-sidebar {
    position: static;
    max-height: none;
    padding-right: 0;
    margin-bottom: 32px;
  }
  .docs-sidebar-toggle { display: block; }
  .docs-toc.collapsed { display: none; }
}

@media (max-width: 768px) {
  .hero h1 { font-size: 2.2rem; }
  .hero .tagline { font-size: 1.05rem; }
  .section { padding: 48px 0; }
  .section-title { font-size: 1.6rem; }
  .features-grid { grid-template-columns: 1fr; }
  .quickstart-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 16px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }

  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.8rem; }
  .steps { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: center; }
}
