:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-hover: #1c2333;
  --border: #30363d;
  --text: #e6edf3;
  --text-secondary: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --green: #3fb950;
  --orange: #d29922;
  --red: #f85149;
  --purple: #bc8cff;
  --code-bg: #0d1117;
  --code-text: #e6edf3;
  --inline-code-bg: #282c34;
  --sidebar-width: 260px;
  --header-height: 56px;
  --max-content: 860px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 100;
}

.header-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

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

.header-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

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

.badge {
  background: var(--accent);
  color: var(--bg);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  margin-right: 16px;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 20px 0;
  z-index: 90;
}

.sidebar-group { margin-bottom: 20px; }

.sidebar-group-title {
  padding: 4px 24px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.sidebar a {
  display: block;
  padding: 6px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  border-left: 2px solid transparent;
  transition: all 0.2s;
}

.sidebar a:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.sidebar a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--surface-hover);
}

/* Main content */
.main {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

.content {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 40px 32px 80px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 80px 32px 60px;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero .subtitle {
  font-size: 22px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.hero .install-cmd {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 20px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 15px;
  margin-bottom: 24px;
}

.hero .install-cmd code { color: var(--green); }

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover { background: var(--accent-hover); }

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

.btn-outline:hover {
  border-color: var(--text-secondary);
  background: var(--surface);
}

.hero .meta {
  font-size: 13px;
  color: var(--text-secondary);
}

.hero .meta span { margin: 0 8px; }

/* Feature cards */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 40px 0 60px;
}

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

.feature-card:hover { border-color: var(--accent); }

.feature-card h3 {
  font-size: 17px;
  margin-bottom: 8px;
  color: var(--text);
}

.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Sections */
section { margin-bottom: 60px; }

h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-top: 20px;
}

h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-top: 16px;
  color: var(--text);
}

h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 10px;
  padding-top: 12px;
  color: var(--text);
}

p { margin-bottom: 16px; }

ul, ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

li { margin-bottom: 6px; }

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

/* Code blocks */
pre {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  overflow-x: auto;
}

pre code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.6;
  color: var(--code-text);
}

code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 14px;
}

p code, li code, td code {
  background: var(--inline-code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--border);
  color: var(--text-secondary);
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--text); background: var(--surface-hover); }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 14px;
}

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

th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tr:hover td { background: var(--surface); }

/* Flow diagram */
.flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 30px 0;
}

.flow-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 28px;
  text-align: center;
  min-width: 340px;
  font-size: 14px;
}

.flow-step.highlight {
  border-color: var(--accent);
  background: #161b2a;
}

.flow-step strong { color: var(--accent); }

.flow-arrow {
  color: var(--text-secondary);
  font-size: 20px;
}

/* API reference cards */
.api-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.api-card h3 {
  padding-top: 0;
  margin-bottom: 12px;
  color: var(--accent);
}

/* Footer */
.footer {
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 14px;
}

.footer a { color: var(--text-secondary); margin: 0 8px; }
.footer a:hover { color: var(--text); }

/* Roadmap */
.roadmap-phase {
  border-left: 2px solid var(--border);
  padding-left: 24px;
  margin-bottom: 30px;
  position: relative;
}

.roadmap-phase::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.roadmap-phase.done::before { background: var(--green); }
.roadmap-phase.active::before { background: var(--accent); }

.roadmap-phase h3 { padding-top: 0; }

/* Responsive */
@media (max-width: 768px) {
  .hamburger { display: block; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
    z-index: 95;
  }

  .sidebar.open { transform: translateX(0); }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 92;
  }

  .sidebar-overlay.open { display: block; }

  .main { margin-left: 0; }

  .content { padding: 24px 16px 60px; }

  .hero { padding: 40px 16px 40px; }
  .hero h1 { font-size: 32px; }
  .hero .subtitle { font-size: 18px; }

  .features { grid-template-columns: 1fr; }

  .hero-buttons { flex-direction: column; align-items: center; }

  h1 { font-size: 28px; }
  h2 { font-size: 22px; }

  .flow-step { min-width: auto; width: 100%; }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .features { grid-template-columns: 1fr 1fr; }
}
