/* ===========================
   continu.st - Styles
   Vaporwave Topology / Zen Contemplative
   =========================== */

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

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: #1a1040;
    color: #d0d8e8;
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.5rem);
    line-height: 1.85;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* --- Continuum Rail (persistent) --- */
#continuum-rail {
    position: fixed;
    top: 60vh;
    left: -10vw;
    width: 120vw;
    height: 4px;
    background: linear-gradient(90deg, #c9a0dc, #e87461, #d0d8e8, #c9a0dc);
    background-size: 300% 100%;
    animation: railShift 30s linear infinite;
    z-index: 100;
    box-shadow: 0 0 20px rgba(201, 160, 220, 0.4), 0 0 60px rgba(201, 160, 220, 0.15);
    pointer-events: none;
    will-change: background-position;
}

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

/* --- Chamber (base) --- */
.chamber {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Blob Container --- */
.blob-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.blob {
    width: 100%;
    height: 100%;
}

.blob-path {
    filter: blur(40px);
}

/* --- Chamber Indicator --- */
#chamber-indicator {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 200;
    cursor: pointer;
}

#indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d0d8e8;
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

#radial-menu {
    position: absolute;
    bottom: -10px;
    right: -10px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#radial-menu.hidden {
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
}

#radial-menu.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.menu-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    fill: #c9a0dc;
    opacity: 0.7;
    cursor: pointer;
    letter-spacing: 0.12em;
    text-anchor: middle;
    transition: opacity 0.3s ease;
}

.menu-label:hover {
    opacity: 1;
}

.menu-label.active {
    fill: #e87461;
    opacity: 1;
}

/* ===========================
   Chamber 1: The Origin
   =========================== */
#chamber-origin {
    background: radial-gradient(ellipse at 50% 60%, #2a2848 0%, #1a1040 70%);
    flex-direction: column;
}

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

.origin-word {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(4rem, 15vw, 20rem);
    letter-spacing: 0.06em;
    color: #f0f2f8;
    display: inline-flex;
    line-height: 1;
}

.letter {
    display: inline-block;
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.letter[data-delay="0"] { animation-delay: 0s; }
.letter[data-delay="1"] { animation-delay: 0.3s; }
.letter[data-delay="2"] { animation-delay: 0.6s; }
.letter[data-delay="3"] { animation-delay: 0.9s; }
.letter[data-delay="4"] { animation-delay: 1.2s; }
.letter[data-delay="5"] { animation-delay: 1.5s; }
.letter[data-delay="6"] { animation-delay: 1.8s; }

.origin-suffix {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(2rem, 6vw, 8rem);
    letter-spacing: 0.06em;
    color: #c9a0dc;
    margin-top: -0.5em;
    position: relative;
    top: calc(60vh - 50vh + 0.5rem);
    opacity: 0.85;
}

/* ===========================
   Chamber 2: The Stream
   =========================== */
#chamber-stream {
    background: radial-gradient(ellipse at 50% 50%, #2a2848 0%, #1a1040 80%);
    flex-direction: column;
    align-items: stretch;
}

.stream-wave-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.wave-svg {
    width: 100%;
    height: 100%;
}

.wave-path {
    animation: waveShift 6s ease-in-out infinite;
}

.wave-path:nth-child(2) { animation-delay: -2s; }
.wave-path:nth-child(3) { animation-delay: -4s; }

@keyframes waveShift {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-60px); }
}

.stream-container {
    position: relative;
    z-index: 10;
    display: flex;
    gap: 2rem;
    padding: 0 4rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    align-items: center;
    height: 100%;
    -ms-overflow-style: none;
}

.stream-container::-webkit-scrollbar {
    display: none;
}

.stream-card {
    flex: 0 0 auto;
    width: min(60vw, 500px);
    padding: clamp(2rem, 4vw, 4rem);
    border-radius: 2rem;
    background: rgba(42, 40, 72, 0.3);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid rgba(208, 216, 232, 0.15);
    transition: backdrop-filter 0.4s ease-out, border-color 0.4s ease-out, background 0.4s ease-out;
    color: #d0d8e8;
    font-family: 'Instrument Serif', serif;
    font-size: clamp(1rem, 2vw, 1.4rem);
    line-height: 1.85;
}

