/* mysterious.day - Memphis Group Immersive Scroll */
/* Palette: #2B2D8E (ultramarine), #E8C547 (gold), #D94E67 (rose), #1A1A2E (dark), #F5F0E8 (parchment), #F0F0F0 (light text), #6BC9A0 (mint accent) */

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

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

body {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.75;
    color: #1A1A2E;
    background: #1A1A2E;
    overflow-x: hidden;
}

/* ==============================
   ROOMS - General
   ============================== */

.room {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background-color: var(--room-bg);
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
}

.room-content {
    position: relative;
    z-index: 10;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 800ms ease-out, transform 800ms ease-out;
}

.room.in-view .room-content {
    opacity: 1;
    transform: translateY(0);
}

/* ==============================
   TYPOGRAPHY
   ============================== */

h1 {
    font-family: 'Bungee Shade', cursive;
    font-weight: 400;
    font-size: clamp(3rem, 10vw, 8rem);
    line-height: 1.1;
    text-align: center;
}

h2 {
    font-family: 'Righteous', cursive;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    letter-spacing: 0.04em;
    margin-bottom: 1em;
}

h3 {
    font-family: 'Righteous', cursive;
    font-weight: 400;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    letter-spacing: 0.04em;
    margin-bottom: 0.5em;
}

p {
    margin-bottom: 1em;
}

/* ==============================
   ROOM 1 -- The Lobby
   ============================== */

.room-1 {
    background-color: #2B2D8E;
}

.room-1 .room-content {
    text-align: center;
    padding: 2rem;
}

.lobby-title {
    color: #E8C547;
    margin-bottom: 0.3em;
    font-size: clamp(4rem, 12vw, 10rem);
}

.lobby-subtitle {
    font-family: 'Righteous', cursive;
    color: #F0F0F0;
    font-size: clamp(1rem, 2vw, 1.4rem);
    letter-spacing: 0.06em;
    opacity: 0.85;
}

/* ==============================
   ROOM 2 -- The Gallery
   ============================== */

.room-2 {
    background-color: #E8C547;
}

.room-2 h2 {
    color: #2B2D8E;
}

.room-2 p {
    color: #1A1A2E;
}

.gallery-content {
    display: flex;
    align-items: center;
    gap: 5%;
    max-width: 1200px;
    width: 90%;
    padding: 2rem;
}

.gallery-left {
    flex: 0 0 60%;
}

.gallery-right {
    flex: 0 0 35%;
}

