/* ==========================================
   Render Engine Documentation - Clean Theme
   ========================================== */

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-code: #0f172a;
    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --border: #334155;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.3);
    --radius: 8px;
    --radius-lg: 12px;
}

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

html {
    scroll-behavior: smooth;
}

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

/* ==========================================
   Typography
   ========================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; margin-top: 2.5rem; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-top: 2rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.1rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

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

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

/* ==========================================
   Layout
   ========================================== */

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

section:last-of-type {
    border-bottom: none;
}

/* ==========================================
   Header
   ========================================== */

header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 3rem 2rem;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

header .subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

header .badge {
    display: inline-block;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-top: 1rem;
}

/* ==========================================
   Navigation
   ========================================== */

nav {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav .container {
    padding: 0 2rem;
    max-width: 900px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.75rem 0;
}

nav a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.2s;
}

nav a:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

nav a.active {
    background: var(--accent);
    color: white;
}

/* ==========================================
   Code
   ========================================== */

code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
    background: var(--bg-secondary);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    color: var(--text-primary);
}

pre {
    background: var(--bg-code);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

pre code {
    background: none;
    padding: 0;
    color: #e2e8f0;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ==========================================
   Cards & Components
   ========================================== */

.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card h4 {
    margin-top: 0;
    color: var(--text-primary);
}

.card p:last-child {
    margin-bottom: 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.feature {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.feature h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.feature p {
    font-size: 0.9rem;
    margin: 0;
}

/* ==========================================
   Lists
   ========================================== */

ul, ol {
    margin: 1rem 0 1rem 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

li strong {
    color: var(--text-primary);
}

/* ==========================================
   Table of Contents
   ========================================== */

.toc {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.toc h3 {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

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

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

.toc a {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

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

/* ==========================================
   Buttons
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

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

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

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

.btn-secondary:hover {
    background: var(--border);
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* ==========================================
   Examples & Diagrams
   ========================================== */

.example {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.example h4 {
    margin-top: 0;
}

.diagram {
    background: var(--bg-code);
    color: #e2e8f0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    line-height: 1.5;
    margin: 1.5rem 0;
}

/* ==========================================
   Tags & Badges
   ========================================== */

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.tag-green {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.tag-orange {
    background: rgba(249, 115, 22, 0.2);
    color: #fdba74;
}

.tag-red {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* ==========================================
   Footer
   ========================================== */

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

/* ==========================================
   Utility Classes
   ========================================== */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 640px) {
    body { font-size: 15px; }

    .container { padding: 1rem; }

    header { padding: 2rem 1rem; }
    header h1 { font-size: 1.5rem; }

    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.1rem; }

    nav ul { gap: 0.25rem; }
    nav a { padding: 0.5rem 0.75rem; font-size: 0.9rem; }

    pre { padding: 1rem; }
    pre code { font-size: 0.8rem; }

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

    .btn-group { flex-direction: column; }
    .btn { width: 100%; justify-content: center; }
}

/* ==========================================
   Print
   ========================================== */

@media print {
    nav, footer, .btn-group { display: none; }
    header { border: none; }
    section { border: none; page-break-inside: avoid; }
}

