/* =========================================================
   확률.com — Zen Ocean Probability
   Palette: ocean-deep | Typography: playfair-elegant
   Layout: asymmetric, 60%+ negative space
   ========================================================= */

:root {
    /* Ocean-deep palette */
    --abyss:        #060E1A;
    --deep-ocean:   #0A1628;
    --current-blue: #1A3050;
    --depth-blue:   #132840;
    --bio-teal:     #2EC4B6;
    --foam-white:   #E0EAF0;
    --ink-wash:     #4A7A8C;
    --pearl:        #C4D8E0;

    /* Type families */
    --font-display: "Playfair Display", "Noto Serif KR", serif;
    --font-korean:  "Noto Serif KR", "Playfair Display", serif;
    --font-body:    "Libre Baskerville", "Playfair Display", Georgia, serif;
    --font-mono:    "Space Mono", "Inter", ui-monospace, monospace;
}

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

html {
    scroll-behavior: smooth;
    background: var(--deep-ocean);
}

body {
    font-family: var(--font-body);
    color: var(--foam-white);
    background: var(--deep-ocean);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.85;
}

/* =========================================================
   Bubble particle field — fixed across viewport
   ========================================================= */
.bubble-field {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -80px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%,
        rgba(46, 196, 182, 0.30),
        rgba(46, 196, 182, 0.05));
    border: 1px solid rgba(46, 196, 182, 0.15);
    pointer-events: none;
    animation-name: rise;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    will-change: transform, opacity;
}

@keyframes rise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    8% {
        opacity: var(--max-opacity, 0.5);
    }
    50% {
        transform: translateY(-50vh) translateX(calc(var(--drift, 0px) * 0.5));
    }
    92% {
        opacity: var(--max-opacity, 0.5);
    }
    100% {
        transform: translateY(-110vh) translateX(var(--drift, 0px));
        opacity: 0;
    }
}

/* =========================================================
   Ocean container & sections
   ========================================================= */
.ocean {
    position: relative;
    z-index: 2;
}

.section {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    padding: 6vh 8vw;
}

.section--surface { background: var(--deep-ocean); }
.section--current { background: var(--deep-ocean); }
.section--depth   { background: var(--depth-blue); }
.section--still   { background: var(--abyss); }

/* Smooth gradient transitions between sections */
.section--current::before,
.section--depth::before,
.section--still::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 18vh;
    pointer-events: none;
    z-index: 1;
}
.section--current::before { background: linear-gradient(to bottom, var(--deep-ocean), transparent); }
.section--depth::before   { background: linear-gradient(to bottom, var(--deep-ocean), transparent); }
.section--still::before   { background: linear-gradient(to bottom, var(--depth-blue), transparent); }

/* =========================================================
   Section meta — small numerals + labels (asymmetric)
   ========================================================= */
.section__meta {
    position: absolute;
    top: 5vh;
    left: 8vw;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-family: var(--font-mono);
    color: var(--ink-wash);
    z-index: 5;
}

.section__meta--right {
    left: auto;
    right: 8vw;
    text-align: right;
    align-items: flex-end;
}

.section__meta--still {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
}

.numeral {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 2rem;
    font-weight: 400;
    color: var(--pearl);
    letter-spacing: 0.04em;
    line-height: 1;
}

.label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.32em;
    color: var(--ink-wash);
}

/* =========================================================
   SECTION 1 — The Surface
   ========================================================= */
.hero {
    position: absolute;
    top: 25%;
    left: 15%;
    max-width: 38vw;
    z-index: 4;
    animation: surface-rise 2s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes surface-rise {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero__korean {
    font-family: var(--font-korean);
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 8rem);
    color: var(--pearl);
    line-height: 1;
    letter-spacing: 0.02em;
}

.hero__roman {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.1rem, 1.6vw, 1.35rem);
    color: var(--bio-teal);
    margin-top: 1.4rem;
    letter-spacing: 0.08em;
    text-transform: lowercase;
}

.hero__notation {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--ink-wash);
    margin-top: 0.8rem;
    letter-spacing: 0.04em;
}

.hero__notation-em {
    color: var(--bio-teal);
    font-style: italic;
}

/* Watercolor placements */
.watercolor {
    position: absolute;
    pointer-events: none;
    z-index: 2;
}

.watercolor--surface {
    bottom: -8%;
    right: -6%;
    width: 46vw;
    height: 46vw;
    max-width: 720px;
    max-height: 720px;
    opacity: 0.85;
}

.watercolor--current {
    top: 12%;
    left: -8%;
    width: 60vw;
    height: 60vw;
    max-width: 900px;
    max-height: 900px;
    opacity: 0.85;
}

.watercolor--depth-a {
    top: -10%;
    right: -5%;
    width: 55vw;
    height: 55vw;
    max-width: 800px;
    max-height: 800px;
}

.watercolor--depth-b {
    bottom: -15%;
    right: 10%;
    width: 35vw;
    height: 35vw;
    max-width: 500px;
    max-height: 500px;
}

/* =========================================================
   Bubble clusters (anchored, not particles)
   ========================================================= */
.bubble-cluster {
    position: absolute;
    z-index: 3;
    pointer-events: none;
}

.bubble-cluster--surface {
    bottom: 18%;
    right: 12%;
    width: 100px;
    height: 100px;
    animation: drift 14s ease-in-out infinite;
}

