*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

:root {
  --bg: #080c10;
  --bg2: #0d1117;
  --bg3: #161b22;
  --bg4: #1c2333;
  --cyan: #00d9ff;
  --green: #00ff88;
  --orange: #ff9500;
  --red: #ff4466;
  --text: #e6edf3;
  --muted: #7d8590;
  --border: #21262d;
  --border2: #30363d;
  --cyan-dim: rgba(0,217,255,0.08);
  --green-dim: rgba(0,255,136,0.08);
  --r: 10px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* Layout */
.page { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 50;
  padding: 0 0 40px;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.sidebar-logo .pkg-name {
  font-family: 'Space Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.sidebar-logo .version {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  padding: 2px 8px;
  background: var(--green-dim);
  border: 1px solid rgba(0,255,136,0.25);
  border-radius: 100px;
  color: var(--green);
  font-family: 'Space Mono', monospace;
}

.sidebar-section {
  padding: 16px 20px 6px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.sidebar-link:hover, .sidebar-link.active {
  background: var(--cyan-dim);
  color: var(--cyan);
}

.sidebar-link .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
  flex-shrink: 0;
}

/* Main content */
.main {
  margin-left: 260px;
  flex: 1;
  min-width: 0;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  background: rgba(8, 12, 16, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 40;
  padding: 0 48px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-left { display: flex; align-items: center; gap: 20px; }

.breadcrumb {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumb span { color: var(--cyan); }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 6px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.2s;
  font-weight: 500;
}

.topbar-badge:hover { border-color: var(--cyan); color: var(--text); }

/* Content */
.content {
  max-width: 860px;
  margin: 0 auto;
  padding: 56px 48px 120px;
}

/* Hero */
.hero-section {
  margin-bottom: 72px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--cyan-dim);
  border: 1px solid rgba(0,217,255,0.2);
  border-radius: 100px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero-tag::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--cyan);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

h1 {
  font-size: 52px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

h1 .mono {
  font-family: 'Space Mono', monospace;
  color: var(--cyan);
  font-size: 44px;
}

.hero-desc {
  font-size: 18px;
  color: var(--muted);
  max-width: 580px;
  margin-bottom: 32px;
  line-height: 1.6;
}

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.badges img { height: 20px; border-radius: 3px; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 40px;
}

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

.stat-num {
  font-family: 'Space Mono', monospace;
  font-size: 27px;
  font-weight: 700;
  color: var(--cyan);
  display: block;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label { font-size: 13px; color: var(--muted); font-weight: 500; }

/* Section headings */
.doc-section { margin-bottom: 64px; }

.section-anchor { display: block; margin-top: -80px; padding-top: 80px; visibility: hidden; }

h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

h2::before {
  content: '';
  width: 3px; height: 22px;
  background: var(--cyan);
  border-radius: 2px;
  flex-shrink: 0;
}

.section-desc {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 28px;
  padding-left: 15px;
}

h3 {
  font-size: 19px;
  font-weight: 600;
  margin: 28px 0 12px;
  color: var(--text);
}

p { color: var(--muted); font-size: 16px; margin-bottom: 16px; line-height: 1.75; }

/* Install tabs */
.install-tabs { margin-bottom: 24px; }

.tab-buttons {
  display: flex;
  gap: 2px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  padding: 6px 6px 0;
}

.tab-btn {
  padding: 8px 18px;
  background: transparent;
  border: none;
  border-radius: 6px 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Space Mono', monospace;
}

.tab-btn.active { background: var(--bg2); color: var(--text); }
.tab-btn:hover:not(.active) { color: var(--text); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Code blocks */
.code-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin: 16px 0;
  position: relative;
}

.code-block.attached-top {
  border-top: none;
  border-radius: 0 0 var(--r) var(--r);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}

.code-lang {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.code-filename {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  color: var(--muted);
}

.copy-btn {
  background: var(--bg4);
  border: 1px solid var(--border2);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.02em;
}

.copy-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.copy-btn.copied { border-color: var(--green); color: var(--green); }

.code-body {
  padding: 20px;
  overflow-x: auto;
}

pre {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}

/* Syntax colors */
.k { color: #ff79c6; }   /* keyword */
.s { color: #f1fa8c; }   /* string */
.c { color: #6272a4; }   /* comment */
.f { color: var(--cyan); } /* function */
.p { color: var(--green); } /* param/var */
.t { color: var(--orange); } /* type */
.n { color: #bd93f9; }   /* number */
.o { color: #ff5555; }   /* operator */

/* Framework cards */
.framework-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.fw-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}

.fw-card:hover { border-color: var(--cyan); transform: translateY(-2px); }
.fw-card.active { border-color: var(--cyan); background: var(--cyan-dim); }

.fw-icon { font-size: 28px; margin-bottom: 6px; display: block; }
.fw-name { font-size: 13px; font-weight: 600; color: var(--text); }
.fw-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* API reference table */
.api-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

.api-table th {
  text-align: left;
  padding: 10px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.api-table td {
  padding: 12px 16px;
  border: 1px solid var(--border);
  color: var(--muted);
  vertical-align: top;
}

.api-table tr:hover td { background: var(--bg3); }

.api-table td:first-child {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  color: var(--cyan);
  font-weight: 700;
  white-space: nowrap;
}

.api-table td:nth-child(2) {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--orange);
}

/* Callout */
.callout {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--r);
  margin: 20px 0;
  font-size: 15px;
}

.callout.info {
  background: var(--cyan-dim);
  border: 1px solid rgba(0,217,255,0.2);
  color: var(--text);
}

.callout.tip {
  background: var(--green-dim);
  border: 1px solid rgba(0,255,136,0.2);
  color: var(--text);
}

.callout.warn {
  background: rgba(255,149,0,0.07);
  border: 1px solid rgba(255,149,0,0.2);
  color: var(--text);
}

.callout-icon { font-size: 19px; flex-shrink: 0; margin-top: 1px; }
.callout p { color: inherit; margin: 0; line-height: 1.6; }

/* Inline code */
code {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--cyan);
}

/* Type pills */
.type-pill {
  display: inline-block;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  padding: 2px 8px;
  background: rgba(255,149,0,0.08);
  border: 1px solid rgba(255,149,0,0.2);
  border-radius: 4px;
  color: var(--orange);
}

/* Returns pill */
.ret-pill {
  display: inline-block;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  padding: 2px 8px;
  background: rgba(0,255,136,0.08);
  border: 1px solid rgba(0,255,136,0.2);
  border-radius: 4px;
  color: var(--green);
}

/* Browser section */
.browser-flow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 48px;
  margin-left: 260px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}

footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--cyan); }

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  footer { margin-left: 0; }
  .hamburger { display: block; }
  .content { padding: 40px 24px 80px; }
  .topbar { padding: 0 24px; }
  h1 { font-size: 36px; }
  h1 .mono { font-size: 30px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .framework-grid { grid-template-columns: repeat(2, 1fr); }
  .browser-flow { grid-template-columns: 1fr; }
}

/* Fade in animation */
.fade-in { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }