/* prototype.bar - Brutalist Neon Bar */

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --surface-dark: #1a1a1a;
    --surface-deeper: #0a0a0a;
    --slab: #2d2d2d;
    --slab-alt: #2a2a2a;
    --slab-line: #333333;
    --neon-primary: #39ff14;
    --neon-secondary: #ff2e63;
    --neon-tertiary: #00f0ff;
    --text-primary: #e0e0e0;
    --text-muted: #6b6b6b;
    --accent-warm: #ffaa00;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--surface-deeper);
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
    /* Grid scaffolding background */
    background-image:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 99px,
            #2d2d2d 99px,
            #2d2d2d 100px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 99px,
            #2d2d2d 99px,
            #2d2d2d 100px
        );
    background-size: 100px 100px;
}

/* SVG filters hidden */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Concrete noise overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.04;
    filter: url(#concrete-noise);
    background: white;
}

/* Fixed vertical navigation */
.floor-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: 48px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    z-index: 900;
    background: rgba(10, 10, 10, 0.6);
}

.floor-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    text-decoration: none;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transition: color 0.3s, text-shadow 0.3s;
}

.floor-link.active,
.floor-link:hover {
    color: var(--neon-primary);
    text-shadow: 0 0 10px var(--neon-primary), 0 0 40px var(--neon-primary);
}

/* =====================
   SECTION 1: THE COUNTER
   ===================== */
.section-counter {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding-left: 80px;
    background-color: var(--surface-deeper);
    overflow: hidden;
}

.counter-wordmark {
    display: flex;
    flex-direction: column;
    position: absolute;
    left: 80px;
    top: 50%;
    transform: translateY(-60%);
}

.counter-wordmark .char {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(4rem, 12vw, 10rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--neon-primary);
    text-shadow: 0 0 10px var(--neon-primary), 0 0 40px var(--neon-primary);
    line-height: 0.85;
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.counter-wordmark .char.visible {
    opacity: 1;
    transform: translateX(0);
}

.counter-wordmark .char.dot {
    color: var(--neon-secondary);
    text-shadow: 0 0 10px var(--neon-secondary), 0 0 40px var(--neon-secondary);
}

.counter-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40vh;
}

.counter-line-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    z-index: 10;
}

.counter-line {
    stroke: var(--neon-primary);
    stroke-width: 3;
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    filter: drop-shadow(0 0 8px rgba(57, 255, 20, 0.6)) drop-shadow(0 0 30px rgba(57, 255, 20, 0.3));
}

.counter-line.animate {
    animation: drawLine 1.2s ease-out forwards;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

.counter-surface {
    position: absolute;
    top: 6px;
    left: 0;
    width: 100%;
    height: calc(100% - 6px);
    background: repeating-linear-gradient(
        90deg,
        #2a2a2a 0px,
        #2a2a2a 1px,
        #333333 1px,
        #333333 2px
    );
    box-shadow: 0 -3px 15px rgba(57, 255, 20, 0.3), 0 -3px 45px rgba(57, 255, 20, 0.1);
}

.counter-labels {
    position: absolute;
    bottom: 20vh;
    left: 80px;
    display: flex;
    gap: 24px;
}

.version-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 1s ease 1.8s;
}

.version-label.visible {
    opacity: 0.2;
}

/* =====================
   SECTION 2: THE SHELVES
   ===================== */
.section-shelves {
    position: relative;
    min-height: 200vh;
    padding: 80px 80px 80px 80px;
    background-color: var(--surface-dark);
}

.section-separator {
    text-align: center;
    margin-bottom: 60px;
}

.slash-marks {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 48px;
    color: var(--neon-secondary);
    text-shadow: 0 0 10px var(--neon-secondary), 0 0 40px var(--neon-secondary);
}

