:root {
    --midnight-indigo: #1B1340;
    --deep-plum: #2A1F5E;
    --dusky-violet: #4A3B7C;
    --gaslight-amber: #D4A843;
    --burnished-gold: #B8892E;
    --parchment-cream: #F0E6CC;
    --lavender-ash: #8E82A6;
    --obsidian-night: #0D0A1F;
    --cursor-x: 50%;
    --cursor-y: 50%;
    color-scheme: dark;
}

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

body {
    background-color: var(--midnight-indigo);
    color: var(--parchment-cream);
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--midnight-indigo);
    z-index: 50;
    display: flex;
    flex-direction: column;
}

.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background:
        radial-gradient(circle 4px at 20px 20px, var(--dusky-violet) 0%, transparent 100%),
        radial-gradient(circle 4px at 40px 40px, var(--dusky-violet) 0%, transparent 100%);
    background-size: 48px 48px;
    pointer-events: none;
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--dusky-violet) 20%, var(--gaslight-amber) 50%, var(--dusky-violet) 80%, transparent);
    opacity: 0.5;
}

.sidebar-frame {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 48px 24px 32px;
}

.sidebar-wordmark {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gaslight-amber);
    text-align: center;
    margin-bottom: 48px;
    text-shadow:
        1px 1px 0 rgba(27, 19, 64, 0.8),
        2px 2px 0 rgba(13, 10, 31, 0.6);
}

.sidebar-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #C4943A, #8B6914);
    border: 1px solid rgba(212, 168, 67, 0.3);
    border-radius: 4px;
    font-family: 'Oswald', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--midnight-indigo);
    text-decoration: none;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.nav-item:hover {
    transform: perspective(400px) rotateY(-3deg) scale(1.02);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.2), 0 4px 12px rgba(212, 168, 67, 0.3);
}

.nav-item.active {
    background: linear-gradient(135deg, #D4A843, #B8892E);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 12px rgba(212, 168, 67, 0.4);
}

/* Gas Flame */
.gas-flame {
    width: 6px;
    height: 10px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: linear-gradient(to top, var(--gaslight-amber), var(--parchment-cream));
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: flameFlicker 800ms ease-in-out infinite;
    flex-shrink: 0;
}

.nav-item.active .gas-flame {
    opacity: 1;
}

@keyframes flameFlicker {
    0%, 100% { opacity: 0.7; transform: scaleY(1) scaleX(1); }
    25% { opacity: 1; transform: scaleY(1.1) scaleX(0.9); }
    50% { opacity: 0.85; transform: scaleY(0.95) scaleX(1.05); }
    75% { opacity: 1; transform: scaleY(1.05) scaleX(0.95); }
}

.sidebar-ornament {
    margin-top: auto;
    text-align: center;
}

.ironwork-small {
    width: 60px;
    height: 20px;
    opacity: 0.6;
}

/* Mobile Bar */
.mobile-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--midnight-indigo);
    z-index: 55;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    border-bottom: 1px solid var(--dusky-violet);
}

.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--gaslight-amber);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-wordmark {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.6rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gaslight-amber);
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(13, 10, 31, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 45;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Lantern Glow */
.lantern-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 40;
    background: radial-gradient(
        circle 120px at var(--cursor-x) var(--cursor-y),
        rgba(212, 168, 67, 0.08) 0%,
        transparent 100%
    );
    transition: none;
}

/* Main Stage */
.main-stage {
    margin-left: 280px;
    position: relative;
    perspective: 1200px;
}

/* Scene Panels */
.scene-panel {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transform: rotateX(0.5deg);
    transform-style: preserve-3d;
}

/* Ironwork Dividers */
.ironwork-divider {
    height: 60px;
    margin-left: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--obsidian-night);
}

.ironwork-strip {
    width: 100%;
    height: 60px;
}

/* Scene 1: The Facade */
.scene-facade {
    background: linear-gradient(180deg, var(--obsidian-night) 0%, var(--midnight-indigo) 30%, var(--deep-plum) 100%);
    flex-direction: column;
}

