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

:root {
    --abyss: #0a0f2e;
    --deep-lab: #162050;
    --crystal-blue: #6488ff;
    --frost-white: #e8eaff;
    --silver-haze: #b0b8d6;
    --blob-glow: #8ca4ff;
    --crystal-rose: #ff8aac;
    --noise-gray: #1a2040;
    --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --spring-settle: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--abyss);
    color: var(--frost-white);
    font-family: 'DM Sans', sans-serif;
    overflow-x: hidden;
}

/* Noise SVG */
.noise-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.06;
    mix-blend-mode: overlay;
}

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

/* Navigation */
.nav-diamond {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.4s var(--spring-bounce);
}

.nav-diamond:hover {
    transform: scale(1.1) rotate(15deg);
}

.nav-diamond.active {
    transform: rotate(45deg);
}

.nav-radial {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-radial.active {
    pointer-events: all;
    opacity: 1;
}

.nav-crystal {
    position: absolute;
    display: block;
    padding: 0.4rem 0.8rem;
    font-family: 'Azeret Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--crystal-blue);
    text-decoration: none;
    border: 1px solid rgba(100, 136, 255, 0.3);
    background: rgba(100, 136, 255, 0.06);
    transform: scale(0) translate(0, 0);
    transition: transform 0.5s var(--spring-bounce), background 0.3s ease;
}

.nav-radial.active .nav-crystal {
    transform: scale(1) translate(calc(var(--i) * -10px - 50px), calc(var(--i) * 45px + 50px));
}

.nav-crystal:hover {
    background: rgba(100, 136, 255, 0.15);
}

/* Rooms */
.room {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Room 1: Genesis */
.room-genesis {
    background: var(--abyss);
    height: 100vh;
}

.genesis-blob {
    position: absolute;
    width: 70vw;
    height: 70vh;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.genesis-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.genesis-title {
    font-family: 'Dela Gothic One', cursive;
    font-size: clamp(3.5rem, 7vw, 6rem);
    font-weight: 400;
    letter-spacing: -0.04em;
    line-height: 0.92;
    color: var(--frost-white);
}

.genesis-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    font-weight: 400;
    color: var(--silver-haze);
    margin-top: 1rem;
}

.orbit-crystals {
    position: absolute;
    width: 75vw;
    height: 75vh;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.orbit-crystal {
    position: absolute;
    width: 20px;
    height: 20px;
    animation: orbit 20s linear infinite;
}

.orbit-crystal:nth-child(1) {
    top: 10%;
    left: 50%;
    animation-duration: 18s;
}

.orbit-crystal:nth-child(2) {
    top: 70%;
    left: 20%;
    animation-duration: 24s;
    animation-delay: -5s;
}

.orbit-crystal:nth-child(3) {
    top: 60%;
    left: 80%;
    animation-duration: 30s;
    animation-delay: -10s;
}

@keyframes orbit {
    from { transform: rotate(0deg) translateX(30px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(30px) rotate(-360deg); }
}

.scroll-chevron {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s cubic-bezier(0.36, 0.07, 0.19, 1.56) infinite;
    z-index: 10;
}

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

/* Room 2: Concepts */
.room-concepts {
    background: var(--abyss);
    min-height: 120vh;
    padding: 10vh 5vw;
}

.concept-trio {
    display: flex;
    gap: 3vw;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 5;
}

.concept-blob {
    position: relative;
    width: 30vw;
    min-width: 280px;
    max-width: 380px;
    opacity: 0;
    transform: scale(0.3);
    transition: transform 0.8s var(--spring-bounce), opacity 0.6s ease;
}

.concept-blob.visible {
    opacity: 1;
    transform: scale(1);
}

.concept-blob-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.concept-content {
    position: relative;
    z-index: 2;
    padding: 4rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 350px;
    justify-content: center;
}

.concept-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 1.5rem;
}

.concept-title {
    font-family: 'Dela Gothic One', cursive;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 400;
    letter-spacing: -0.04em;
    line-height: 0.92;
    color: var(--frost-white);
    margin-bottom: 1rem;
}

.concept-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--silver-haze);
    max-width: 250px;
}

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

/* Room 3: Crystal Gallery */
.room-gallery {
    background: #0d1235;
    min-height: 120vh;
    padding: 10vh 5vw;
}

.crystal-gallery {
    position: relative;
    width: 100%;
    height: 80vh;
    max-width: 1200px;
    margin: 0 auto;
}

.crystal-card {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    perspective: 600px;
    cursor: pointer;
}

.crystal-card:hover .crystal-front {
    transform: rotateY(180deg);
}

.crystal-card:hover .crystal-back {
    transform: rotateY(0deg);
}

.crystal-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    border: 1px solid rgba(100, 136, 255, 0.3);
    background: rgba(100, 136, 255, 0.06);
    backdrop-filter: blur(8px);
    clip-path: polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
    transition: transform 0.6s var(--spring-bounce);
    filter: drop-shadow(0 0 15px rgba(140, 164, 255, 0.2));
}