.stream-card:hover {
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-color: rgba(201, 160, 220, 0.4);
    background: rgba(42, 40, 72, 0.4);
}

/* ===========================
   Chamber 3: The Fold
   =========================== */
#chamber-fold {
    background: radial-gradient(ellipse at 50% 50%, #c9a0dc 0%, #3d2a6b 40%, #1a1040 100%);
    perspective: 800px;
}

.fold-perspective {
    position: relative;
    width: 80%;
    max-width: 800px;
    z-index: 10;
    transform-style: preserve-3d;
}

.fold-plane {
    position: absolute;
    width: 100%;
    padding: 2rem 3rem;
    text-align: center;
    transform: translateZ(var(--z-offset));
    transition: transform 0.6s ease-out, opacity 0.6s ease-out;
}

.fold-plane[data-depth="0"] {
    position: relative;
    color: #f0f2f8;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    opacity: 0.9;
}

.fold-plane[data-depth="1"] {
    top: 3rem;
    color: #d0d8e8;
    font-size: clamp(1rem, 2vw, 1.4rem);
    opacity: 0.6;
}

.fold-plane[data-depth="2"] {
    top: 6rem;
    color: #8b9caf;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    opacity: 0.35;
}

/* ===========================
   Chamber 4: The Pulse
   =========================== */
#chamber-pulse {
    background: radial-gradient(ellipse at 50% 50%, #2a2848 0%, #1a1040 80%);
}

.pulse-center {
    position: absolute;
    z-index: 5;
    width: 50vmin;
    height: 50vmin;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pulse-circle {
    width: 100%;
    height: 100%;
}

.orbital-track {
    position: absolute;
    z-index: 10;
    width: 70vmin;
    height: 50vmin;
    pointer-events: none;
}

.orbital-word {
    position: absolute;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.65rem, 1vw, 0.85rem);
    letter-spacing: 0.12em;
    color: #c9a0dc;
    opacity: 0.7;
    white-space: nowrap;
}

/* ===========================
   Chamber 5: The Weave
   =========================== */
#chamber-weave {
    background: radial-gradient(ellipse at 50% 50%, #2a2848 0%, #1a1040 80%);
}

.weave-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.weave-wave {
    opacity: 0.4;
    fill: none;
    stroke-width: 2.5;
}

.weave-columns {
    position: relative;
    z-index: 10;
    display: flex;
    gap: 4rem;
    height: 60%;
    align-items: center;
    padding: 0 6rem;
}

.weave-column {
    writing-mode: vertical-rl;
    font-family: 'Instrument Serif', serif;
    font-size: clamp(0.9rem, 1.5vw, 1.3rem);
    color: #d0d8e8;
    opacity: 0.8;
    line-height: 2.2;
    letter-spacing: 0.02em;
}

.weave-column:nth-child(2) { color: #c9a0dc; }
.weave-column:nth-child(3) { color: #8b9caf; }

/* ===========================
   Chamber 6: The Continuum
   =========================== */
#chamber-continuum {
    background: #1a1040;
    flex-direction: column;
}

.continuum-fill {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #c9a0dc, #e87461, #d0d8e8, #c9a0dc);
    background-size: 300% 100%;
    animation: railShift 30s linear infinite;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 1;
}

#chamber-continuum.active .continuum-fill {
    opacity: 1;
}

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

.continuum-domain {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 8vw, 8rem);
    letter-spacing: 0.06em;
    color: #f0f2f8;
    margin-bottom: 1rem;
}

.continuum-message {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: #f0f2f8;
    opacity: 0.8;
    letter-spacing: 0.02em;
}

/* --- Scroll Sentinel --- */
#scroll-sentinel {
    height: 1px;
    width: 100%;
    pointer-events: none;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .stream-card {
        width: 80vw;
    }

    .weave-columns {
        padding: 0 2rem;
        gap: 2rem;
    }

    .fold-perspective {
        width: 90%;
    }

    .origin-suffix {
        top: calc(60vh - 50vh);
    }

    .stream-container {
        padding: 0 2rem;
    }

    .orbital-track {
        width: 80vmin;
        height: 56vmin;
    }
}

@media (max-width: 480px) {
    .stream-card {
        width: 85vw;
        padding: 1.5rem;
    }

    .weave-columns {
        padding: 0 1.5rem;
        gap: 1.5rem;
    }
}
