/* ========================================
   munju.im — Goblincore Meditation
   ======================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    background: #1a1209;
    color: #c4b8a8;
    overflow: hidden;
}

/* ---- Scroll Container ---- */
.scroll-container {
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
}

/* ---- Zones ---- */
.zone {
    position: relative;
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    overflow: hidden;
}

.zone-content {
    position: relative;
    z-index: 5;
    padding: 8vh 6vw;
    max-width: 50%;
}

/* ---- Zone 1: Surface ---- */
.zone-surface {
    background: #e8ddd0;
    color: #5c4a38;
}

.site-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(3rem, 7vw, 5.5rem);
    color: #2c1e14;
    letter-spacing: 0.06em;
    line-height: 1.1;
}

.korean-decorative {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 100;
    font-size: 8vw;
    color: #c4623a;
    opacity: 0.2;
    margin-left: 2rem;
    line-height: 1.2;
    margin-top: 0.5rem;
}

.surface-tagline {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    color: #5c4a38;
    line-height: 1.75;
    margin-top: 2rem;
    max-width: 30ch;
}

.zone-gradient-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20vh;
    background: linear-gradient(180deg, transparent 0%, #2c1e14 100%);
    z-index: 3;
    pointer-events: none;
}

/* ---- Zone 2: Understory ---- */
.zone-understory {
    background: #2c1e14;
    color: #c4b8a8;
}

.zone-headline {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    color: #e8ddd0;
    letter-spacing: 0.06em;
    line-height: 1.15;
    margin-bottom: 2rem;
}

.zone-body {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    color: #c4b8a8;
    line-height: 1.75;
    margin-bottom: 1.5rem;
    max-width: 50ch;
}

.zone-body em {
    font-style: italic;
    color: #e6a84a;
}

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

.hypha {
    fill: none;
    stroke: #5c4a38;
    stroke-width: 1.5;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.zone-understory.in-view .hypha {
    stroke-dashoffset: 0;
}

.node {
    fill: #7aefb2;
    opacity: 0;
    transition: opacity 1s ease 2.5s;
}

.zone-understory.in-view .node {
    opacity: 1;
    animation: nodePulse 3s ease-in-out infinite;
}

@keyframes nodePulse {
    0%, 100% { opacity: 0.6; r: 4; }
    50% { opacity: 1; r: 6; }
}

/* ---- Zone 3: Bedrock ---- */
.zone-bedrock {
    background: #1a1209;
}

.aurora-behind {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #7aefb2 0%, #b88ae6 40%, #e6a84a 70%, #c4623a 100%);
    background-size: 400% 400%;
    animation: auroraShift 20s ease infinite;
    z-index: 0;
}

.bedrock-surface {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1209;
    z-index: 2;
    clip-path: polygon(
        0% 0%, 100% 0%, 100% 100%, 0% 100%,
        0% 0%, 15% 25%, 22% 30%, 18% 45%, 25% 55%, 20% 65%, 0% 50%, 0% 0%,
        35% 0%, 40% 15%, 48% 22%, 42% 35%, 50% 40%, 55% 30%, 45% 10%, 35% 0%,
        70% 100%, 75% 80%, 82% 72%, 78% 60%, 85% 55%, 90% 70%, 80% 90%, 70% 100%
    );
}

.zone-bedrock .zone-content {
    max-width: 45%;
}

.jamo-container {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: 15vw;
    color: #e8ddd0;
    display: flex;
    gap: 0.5vw;
    line-height: 1;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.jamo {
    display: inline-block;
    transition: transform 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.jamo.dispersed[data-index="0"] { transform: translate(-3vw, -5vh) rotate(-15deg); opacity: 0.3; }
.jamo.dispersed[data-index="1"] { transform: translate(2vw, -8vh) rotate(10deg); opacity: 0.25; }
.jamo.dispersed[data-index="2"] { transform: translate(-5vw, 4vh) rotate(-8deg); opacity: 0.35; }
.jamo.dispersed[data-index="3"] { transform: translate(6vw, 6vh) rotate(20deg); opacity: 0.2; }
.jamo.dispersed[data-index="4"] { transform: translate(4vw, -3vh) rotate(-12deg); opacity: 0.3; }

.bedrock-text {
    color: #c4b8a8;
}

/* ---- Zone 4: Aurora ---- */
.zone-aurora {
    background: #1a1209;
}

.aurora-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #7aefb2 0%, #b88ae6 25%, #e6a84a 50%, #c4623a 75%, #7aefb2 100%);
    background-size: 400% 400%;
    animation: auroraShift 20s ease infinite;
    z-index: 0;
}

@keyframes auroraShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}

.aurora-content {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 0;
}

.aurora-headline {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 4rem);
    color: #1a1209;
    letter-spacing: 0.06em;
    text-shadow: 0 0 40px rgba(26, 18, 9, 0.3);
    margin-bottom: 2rem;
}

.korean-final {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: 20vw;
    line-height: 1;
    background: linear-gradient(135deg, #1a1209 0%, #2c1e14 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---- Mushroom Nav ---- */
.mushroom-nav {
    position: fixed;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mushroom-dot {
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mushroom-dot:hover {
    transform: scale(1.3);
}

.mushroom-dot .cap,
.mushroom-dot .stem {
    fill: #5c4a38;
    transition: fill 0.4s ease;
}

.mushroom-dot.active .cap,
.mushroom-dot.active .stem {
    fill: #7aefb2;
}

/* ---- Water Bubbles ---- */
.bubble-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

.zone-surface .bubble-field {
    left: 40%;
    width: 60%;
}

.bubble {
    position: absolute;
    bottom: -10%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(168, 216, 234, 0.3), rgba(168, 216, 234, 0) 70%);
    border: 1px solid rgba(168, 216, 234, 0.08);
    box-shadow: inset 0 0 4px #a8d8ea33, 0 0 2px rgba(168, 216, 234, 0.1);
    animation: bubbleRise var(--duration) var(--delay) infinite cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes bubbleRise {
    0% {
        transform: translateX(0) translateY(0);
        opacity: var(--opacity);
    }
    50% {
        transform: translateX(calc(var(--drift) * 1px)) translateY(-55vh);
    }
    100% {
        transform: translateX(calc(var(--drift) * 0.5px)) translateY(-120vh);
        opacity: 0;
    }
}
