:root {
    --deep-void: #0B0E1A;
    --piazza-stone: #C4956A;
    --marble-cream: #F2EAD8;
    --twilight-teal: #3B7A7A;
    --shadow-amber: #8B6914;
    --liminal-rose: #D4A0A0;
    --column-gray: #6B7B8D;
    --void-grad: #1A1040;

    --font-heading: 'Playfair Display', serif;
    --font-body: 'Crimson Pro', serif;
    --font-mono: 'Space Mono', monospace;

    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background: var(--deep-void);
    color: var(--marble-cream);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    overflow: hidden;
    height: 100vh;
}

/* ===== Nav ===== */
.nav-glyph {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 100;
    cursor: pointer;
    animation: penroseRotate 30s linear infinite;
}

@keyframes penroseRotate {
    to { transform: rotate(360deg); }
}

/* ===== Room Indicators ===== */
.room-indicators {
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.room-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--marble-cream), var(--liminal-rose));
    opacity: 0.3;
    cursor: pointer;
    transition: opacity 300ms ease, box-shadow 300ms ease;
}

.room-dot.active {
    opacity: 1;
    box-shadow: 0 0 10px rgba(212, 160, 160, 0.5);
}

/* ===== Gallery ===== */
.gallery {
    display: flex;
    width: 500vw;
    height: 100vh;
    transition: transform 600ms var(--ease-smooth);
}

/* ===== Room Base ===== */
.room {
    min-width: 100vw;
    height: 100vh;
    position: relative;
    perspective: 1000px;
    overflow: hidden;
}

.bg-plane, .mid-plane, .fg-plane {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
}

.bg-plane { z-index: 1; }
.mid-plane { z-index: 2; display: flex; align-items: center; justify-content: center; }
.fg-plane { z-index: 3; pointer-events: none; }

/* ===== Room 1: Entrance ===== */
.room-1 { background: var(--deep-void); }

.archway {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.arch-frame {
    width: 350px;
    height: 450px;
    border: 2px solid var(--piazza-stone);
    border-radius: 175px 175px 0 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.5;
    filter: drop-shadow(15px 25px 0 rgba(139, 105, 20, 0.2));
}

.arch-content {
    position: relative;
    text-align: center;
    z-index: 2;
}

.room-heading {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(3rem, 7vw, 6rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--marble-cream);
    filter: drop-shadow(15px 25px 0 rgba(139, 105, 20, 0.3));
}

.room-sub {
    font-family: var(--font-heading);
    font-weight: 400;
    font-style: italic;
    font-size: 1.3rem;
    color: var(--liminal-rose);
    margin-top: 0.5rem;
}

.column {
    position: absolute;
    width: 30px;
    height: 400px;
    background: repeating-linear-gradient(90deg, var(--column-gray) 0px, #8a9aac 3px, var(--column-gray) 6px);
    opacity: 0.3;
    top: 50%;
    transform: translateY(-50%);
    filter: drop-shadow(15px 25px 0 rgba(139, 105, 20, 0.15));
}

.column-left { left: 15%; }
.column-right { right: 15%; }

/* ===== Marble Spheres ===== */
.marble-sphere {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--marble-cream), var(--liminal-rose), var(--column-gray));
    animation: drift 25s ease-in-out infinite;
    filter: drop-shadow(8px 12px 0 rgba(139, 105, 20, 0.2));
}

.sphere-1 { width: 50px; height: 50px; top: 20%; left: 10%; animation-delay: -5s; }
.sphere-2 { width: 35px; height: 35px; bottom: 25%; right: 15%; animation-delay: -12s; }
.sphere-3 { width: 45px; height: 45px; top: 15%; left: 20%; animation-delay: -3s; }
.sphere-4 { width: 30px; height: 30px; top: 60%; right: 10%; animation-delay: -8s; }
.sphere-5 { width: 55px; height: 55px; bottom: 20%; left: 40%; animation-delay: -15s; }
.sphere-6 { width: 40px; height: 40px; top: 30%; right: 30%; animation-delay: -10s; }

