/* ============================================
   interplanetary.quest - Surreal Dreamscape
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-deep: #0A0815;
    --bg-mid: #1A1230;
    --bg-shift: #0D1F2D;
    --text-primary: #E8DFF5;
    --text-secondary: #BFB5D0;
    --text-whisper: #8E7BAF;
    --glow-pink: #E8A0BF;
    --glow-teal: #6BCEC7;
    --glow-gold: #E8C872;
    --bg-hue: 270;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-secondary);
    font-family: 'Karla', sans-serif;
    font-weight: 300;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- Scroll Depth Indicator --- */
.scroll-indicator {
    position: fixed;
    left: 16px;
    top: 0;
    bottom: 0;
    width: 2px;
    z-index: 100;
    pointer-events: none;
}

.scroll-line {
    position: absolute;
    top: 5vh;
    bottom: 5vh;
    width: 2px;
    background: rgba(180, 160, 220, 0.2);
    left: 0;
}

.scroll-dot {
    position: absolute;
    top: 5vh;
    left: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--glow-teal);
    box-shadow: 0 0 12px var(--glow-teal), 0 0 24px rgba(107, 206, 199, 0.3);
    transition: top 0.1s linear;
}

/* --- Star Field --- */
#star-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#star-field .star {
    position: absolute;
    border-radius: 50%;
    background: #E8DFF5;
    animation: twinkle var(--twinkle-duration, 5s) ease-in-out infinite alternate;
    animation-delay: var(--twinkle-delay, 0s);
}

@keyframes twinkle {
    0% { opacity: var(--star-opacity-min, 0.1); }
    100% { opacity: var(--star-opacity-max, 0.5); }
}

/* --- Biomorphic Shapes Layer --- */
#biomorphic-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.biomorphic-shape {
    position: absolute;
    border-radius: 40% 60% 55% 45% / 50% 40% 60% 50%;
    opacity: 0.07;
    animation: drift var(--drift-duration, 30s) ease-in-out infinite alternate;
    will-change: transform;
}

.biomorphic-shape:nth-child(1) {
    width: 350px;
    height: 300px;
    background: radial-gradient(ellipse, rgba(232, 160, 191, 0.4), transparent 70%);
    top: 10%;
    left: -5%;
    border-radius: 45% 55% 50% 50% / 55% 45% 55% 45%;
    --drift-duration: 35s;
}

.biomorphic-shape:nth-child(2) {
    width: 250px;
    height: 280px;
    background: radial-gradient(ellipse, rgba(107, 206, 199, 0.4), transparent 70%);
    top: 40%;
    right: -3%;
    border-radius: 55% 45% 60% 40% / 40% 60% 40% 60%;
    --drift-duration: 28s;
    animation-delay: -10s;
}

.biomorphic-shape:nth-child(3) {
    width: 400px;
    height: 350px;
    background: radial-gradient(ellipse, rgba(142, 123, 175, 0.35), transparent 70%);
    top: 65%;
    left: 20%;
    border-radius: 50% 50% 45% 55% / 60% 40% 55% 45%;
    --drift-duration: 40s;
    animation-delay: -20s;
}

.biomorphic-shape:nth-child(4) {
    width: 200px;
    height: 220px;
    background: radial-gradient(ellipse, rgba(232, 200, 114, 0.3), transparent 70%);
    top: 20%;
    right: 25%;
    border-radius: 60% 40% 50% 50% / 45% 55% 50% 50%;
    --drift-duration: 25s;
    animation-delay: -5s;
}

.biomorphic-shape:nth-child(5) {
    width: 300px;
    height: 260px;
    background: radial-gradient(ellipse, rgba(232, 160, 191, 0.3), transparent 70%);
    bottom: 10%;
    left: 50%;
    border-radius: 42% 58% 48% 52% / 52% 48% 56% 44%;
    --drift-duration: 32s;
    animation-delay: -15s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    33% {
        transform: translate(20px, -15px) rotate(3deg) scale(1.03);
    }
    66% {
        transform: translate(-15px, 10px) rotate(-2deg) scale(0.97);
    }
    100% {
        transform: translate(10px, 20px) rotate(1deg) scale(1.02);
    }
}

/* --- Zone Basics --- */
.zone {
    position: relative;
    z-index: 2;
}