.facade-building {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.facade-window {
    position: absolute;
    left: var(--wx);
    top: var(--wy);
    width: 40px;
    height: 60px;
    border: 1px solid var(--dusky-violet);
    border-radius: 2px 2px 0 0;
    background: rgba(74, 59, 124, 0.15);
    transition: background 0.6s ease, box-shadow 0.6s ease;
}

.facade-window.lit {
    background: rgba(212, 168, 67, 0.2);
    box-shadow: 0 0 20px rgba(212, 168, 67, 0.15), inset 0 0 10px rgba(212, 168, 67, 0.1);
}

.facade-content {
    position: relative;
    z-index: 5;
    text-align: center;
}

.facade-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.8rem, 9vw, 7rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--parchment-cream);
    line-height: 1.05;
    text-shadow:
        1px 1px 0 var(--deep-plum),
        2px 2px 0 var(--midnight-indigo),
        3px 3px 0 var(--obsidian-night);
}

.facade-lamp {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 32px;
}

.lamp-flame {
    width: 12px;
    height: 18px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: linear-gradient(to top, var(--gaslight-amber), var(--parchment-cream));
    animation: flameFlicker 800ms ease-in-out infinite;
    box-shadow: 0 0 12px rgba(212, 168, 67, 0.5), 0 0 24px rgba(212, 168, 67, 0.3);
}

.lamp-post {
    width: 2px;
    height: 40px;
    background: var(--dusky-violet);
    margin-top: 4px;
}

/* Scene 2: The Arcade */
.scene-arcade {
    background: linear-gradient(180deg, var(--midnight-indigo), var(--deep-plum) 50%, var(--midnight-indigo));
}

.arcade-perspective {
    position: relative;
    width: 100%;
    max-width: 900px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 40px;
    padding: 40px;
    perspective: 800px;
}

.arcade-vanishing {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 80%;
    background: linear-gradient(to bottom, transparent, var(--dusky-violet) 50%, transparent);
    transform: translate(-50%, -50%);
    opacity: 0.3;
}

.arcade-card {
    width: 100%;
    max-width: 340px;
}

.arcade-left {
    transform: perspective(800px) rotateY(6deg);
    justify-self: end;
}

.arcade-right {
    transform: perspective(800px) rotateY(-6deg);
    justify-self: start;
}

.arcade-deep {
    opacity: 0.85;
    transform-origin: center;
}

.arcade-left.arcade-deep {
    transform: perspective(800px) rotateY(6deg) scale(0.92) translateZ(-30px);
}

.arcade-right.arcade-deep {
    transform: perspective(800px) rotateY(-6deg) scale(0.92) translateZ(-30px);
}

.card-frame {
    background: rgba(42, 31, 94, 0.88);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid var(--dusky-violet);
    border-radius: 6px;
    padding: 28px 24px;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.card-frame:hover {
    border-color: var(--gaslight-amber);
    box-shadow: 0 0 16px rgba(212, 168, 67, 0.15);
}

.card-sign {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gaslight-amber);
    margin-bottom: 12px;
    line-height: 1.05;
}

.card-desc {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--parchment-cream);
    opacity: 0.8;
    line-height: 1.6;
}

/* Scene 3: The Park */
.scene-park {
    background: linear-gradient(180deg, var(--deep-plum), var(--midnight-indigo));
    flex-direction: column;
    gap: 0;
}

.park-railing-top,
.park-railing-bottom {
    width: 80%;
    max-width: 700px;
    height: 2px;
    background: repeating-linear-gradient(
        90deg,
        var(--dusky-violet) 0px,
        var(--dusky-violet) 20px,
        transparent 20px,
        transparent 24px
    );
    position: relative;
}

.park-railing-top::after,
.park-railing-bottom::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--dusky-violet);
    opacity: 0.5;
}

.park-text-panel {
    background: rgba(27, 19, 64, 0.88);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid var(--dusky-violet);
    border-radius: 4px;
    padding: 48px 40px;
    max-width: 58ch;
    margin: 24px auto;
}

.section-heading {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.8rem, 8vw, 5rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gaslight-amber);
    line-height: 1.05;
    margin-bottom: 24px;
}

.body-text {
    font-family: 'Lora', serif;
    font-weight: 400;
    color: var(--parchment-cream);
    margin-bottom: 1.2rem;
    max-width: 58ch;
    line-height: 1.72;
}

/* Scene 4: The Workshop */
.scene-workshop {
    background: linear-gradient(180deg, var(--midnight-indigo), var(--obsidian-night) 60%, var(--midnight-indigo));
    flex-direction: column;
    gap: 40px;
    padding: 40px;
}

.workshop-heading {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.8rem, 8vw, 5rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gaslight-amber);
    line-height: 1.05;
    text-align: center;
}

.workbench {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 800px;
    width: 100%;
    perspective: 600px;
}

.bench-item {
    transform: rotateX(12deg) rotateZ(-2deg);
    transform-origin: center bottom;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bench-item:hover {
    transform: rotateX(0deg) rotateZ(0deg);
}

.bench-item-inner {
    background: rgba(42, 31, 94, 0.7);
    border: 1px solid var(--dusky-violet);
    border-radius: 4px;
    padding: 24px 20px;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.bench-item:hover .bench-item-inner {
    border-color: var(--gaslight-amber);
    box-shadow: 0 8px 24px rgba(212, 168, 67, 0.15);
}

.item-label {
    display: block;
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    letter-spacing: 0.10em;
    color: var(--gaslight-amber);
    margin-bottom: 8px;
    line-height: 1.3;
}

.item-detail {
    display: block;
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--parchment-cream);
    opacity: 0.75;
    line-height: 1.6;
}

/* Scene 5: The Bridge */
.scene-bridge {
    background: linear-gradient(180deg,
        var(--midnight-indigo) 0%,
        var(--deep-plum) 40%,
        var(--gaslight-amber) 85%,
        var(--burnished-gold) 100%
    );
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 0;
}

.bridge-sky {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, var(--midnight-indigo), var(--deep-plum));
}

.bridge-structure {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.bridge-svg {
    width: 100%;
    height: auto;
}

.bridge-content {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 40px 20px;
}

.bridge-heading {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.8rem, 8vw, 5rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--parchment-cream);
    line-height: 1.05;
    margin-bottom: 12px;
}

.bridge-text {
    font-family: 'Oswald', sans-serif;
    font-weight: 300;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    letter-spacing: 0.10em;
    color: var(--parchment-cream);
    opacity: 0.85;
    margin-bottom: 24px;
    line-height: 1.3;
}

.bridge-contact {
    margin-top: 16px;
}

.contact-line {
    font-family: 'Oswald', sans-serif;
    font-weight: 300;
    font-size: 1.1rem;
    letter-spacing: 0.12em;
    color: var(--gaslight-amber);
}

.bridge-water {
    position: relative;
    z-index: 1;
    height: 80px;
    background: linear-gradient(180deg, rgba(212, 168, 67, 0.15), transparent);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
}

.water-reflection {
    padding-top: 8px;
}

.reflection-text {
    font-family: 'Oswald', sans-serif;
    font-weight: 300;
    font-size: 1.1rem;
    letter-spacing: 0.12em;
    color: var(--gaslight-amber);
    opacity: 0.25;
    transform: scaleY(-1);
    filter: blur(2px);
    display: inline-block;
    animation: waterShimmer 3s ease-in-out infinite;
}

@keyframes waterShimmer {
    0%, 100% { transform: scaleY(-1) translateY(0); }
    50% { transform: scaleY(-1) translateY(3px); }
}

/* Scene 6: The Chimneypots */
.scene-chimneypots {
    min-height: 50vh;
    margin-left: 280px;
    background: var(--obsidian-night);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 40px;
    overflow: hidden;
}

