/* hwaklyul.com — probability as nocturnal phenomenon
   Palette:
     Void              #08080e
     Glow Primary      #4a6aff (indigo)
     Glow Secondary    #6aeaff (pale cyan)
     Glow Tertiary     #ffb84a (warm amber)
     Point Default     #8a9aee
     Point Highlight   #ffa07a
     Text Dim          rgba(255,255,255,0.40)
     Text Bright       rgba(255,255,255,0.85)
*/

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

html,
body {
    background-color: #08080e;
    color: rgba(255, 255, 255, 0.85);
    width: 100%;
    overflow-x: hidden;
    /* The void is the canvas — no textures, no gradients. */
}

body {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 300;
    line-height: 2.0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main#void {
    position: relative;
    width: 100%;
}

/* Generic zone reset — no borders, no boundaries. */
.zone {
    position: relative;
    width: 100%;
    background-color: #08080e;
}

/* ---------- Zone 1: The Emergence (0–100vh) ---------- */
.zone-emergence {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-korean {
    font-family: "Noto Sans KR", "Inter", sans-serif;
    font-weight: 100;
    font-size: clamp(5rem, 12vw, 12rem);
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.05em;
    text-align: center;
    line-height: 1;

    /* Three-layer glow — phosphorescent letterforms in indigo. */
    text-shadow:
        0 0 30px rgba(74, 106, 255, 0.4),
        0 0 60px rgba(74, 106, 255, 0.2),
        0 0 120px rgba(74, 106, 255, 0.1);

    /* 1.5s of pure black, then 3s fade-in. */
    opacity: 0;
    animation: emerge 3s ease-out 1.5s forwards;
    will-change: opacity, letter-spacing;
}

@keyframes emerge {
    from {
        opacity: 0;
        letter-spacing: 0.25em;
    }
    to {
        opacity: 1;
        letter-spacing: 0.05em;
    }
}

/* Soft pulse after emergence — breathing light. */
.hero-korean.emerged {
    animation: emerge 3s ease-out 1.5s forwards, breath 8s ease-in-out 5s infinite;
}

@keyframes breath {
    0%, 100% {
        text-shadow:
            0 0 30px rgba(74, 106, 255, 0.40),
            0 0 60px rgba(74, 106, 255, 0.20),
            0 0 120px rgba(74, 106, 255, 0.10);
    }
    50% {
        text-shadow:
            0 0 40px rgba(74, 106, 255, 0.55),
            0 0 80px rgba(106, 234, 255, 0.18),
            0 0 160px rgba(74, 106, 255, 0.12);
    }
}

/* ---------- Zone 2: The Distribution (100–250vh) ---------- */
.zone-distribution {
    height: 150vh;
    position: relative;
}

.point-cloud {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.point {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #8a9aee;
    box-shadow:
        0 0 6px rgba(138, 154, 238, 0.7),
        0 0 14px rgba(74, 106, 255, 0.35);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
    will-change: opacity, transform;
}

.point.warm {
    background-color: #ffa07a;
    box-shadow:
        0 0 6px rgba(255, 160, 122, 0.75),
        0 0 14px rgba(255, 184, 74, 0.35);
}

.point.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ---------- Zone 3: The Text (250–400vh) ---------- */
.zone-text {
    height: 150vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 25vh;
    gap: 50vh;
}

.passage {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 300;
    font-size: 1.2rem;
    line-height: 2.0;
    color: rgba(255, 255, 255, 0.40);
    text-align: center;
    max-width: 32rem;
    padding: 0 1.5rem;
    transition: color 0.5s ease, opacity 0.7s ease, transform 0.7s ease;
    opacity: 0;
    transform: translateY(20px);
    will-change: opacity, transform, color;
}

.passage.in-view {
    opacity: 1;
    transform: translateY(0);
}

.passage:hover {
    color: rgba(255, 255, 255, 0.85);
}

/* ---------- Zone 4: The Collapse (400–500vh) ---------- */
.zone-collapse {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collapse-cloud {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.collapse-point {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #8a9aee;
    box-shadow:
        0 0 6px rgba(138, 154, 238, 0.7),
        0 0 14px rgba(74, 106, 255, 0.35);
    opacity: 0.85;
    transform: translate(-50%, -50%);
    will-change: transform, opacity;
}

.collapse-point.warm {
    background-color: #ffa07a;
    box-shadow:
        0 0 6px rgba(255, 160, 122, 0.75),
        0 0 14px rgba(255, 184, 74, 0.35);
}

.singularity {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.singularity.revealed {
    opacity: 1;
}

.point-final {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ffb84a;
    box-shadow:
        0 0 12px rgba(255, 184, 74, 0.9),
        0 0 30px rgba(255, 184, 74, 0.55),
        0 0 60px rgba(255, 184, 74, 0.30),
        0 0 120px rgba(255, 184, 74, 0.15);
    animation: finalPulse 4s ease-in-out infinite;
}

@keyframes finalPulse {
    0%, 100% {
        box-shadow:
            0 0 12px rgba(255, 184, 74, 0.90),
            0 0 30px rgba(255, 184, 74, 0.55),
            0 0 60px rgba(255, 184, 74, 0.30),
            0 0 120px rgba(255, 184, 74, 0.15);
    }
    50% {
        box-shadow:
            0 0 16px rgba(255, 184, 74, 1.0),
            0 0 40px rgba(255, 184, 74, 0.65),
            0 0 80px rgba(255, 184, 74, 0.40),
            0 0 160px rgba(255, 184, 74, 0.20);
    }
}

.label-final {
    font-family: "Fira Code", "Inter", monospace;
    font-weight: 300;
    font-size: 1rem;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 0 16px rgba(106, 234, 255, 0.35);
    display: flex;
    gap: 0.4rem;
}

.label-final .mono {
    font-family: "Fira Code", "Inter", monospace;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .passage {
        font-size: 1.05rem;
        padding: 0 1.25rem;
    }

    .point,
    .collapse-point {
        width: 5px;
        height: 5px;
    }
}

/* Selection in the void glows softly. */
::selection {
    background: rgba(74, 106, 255, 0.35);
    color: rgba(255, 255, 255, 0.95);
}
