:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-surface: rgba(26, 26, 26, 0.6);
    --bg-glass: rgba(20, 20, 20, 0.85);

    --accent-primary: #e5ff00; /* NY Taxi Yellow / Acid Yellow */
    --accent-hover: #ccff00;
    --accent-muted: rgba(229, 255, 0, 0.1);

    --text-primary: #f2f2f2;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --border-color: rgba(255, 255, 255, 0.1);
    --border-highlight: rgba(229, 255, 0, 0.3);

    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100vw;
    margin: 0;
}

/* Grit & Noise Overlay for that NY street vibe */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Base Responsive Fixes */
img, video {
    max-width: 100%;
    height: auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

h1 { font-size: 3.5rem; text-transform: uppercase; }
h2 { font-size: 2.5rem; position: relative; padding-bottom: 0.5rem; }
h3 { font-size: 1.5rem; }

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: var(--radius-sm);
}

p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
}

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4rem;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4rem 0 1.5rem; /* Left matches sidebar, right matches main content */
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-brand .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bg-primary);
    background: var(--accent-primary);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    letter-spacing: -0.05em;
    box-shadow: 0 0 15px rgba(229, 255, 0, 0.4);
}

.nav-brand .version {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.95rem;
}

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

.nav-links .github-link {
    font-size: 1.25rem;
}

.nav-links .github-link:hover {
    color: var(--accent-primary);
}

/* Mobile Menu Elements */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    color: var(--accent-primary);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 4rem;
    left: 0;
    width: 100vw;
    height: calc(100vh - 4rem);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    transition: opacity var(--transition);
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Layout */
.layout-container {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    margin: 0 auto;
    padding-top: 4rem;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    flex: 0 0 260px; /* Fixed width sidebar */
    position: sticky;
    top: 4rem;
    height: calc(100vh - 4rem);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    overflow-y: auto;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

.search-box i {
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    font-family: var(--font-body);
}

.search-box .shortcut-key {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section h4 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.nav-section ul {
    list-style: none;
}

.nav-section li a {
    display: block;
    padding: 0.4rem 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    border-left: 2px solid transparent;
}

.nav-section li a:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-left-color: var(--border-color);
}

.nav-section li a.active {
    background: var(--accent-muted);
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
}

/* Main Content Area */
.main-content {
    flex: 1; /* Take up remaining space */
    min-width: 0; /* Critical for flex items to shrink below their content size */
    padding: 3rem 4rem;
    max-width: 900px;
}

.hero {
    margin-bottom: 4rem;
}

.taxi-badge {
    display: inline-block;
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero h1 .highlight {
    color: var(--accent-primary);
    text-shadow: 0 0 20px rgba(229, 255, 0, 0.3);
}

.hero .subtitle {
    font-size: 1.25rem;
    max-width: 600px;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    font-family: var(--font-heading);
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: 1px solid var(--accent-primary);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(229, 255, 0, 0.2);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--text-primary);
    transform: translateY(-2px);
}

/* Sections */
section {
    margin-bottom: 4rem;
    scroll-margin-top: 5rem;
}

section p {
    margin-bottom: 1.5rem;
}

hr {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 4rem 0;
}

/* Step Cards */
.step-card {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.step-card:hover {
    border-color: var(--border-highlight);
    transform: translateX(5px);
}

.step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.step-details h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.step-details p {
    font-size: 0.95rem;
    margin-bottom: 0;
    word-break: break-word; /* Prevent long URLs/text from breaking cards */
}

/* Code Blocks */
.code-block {
    background: #000;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 1.5rem 0;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #111;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.code-header .lang-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.code-header .copy-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
}

.code-header .copy-btn:hover {
    color: var(--accent-primary);
}

.code-block pre {
    padding: 1.5rem;
    overflow-x: auto;
}

.code-block pre code {
    background: transparent;
    color: #e6e6e6;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    padding: 0;
}

/* Footer */
.doc-footer {
    margin-top: 6rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.back-to-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.back-to-top:hover {
    color: var(--accent-primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .layout-container {
        grid-template-columns: 220px 1fr;
    }
    .main-content {
        padding: 2.5rem;
    }
}

@media (max-width: 768px) {
    .layout-container {
        flex-direction: column;
    }
    
    .mobile-menu-btn {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        width: 280px;
        z-index: 95;
        transition: left var(--transition);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.8);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .nav-brand .version {
        display: none;
    }
    
    .main-content {
        padding: 2rem 1.5rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Fix horizontal scrolling on mobile */
    .step-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem 1rem;
    }

    .step-icon {
        margin-bottom: 1rem;
    }

    .code-block pre {
        padding: 1rem;
    }
    
    .code-block pre code {
        font-size: 0.85rem;
    }

    /* Wrap long words like variables on mobile */
    p, h1, h2, h3, h4 {
        word-break: break-word;
    }
}
