:root {
    /* Color Palette - Modern Professional (Slate & Saffron) */
    --bg-primary: #0f172a;
    /* Slate 900 */
    --bg-secondary: #1e293b;
    /* Slate 800 */
    --bg-tertiary: #334155;
    /* Slate 700 */
    --text-primary: #f8fafc;
    /* Slate 50 */
    --text-secondary: #cbd5e1;
    /* Slate 300 */

    /* Accents - The Soul of Smrti */
    --accent-gold: #fbbf24;
    /* Amber 400 */
    --accent-saffron: #f97316;
    /* Orange 500 */
    --accent-glow: rgba(249, 115, 22, 0.2);

    /* Code Colors */
    --code-bg: #1e1e1e;
    /* VS Code Dark */
    --code-text: #d4d4d4;
    --token-keyword: #ff7b72;
    --token-string: #a5d6ff;
    --token-function: #d2a8ff;
    --token-number: #79c0ff;
    --token-comment: #8b949e;

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'Fira Code', monospace;

    /* Layout Dimensions */
    --header-height: 70px;
    --sidebar-width: 280px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
}

/* Typography */
h1,
h2,
h3,
h4 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.8rem;
    margin-top: 2.5rem;
    border-bottom: 1px solid var(--bg-tertiary);
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.4rem;
    margin-top: 2rem;
    color: var(--accent-gold);
}

p,
ul,
ol {
    margin-bottom: 1.2rem;
    color: var(--text-secondary);
}

a {
    color: var(--accent-saffron);
    text-decoration: none;
    transition: 0.2s;
}

a:hover {
    color: var(--accent-gold);
}

/* Layout Containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--bg-tertiary);
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-saffron));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links a {
    color: var(--text-primary);
    font-weight: 500;
    margin-left: 2rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-gold);
}

.btn-primary {
    background: var(--accent-saffron);
    color: white !important;
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    transition: 0.3s;
}

.btn-primary:hover {
    background: var(--accent-gold);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Hero Section (Index) */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 70%);
}

.hero-subtitle {
    font-size: 1.25rem;
    max-width: 700px;
    margin: 1rem auto 2.5rem;
}

/* Features Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    padding: 2rem;
    border-radius: 12px;
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Documentation Layout (3-Column Grid) */
.docs-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr 240px;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding-top: var(--header-height);
    min-height: 100vh;
}

/* Left Sidebar */
.sidebar {
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    background: var(--bg-primary);
    border-right: 1px solid var(--bg-tertiary);
    padding: 2rem 1rem;
}

.sidebar h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin: 1.5rem 0 0.8rem;
}

.sidebar ul {
    list-style: none;
    padding-left: 0;
}

.sidebar li a {
    display: block;
    padding: 0.4rem 0.8rem;
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 0.95rem;
}

.sidebar li a:hover,
.sidebar li a.active {
    background: var(--bg-secondary);
    color: var(--accent-gold);
}

/* Main Content */
.content {
    padding: 3rem 2rem;
    min-width: 0;
}

/* min-width 0 prevents code blocks from overflowing grid */
section {
    scroll-margin-top: calc(var(--header-height) + 2rem);
    margin-bottom: 3rem;
}

/* Right TOC */
.toc-right {
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    padding: 3rem 1rem;
    font-size: 0.9rem;
    border-left: 1px solid var(--bg-tertiary);
}

.toc-right h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.toc-right ul {
    list-style: none;
    margin: 0;
}

.toc-right li {
    margin-bottom: 0.5rem;
}

.toc-right a {
    color: var(--text-secondary);
    display: block;
    padding-left: 0.5rem;
    border-left: 2px solid transparent;
}

.toc-right a:hover,
.toc-right a.active {
    color: var(--accent-saffron);
    border-left-color: var(--accent-saffron);
}

/* Code Blocks */
pre {
    background: var(--code-bg);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 1.5rem 0;
    border: 1px solid var(--bg-tertiary);
    position: relative;
}

.code-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.code-wrapper pre {
    margin: 0;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: 0.2s;
}

.code-wrapper:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background: var(--bg-tertiary);
    color: white;
}

/* Syntax Highlighting */
.kw {
    color: var(--token-keyword);
}

.fn {
    color: var(--token-function);
}

.str {
    color: var(--token-string);
}

.type {
    color: var(--accent-gold);
}

.num {
    color: var(--token-number);
}

.cmt {
    color: var(--token-comment);
    font-style: italic;
}

/* Admonitions */
.admonition {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background: var(--bg-secondary);
    border-left: 4px solid var(--bg-tertiary);
    margin: 1.5rem 0;
}

.admonition-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.admonition.note {
    border-left-color: var(--accent-gold);
    background: rgba(251, 191, 36, 0.1);
}

.admonition.note .admonition-title {
    color: var(--accent-gold);
}

.admonition.warning {
    border-left-color: var(--accent-saffron);
    background: rgba(249, 115, 22, 0.1);
}

.admonition.warning .admonition-title {
    color: var(--accent-saffron);
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .docs-layout {
        grid-template-columns: 260px 1fr;
    }

    .toc-right {
        display: none;
    }
}

@media (max-width: 768px) {
    .docs-layout {
        display: block;
    }

    .sidebar {
        display: none;
        /* In real app, toggle with menu */
    }

    .header {
        padding: 0 1rem;
    }

    .container {
        padding: 0 1.5rem;
    }
}