/* monopole.boo - Isometric Arcade Cabinet meets Neon Candy Laboratory */

:root {
    --bg-void: #0a0a12;
    --bg-floor-mid: #0d0d18;
    --bg-floor-light: #0f0f1e;
    --neon-pink: #ff2d95;
    --neon-cyan: #00f5ff;
    --accent-yellow: #ffe640;
    --accent-grape: #b44dff;
    --iso-mint: #3dffa8;
    --iso-rose: #ff69b4;
    --iso-violet: #1a0033;
    --text-primary: #e8e0ff;
    --text-secondary: #b8a9d4;
}

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

html {
    overflow: hidden;
    height: 100vh;
}

body {
    background: var(--bg-void);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    height: 100vh;
    overflow: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body::-webkit-scrollbar {
    display: none;
}

/* ========== PROGRESS BAR ========== */

#progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(10, 10, 18, 0.8);
    z-index: 1000;
}

#progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-cyan));
    transition: width 0.15s ease-out;
}

.progress-marker {
    position: absolute;
    top: -4px;
    width: 8px;
    height: 8px;
    background: var(--bg-void);
    border: 1px solid var(--text-secondary);
    transform: rotate(45deg) translateX(-50%);
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.progress-marker.active {
    background: var(--neon-pink);
    border-color: var(--neon-pink);
    box-shadow: 0 0 8px var(--neon-pink), 0 0 20px var(--neon-pink);
}

/* ========== SCROLL CONTAINER ========== */

#scroll-container {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 600vw;
    overflow: hidden;
}

/* ========== ROOMS ========== */

.room {
    position: relative;
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    overflow: hidden;
}

.iso-floor {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            60deg,
            transparent,
            transparent 58px,
            var(--bg-floor-mid) 58px,
            var(--bg-floor-mid) 60px
        ),
        repeating-linear-gradient(
            120deg,
            transparent,
            transparent 58px,
            var(--bg-floor-light) 58px,
            var(--bg-floor-light) 60px
        );
    opacity: 0.4;
}

.room-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.iso-scene {
    position: relative;
    width: 80%;
    height: 80%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

/* ========== ISOMETRIC CUBES ========== */

.iso-cube {
    width: var(--size, 50px);
    height: var(--size, 50px);
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(55deg) rotateZ(45deg);
}

.iso-cube::before,
.iso-cube::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
}

