:root {
    /* Industrial Palette */
    --bg-oil: #0a0a0a;
    --bg-panel: #161616;
    --bg-terminal: #000000;

    /* Text Colors */
    --text-phosphor: #33ff00;
    /* Safety Green (Active/high-tech) */
    --text-steel: #b0b3b8;
    /* Stamped unpolished steel */
    --text-dim: #5c5c5c;

    /* Accents */
    --rust-dark: #3e2723;
    --rust-light: #8d6e63;
    --chrome-highlight: #e0e0e0;
    --chrome-shadow: #212121;
    --hazard-yellow: #ffab00;

    /* Global Settings */
    --font-header: 'VT323', monospace;
    --font-body: 'Space Mono', monospace;
    --font-ui: 'Share Tech Mono', monospace;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-oil);
    color: var(--text-steel);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    /* The "Assemblage" Texture Stack */
    background-image:
        /* 1. Vignette (Grease/Burn-in) */
        radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.8) 100%),
        /* 2. Faint Hazard Stripes (Industrial Texture) */
        repeating-linear-gradient(45deg,
            rgba(0, 0, 0, 0.2),
            rgba(0, 0, 0, 0.2) 2px,
            transparent 2px,
            transparent 4px);
    background-size: 100% 100%, 20px 20px;
}

/* --- Typography --- */

h1,
h2,
h3 {
    font-family: var(--font-header);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

h1 {
    color: var(--text-steel);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.8), -1px -1px 0px rgba(255, 255, 255, 0.1);
    /* Stamped Steel Effect */
}

/* Mobile Navbar */
.mobile-navbar {
    display: none;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-panel);
    border-bottom: 2px solid var(--rust-light);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10001;
    height: 60px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
}

.navbar-brand h1 {
    font-size: 1.5rem;
    margin: 0;
}

/* --- Layout --- */

.container {
    display: grid;
    grid-template-columns: 320px 1fr;
    flex: 1;
    overflow: hidden;
    padding: 1rem;
    gap: 1.5rem;
}

/* --- Sidebar (Legacy Control Panel) --- */
aside {
    background: var(--bg-panel);
    border: 4px solid var(--rust-dark);
    padding: 1.5rem;
    overflow-y: auto;
    position: relative;

    /* "Bolts" via Background Gradients (No extra HTML needed!) */
    background-image:
        radial-gradient(circle at 10px 10px, #555 0%, #111 60%, transparent 70%),
        /* Top Left */
        radial-gradient(circle at calc(100% - 10px) 10px, #555 0%, #111 60%, transparent 70%),
        /* Top Right */
        radial-gradient(circle at 10px calc(100% - 10px), #555 0%, #111 60%, transparent 70%),
        /* Bot Left */
        radial-gradient(circle at calc(100% - 10px) calc(100% - 10px), #555 0%, #111 60%, transparent 70%);
    /* Bot Right */
    background-repeat: no-repeat;
    background-size: 20px 20px;
    background-position: 0 0, 100% 0, 0 100%, 100% 100%;
}

/* Custom Scrollbar (Hydraulic Track) */
aside::-webkit-scrollbar,
.code-content::-webkit-scrollbar,
.output-content::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

aside::-webkit-scrollbar-track,
.code-content::-webkit-scrollbar-track,
.output-content::-webkit-scrollbar-track {
    background: #000;
    border-left: 1px solid #333;
}

aside::-webkit-scrollbar-thumb,
.code-content::-webkit-scrollbar-thumb,
.output-content::-webkit-scrollbar-thumb {
    background: #333;
    border: 2px solid #000;
    border-radius: 0;
    /* Square/Mechanical */
}

/* Version List Items */
.version-list {
    list-style: none;
}

.version-item {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: #111;
    border: 1px solid #333;
    cursor: pointer;
    font-family: var(--font-ui);
    position: relative;
    transition: all 0.05s linear;
    /* Snappy mechanical transition */
}

.version-item:hover {
    background: #1a1a1a;
    border-color: var(--text-steel);
}

.version-item.active {
    background: #1a1a1a;
    border: 2px solid var(--text-phosphor);
    box-shadow: 0 0 10px rgba(51, 255, 0, 0.1);
}

.version-item.active .v-name {
    color: var(--text-phosphor);
    text-shadow: 0 0 4px var(--text-phosphor);
}

.v-name {
    font-size: 1.1rem;
    font-weight: 700;
    display: block;
    color: var(--text-steel);
}

.v-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
    display: block;
}

.v-time {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--hazard-yellow);
    font-family: var(--font-header);
}

.stat-highlight {
    color: var(--text-phosphor) !important;
    text-shadow: 0 0 5px var(--text-phosphor);
    font-weight: 700;
}

.v-rank {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-left: 0.75rem;
    font-family: var(--font-ui);
    vertical-align: middle;
}

.v-minmax {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.25rem;
    font-family: var(--font-ui);
    letter-spacing: -0.02em;
}

.v-overall {
    display: block;
    font-size: 0.75rem;
    color: var(--chrome-highlight);
    margin-top: 0.25rem;
    font-style: italic;
    border-top: 1px dashed #333;
    padding-top: 0.25rem;
    opacity: 0.8;
}





/* --- Main Content --- */
main {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 1.5rem;
    overflow: hidden;
}

.info-header {
    border-bottom: 2px dashed var(--text-dim);
    /* "Perforated" tear-off look */
    padding-bottom: 1rem;
}

.info-title {
    font-size: 2rem;
    color: var(--text-steel);
    margin-bottom: 0.5rem;
}

.info-desc {
    color: var(--text-dim);
    font-family: var(--font-ui);
    max-width: 800px;
}

.workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    min-height: 0;
}

/* The "Panel" Container style */
.panel {
    background: var(--bg-panel);
    border: 2px solid var(--chrome-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    /* Chrome-like border style */
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.1),
        3px 3px 10px rgba(0, 0, 0, 0.5);
}

.panel-header {
    background: #222;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-ui);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: var(--text-steel);
}

/* --- Code & Output (The Industrial Terminal) --- */
.code-content,
.output-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    font-family: 'VT323', monospace;
    /* The requested font */
    font-size: 1.1rem;
    /* Slightly larger for VT323 readability */
    line-height: 1.4;
    position: relative;
}

