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

:root {
    --black: #0a0a0a;
    --dark: #141414;
    --gray-dark: #1a1a1a;
    --gray: #2a2a2a;
    --gray-mid: #666;
    --gray-light: #999;
    --white: #f0f0f0;
    --cream: #e8e4df;
    --accent: #c9ff57;
    --accent-dim: #a8d44a;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Mono', monospace;
    background: var(--black);
    color: var(--white);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============ PASSWORD SCREEN ============ */
.password-screen {
    position: fixed;
    inset: 0;
    background: var(--black);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.password-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.password-container {
    text-align: center;
}

.password-label {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gray-mid);
    margin-bottom: 30px;
}

.password-input-wrapper {
    position: relative;
}

.password-input {
    background: transparent;
    border: 1px solid var(--gray);
    padding: 15px 20px;
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    color: var(--white);
    letter-spacing: 0.2em;
    text-align: center;
    width: 280px;
    transition: border-color 0.3s ease;
}

.password-input:focus {
    outline: none;
    border-color: var(--accent);
}

.password-input::placeholder {
    color: var(--gray-mid);
    letter-spacing: 0.1em;
}

.password-error {
    margin-top: 20px;
    font-size: 0.75rem;
    color: #ff6b6b;
    letter-spacing: 0.1em;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.password-error.visible {
    opacity: 1;
}

.password-hint {
    margin-top: 40px;
    font-size: 0.65rem;
    color: var(--gray-mid);
    letter-spacing: 0.15em;
}

/* ============ LOADING SEQUENCE ============ */
.loader {
    position: fixed;
    inset: 0;
    background: var(--black);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loader.visible {
    opacity: 1;
    visibility: visible;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: left;
    font-size: 0.85rem;
    color: var(--gray-light);
    line-height: 2;
    letter-spacing: 0.05em;
}

.loader-line {
    opacity: 0;
    transform: translateY(10px);
}

.loader-line.visible {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.4s ease;
}

.loader-line .status {
    color: var(--accent);
}

.loader-line .dots {
    color: var(--gray-mid);
}

.loader-line.processing .dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

.loader-bar {
    width: 300px;
    height: 2px;
    background: var(--gray);
    margin-top: 40px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.loader-bar.visible {
    opacity: 1;
}

.loader-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.3s ease;
}

/* ============ CONTENT WRAPPER ============ */
.content-wrapper {
    opacity: 0;
    transition: opacity 1s ease;
}

.content-wrapper.visible {
    opacity: 1;
}

/* ============ INTRO SECTION (Fixed for parallax) ============ */
.intro-section {
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
    background: var(--black);
}

.typewriter-container {
    text-align: center;
}

.typewriter {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--white);
}

.typewriter .cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--accent);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 1s infinite;
}

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

.intro-scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gray-mid);
    animation: pulse 2s ease-in-out infinite;
}

/* Spacer to push content down */
.intro-spacer {
    height: 100vh;
}

/* ============ AUDIO SECTION (Scrolls over intro) ============ */
.audio-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    z-index: 10;
    background: var(--black);
}

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

.tag {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gray-mid);
    margin-bottom: 20px;
}

.title {
    font-family: 'Syne', sans-serif;
    font-size: clamp(3rem, 12vw, 7rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 0.95;
    color: var(--white);
    text-transform: uppercase;
}

.title span {
    display: block;
    color: var(--accent);
}

.chapter-num {
    font-family: 'Syne', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--gray-light);
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.chapter-num::before,
.chapter-num::after {
    content: '';
    width: 40px;
    height: 1px;
    background: var(--gray);
}

/* Player */
.player {
    width: 100%;
    max-width: 500px;
    background: var(--dark);
    border: 1px solid var(--gray);
    padding: 40px;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gray-mid);
}

.player-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--gray-mid);
    border-radius: 50%;
    transition: background 0.3s ease;
}

.status-dot.active {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

/* Waveform visualization */
.waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 60px;
    margin-bottom: 30px;
}

.wave-bar {
    width: 3px;
    background: var(--gray);
    border-radius: 2px;
    transition: height 0.15s ease, background 0.3s ease;
}

.wave-bar.active {
    background: var(--accent);
}

.wave-bar.passed {
    background: var(--accent-dim);
}

/* Controls */
.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.btn-secondary {
    width: 45px;
    height: 45px;
    border: 1px solid var(--gray);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: var(--white);
}

.btn-secondary svg {
    width: 16px;
    height: 16px;
    fill: var(--gray-light);
    transition: fill 0.3s ease;
}

.btn-secondary:hover svg {
    fill: var(--white);
}