.iso-cube::before {
    background: var(--color-left, #1a0033);
    transform: rotateY(-90deg) translateZ(calc(var(--size, 50px) / 2)) translateX(calc(var(--size, 50px) / -2));
}

.iso-cube::after {
    background: var(--color-right, #b44dff);
    transform: rotateX(90deg) translateZ(calc(var(--size, 50px) / 2)) translateY(calc(var(--size, 50px) / -2));
}

.iso-cube {
    background: var(--color-top, #3dffa8);
    box-shadow:
        0 0 15px rgba(61, 255, 168, 0.2),
        0 0 30px rgba(61, 255, 168, 0.1);
}

/* ========== ENTRY VESTIBULE ========== */

.entry-scene {
    perspective: 1200px;
}

.title-block {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.cube-title {
    animation: cube-drop 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
    transform: rotateX(55deg) rotateZ(45deg) translateY(-200px);
}

.cube-title.c1 { animation-delay: 0.1s; }
.cube-title.c2 { animation-delay: 0.3s; }
.cube-title.c3 { animation-delay: 0.5s; }
.cube-title.c4 { animation-delay: 0.7s; }
.cube-title.c5 { animation-delay: 0.9s; }

@keyframes cube-drop {
    0% {
        opacity: 0;
        transform: rotateX(55deg) rotateZ(45deg) translateY(-200px);
    }
    100% {
        opacity: 1;
        transform: rotateX(55deg) rotateZ(45deg) translateY(0);
    }
}

.entry-text {
    text-align: center;
    animation: fade-in 1s ease 1.5s forwards;
    opacity: 0;
}

@keyframes fade-in {
    to { opacity: 1; }
}

.neon-title {
    font-family: 'Poiret One', cursive;
    font-size: clamp(3rem, 8vw, 7rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--neon-pink);
    text-shadow:
        0 0 20px rgba(255, 45, 149, 0.6),
        0 0 60px rgba(255, 45, 149, 0.3),
        0 0 100px rgba(255, 45, 149, 0.15);
    animation: neon-pulse 3s ease-in-out infinite;
    animation-delay: 2s;
}

@keyframes neon-pulse {
    0%, 100% {
        text-shadow:
            0 0 20px rgba(255, 45, 149, 0.6),
            0 0 60px rgba(255, 45, 149, 0.3);
    }
    50% {
        text-shadow:
            0 0 30px rgba(255, 45, 149, 0.8),
            0 0 80px rgba(255, 45, 149, 0.5),
            0 0 120px rgba(255, 45, 149, 0.2);
    }
}

.domain-subtitle {
    font-family: 'Poiret One', cursive;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--neon-cyan);
    text-shadow:
        0 0 20px rgba(0, 245, 255, 0.6),
        0 0 60px rgba(0, 245, 255, 0.3);
    letter-spacing: 0.3em;
    margin-top: -0.5rem;
}

.tagline {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(0.8rem, 1.5vw, 1.2rem);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-top: 1rem;
}

.scroll-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    animation: fade-in 1s ease 2.5s forwards, arrow-bounce 2s ease-in-out infinite 3s;
    opacity: 0;
}

.scroll-arrow svg {
    transform: rotate(-90deg);
    filter: drop-shadow(0 0 8px var(--neon-pink));
}

@keyframes arrow-bounce {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(15px); }
}

.scroll-hint {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

/* ========== INFO CARDS ========== */

.info-card {
    background: rgba(10, 10, 18, 0.85);
    padding: 2rem 2.5rem;
    max-width: 480px;
    position: relative;
    clip-path: polygon(20px 0, 100% 0, calc(100% - 20px) 100%, 0 100%);
    transition: transform 0.15s ease-out;
}

.deco-frame {
    position: relative;
}

.deco-frame::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    width: 30px;
    height: 30px;
    border-top: 2px solid var(--neon-pink);
    border-left: 2px solid var(--neon-pink);
    filter: drop-shadow(0 0 4px var(--neon-pink));
}

.deco-frame::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 30px;
    height: 30px;
    border-bottom: 2px solid var(--neon-cyan);
    border-right: 2px solid var(--neon-cyan);
    filter: drop-shadow(0 0 4px var(--neon-cyan));
}

.info-card h2 {
    font-family: 'Poiret One', cursive;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--neon-pink);
    text-shadow: 0 0 15px rgba(255, 45, 149, 0.5);
    margin-bottom: 1rem;
}

.info-card h3 {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-yellow);
    text-shadow: 0 0 10px rgba(255, 230, 64, 0.4);
    margin-bottom: 0.8rem;
}

.info-card p {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.4vw, 1.1rem);
    line-height: 1.65;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
}

.info-card p:last-child {
    margin-bottom: 0;
}

.info-card .highlight {
    color: var(--neon-cyan);
    font-weight: 400;
    text-shadow: 0 0 10px rgba(0, 245, 255, 0.3);
}

.info-card .code-block {
    background: rgba(0, 245, 255, 0.05);
    border-left: 3px solid var(--neon-cyan);
    padding: 0.8rem 1rem;
    margin: 1rem 0;
    font-family: 'Victor Mono', monospace;
    color: var(--neon-cyan);
    font-size: 1.1rem;
    text-shadow: 0 0 8px rgba(0, 245, 255, 0.4);
}

.info-card code {
    font-family: 'Victor Mono', monospace;
    color: var(--neon-cyan);
}

.secondary-card {
    max-width: 400px;
    clip-path: polygon(15px 0, 100% 0, calc(100% - 15px) 100%, 0 100%);
}

/* ========== PROBLEM ROOM ========== */