.gallery-illustration {
    width: 80%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ==============================
   ROOM 3 -- The Archive
   ============================== */

.room-3 {
    background-color: #D94E67;
}

.room-3 h2 {
    color: #F0F0F0;
    text-align: center;
    margin-bottom: 1.5em;
}

.room-3 h3 {
    color: #F0F0F0;
}

.room-3 p {
    color: #F0F0F0;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    opacity: 0.9;
}

.archive-content {
    max-width: 1200px;
    width: 90%;
    padding: 2rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2vw;
}

.archive-card {
    background: rgba(26, 26, 46, 0.15);
    border: 3px solid #2B2D8E;
    padding: 1.5rem 1rem;
    text-align: center;
    animation: borderCycle 6s linear infinite;
    animation-delay: var(--card-delay);
}

@keyframes borderCycle {
    0% { border-color: #2B2D8E; }
    33% { border-color: #E8C547; }
    66% { border-color: #D94E67; }
    100% { border-color: #2B2D8E; }
}

.card-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    display: block;
}

/* ==============================
   ROOM 4 -- The Studio
   ============================== */

.room-4 {
    background-color: #E8C547;
}

.studio-diagonal-upper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #2B2D8E;
    clip-path: polygon(0 0, 100% 0, 0 100%);
    z-index: 1;
}

.studio-diagonal-lower {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #E8C547;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
    z-index: 1;
}

.studio-content {
    max-width: 600px;
    text-align: center;
    padding: 2rem;
    z-index: 10;
}

.room-4 h2 {
    color: #F0F0F0;
    text-shadow: 2px 2px 0 rgba(26,26,46,0.3);
}

.room-4 p {
    color: #F0F0F0;
    text-shadow: 1px 1px 0 rgba(26,26,46,0.2);
}

/* ==============================
   ROOM 5 -- The Exit
   ============================== */

.room-5 {
    background-color: #D94E67;
}

.exit-content {
    text-align: center;
    padding: 2rem;
    max-width: 900px;
}

.exit-title {
    color: #F0F0F0;
    font-size: clamp(2.5rem, 8vw, 6rem);
}

/* ==============================
   FLOATING SHAPES - Animations
   ============================== */

.floating-shape {
    position: absolute;
    z-index: 5;
    pointer-events: none;
}

/* Room 1 floating shapes - drift upward */
.shape-1 {
    top: 70%;
    left: 10%;
    animation: floatUp 20s linear infinite;
}

.shape-2 {
    top: 60%;
    left: 75%;
    animation: floatUp 25s linear infinite;
    animation-delay: -5s;
}

.shape-3 {
    top: 80%;
    left: 40%;
    animation: floatUp 18s linear infinite;
    animation-delay: -8s;
}

.shape-4 {
    top: 50%;
    left: 55%;
    animation: floatUp 22s linear infinite;
    animation-delay: -12s;
}

.shape-5 {
    top: 85%;
    left: 25%;
    animation: floatUp 28s linear infinite;
    animation-delay: -3s;
}

/* Room 2 floating shapes */
.shape-6 {
    top: 15%;
    right: 8%;
    animation: floatUp 24s linear infinite;
    animation-delay: -6s;
}

.shape-7 {
    bottom: 10%;
    left: 5%;
    animation: floatDrift 20s linear infinite;
}

.shape-8 {
    top: 60%;
    right: 20%;
    animation: floatUp 26s linear infinite;
    animation-delay: -10s;
}

/* Room 3 floating shapes */
.shape-9 {
    top: 12%;
    left: 6%;
    animation: floatDrift 22s linear infinite;
    animation-delay: -4s;
}

.shape-10 {
    bottom: 8%;
    right: 10%;
    animation: floatUp 19s linear infinite;
    animation-delay: -7s;
}

/* Room 4 floating shapes */
.shape-11 {
    top: 30%;
    left: 25%;
    z-index: 3;
    animation: floatDrift 15s linear infinite;
}

.shape-12 {
    top: 20%;
    right: 15%;
    animation: floatUp 23s linear infinite;
    animation-delay: -5s;
}

.shape-13 {
    bottom: 15%;
    left: 10%;
    animation: floatUp 27s linear infinite;
    animation-delay: -9s;
}

.shape-14 {
    bottom: 25%;
    right: 25%;
    animation: floatDrift 21s linear infinite;
    animation-delay: -3s;
}

/* Room 5 floating shapes - rotate */
.shape-15 {
    top: 15%;
    left: 8%;
    animation: floatRotate 30s linear infinite;
}

.shape-16 {
    top: 25%;
    right: 12%;
    animation: floatRotate 25s linear infinite;
    animation-delay: -8s;
}

.shape-17 {
    bottom: 20%;
    left: 15%;
    animation: floatRotate 28s linear infinite;
    animation-delay: -4s;
}

.shape-18 {
    bottom: 30%;
    right: 8%;
    animation: floatRotate 22s linear infinite;
    animation-delay: -12s;
}

.shape-19 {
    top: 50%;
    left: 50%;
    animation: floatRotate 26s linear infinite;
    animation-delay: -6s;
}

.shape-20 {
    bottom: 10%;
    right: 30%;
    animation: floatRotate 20s linear infinite;
    animation-delay: -15s;
}

/* ==============================
   KEYFRAME ANIMATIONS
   ============================== */

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(15deg);
        opacity: 0;
    }
}

@keyframes floatDrift {
    0% {
        transform: translateX(0) translateY(0);
        opacity: 0.6;
    }
    25% {
        transform: translateX(30px) translateY(-20px);
        opacity: 1;
    }
    50% {
        transform: translateX(-20px) translateY(-50px);
        opacity: 0.8;
    }
    75% {
        transform: translateX(15px) translateY(-80px);
        opacity: 1;
    }
    100% {
        transform: translateX(0) translateY(-100px);
        opacity: 0.6;
    }
}

@keyframes floatRotate {
    0% {
        transform: rotate(0deg) translateY(0);
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: rotate(360deg) translateY(-30px);
        opacity: 0.6;
    }
}

/* ==============================
   RESPONSIVE
   ============================== */

@media (max-width: 900px) {
    .gallery-content {
        flex-direction: column;
        text-align: center;
    }

    .gallery-left,
    .gallery-right {
        flex: none;
        width: 100%;
    }

    .gallery-illustration {
        width: 60%;
        margin-bottom: 2rem;
    }

    .card-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3vw;
    }
}

@media (max-width: 600px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 4vw;
    }

    .archive-card {
        padding: 1rem 0.75rem;
    }

    .lobby-title {
        font-size: clamp(2.5rem, 14vw, 5rem);
    }
}