.crystal-front span {
    font-family: 'Azeret Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--crystal-blue);
}

.crystal-back {
    transform: rotateY(-180deg);
}

.crystal-back span {
    font-family: 'DM Sans', sans-serif;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--silver-haze);
    text-align: center;
    padding: 1rem;
}

/* Room 4: Void */
.room-void {
    background: var(--deep-lab);
    min-height: 120vh;
    padding: 10vh 5vw;
}

.void-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4vw;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 5;
}

.void-text {
    flex: 1;
    max-width: 300px;
}

.void-text p {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--silver-haze);
    margin-bottom: 1rem;
}

.void-accent {
    color: var(--crystal-rose) !important;
    font-weight: 500;
}

.void-blob {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: var(--abyss);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: voidPulse 4s ease-in-out infinite;
    box-shadow: inset 0 0 60px rgba(10, 15, 46, 0.8);
    flex-shrink: 0;
}

.void-crystal {
    width: 60px;
    height: 60px;
    animation: rotate 30s linear infinite;
    filter: drop-shadow(0 0 15px rgba(140, 164, 255, 0.4));
}

@keyframes voidPulse {
    0%, 100% { transform: scale(0.97); }
    50% { transform: scale(1.03); }
}

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

/* Room 5: Collapse */
.room-collapse {
    background: var(--abyss);
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collapse-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.collapse-blob {
    position: absolute;
    width: 60vw;
    height: 60vh;
    transition: transform 0.1s linear;
}

.collapse-final {
    position: relative;
    z-index: 10;
    text-align: center;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.collapse-final.visible {
    opacity: 1;
}

.collapse-name {
    display: block;
    font-family: 'Azeret Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--crystal-blue);
}

.collapse-version {
    display: block;
    font-family: 'Azeret Mono', monospace;
    font-size: 0.65rem;
    color: var(--silver-haze);
    margin-top: 0.5rem;
}

/* Particles */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--blob-glow);
    opacity: 0.3;
    animation: rise var(--duration) linear infinite;
    left: var(--left);
    bottom: -10px;
}

@keyframes rise {
    to { transform: translateY(calc(-100vh - 20px)); }
}

/* Connecting line animation */
.flow-line {
    stroke: var(--crystal-blue);
    stroke-width: 1;
    stroke-opacity: 0.15;
    stroke-dasharray: 4 8;
    animation: flowDash 8s linear infinite;
    fill: none;
}

@keyframes flowDash {
    to { stroke-dashoffset: -48; }
}

/* Responsive */
@media (max-width: 768px) {
    .concept-trio {
        flex-direction: column;
    }

    .concept-blob {
        width: 90vw;
        max-width: none;
    }

    .crystal-gallery {
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    .crystal-card {
        position: relative;
        left: auto;
        top: auto;
        width: 80vw;
        height: 80vw;
        max-width: 200px;
        max-height: 200px;
    }

    .void-container {
        flex-direction: column;
        text-align: center;
    }

    .nav-diamond {
        top: auto;
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .nav-radial {
        top: auto;
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .nav-radial.active .nav-crystal {
        transform: scale(1) translate(calc(var(--i) * -5px - 40px), calc(var(--i) * -40px - 50px));
    }
}