/* --- Hero Zone --- */
.zone-hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.nebula-bloom {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0%;
    height: 0%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(232, 160, 191, 0.08), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.nebula-bloom.active {
    animation: nebulaExpand 4s ease-out forwards;
}

@keyframes nebulaExpand {
    0% {
        width: 0%;
        height: 0%;
        opacity: 0;
    }
    100% {
        width: 120%;
        height: 120%;
        opacity: 1;
    }
}

.hero-title {
    font-family: 'Cormorant Infant', serif;
    font-weight: 300;
    font-size: 48px;
    letter-spacing: 0.02em;
    line-height: 1.4;
    text-align: center;
    z-index: 1;
    opacity: 0;
    background-image: linear-gradient(120deg, #E8DFF5, #E8A0BF, #6BCEC7, #E8DFF5);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 8s linear infinite;
    animation-play-state: paused;
}

.hero-title.visible {
    opacity: 1;
    transition: opacity 2s ease;
    animation-play-state: running;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* --- Void Zones --- */
.zone-void {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.void-1 { min-height: 100vh; }
.void-2 { min-height: 110vh; }
.void-3 { min-height: 90vh; }
.void-4 { min-height: 100vh; }
.void-5 { min-height: 80vh; }
.void-final { min-height: 60vh; }

/* --- Constellations --- */
.constellation {
    position: absolute;
    width: 300px;
    height: 250px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 1s ease;
    pointer-events: none;
}

.constellation.visible {
    opacity: 1;
}

.constellation-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 3s ease-in-out;
}

.constellation.visible .constellation-line {
    stroke-dashoffset: 0;
}

.constellation-2 {
    width: 350px;
    height: 280px;
    left: 60%;
    top: 40%;
}

.constellation-3 {
    width: 280px;
    height: 280px;
    left: 35%;
    top: 55%;
}

.constellation-4 {
    width: 320px;
    height: 220px;
    left: 45%;
    top: 50%;
}

/* --- Whisper Text --- */
.whisper-text {
    position: absolute;
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: 20px;
    color: var(--text-whisper);
    opacity: 0;
    transition: opacity 2s ease;
    pointer-events: none;
    white-space: nowrap;
}

.whisper-text.visible {
    opacity: 0.6;
}

/* --- Passage Zones --- */
.zone-passage {
    min-height: 60vh;
    display: flex;
    align-items: center;
    padding: 80px 0;
    position: relative;
}

.passage {
    max-width: 540px;
    padding: 60px;
}

.passage-left {
    margin-left: 15vw;
    margin-right: auto;
}

.passage-right {
    margin-left: auto;
    margin-right: 15vw;
}

.passage-center {
    margin-left: auto;
    margin-right: auto;
}

/* --- Blur Reveal --- */
.blur-reveal {
    opacity: 0;
    filter: blur(8px);
    transition: opacity 1.2s ease, filter 1.2s ease;
}

.blur-reveal.revealed {
    opacity: 1;
    filter: blur(0px);
}

.blur-reveal.dissolved {
    opacity: 0;
    filter: blur(6px);
    transition: opacity 0.8s ease, filter 0.8s ease;
}

/* --- Typography --- */
.section-heading {
    font-family: 'Cormorant Infant', serif;
    font-weight: 300;
    font-size: 36px;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    line-height: 1.4;
    margin-bottom: 24px;
}

.body-text {
    font-family: 'Karla', sans-serif;
    font-weight: 300;
    font-size: 17px;
    line-height: 1.9;
    color: var(--text-secondary);
}

/* --- Background Gradient Overlay --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(ellipse 80% 60% at 20% 30%, rgba(232, 160, 191, 0.05), transparent),
        radial-gradient(ellipse 70% 50% at 80% 60%, rgba(107, 206, 199, 0.04), transparent),
        radial-gradient(ellipse 90% 70% at 50% 80%, rgba(142, 123, 175, 0.05), transparent);
    pointer-events: none;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }

    .section-heading {
        font-size: 28px;
    }

    .passage {
        max-width: 90vw;
        padding: 40px 24px;
    }

    .passage-left {
        margin-left: 5vw;
    }

    .passage-right {
        margin-right: 5vw;
    }

    .constellation {
        width: 200px;
        height: 180px;
    }

    .whisper-text {
        font-size: 16px;
    }

    .scroll-indicator {
        display: none;
    }
}
