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

:root {
    --bg: #0a0a0a;
    --bg-subtle: #111111;
    --bg-sidebar: #0d0d0d;
    --border: #222222;
    --text: #e5e5e5;
    --text-muted: #888888;
    --text-dim: #555555;
    --accent: #22c55e;
    --accent-dim: #16a34a;
    --code-bg: #1a1a1a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

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

.sidebar-logo a {
    color: var(--text);
    text-decoration: none;
    font-family: 'SF Mono', monospace;
    font-weight: 700;
}

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

.sidebar-section {
    margin-bottom: 25px;
}

.sidebar-section-title {
    padding: 0 20px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.sidebar-link {
    display: block;
    padding: 8px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s;
    border-left: 2px solid transparent;
}

.sidebar-link:hover {
    color: var(--text);
    background: var(--bg-subtle);
}

.sidebar-link.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: rgba(34, 197, 94, 0.05);
}

/* Main content */
.main {
    flex: 1;
    margin-left: 260px;
    max-width: 800px;
    padding: 40px 60px;
}

/* Typography */
h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 40px 0 15px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text);
}

h2:first-of-type {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 25px 0 10px;
    color: var(--text);
}

p {
    margin-bottom: 15px;
    color: var(--text-muted);
}

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

a:hover {
    text-decoration: underline;
}

/* Code */
code {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent);
}

pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    overflow-x: auto;
    margin: 15px 0 20px;
    position: relative;
}

pre code {
    background: none;
    padding: 0;
    color: var(--text);
    font-size: 0.85rem;
    line-height: 1.5;
}

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

pre:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background: var(--text-dim);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0 25px;
    font-size: 0.9rem;
}

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

th {
    color: var(--text);
    font-weight: 600;
    background: var(--bg-subtle);
}

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

td code {
    font-size: 0.85em;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

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

.card:hover {
    border-color: var(--text-dim);
}

.card h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text);
}

.card p {
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* Callouts */
.callout {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid;
}

.callout-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

.callout-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
}

.callout-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
}

.callout p {
    margin: 0;
    color: var(--text);
}

/* Lists */
ul, ol {
    margin: 10px 0 20px 20px;
    color: var(--text-muted);
}

li {
    margin-bottom: 8px;
}

/* Footer nav */
.doc-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.doc-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.doc-footer a:hover {
    color: var(--accent);
}

/* Mobile */
@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .main {
        margin-left: 0;
        padding: 30px 20px;
    }
}

/* Syntax highlighting (basic) */
.token-comment { color: #6a737d; }
.token-keyword { color: #ff7b72; }
.token-string { color: #a5d6ff; }
.token-variable { color: #ffa657; }
