/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
}

body {
    background: #0b1628;
    color: #c8bfae;
    font-family: 'Lora', serif;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* === SCENE CONTAINER === */
.scene-container {
    width: 100%;
}

.scene {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
}

/* === SCENE 01: ROOFTOP === */
.scene-rooftop {
    background: #0b1628;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Skyline */
.skyline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
}

.building {
    position: absolute;
    bottom: 0;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.bg-building {
    background: #0f1a30;
    z-index: 1;
}

.fg-building {
    background: #162040;
    z-index: 2;
}

.central-building {
    z-index: 3;
}

.window {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #e8c44a;
    image-rendering: pixelated;
}

.window.dark {
    background: #0f1a30;
}

.rooftop-structure {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 20px;
    background: #162040;
    border-top: 2px solid #6b7a8d;
}

/* Neon Sign */
.neon-sign {
    position: relative;
    z-index: 20;
    text-align: center;
    margin-bottom: 10vh;
}

.neon-text {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: #e8c44a;
    text-shadow: 0 0 20px #e8c44a80, 0 0 40px #e8c44a40, 0 0 60px #e8c44a20;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    border-right: 3px solid #e8c44a;
    width: 0;
    animation: typing 3s steps(15, end) 1s forwards, blink 0.7s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    0%, 100% { border-color: #e8c44a; }
    50% { border-color: transparent; }
}

/* Rain */
.rain-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.raindrop {
    position: absolute;
    width: 1px;
    background: linear-gradient(to bottom, transparent, #ffffff26);
    top: -20px;
    animation: rain linear infinite;
}

@keyframes rain {
    from { transform: translateY(-20px); }
    to { transform: translateY(100vh); }
}

/* Scroll Cue */
.scroll-cue {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    animation: cue-blink 1.5s ease-in-out infinite;
}

.pixel-arrow {
    width: 16px;
    height: 16px;
    border-right: 3px solid #e8c44a;
    border-bottom: 3px solid #e8c44a;
    transform: rotate(45deg);
    image-rendering: pixelated;
}

@keyframes cue-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* === SCENE 02: FILING ROOM === */
.scene-filing {
    background: #121d33;
}

.scene-transition {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to bottom, #0b1628, #121d33);
}

/* Filing Cabinets */
.filing-cabinets {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2;
}

.cabinet-drawer {
    width: 120px;
    height: 40px;
    background: #6b7a8d;
    border: 2px solid #4a5a6d;
    position: relative;
    transition: transform 0.3s ease-out;
    image-rendering: pixelated;
    display: flex;
    align-items: center;
}

.cabinet-drawer:hover {
    transform: translateX(30px);
}

.drawer-handle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 8px;
    background: #d4a043;
    border: 1px solid #b8882e;
}

.drawer-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    color: #0b1628;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding-left: 8px;
}

/* Documents */
.documents-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 4rem 2rem;
    padding-left: 140px;
}

.document-card {
    background: #f5f0e0;
    border: 2px solid #d4c9a8;
    box-shadow: 4px 4px 0 #2a1f1433;
    padding: 2rem;
    max-width: 560px;
    width: 100%;
    margin: 0 auto 2rem;
    position: relative;
    opacity: 0;
    transform: translateX(-100px) rotate(-3deg);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.document-card.visible {
    opacity: 1;
    transform: translateX(0) rotate(0deg);
}

.document-card:nth-child(2) { transition-delay: 0.2s; }
.document-card:nth-child(3) { transition-delay: 0.4s; }

/* Stamp Mark */
.stamp-mark {
    position: absolute;
    top: 12px;
    right: 12px;
    font-family: 'Press Start 2P', cursive;
    font-size: 7px;
    color: #8b2e2e;
    border: 2px solid #8b2e2e;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-12deg);
    opacity: 0.7;
    text-align: center;
    line-height: 1.2;
}

/* Document corners */
.doc-corner {
    position: absolute;
    width: 8px;
    height: 8px;
    border-color: #8b2e2e;
    border-style: solid;
    border-width: 0;
}

.doc-corner.tl { top: 4px; left: 4px; border-top-width: 2px; border-left-width: 2px; }
.doc-corner.tr { top: 4px; right: 4px; border-top-width: 2px; border-right-width: 2px; }
.doc-corner.bl { bottom: 4px; left: 4px; border-bottom-width: 2px; border-left-width: 2px; }
.doc-corner.br { bottom: 4px; right: 4px; border-bottom-width: 2px; border-right-width: 2px; }

.doc-heading {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(0.7rem, 1.2vw, 1rem);
    color: #2a1f14;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.doc-body {
    font-family: 'Lora', serif;
    font-size: clamp(0.9rem, 1.3vw, 1.1rem);
    color: #2a1f14;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.doc-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.7rem, 1vw, 0.875rem);
    color: #6b7a8d;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.3;
}

/* === SCENE 03: CLERK'S DESK === */
.scene-desk {
    background: #1a1008;
    background-image: repeating-linear-gradient(90deg, transparent, transparent 2px, #1a100810 2px, #1a100810 4px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    padding: 2rem;
}

.desk-lamp-glow {
    position: absolute;
    top: 0;
    left: 10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #d4a04360 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

/* Typewriter */
.typewriter-area {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.typewriter-svg {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display: block;
    margin-bottom: 1rem;
}

.typed-output {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.8rem, 1.2vw, 1rem);
    color: #c8bfae;
    max-width: 400px;
    min-height: 80px;
    line-height: 1.6;
    letter-spacing: 0.02em;
}

.typed-output .cursor {
    display: inline-block;
    width: 8px;
    height: 1.1em;
    background: #e8c44a;
    vertical-align: text-bottom;
    animation: blink 0.7s step-end infinite;
}

/* Document Stack */
.doc-stack {
    position: relative;
    z-index: 5;
    width: 200px;
    height: 260px;
}

.stack-paper {
    position: absolute;
    width: 180px;
    height: 240px;
    background: #f5f0e0;
    border: 2px solid #d4c9a8;
    box-shadow: 3px 3px 0 #2a1f1433;
    top: 0;
    left: 0;
}

.stack-paper.top-paper {
    padding: 20px;
    z-index: 3;
}

.stack-label {
    font-family: 'Press Start 2P', cursive;
    font-size: 7px;
    color: #2a1f14;
    text-transform: uppercase;
    display: block;
    margin-bottom: 16px;
    letter-spacing: 0.05em;
}

.stack-lines {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.text-line {
    height: 2px;
    background: #2a1f1440;
    width: 100%;
}

.text-line.short {
    width: 60%;
}

/* Stamp Area */
.stamp-area {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.ink-pad {
    width: 80px;
    height: 50px;
    background: #1a1008;
    border: 3px solid #2a1f14;
    box-shadow: inset 0 0 0 4px #8b2e2e40;
}

.stamp-tool {
    width: 60px;
    height: 60px;
    background: #2a1f14;
    border: 2px solid #3d2b1a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease;
    image-rendering: pixelated;
}

.stamp-tool span {
    font-family: 'Press Start 2P', cursive;
    font-size: 6px;
    color: #d4a043;
    text-transform: uppercase;
}

.stamp-tool:hover {
    transform: translateY(-4px);
}

.stamp-tool.stamping {
    animation: stamp-down 0.4s ease;
}

@keyframes stamp-down {
    0% { transform: translateY(-4px); }
    40% { transform: translateY(8px) scale(1.05); }
    60% { transform: translateY(8px) scale(1.05); }
    100% { transform: translateY(0); }
}

/* === SCENE 04: BASEMENT ARCHIVE === */
.scene-archive {
    background: #070d1a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.bare-bulb-glow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #d4a04350 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

/* Shelving */
.shelving {
    position: relative;
    z-index: 5;
    max-width: 600px;
    width: 100%;
}

.shelf-row {
    border-bottom: 2px solid #6b7a8d40;
    padding: 2rem 0;
}

.shelf-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.7rem, 1vw, 0.875rem);
    color: #6b7a8d;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.shelf-content {
    font-family: 'Lora', serif;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    color: #c8bfae;
    line-height: 1.7;
}

.shelf-content p {
    margin-bottom: 0.3rem;
}

.copyright {
    position: relative;
    z-index: 5;
    margin-top: 3rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.65rem, 0.9vw, 0.8rem);
    color: #6b7a8d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
}

/* === DASHED RULES === */
.shelf-row + .shelf-row {
    border-top: none;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .filing-cabinets {
        display: none;
    }

    .documents-area {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .scene-desk {
        flex-direction: column;
        gap: 2rem;
    }

    .doc-stack {
        display: none;
    }

    .stamp-area {
        display: none;
    }

    .neon-text {
        font-size: clamp(1rem, 5vw, 1.8rem);
    }

    .skyline .building {
        display: none;
    }

    .skyline .central-building {
        display: block;
        left: 50% !important;
        transform: translateX(-50%);
    }
}