.btn-play {
    width: 70px;
    height: 70px;
    border: 2px solid var(--accent);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-play:hover {
    background: var(--accent);
}

.btn-play svg {
    width: 24px;
    height: 24px;
    fill: var(--accent);
    transition: fill 0.3s ease;
    margin-left: 3px;
}

.btn-play:hover svg {
    fill: var(--black);
}

.btn-play .pause-icon {
    display: none;
    margin-left: 0;
}

.btn-play.playing .play-icon {
    display: none;
}

.btn-play.playing .pause-icon {
    display: block;
}

/* Progress */
.progress-container {
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 2px;
    background: var(--gray);
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    position: relative;
}

.progress-handle {
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.progress-bar:hover .progress-handle {
    opacity: 1;
}

.time-display {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--gray-mid);
    letter-spacing: 0.1em;
}

/* Volume */
.volume {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.volume svg {
    width: 16px;
    height: 16px;
    fill: var(--gray-mid);
}

.volume-bar {
    width: 80px;
    height: 2px;
    background: var(--gray);
    cursor: pointer;
    position: relative;
}

.volume-fill {
    height: 100%;
    background: var(--gray-light);
    width: 70%;
}

.scroll-hint {
    margin-top: 60px;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gray-mid);
    animation: pulse 2s ease-in-out infinite;
}

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

/* ============ STORY SECTION ============ */
.story-section {
    padding: 120px 40px;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    background: var(--black);
}

.section-header {
    text-align: center;
    margin-bottom: 100px;
}

.section-title {
    font-family: 'Syne', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.section-title::before,
.section-title::after {
    content: '';
    width: 40px;
    height: 1px;
    background: var(--gray);
}

.story-text {
    font-size: 1.05rem;
    line-height: 2;
    color: var(--cream);
    padding-left: 10%;
}

.story-text p {
    margin-bottom: 1.8em;
    max-width: 580px;
}

.dialogue {
    font-style: italic;
    color: var(--white);
    padding-left: 1.5em;
}

.thought {
    color: var(--gray-light);
    font-style: italic;
}

.divider {
    text-align: center;
    color: var(--gray);
    margin: 4em 0;
    letter-spacing: 0.5em;
    padding-left: 0;
}

.story-end {
    margin-top: 3em;
}

/* ============ FADE IN ANIMATION ============ */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.story-text p {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.story-text p.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============ GALLERY SECTION ============ */
.gallery-section {
    padding: 120px 20px;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    background: var(--black);
}

.gallery-header {
    text-align: center;
    margin-bottom: 120px;
}

.gallery-subtitle {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gray-mid);
    margin-top: 15px;
}

.gallery-item {
    margin-bottom: 150px;
    max-width: 600px;
}

.gallery-item.left {
    margin-right: auto;
}

.gallery-item.center {
    margin-left: auto;
    margin-right: auto;
}

.gallery-item.right {
    margin-left: auto;
}

/* Film development effect */
.gallery-item img {
    width: 100%;
    max-height: 75vh;
    object-fit: contain;
    filter: brightness(1.8) contrast(0.5) saturate(0);
    opacity: 0;
    transition: filter 1.5s ease, opacity 1s ease;
}

.gallery-item.visible img {
    filter: brightness(1) contrast(1) saturate(1);
    opacity: 1;
}

.gallery-caption {
    margin-top: 20px;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: var(--gray-light);
    font-style: italic;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease 0.8s, transform 0.6s ease 0.8s;
}

.gallery-item.visible .gallery-caption {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item.left .gallery-caption {
    text-align: left;
}

.gallery-item.center .gallery-caption {
    text-align: center;
}

.gallery-item.right .gallery-caption {
    text-align: right;
}

/* ============ FLOATING PARTICLES ============ */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: #c9ff57;
    border-radius: 50%;
    opacity: 0;
    will-change: transform, opacity;
    -webkit-animation: floatParticle 15s infinite ease-in-out;
    animation: floatParticle 15s infinite ease-in-out;
}

@-webkit-keyframes floatParticle {
    0% {
        opacity: 0;
        -webkit-transform: translateY(100vh) scale(0);
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        -webkit-transform: translateY(-20vh) scale(1);
        transform: translateY(-20vh) scale(1);
    }
}

@keyframes floatParticle {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translateY(-20vh) scale(1);
    }
}

/* ============ FOOTER ============ */
.footer {
    padding: 100px 20px;
    text-align: center;
    position: relative;
    z-index: 10;
    background: var(--black);
}

.footer-text {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gray-mid);
}

.footer-text span {
    color: var(--accent);
    animation: heartbeat 2s ease-in-out infinite;
}

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

.footer-date {
    margin-top: 10px;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: var(--gray);
}

/* ============ GRAIN OVERLAY ============ */
.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.03;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Audio element */
audio {
    display: none;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 700px) {
    .story-section {
        padding: 80px 25px;
    }

    .story-text {
        padding-left: 0;
    }

    .story-text p {
        max-width: 100%;
    }

    .gallery-item {
        max-width: 100%;
    }

    .gallery-item.left,
    .gallery-item.center,
    .gallery-item.right {
        margin-left: 0;
        margin-right: 0;
    }

    .gallery-item .gallery-caption {
        text-align: left;
    }

    .typewriter {
        font-size: 0.8rem;
    }

    .player {
        padding: 30px 25px;
    }

    .loader-content {
        font-size: 0.75rem;
        padding: 0 20px;
    }

    .title {
        font-size: clamp(2.5rem, 15vw, 5rem);
    }
    
    .password-input {
        width: 240px;
    }
}
