/* muhan.ai - Cinematic Surreal Cosmological Descent */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    font-size: clamp(0.875rem, 1.2vw, 1.125rem);
    line-height: 1.7;
    color: #A8A3C7;
    background: #0D0D1A;
    overflow-x: hidden;
}

/* ===== Progress Line ===== */
.progress-line {
    position: fixed;
    top: 0;
    right: 0;
    width: 1px;
    height: 0%;
    background: linear-gradient(180deg, #0D0D1A, #6C63FF, #FF6B9D);
    z-index: 100;
}

/* ===== Noise Field ===== */
.noise-field {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(108,99,255,0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(255,107,157,0.03) 0%, transparent 50%),
        conic-gradient(from 0deg at 50% 50%, rgba(108,99,255,0.02), rgba(255,107,157,0.02), rgba(108,99,255,0.02));
    animation: noise-shift 60s linear infinite;
    pointer-events: none;
}

@keyframes noise-shift {
    0% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(15deg); }
    100% { filter: hue-rotate(0deg); }
}

/* ===== Floating Korean Glyphs ===== */
.floating-glyph {
    position: fixed;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 100;
    font-size: clamp(8rem, 20vw, 30rem);
    color: #1A1A2E;
    letter-spacing: 0.1em;
    pointer-events: none;
    z-index: 0;
}

.glyph-1 { top: 10%; left: 5%; animation: glyph-drift-1 120s linear infinite; opacity: 0.06; }
.glyph-2 { top: 30%; right: 10%; animation: glyph-drift-2 90s linear infinite; opacity: 0.04; }
.glyph-3 { top: 50%; left: 20%; animation: glyph-drift-3 150s linear infinite; opacity: 0.05; }
.glyph-4 { top: 70%; right: 15%; animation: glyph-drift-1 180s linear infinite; opacity: 0.04; }
.glyph-5 { top: 85%; left: 40%; animation: glyph-drift-2 100s linear infinite; opacity: 0.06; }