.magnet-demo {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.bar-magnet {
    width: 120px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.bar-magnet.north {
    background: linear-gradient(135deg, var(--neon-pink), #cc0066);
    color: white;
    box-shadow: 0 0 20px rgba(255, 45, 149, 0.5);
}

.bar-magnet.south {
    background: linear-gradient(135deg, var(--neon-cyan), #009db3);
    color: white;
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.5);
}

.split-line {
    width: 3px;
    height: 80px;
    background: var(--accent-yellow);
    box-shadow: 0 0 10px var(--accent-yellow);
    animation: split-pulse 2s ease-in-out infinite;
}

@keyframes split-pulse {
    0%, 100% { opacity: 1; height: 80px; }
    50% { opacity: 0.5; height: 60px; }
}

.field-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.field-line {
    stroke-dasharray: 8, 4;
    animation: field-flow 3s linear infinite;
    filter: drop-shadow(0 0 4px rgba(255, 45, 149, 0.5));
}

@keyframes field-flow {
    to { stroke-dashoffset: -24; }
}

.iso-cube-cluster {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ========== THEORY ROOM ========== */

.dirac-string {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
}

.dirac-line {
    stroke-dasharray: 12, 6;
    animation: field-flow 4s linear infinite;
    filter: drop-shadow(0 0 8px rgba(0, 245, 255, 0.6)) drop-shadow(0 0 24px rgba(0, 245, 255, 0.3));
}

.monopole-point {
    filter: drop-shadow(0 0 12px var(--neon-pink)) drop-shadow(0 0 30px var(--neon-pink));
    animation: monopole-glow 2s ease-in-out infinite;
}

@keyframes monopole-glow {
    0%, 100% { r: 8; opacity: 1; }
    50% { r: 12; opacity: 0.8; }
}

.theory-cubes {
    z-index: 1;
}

/* ========== DETECTION ROOM ========== */

.squid-detector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.detector-ring {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 3px solid var(--neon-cyan);
    position: relative;
    box-shadow:
        0 0 15px rgba(0, 245, 255, 0.4),
        0 0 40px rgba(0, 245, 255, 0.2),
        inset 0 0 15px rgba(0, 245, 255, 0.1);
    animation: ring-pulse 3s ease-in-out infinite;
}

@keyframes ring-pulse {
    0%, 100% {
        box-shadow:
            0 0 15px rgba(0, 245, 255, 0.4),
            0 0 40px rgba(0, 245, 255, 0.2),
            inset 0 0 15px rgba(0, 245, 255, 0.1);
    }
    50% {
        box-shadow:
            0 0 25px rgba(0, 245, 255, 0.6),
            0 0 60px rgba(0, 245, 255, 0.3),
            inset 0 0 25px rgba(0, 245, 255, 0.2);
    }
}

.ring-segment {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--neon-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--neon-cyan);
}

.ring-segment.s1 { top: -10px; left: 50%; transform: translateX(-50%); }
.ring-segment.s2 { bottom: -10px; left: 50%; transform: translateX(-50%); }
.ring-segment.s3 { left: -10px; top: 50%; transform: translateY(-50%); }
.ring-segment.s4 { right: -10px; top: 50%; transform: translateY(-50%); }

.pulse-particle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--neon-pink);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px var(--neon-pink), 0 0 30px var(--neon-pink);
    animation: particle-orbit 4s linear infinite;
}

@keyframes particle-orbit {
    0% { transform: translate(-50%, -50%) rotate(0deg) translateX(80px) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg) translateX(80px) rotate(-360deg); }
}

.detector-body {
    display: flex;
    justify-content: center;
}

.detector-label {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--neon-cyan);
    letter-spacing: 0.3em;
    text-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}

.signal-graph {
    width: 300px;
    position: relative;
    margin-top: 1.5rem;
}

.signal-graph svg {
    width: 100%;
    height: 60px;
    filter: drop-shadow(0 0 6px rgba(255, 230, 64, 0.6));
}

.signal-line {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    animation: draw-signal 3s ease forwards 1s;
}

@keyframes draw-signal {
    to { stroke-dashoffset: 0; }
}