.shelves-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.shelf-block {
    position: relative;
    background: var(--slab);
    padding: 40px 32px;
    transform: rotate(-1deg);
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.shelf-block:nth-child(even) {
    transform: rotate(1.5deg);
}

.shelf-block:nth-child(3n+1) {
    transform: rotate(-2deg);
}

.shelf-block.shelf-left {
    border-left: 2px solid var(--neon-primary);
    box-shadow: -15px 0 45px rgba(57, 255, 20, 0.1);
    transform: translateX(-80px) rotate(-1deg);
}

.shelf-block.shelf-right {
    border-right: 2px solid var(--neon-tertiary);
    box-shadow: 15px 0 45px rgba(0, 240, 255, 0.1);
    transform: translateX(80px) rotate(1.5deg);
}

.shelf-block.revealed {
    opacity: 1;
}

.shelf-block.revealed.shelf-left {
    transform: translateX(0) rotate(-1deg);
}

.shelf-block.revealed:nth-child(3n+1).shelf-left {
    transform: translateX(0) rotate(-2deg);
}

.shelf-block.revealed.shelf-right {
    transform: translateX(0) rotate(1.5deg);
}

.shelf-block .neon-border-active {
    transition: box-shadow 0.4s ease 0.3s;
}

.shelf-block.shelf-left.neon-lit {
    box-shadow: -15px 0 45px rgba(57, 255, 20, 0.3), -5px 0 15px rgba(57, 255, 20, 0.2);
}

.shelf-block.shelf-right.neon-lit {
    box-shadow: 15px 0 45px rgba(0, 240, 255, 0.3), 5px 0 15px rgba(0, 240, 255, 0.2);
}

.version-stamp {
    position: absolute;
    top: 8px;
    right: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--neon-primary);
    border: 1px solid var(--neon-primary);
    padding: 2px 6px;
    opacity: 0.6;
}

.shelf-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2rem, 6vw, 5rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.shelf-title::first-letter {
    color: var(--text-muted);
}

.shelf-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
}

/* Blinking cursor indicator */
.blink-cursor {
    width: 8px;
    height: 16px;
    background: var(--neon-tertiary);
    margin-top: 16px;
    animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* =====================
   SECTION 3: THE BASEMENT
   ===================== */
.section-basement {
    position: relative;
    min-height: 100vh;
    background: var(--surface-deeper);
    padding: 0 80px 80px;
}

.diagonal-transition {
    width: 100%;
    height: 200px;
    background: var(--surface-dark);
    clip-path: polygon(0 0, 100% 0, 100% 30%, 0 100%);
    margin-bottom: 40px;
}

.section-basement .section-separator {
    margin-bottom: 40px;
}

.basement-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Flicker animation */
.basement-content.flicker {
    animation: fluorFlicker 0.3s ease;
}

@keyframes fluorFlicker {
    0% { opacity: 1; }
    25% { opacity: 0.7; }
    50% { opacity: 1; }
    75% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Terminal Window */
.terminal-window {
    border: 1px solid var(--neon-tertiary);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2), 0 0 45px rgba(0, 240, 255, 0.1);
    background: var(--surface-deeper);
    overflow: hidden;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #1a1a1a;
    border-bottom: 1px solid #2d2d2d;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
}

.terminal-dot:first-child { background: var(--neon-secondary); }
.terminal-dot:nth-child(2) { background: var(--accent-warm); }
.terminal-dot:nth-child(3) { background: var(--neon-primary); }

.terminal-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-left: auto;
}

.terminal-body {
    padding: 24px;
    min-height: 300px;
}

.terminal-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    line-height: 2;
    color: var(--neon-primary);
    min-height: 1.8em;
}

.terminal-line .typed-text {
    color: var(--neon-primary);
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.4);
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: var(--neon-tertiary);
    margin-left: 24px;
    margin-bottom: 24px;
    animation: cursorBlink 1s step-end infinite;
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 900px) {
    .shelves-grid {
        grid-template-columns: 1fr;
    }

    .section-counter {
        padding-left: 60px;
    }

    .counter-wordmark {
        left: 60px;
    }

    .counter-labels {
        left: 60px;
        flex-direction: column;
        gap: 8px;
    }

    .section-shelves {
        padding: 60px 60px 60px 60px;
    }

    .section-basement {
        padding: 0 60px 60px;
    }
}

@media (max-width: 600px) {
    .floor-nav {
        width: 36px;
    }

    .section-counter {
        padding-left: 48px;
    }

    .counter-wordmark {
        left: 48px;
    }

    .counter-labels {
        left: 48px;
    }

    .section-shelves,
    .section-basement {
        padding-left: 48px;
        padding-right: 20px;
    }

    .shelf-block.shelf-left,
    .shelf-block.shelf-right {
        transform: translateX(0) rotate(0deg);
    }

    .shelf-block.revealed.shelf-left,
    .shelf-block.revealed.shelf-right,
    .shelf-block.revealed:nth-child(3n+1).shelf-left {
        transform: translateX(0) rotate(0deg);
    }
}