.skyline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
}

.skyline-svg {
    width: 100%;
    height: 200px;
}

.chimney-smoke {
    position: absolute;
    width: 16px;
    height: 60px;
    background: radial-gradient(ellipse, rgba(142, 130, 166, 0.15) 0%, transparent 70%);
    filter: blur(4px);
    animation: smokeRise 6s ease-out infinite;
}

.smoke-1 { left: 5%; top: 40px; animation-delay: 0s; }
.smoke-2 { left: 45%; top: 20px; animation-delay: -2s; }
.smoke-3 { left: 82%; top: 50px; animation-delay: -4s; }

@keyframes smokeRise {
    0% { transform: translateY(0) scale(1); opacity: 0.4; }
    100% { transform: translateY(-50px) scale(1.5); opacity: 0; }
}

.streetlights {
    display: flex;
    gap: 60px;
    position: relative;
    z-index: 2;
    margin-bottom: 32px;
}

.streetlight-flame {
    width: 6px;
    height: 10px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: linear-gradient(to top, var(--gaslight-amber), var(--parchment-cream));
    animation: flameFlicker 800ms ease-in-out infinite;
    box-shadow: 0 0 8px rgba(212, 168, 67, 0.4);
}

.streetlight-flame:nth-child(2) { animation-delay: -200ms; }
.streetlight-flame:nth-child(3) { animation-delay: -400ms; }
.streetlight-flame:nth-child(4) { animation-delay: -600ms; }
.streetlight-flame:nth-child(5) { animation-delay: -150ms; }

.footer-text {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--lavender-ash);
    text-align: center;
    position: relative;
    z-index: 2;
}

/* Reveal Animation */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.25, 0.1, 0.25, 1), transform 1s cubic-bezier(0.25, 0.1, 0.25, 1);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

.arcade-left[data-reveal].revealed {
    transform: perspective(800px) rotateY(6deg) translateY(0);
}

.arcade-right[data-reveal].revealed {
    transform: perspective(800px) rotateY(-6deg) translateY(0);
}

.arcade-left.arcade-deep[data-reveal].revealed {
    transform: perspective(800px) rotateY(6deg) scale(0.92) translateZ(-30px) translateY(0);
}

.arcade-right.arcade-deep[data-reveal].revealed {
    transform: perspective(800px) rotateY(-6deg) scale(0.92) translateZ(-30px) translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        z-index: 60;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-bar {
        display: flex;
    }

    .mobile-overlay {
        display: block;
    }

    .main-stage {
        margin-left: 0;
        padding-top: 64px;
    }

    .ironwork-divider {
        margin-left: 0;
    }

    .scene-chimneypots {
        margin-left: 0;
    }

    .arcade-perspective {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }

    .arcade-left,
    .arcade-right,
    .arcade-left.arcade-deep,
    .arcade-right.arcade-deep {
        transform: none;
        justify-self: center;
        max-width: 100%;
    }

    .arcade-left[data-reveal].revealed,
    .arcade-right[data-reveal].revealed,
    .arcade-left.arcade-deep[data-reveal].revealed,
    .arcade-right.arcade-deep[data-reveal].revealed {
        transform: translateY(0);
    }

    .workbench {
        grid-template-columns: 1fr;
    }

    .bench-item {
        transform: none;
    }

    .bench-item:hover {
        transform: none;
    }

    .park-text-panel {
        margin: 24px 16px;
        padding: 32px 24px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .gas-flame,
    .lamp-flame,
    .streetlight-flame {
        animation: none;
        opacity: 0.85;
    }

    .chimney-smoke {
        animation: none;
        opacity: 0.2;
    }

    .reflection-text {
        animation: none;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .bench-item {
        transform: none;
        transition: none;
    }

    .nav-item {
        transition: none;
    }

    .card-frame {
        transition: none;
    }

    .facade-window {
        transition: none;
    }
}