/* CRT Scanline Overlay */
.code-content::after,
.output-content::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    /* Crucial for text selection */
    z-index: 2;
    mix-blend-mode: overlay;
    opacity: 0.7;
}

.code-content {
    background: var(--bg-terminal);
    color: #4da6ff;
    /* Cyan-ish for code base */
    white-space: pre-wrap;
}

.output-content {
    background: #050505;
    color: var(--text-phosphor);
    text-shadow: 0 0 3px rgba(51, 255, 0, 0.4);
    /* Bloom */
}

/* Monochrome Syntax Highlighting (No Carnival) */
.kwd {
    color: #88c0d0;
}

/* Muted Cyan */
.str {
    color: #a3be8c;
}

/* Muted Green */
.num {
    color: #ebcb8b;
}

/* Muted Yellow */
.com {
    color: #4c566a;
    font-style: italic;
}

/* Muted Grey */
.func {
    color: #81a1c1;
}

/* Blueish Grey */

/* --- Controls & Buttons (Mechanical Switches) --- */

.run-btn {
    background: #333;
    color: var(--text-steel);
    border: none;
    border-top: 2px solid #555;
    /* Highlight */
    border-left: 2px solid #555;
    border-right: 2px solid #111;
    /* Shadow */
    border-bottom: 2px solid #111;
    padding: 0.5rem 1.5rem;
    font-family: var(--font-header);
    font-size: 1.2rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.05s linear;
    /* Snappy */
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

.run-btn:active {
    transform: translateY(3px);
    /* Physical Travel */
    border-top: 2px solid #111;
    /* Inverted shadow */
    border-left: 2px solid #111;
    border-right: 2px solid #333;
    border-bottom: 2px solid #333;
    box-shadow: none;
    color: var(--text-phosphor);
}

.run-btn svg {
    display: none;
}

/* Remove icon, stick to text for industrial look */

.benchmark-btn {
    background: transparent;
    border: 1px solid var(--text-dim);
    color: var(--text-dim);
    padding: 2px 8px;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.1s;
}

.benchmark-btn:hover {
    border-color: var(--text-steel);
    color: var(--text-steel);
    background: rgba(255, 255, 255, 0.05);
}

/* Sort Controls */
.sort-controls {
    display: flex;
    gap: 2px;
    background: #111;
    padding: 4px;
    border: 1px solid #333;
    margin-top: 1rem;
}

.sort-btn {
    flex: 1;
    background: #222;
    border: 1px solid;
    border-color: #444 #111 #111 #444;
    /* Bevel */
    color: #666;
    font-family: var(--font-ui);
    font-size: 0.7rem;
    text-transform: uppercase;
    cursor: pointer;
    padding: 4px 0;
}

.sort-btn:active,
.sort-btn.active {
    background: #111;
    border-color: #111 #444 #444 #111;
    /* Inverted Bevel */
    color: var(--hazard-yellow);
}

/* Mobile Strategy Navigation Default (Hidden) */
.mobile-strategy-nav,
.mobile-benchmark-btn {
    display: none;
}

/* Mobile Adjustments */
@media (max-width: 900px) {
    /* ... existing media query content ... */

    /* ADDED STYLES FOR BENCHMARK BTN */
    .mobile-benchmark-btn {
        display: flex;
        width: 100%;
        margin-bottom: 1rem;
        background: transparent;
        border: 1px dashed var(--hazard-yellow);
        color: var(--hazard-yellow);
        font-size: 0.9rem;
    }

    .mobile-benchmark-btn:active {
        background: var(--hazard-yellow);
        color: #000;
    }

    .mobile-benchmark-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Allow body scroll on mobile */
    body {
        overflow-y: auto;
        height: auto;
    }

    .container {
        display: flex;
        flex-direction: column;
        height: auto;
        overflow: visible;
        padding-top: 70px;
        /* Header space */
    }

    .mobile-navbar {
        display: flex;
        text-align: center;
        justify-content: center;
    }

    .mobile-menu-toggle {
        position: absolute;
        left: 1rem;
        background: transparent;
        border: 1px solid var(--text-dim);
        color: var(--text-steel);
        padding: 5px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-menu-toggle svg {
        width: 24px;
        height: 24px;
    }

    aside {
        position: fixed;
        left: -100%;
        top: 60px;
        bottom: 0;
        width: 85%;
        z-index: 10000;
        transition: left 0.2s ease-in-out;
        border-right: 4px solid var(--rust-dark);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.8);
    }

    aside.mobile-open {
        left: 0;
    }

    .mobile-backdrop.active {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.8);
        z-index: 9999;
    }

    main {
        overflow: visible;
        height: auto;
        display: block;
    }

    .workspace {
        display: flex;
        flex-direction: column;
        height: auto;
        gap: 2rem;
        padding-bottom: 2rem;
    }

    .panel {
        height: 500px;
        /* Fixed height for panels on mobile so they have internal scroll */
        min-height: 0;
    }

    /* Reposition Portfolio Link for mobile */
    a[href*="ajlato.com/projects"] {
        bottom: 10px !important;
        right: 10px !important;
        font-size: 12px !important;
        padding: 5px 10px !important;
        background: var(--rust-dark) !important;
        border: 1px solid var(--text-dim) !important;
    }

    /* Mobile Strategy Navigation */
    .mobile-strategy-nav {
        display: flex;
        gap: 1rem;
        margin: 0.5rem 0 1rem 0;
    }

    .nav-btn {
        flex: 1;
        background: var(--bg-panel);
        border: 1px solid var(--text-dim);
        color: var(--text-steel);
        padding: 0.75rem;
        font-family: var(--font-header);
        text-transform: uppercase;
        font-size: 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        cursor: pointer;
    }

    .nav-btn:active {
        background: var(--text-dim);
        color: #fff;
    }

    .nav-btn svg {
        width: 20px;
        height: 20px;
    }

    /* Make Run Button HUUUUGE on Mobile */
    .run-btn {
        width: 100%;
        padding: 1rem;
        font-size: 1.5rem;
        margin-top: 0.5rem;
        background: var(--rust-dark);
        border-color: #5d4037;
        color: #fff;
    }

    .run-btn:active {
        background: #3e2723;
    }
}