@keyframes drift {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(15px, -20px) rotate(120deg); }
    66% { transform: translate(-10px, 10px) rotate(240deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

/* ===== Room 2: Colonnade ===== */
.room-2 { background: linear-gradient(180deg, var(--void-grad), var(--deep-void)); }

.colonnade-sky {
    background: linear-gradient(180deg, var(--twilight-teal) 0%, var(--void-grad) 100%);
    opacity: 0.3;
}

.colonnade {
    display: flex;
    gap: 3rem;
    align-items: flex-end;
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
}

.col-pillar {
    width: 24px;
    height: calc(200px + var(--i) * -20px);
    background: repeating-linear-gradient(90deg, var(--column-gray) 0px, #8a9aac 3px, var(--column-gray) 6px);
    opacity: calc(0.6 - var(--i) * 0.08);
    transform: scale(calc(1 - var(--i) * 0.08));
    filter: drop-shadow(15px 25px 0 rgba(139, 105, 20, 0.2));
    border-radius: 4px 4px 0 0;
}

.col-text {
    max-width: 38ch;
    position: relative;
    z-index: 2;
    padding: 0 2rem;
}

/* ===== Room 3: Plaza ===== */
.room-3 { background: var(--deep-void); }

.organic-blob {
    position: absolute;
    width: 400px;
    height: 400px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--twilight-teal);
    opacity: 0.08;
    border-radius: 40% 60% 55% 45% / 55% 45% 60% 40%;
    animation: blobMorph 15s ease-in-out infinite;
}

@keyframes blobMorph {
    0%, 100% { border-radius: 40% 60% 55% 45% / 55% 45% 60% 40%; }
    25% { border-radius: 55% 45% 40% 60% / 40% 60% 45% 55%; }
    50% { border-radius: 45% 55% 60% 40% / 60% 40% 55% 45%; }
    75% { border-radius: 60% 40% 45% 55% / 45% 55% 40% 60%; }
}

.plaza-quote {
    text-align: center;
    max-width: 600px;
    position: relative;
    z-index: 2;
}

.plaza-quote p {
    font-family: var(--font-heading);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 3rem);
    color: var(--marble-cream);
    line-height: 1.3;
    filter: drop-shadow(10px 15px 0 rgba(139, 105, 20, 0.2));
}

/* ===== Room 4: Gallery ===== */
.room-4 { background: linear-gradient(135deg, var(--deep-void), var(--void-grad)); }

.gallery-blocks {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 900px;
    position: relative;
    z-index: 2;
}

.gallery-block {
    max-width: 280px;
    padding: 2rem;
    border-left: 2px solid var(--piazza-stone);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 600ms var(--ease-bounce), transform 600ms var(--ease-bounce);
    filter: drop-shadow(15px 25px 0 rgba(139, 105, 20, 0.25));
}

.gallery-block.revealed {
    opacity: 1;
    transform: translateY(0);
}

.gb-1 { transform: rotate(-2deg) translateY(30px); }
.gb-2 { transform: rotate(1.5deg) translateY(30px); }
.gb-3 { transform: rotate(-1deg) translateY(30px); }

.gb-1.revealed { transform: rotate(-2deg) translateY(0); }
.gb-2.revealed { transform: rotate(1.5deg) translateY(0); }
.gb-3.revealed { transform: rotate(-1deg) translateY(0); }

.block-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.02em;
    color: var(--piazza-stone);
    margin-bottom: 0.75rem;
}

/* ===== Room 5: Horizon ===== */
.room-5 { background: var(--deep-void); }

.horizon-sky {
    background: linear-gradient(180deg, var(--twilight-teal), var(--void-grad));
    opacity: 0.4;
}

.penrose-center {
    margin-bottom: 2rem;
    animation: penroseRotate 60s linear infinite;
}

.penrose { width: 100px; height: 100px; }

.horizon-text {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--liminal-rose);
    max-width: 40ch;
    text-align: center;
    margin-bottom: 1rem;
}

.horizon-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--column-gray);
}

.room-5 .mid-plane {
    flex-direction: column;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    body { overflow-y: auto; overflow-x: hidden; height: auto; }
    .gallery { flex-direction: column; width: 100vw; height: auto; }
    .room { min-width: 100vw; min-height: 100vh; }
    .room-indicators { display: none; }
    .arch-frame { width: 250px; height: 320px; border-radius: 125px 125px 0 0; }
    .colonnade { gap: 1.5rem; }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .gallery-block { opacity: 1; transform: none; }
}