.graph-label {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--accent-yellow);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-align: center;
    display: block;
    margin-top: 0.5rem;
    text-shadow: 0 0 8px rgba(255, 230, 64, 0.4);
}

/* ========== IMPLICATIONS ROOM ========== */

.cube-pyramid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    perspective: 1000px;
}

.pyramid-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.row-bottom .iso-cube { animation: pyramid-build 0.8s ease forwards; animation-delay: 0.1s; opacity: 0; }
.row-middle .iso-cube { animation: pyramid-build 0.8s ease forwards; animation-delay: 0.5s; opacity: 0; }
.row-top .iso-cube { animation: pyramid-build 0.8s ease forwards; animation-delay: 0.9s; opacity: 0; }
.row-peak .iso-cube { animation: pyramid-build 0.8s ease forwards; animation-delay: 1.3s; opacity: 0; }

@keyframes pyramid-build {
    from { opacity: 0; transform: rotateX(55deg) rotateZ(45deg) translateY(-40px) scale(0.5); }
    to { opacity: 1; transform: rotateX(55deg) rotateZ(45deg) translateY(0) scale(1); }
}

/* ========== EXIT CORRIDOR ========== */

.exit-scene {
    flex-direction: column;
}

.dissolving-tiles {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 400px;
    margin-bottom: 3rem;
}

.dissolve-cube {
    animation: dissolve-float 6s ease-in-out infinite;
}

.dissolve-cube.d1 { animation-delay: 0s; }
.dissolve-cube.d2 { animation-delay: 1s; }
.dissolve-cube.d3 { animation-delay: 2s; }
.dissolve-cube.d4 { animation-delay: 0.5s; }
.dissolve-cube.d5 { animation-delay: 1.5s; }
.dissolve-cube.d6 { animation-delay: 2.5s; }

@keyframes dissolve-float {
    0%, 100% {
        transform: rotateX(55deg) rotateZ(45deg) translateY(0) translateX(0);
        opacity: 1;
    }
    50% {
        transform: rotateX(55deg) rotateZ(45deg) translateY(-30px) translateX(15px);
        opacity: 0.4;
    }
}

.exit-text {
    text-align: center;
}

.exit-title {
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 1rem;
}

.exit-subtitle {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.4vw, 1.1rem);
    color: var(--text-secondary);
    max-width: 500px;
    line-height: 1.65;
    margin: 0 auto 2rem;
}

.credits {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.credits p {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.credit-label {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--accent-grape);
    letter-spacing: 0.2em;
    margin-right: 0.8rem;
    text-shadow: 0 0 8px rgba(180, 77, 255, 0.4);
}

/* ========== ROOM TRANSITIONS ========== */

.room {
    opacity: 0.4;
    transition: opacity 0.6s ease;
}

.room.in-view {
    opacity: 1;
}

/* ========== NEON SWEEP ========== */

.room::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, transparent, var(--neon-pink), var(--neon-cyan), transparent);
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.room.sweep::after {
    animation: neon-sweep 0.8s ease forwards;
    opacity: 1;
}

@keyframes neon-sweep {
    from { left: -4px; }
    to { left: 100%; }
}

/* ========== MOBILE ========== */

@media (max-width: 768px) {
    #scroll-container {
        scroll-snap-type: x mandatory;
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }

    .room {
        scroll-snap-align: start;
    }

    .iso-cube {
        transform: rotateX(45deg) rotateZ(30deg);
    }

    .cube-title {
        transform: rotateX(45deg) rotateZ(30deg) translateY(-200px);
    }

    @keyframes cube-drop {
        0% {
            opacity: 0;
            transform: rotateX(45deg) rotateZ(30deg) translateY(-200px);
        }
        100% {
            opacity: 1;
            transform: rotateX(45deg) rotateZ(30deg) translateY(0);
        }
    }

    .info-card {
        max-width: 90%;
        padding: 1.5rem;
    }

    .title-block {
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .detector-ring {
        width: 120px;
        height: 120px;
    }

    .magnet-demo {
        flex-direction: column;
    }

    .bar-magnet {
        width: 100px;
        height: 50px;
    }
}
