* {
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', Courier, monospace;
    text-align: center;
    background-color: #000;
    color: #00ff41;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.04) 2px,
        rgba(0, 0, 0, 0.04) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

h1, h2 {
    color: #00ff41;
    text-shadow: 0 0 10px #00ff41, 0 0 20px #00ff41, 0 0 40px #008f11;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 3px;
    text-transform: uppercase;
    padding: 20px;
    margin: 0;
    border-bottom: 1px solid #003b10;
    background-color: rgba(0, 0, 0, 0.85);
}

p {
    color: #008f11;
    font-family: 'Courier New', Courier, monospace;
}

a {
    color: #00ff41;
    text-decoration: none;
    text-shadow: 0 0 5px #00ff41;
    transition: all 0.15s;
}

a:hover {
    color: #000;
    background: #00ff41;
    text-shadow: none;
}

header {
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 1px solid #00ff41;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

nav {
    padding: 14px 0;
}

nav a {
    color: #00ff41;
    font-size: 1.5em;
    margin: 0 16px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 5px #00ff41;
    padding: 4px 8px;
}

nav a:hover {
    color: #000;
    background: #00ff41;
    text-shadow: none;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.home-links {
    margin: 40px auto;
}

.home-links a {
    display: inline-block;
    margin: 12px;
    padding: 14px 28px;
    background: rgba(0, 0, 0, 0.8);
    color: #00ff41;
    border: 1px solid #00ff41;
    font-size: 18px;
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 8px #00ff41;
    box-shadow: 0 0 12px rgba(0, 255, 65, 0.2), inset 0 0 12px rgba(0, 255, 65, 0.05);
    transition: all 0.2s;
}

.home-links a:hover {
    background: #00ff41;
    color: #000;
    text-shadow: none;
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.7);
}

.nav-buttons {
    margin: 20px 0;
}

button {
    background: rgba(0, 0, 0, 0.8);
    color: #00ff41;
    border: 1px solid #00ff41;
    padding: 10px 22px;
    font-size: 13px;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 2px;
    cursor: pointer;
    text-transform: uppercase;
    text-shadow: 0 0 5px #00ff41;
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.2);
    transition: all 0.15s;
    margin: 5px;
}

button:hover:not(:disabled) {
    background: #00ff41;
    color: #000;
    text-shadow: none;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.6);
}

button:disabled {
    color: #003b10;
    border-color: #003b10;
    cursor: not-allowed;
    text-shadow: none;
    box-shadow: none;
}

button.speed-active {
    background: #00ff41;
    color: #000;
    text-shadow: none;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.6);
}

.file-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
    padding: 10px 20px 40px;
}

.file-list li {
    list-style-type: none;
    margin: 3px;
}

.file-list li a {
    color: #008f11;
    font-size: 13px;
    font-family: 'Courier New', Courier, monospace;
    text-shadow: none;
    padding: 2px 6px;
    display: inline-block;
    transition: all 0.15s;
}

.file-list li.active a {
    color: #ffffff;
    text-shadow: 0 0 8px #00ff41;
    background: rgba(0, 255, 65, 0.12);
}

.file-list li a:hover {
    color: #00ff41;
    text-shadow: 0 0 6px #00ff41;
    background: rgba(0, 255, 65, 0.08);
}

#image-display {
    max-width: 80%;
    max-height: 60vh;
    margin: 20px auto;
    display: none;
    border: 1px solid #00ff41;
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.35);
}

#video-display {
    width: 60%;
    height: auto;
    margin: 20px auto;
    display: block;
    border: 1px solid #00ff41;
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.35);
}

footer {
    width: 100%;
    text-align: center;
    color: #004d18;
    font-size: 12px;
    border-top: 1px solid #003b10;
    background: rgba(0, 0, 0, 0.9);
    padding: 8px 0;
    margin-top: 20px;
}

footer p {
    color: #004d18;
    margin: 0;
}

#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}


/* Snaps gallery two-panel layout */
.snaps-layout {
    display: flex;
    align-items: stretch;
    gap: 16px;
    height: 85vh;
    max-width: 1400px;
    margin: 0 auto;
}
.snaps-image-panel {
    flex: 1 1 70%;
    min-height: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    margin: 0;
}
.snaps-image-panel #image-display {
    max-width: 100%;
    max-height: 100%;
    margin: 0 auto;
    display: block;
}
.snaps-list-panel {
    flex: 0 0 28%;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #003b10;
    border-radius: 4px;
    width: auto;
    margin: 0;
}
.snaps-list-panel .file-list {
    display: block;
    padding: 8px;
    margin-top: 0;
}
.file-list li.active a {
    color: #ffffff;
    text-shadow: 0 0 8px #00ff41;
    background: rgba(0, 255, 65, 0.12);
}

/* Snaps page: full-viewport flex column so layout fills exactly the remaining height */
body.snaps-page {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
body.snaps-page .snaps-layout {
    flex: 1 1 0;
    min-height: 0;
    height: auto;
}

@media (max-width: 768px) {
    .snaps-layout {
        flex-direction: column;
    }
    .snaps-image-panel {
        flex: 0 0 40%;
        max-height: none;
    }
    .snaps-list-panel {
        flex: 1 1 0;
        height: auto;
        min-height: 0;
    }
}

/* Vids gallery two-panel layout — mirrors snaps layout */
body.vids-page {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.vids-layout {
    display: flex;
    align-items: stretch;
    gap: 16px;
    flex: 1 1 0;
    min-height: 0;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}
.vids-video-panel {
    flex: 1 1 70%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    margin: 0;
}
.vids-video-panel #video-display {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}
.vids-list-panel {
    flex: 0 0 28%;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #003b10;
    border-radius: 4px;
    width: auto;
    margin: 0;
}
.vids-list-panel .file-list {
    display: block;
    padding: 8px;
    margin-top: 0;
}

@media (max-width: 768px) {
    .vids-layout {
        flex-direction: column;
    }
    .vids-video-panel {
        flex: 0 0 50%;
        max-height: none;
    }
    .vids-list-panel {
        flex: 1 1 0;
        height: auto;
        min-height: 0;
    }
}