@keyframes glyph-drift-1 {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(3vw, -2vh) rotate(2deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes glyph-drift-2 {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-2vw, 3vh) rotate(-1deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes glyph-drift-3 {
    0% { transform: translate(0, 0); }
    50% { transform: translate(2vw, 2vh); }
    100% { transform: translate(0, 0); }
}

/* ===== Gradient Orbs ===== */
.gradient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #6C63FF 0%, transparent 70%);
    top: 20%;
    left: 10%;
    opacity: 0.08;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #FF6B9D 0%, transparent 70%);
    top: 50%;
    right: 5%;
    opacity: 0.06;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #FFD93D 0%, transparent 70%);
    top: 75%;
    left: 30%;
    opacity: 0.05;
}

/* ===== Dimensions ===== */
.dimension {
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ===== Section 1: The Threshold ===== */
.dimension-1 {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #06060F;
}

.threshold-content {
    text-align: center;
    z-index: 2;
}

.threshold-glyph {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 100;
    font-size: clamp(15vw, 20vw, 40vw);
    color: #E8E6F0;
    opacity: 0;
    letter-spacing: 0.5em;
    animation: threshold-appear 3s cubic-bezier(0.16, 1, 0.3, 1) 1.5s forwards;
}

@keyframes threshold-appear {
    0% { opacity: 0; letter-spacing: 0.5em; }
    100% { opacity: 1; letter-spacing: 0.1em; }
}

.threshold-subtitle {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.5rem);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #A8A3C7;
    opacity: 0;
    animation: subtitle-appear 1.5s ease 5.5s forwards;
}

@keyframes subtitle-appear {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* ===== Section 2: The Manifesto ===== */
.dimension-2 {
    min-height: 150vh;
    padding: 20vh 2rem;
    background: #0D0D1A;
}

.manifesto-flow {
    position: relative;
    max-width: 50vw;
    margin-left: 38.2%;
}

.manifesto-line {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-size: clamp(2.5rem, 6vw, 6rem);
    line-height: 1.15;
    color: #E8E6F0;
    margin-bottom: 15vh;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1), transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.manifesto-line.revealed {
    opacity: 1;
    transform: translateY(0);
}

.manifesto-line.past {
    opacity: 0.15;
}

.accent-word {
    color: #6C63FF;
    transition: color 4s ease;
}

/* ===== Section 3: Horizontal Gallery ===== */
.dimension-3 {
    min-height: 100vh;
    overflow: hidden;
}

.horizontal-gallery {
    display: flex;
    width: 400vw;
    height: 100vh;
    scroll-snap-type: x mandatory;
    overflow-x: auto;
}

.h-panel {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
}

.h-panel-1 { background: linear-gradient(135deg, #0D0D1A, #1A1A2E); }
.h-panel-2 { background: linear-gradient(135deg, #1A1A2E, #0D0D1A); }
.h-panel-3 { background: linear-gradient(135deg, #0D0D1A, #1A1A2E); }
.h-panel-4 { background: linear-gradient(135deg, #1A1A2E, #0D0D1A); }

.h-panel-glyph {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 100;
    font-size: clamp(10rem, 25vw, 30rem);
    color: #E8E6F0;
    line-height: 1;
}

.h-panel-word {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.5rem);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #A8A3C7;
    margin-top: 2rem;
}

/* ===== Section 4: The Depth Field ===== */
.dimension-4 {
    min-height: 200vh;
    padding: 20vh 2rem;
    background: #06060F;
    position: relative;
}

.constellation {
    display: flex;
    justify-content: center;
    margin-bottom: 10vh;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.constellation.revealed {
    opacity: 1;
}

.depth-phrase {
    position: relative;
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    color: #A8A3C7;
    max-width: 35ch;
    margin-bottom: 20vh;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1), transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.depth-phrase.revealed {
    opacity: 1;
    transform: translateY(0);
}

.depth-phrase-1 { margin-left: 38.2%; }
.depth-phrase-2 { margin-left: 55%; }
.depth-phrase-3 { margin-left: 38.2%; }

/* ===== Section 5: The Convergence ===== */
.dimension-5 {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0D0D1A;
}

.convergence-content {
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 2s cubic-bezier(0.16, 1, 0.3, 1), transform 2s cubic-bezier(0.16, 1, 0.3, 1);
}

.convergence-content.revealed {
    opacity: 1;
    transform: translateY(0);
}

.convergence-title {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-size: clamp(4rem, 12vw, 14rem);
    letter-spacing: -0.03em;
    line-height: 0.92;
    margin-bottom: 2rem;
}

.title-muhan {
    color: #E8E6F0;
}

.title-ai {
    animation: color-cycle 12s linear infinite;
}

@keyframes color-cycle {
    0%, 100% { color: #6C63FF; }
    33% { color: #FF6B9D; }
    66% { color: #FFD93D; }
}

.convergence-line {
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    color: #A8A3C7;
    letter-spacing: 0.02em;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .manifesto-flow {
        max-width: 90%;
        margin-left: 5%;
    }

    .manifesto-line {
        font-size: clamp(1.5rem, 5vw, 3rem);
        margin-bottom: 10vh;
    }

    .floating-glyph {
        display: none;
    }

    .gradient-orb {
        display: none;
    }

    .depth-phrase {
        margin-left: 5% !important;
        max-width: 80%;
    }

    .horizontal-gallery {
        flex-direction: column;
        width: 100vw;
        height: auto;
    }

    .h-panel {
        width: 100vw;
        min-height: 100vh;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .threshold-glyph,
    .threshold-subtitle {
        animation: none;
        opacity: 1;
        letter-spacing: 0.1em;
    }

    .floating-glyph {
        animation: none;
    }

    .manifesto-line,
    .depth-phrase,
    .convergence-content,
    .constellation {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .title-ai {
        animation: none;
        color: #6C63FF;
    }

    .noise-field {
        animation: none;
    }
}
