/* mujun.day - Seapunk Horizontal Scroll Experience */
/* Colors: #00CED1, #FF6B6B, #9B59B6, #0A1628, #1B3A4B, #E8F4F0, #C8E6E0, #FFDAB9, #F0F7F4, #2D5F5D */

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

html {
    overflow: hidden;
    height: 100%;
}

body {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    font-family: 'Libre Baskerville', serif;
    background: #0A1628;
    -webkit-font-smoothing: antialiased;
}

/* ============ TYPOGRAPHY ============ */

.display-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.0;
}

.body-text {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1.7;
    font-size: clamp(16px, 1.8vw, 22px);
}

/* ============ SCROLL CONTAINER ============ */

.scroll-container {
    display: flex;
    width: 600vw;
    height: 100vh;
    will-change: transform;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ============ CHAMBER BASE ============ */

.chamber {
    position: relative;
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    overflow: hidden;
    contain: layout paint;
}

.chamber-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ============ CHAMBER 1: THE SPEAR ============ */

.chamber-1 {
    background: #E8F4F0;
}

.domain-vertical {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: clamp(48px, 10vw, 160px);
    letter-spacing: 0.02em;
    color: #1B3A4B;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    position: absolute;
    left: -0.15em;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.15;
    line-height: 1;
    white-space: nowrap;
}

.kanji-center {
    font-family: 'Noto Serif JP', serif;
    font-weight: 700;
    font-size: clamp(80px, 20vw, 300px);
    color: #1B3A4B;
    text-shadow: 0 0 40px rgba(0, 206, 209, 0.3);
    position: relative;
    z-index: 3;
}

.kanji-pulse {
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.chamber-1 .chamber-text {
    color: #2D5F5D;
    margin-top: 2rem;
    font-style: italic;
    opacity: 0.8;
}

/* ============ CHAMBER 2: SURFACE ============ */

.chamber-2 {
    background: linear-gradient(to bottom, #E8F4F0 0%, #E8F4F0 48%, #1B3A4B 52%, #1B3A4B 100%);
}

.waterline-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.sky-half {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(180deg, #F0F7F4 0%, #E8F4F0 60%, #C8E6E0 100%);
}

.ocean-half {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(180deg, #1B3A4B 0%, #0A1628 100%);
}

.wave-boundary {
    position: absolute;
    top: 47%;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 3;
}

.wave-path {
    animation: wave-shift 4s ease-in-out infinite;
}

@keyframes wave-shift {
    0%, 100% { d: path('M0,30 Q125,0 250,30 T500,30 T750,30 T1000,30'); }
    50% { d: path('M0,30 Q125,60 250,30 T500,30 T750,30 T1000,30'); }
}

.waterline-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    font-size: clamp(24px, 4vw, 56px);
    color: #F0F7F4;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 206, 209, 0.3);
    text-align: center;
    padding: 0 2rem;
    width: 100%;
}

.static-flare::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 70% 30%, rgba(0, 206, 209, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 72% 28%, rgba(255, 255, 255, 0.4) 0%, transparent 8%),
        radial-gradient(circle at 68% 32%, rgba(255, 255, 255, 0.2) 0%, transparent 15%);
    z-index: 1;
    pointer-events: none;
}

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

/* ============ CHAMBER 3: DESCENT ============ */

.chamber-3 {
    background: linear-gradient(135deg, #1B3A4B 0%, #0A1628 100%);
}

.depth-perspective {
    perspective: 800px;
}

.descent-text {
    color: #C8E6E0;
    text-align: center;
    margin-bottom: 1.5rem;
}

.descent-text.display-text {
    font-size: clamp(32px, 6vw, 80px);
    background: linear-gradient(135deg, #00CED1, #9B59B6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.descent-text.body-text {
    font-size: clamp(18px, 2.5vw, 32px);
    font-style: italic;
}

.depth-1 {
    transform: translateZ(0px);
}

.depth-2 {
    transform: translateZ(-40px);
    opacity: 0.85;
}

.depth-3 {
    transform: translateZ(-80px);
    opacity: 0.7;
}

.wave-divider {
    width: 200px;
    height: 40px;
    margin-top: 2rem;
    opacity: 0.3;
}

/* ============ CHAMBER 4: THE PARADOX ============ */

.chamber-4 {
    background: #0A1628;
}

.paradox-kanji-container {
    position: relative;
    width: clamp(150px, 30vw, 400px);
    height: clamp(150px, 30vw, 400px);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.kanji-overlap {
    font-family: 'Noto Serif JP', serif;
    font-weight: 700;
    font-size: clamp(80px, 20vw, 300px);
    position: absolute;
    mix-blend-mode: difference;
    opacity: 0.5;
}

.kanji-spear {
    color: #00CED1;
    transform: translate(-10%, -5%);
}

.kanji-shield {
    color: #FF6B6B;
    transform: translate(10%, 5%);
}

.paradox-text {
    font-size: clamp(24px, 4vw, 56px);
    text-align: center;
    margin-bottom: 0.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, #00CED1, #9B59B6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============ CHAMBER 5: BIOLUMINESCENCE ============ */

.chamber-5 {
    background: #0A1628;
}

.biolum-text {
    font-size: clamp(36px, 7vw, 100px);
    text-align: center;
    margin-bottom: 1rem;
}

.glow-cyan {
    color: #00CED1;
    text-shadow:
        0 0 10px rgba(0, 206, 209, 0.8),
        0 0 30px rgba(0, 206, 209, 0.5),
        0 0 60px rgba(0, 206, 209, 0.3),
        0 0 100px rgba(0, 206, 209, 0.15);
}

.glow-magenta {
    color: #9B59B6;
    text-shadow:
        0 0 10px rgba(155, 89, 182, 0.8),
        0 0 30px rgba(155, 89, 182, 0.5),
        0 0 60px rgba(155, 89, 182, 0.3),
        0 0 100px rgba(155, 89, 182, 0.15);
}

/* ============ CHAMBER 6: THE SHIELD ============ */

.chamber-6 {
    background: #FFDAB9;
}

.kanji-shield-final {
    color: #FF6B6B;
    text-shadow: 0 0 40px rgba(255, 107, 107, 0.4);
}

.resolution-text {
    font-family: 'Noto Serif JP', serif;
    font-weight: 700;
    font-size: clamp(48px, 10vw, 140px);
    color: #1B3A4B;
    margin-top: 1.5rem;
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.2);
}

.resolution-sub {
    color: #2D5F5D;
    margin-top: 1rem;
    font-style: italic;
    opacity: 0.8;
}

.flare-warm::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(255, 107, 107, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 32% 38%, rgba(255, 255, 255, 0.35) 0%, transparent 10%),
        radial-gradient(circle at 28% 42%, rgba(255, 218, 185, 0.2) 0%, transparent 20%);
    pointer-events: none;
}

/* ============ AURORA BACKGROUNDS ============ */

.chamber-aurora {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 206, 209, 0.04) 15%,
        transparent 30%,
        rgba(155, 89, 182, 0.03) 45%,
        transparent 60%,
        rgba(255, 107, 107, 0.02) 75%,
        transparent 100%
    );
    animation: aurora 12s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.aurora-intense {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 206, 209, 0.08) 15%,
        transparent 30%,
        rgba(155, 89, 182, 0.06) 45%,
        transparent 60%,
        rgba(255, 107, 107, 0.04) 75%,
        transparent 100%
    );
}

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

/* ============ BUBBLE PARTICLES ============ */

.bubble-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.bubble {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(200, 230, 224, 0.3);
    will-change: transform;
}

/* ============ CURSOR FLARE OVERLAY ============ */

#flare-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    will-change: background;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#flare-overlay.active {
    opacity: 1;
}

/* ============ PROGRESS BAR ============ */

#progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(10, 22, 40, 0.3);
    z-index: 200;
}

#progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00CED1, #9B59B6, #FF6B6B);
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ============ CHAMBER INDICATOR ============ */

#chamber-indicator {
    position: fixed;
    top: 20px;
    right: 24px;
    font-family: 'Libre Baskerville', serif;
    font-size: 12px;
    color: #C8E6E0;
    opacity: 0.4;
    z-index: 200;
    letter-spacing: 0.05em;
    transition: color 0.5s ease;
}

.chamber-1-active #chamber-indicator,
.chamber-2-active #chamber-indicator {
    color: #1B3A4B;
}

.chamber-6-active #chamber-indicator {
    color: #2D5F5D;
}

/* ============ ANIMATION FOR CHAMBER 6 DRIFT ============ */

.chamber-6 .chamber-content {
    animation: drift-up 6s ease-in-out infinite;
}

@keyframes drift-up {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
    .domain-vertical {
        font-size: clamp(36px, 8vw, 80px);
        opacity: 0.1;
    }

    .waterline-text {
        font-size: clamp(18px, 5vw, 36px);
        padding: 0 1rem;
    }

    .paradox-kanji-container {
        width: 60vw;
        height: 60vw;
    }
}