.bubble-cluster--depth {
    bottom: 14%;
    right: 12%;
    width: 100px;
    height: 100px;
    animation: drift 18s ease-in-out infinite reverse;
}

.bubble-cluster--still {
    top: 60%;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    animation: drift 22s ease-in-out infinite;
}

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

.bubble-cluster--still {
    /* Override drift translate to keep the X-centering */
    animation-name: drift-still;
}
@keyframes drift-still {
    0%, 100% { transform: translate(-50%, 0); }
    50%      { transform: translate(calc(-50% + 6px), -8px); }
}

.cluster-bubble {
    position: absolute;
    width: var(--size);
    height: var(--size);
    left: var(--x);
    top: var(--y);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%,
        rgba(46, 196, 182, 0.32),
        rgba(46, 196, 182, 0.06));
    border: 1px solid rgba(46, 196, 182, 0.18);
}

/* =========================================================
   Scroll cue
   ========================================================= */
.scroll-cue {
    position: absolute;
    bottom: 5vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    z-index: 5;
    animation: scroll-cue-fade 4s ease-in-out infinite;
}

.scroll-cue__line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--ink-wash), transparent);
}

.scroll-cue__word {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: lowercase;
    letter-spacing: 0.4em;
    color: var(--ink-wash);
}

@keyframes scroll-cue-fade {
    0%, 100% { opacity: 0.4; transform: translate(-50%, 0); }
    50%      { opacity: 0.9; transform: translate(-50%, 6px); }
}

/* =========================================================
   Prose blocks (Sections 2 & 3)
   ========================================================= */
.prose {
    position: absolute;
    z-index: 4;
    max-width: 480px;
}

.prose--right {
    top: 32%;
    right: 8vw;
    width: 38vw;
}

.prose--left {
    top: 28%;
    left: 8vw;
    width: 35vw;
}

.prose__heading {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: var(--pearl);
    line-height: 1.12;
    letter-spacing: 0.02em;
    margin-bottom: 2.4rem;
}

.prose__heading em {
    font-style: italic;
    font-weight: 400;
    color: var(--bio-teal);
}

.prose__paragraph {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    color: var(--foam-white);
    line-height: 1.85;
    margin-bottom: 1.4rem;
}

.prose__paragraph em {
    color: var(--bio-teal);
    font-style: italic;
}

.prose__fragment {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    color: var(--ink-wash);
    margin-top: 2rem;
    letter-spacing: 0.04em;
}

.prose__notation-row {
    margin: 1.6rem 0 1.4rem;
}

.notation {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--bio-teal);
    letter-spacing: 0.04em;
    padding: 0.3rem 0.6rem;
    background: rgba(46, 196, 182, 0.05);
    border-left: 2px solid rgba(46, 196, 182, 0.35);
}

/* =========================================================
   SECTION 4 — The Still Point
   ========================================================= */
.still-point {
    position: absolute;
    top: 38%;
    left: 18%;
    max-width: 40vw;
    z-index: 4;
}

.still-point__phrase {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.4rem, 5vw, 4.4rem);
    color: var(--pearl);
    line-height: 1.1;
    letter-spacing: 0.02em;
}

.still-point__phrase em {
    font-style: italic;
    font-weight: 400;
    color: var(--bio-teal);
}

.still-point__notation {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--ink-wash);
    margin-top: 2.2rem;
    letter-spacing: 0.36em;
    text-transform: lowercase;
}

.abyss-mark {
    position: absolute;
    bottom: 6vh;
    right: 8vw;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--ink-wash);
    letter-spacing: 0.32em;
    text-transform: lowercase;
    z-index: 5;
    display: flex;
    gap: 0.8rem;
    align-items: center;
    opacity: 0.7;
}

.abyss-mark__dash {
    color: var(--bio-teal);
    opacity: 0.6;
}

/* =========================================================
   Shake (Zen Disruption) keyframes
   ========================================================= */
@keyframes zen-shake {
    0%, 100% { transform: translateX(0); }
    10%      { transform: translateX(-3px); }
    30%      { transform: translateX(4px); }
    50%      { transform: translateX(-5px); }
    70%      { transform: translateX(3px); }
    90%      { transform: translateX(-2px); }
}

/* =========================================================
   Reveal-on-scroll (subtle)
   ========================================================= */
.section .prose,
.section .still-point,
.section .hero {
    transition: opacity 1.4s ease, transform 1.4s ease;
}

.section.is-out .prose,
.section.is-out .still-point {
    opacity: 0.45;
}

.section.is-in .prose,
.section.is-in .still-point {
    opacity: 1;
}

/* =========================================================
   Responsive — keep asymmetry, soften extremes
   ========================================================= */
@media (max-width: 760px) {
    .section { padding: 8vh 6vw; }

    .hero {
        top: 22%;
        left: 8%;
        max-width: 80vw;
    }

    .prose--right {
        top: 30%;
        right: 6vw;
        width: 80vw;
    }

    .prose--left {
        top: 26%;
        left: 6vw;
        width: 80vw;
    }

    .still-point {
        top: 32%;
        left: 10%;
        max-width: 80vw;
    }

    .watercolor--surface { width: 80vw; height: 80vw; bottom: -20%; right: -20%; }
    .watercolor--current { width: 90vw; height: 90vw; }
    .watercolor--depth-a { width: 90vw; height: 90vw; }
    .watercolor--depth-b { width: 60vw; height: 60vw; }

    .abyss-mark { font-size: 0.6rem; right: 6vw; }
}
