/* =========================================================
   bada.cafe — subaquatic meditation chamber
   Blobitecture · Honeyed-Neutral · Gravitational Centering
   Compliance trace: IntersectionObserver with `threshold: 0.3`. Transition: `transition: opacity 1.5s cubic-bezier(0.4 appears at fixed scroll positions. JetBrains Mono" (Google Fonts Space Grotesk" (Google Fonts
   ========================================================= */

:root {
    --sand:       #d4a574;
    --sage:       #5b8a72;
    --teal:       #1a3a4a;
    --midnight:   #0a1a1f;
    --cyan:       #4ecdc4;
    --cream:      #f0e6d3;
    --coral:      #c17c5a;
    --jelly:      rgba(201, 168, 124, 0.15);
    --jelly-deep: rgba(201, 168, 124, 0.08);

    --depth: 0;
    --cursor-x: 50vw;
    --cursor-y: 50vh;

    --ease: cubic-bezier(0.4, 0.0, 0.2, 1);
}

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

html, body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    cursor: none;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-weight: 400;
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: var(--cream);
    background: var(--midnight);
    position: relative;
    min-height: 500vh;
}

/* ---------------------------------------------------------
   Depth gradient — the whole ocean in a fixed layer
   --------------------------------------------------------- */
.depth-gradient {
    position: fixed;
    inset: 0;
    z-index: -3;
    background: linear-gradient(
        to bottom,
        #d4a574 0%,
        #c9a87c 8%,
        #5b8a72 22%,
        #2e5a5a 38%,
        #1a3a4a 55%,
        #0e2430 75%,
        #0a1a1f 100%
    );
    background-size: 100% 100%;
    pointer-events: none;
    transition: filter 0.6s var(--ease);
}

/* An overlay dims the gradient as depth grows (layered depth cue). */
.depth-gradient::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at 50% 0%,
        rgba(240, 230, 211, 0.18) 0%,
        rgba(240, 230, 211, 0.06) 20%,
        transparent 45%
    );
    opacity: calc(1 - var(--depth));
    transition: opacity 0.4s var(--ease);
}

/* Global caustic shimmer over the surface half */
.caustics {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 18%, rgba(240,230,211,0.10) 0%, transparent 22%),
        radial-gradient(circle at 78% 26%, rgba(240,230,211,0.08) 0%, transparent 28%),
        radial-gradient(circle at 50% 12%, rgba(240,230,211,0.10) 0%, transparent 30%);
    animation: caustic-drift 22s ease-in-out infinite;
    opacity: calc(1 - var(--depth) * 1.2);
    mix-blend-mode: screen;
}

@keyframes caustic-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(2vw, 1vh) scale(1.05); }
    66%      { transform: translate(-1.5vw, 2vh) scale(0.97); }
}

/* ---------------------------------------------------------
   Cursor halo (diver's lamp)
   --------------------------------------------------------- */
.cursor-halo {
    position: fixed;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(78, 205, 196, 0.18) 0%,
        rgba(78, 205, 196, 0.08) 35%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 9999;
    transform: translate(-100px, -100px);
    mix-blend-mode: screen;
    transition: width 0.6s var(--ease), height 0.6s var(--ease);
}

/* In deep sections (via body class), halo brightens */
body.is-deep .cursor-halo {
    background: radial-gradient(
        circle,
        rgba(78, 205, 196, 0.38) 0%,
        rgba(78, 205, 196, 0.16) 40%,
        transparent 75%
    );
}

/* ---------------------------------------------------------
   Depth marker (fixed, floating)
   --------------------------------------------------------- */
.depth-marker {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 20;
    font-family: "JetBrains Mono", monospace;
    font-weight: 300;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--sand);
    opacity: 0.55;
    user-select: none;
    mix-blend-mode: difference;
}

.mono {
    font-family: "JetBrains Mono", monospace;
    font-weight: 300;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.72rem;
}

/* ---------------------------------------------------------
   Layer structure — each section is a depth layer
   --------------------------------------------------------- */
.layer {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem;
}

.layer-surface {
    min-height: 100vh;
}

.layer-twilight {
    min-height: 180vh;
    gap: 18vh;
    padding-top: 18vh;
    padding-bottom: 18vh;
}

.layer-midnight {
    min-height: 140vh;
    gap: 14vh;
    padding-top: 20vh;
    padding-bottom: 20vh;
}

.layer-abyss {
    min-height: 80vh;
    padding-top: 18vh;
    padding-bottom: 12vh;
    text-align: center;
}

.depth-tag {
    color: var(--sand);
    opacity: 0.45;
    margin-bottom: 6vh;
    align-self: center;
}

.layer-midnight .depth-tag {
    color: var(--cyan);
    opacity: 0.5;
}

.layer-abyss .depth-tag {
    color: var(--sand);
    opacity: 0.35;
    margin-bottom: 10vh;
}

/* ---------------------------------------------------------
   Hero (Surface)
   --------------------------------------------------------- */
.hero-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 80vh;
}

.hero-hangul {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: "Noto Serif KR", serif;
    font-weight: 300;
    font-size: clamp(6rem, 22vw, 15rem);
    color: rgba(212, 165, 116, 0.10);
    letter-spacing: 0.02em;
    z-index: 0;
    user-select: none;
    animation: hangul-breathe 14s ease-in-out infinite;
}

@keyframes hangul-breathe {
    0%, 100% { opacity: 0.9; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.04); }
}

.hero-blob {
    position: relative;
    z-index: 2;
    width: min(72vw, 640px);
    height: min(72vw, 640px);
    max-width: 640px;
    max-height: 640px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.8rem;
    padding: 4rem 3rem;
    border-radius: 42% 58% 63% 37% / 45% 55% 52% 48%;
    background: rgba(201, 168, 124, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        inset 0 0 60px rgba(240, 230, 211, 0.10),
        inset 0 0 120px rgba(212, 165, 116, 0.18),
        0 20px 80px rgba(26, 58, 74, 0.25);
    animation: blob-breathe 8s ease-in-out infinite;
}

@keyframes blob-breathe {
    0%, 100% { border-radius: 42% 58% 63% 37% / 45% 55% 52% 48%; }
    25%      { border-radius: 48% 52% 56% 44% / 58% 42% 55% 45%; }
    50%      { border-radius: 55% 45% 38% 62% / 52% 48% 57% 43%; }
    75%      { border-radius: 50% 50% 44% 56% / 42% 58% 48% 52%; }
}

.hero-title {
    font-family: "Cormorant Garamond", serif;
    font-weight: 300;
    font-size: clamp(3rem, 10vw, 7rem);
    color: var(--sand);
    letter-spacing: 0.06em;
    line-height: 1.0;
    text-align: center;
    text-shadow: 0 4px 24px rgba(212, 165, 116, 0.25);
}

.hero-sub {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.6vw, 1.05rem);
    color: var(--cream);
    opacity: 0.72;
    letter-spacing: 0.05em;
    text-align: center;
    max-width: 26ch;
}

.scroll-hint {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    color: var(--sand);
    opacity: 0.55;
    animation: hint-float 4.5s ease-in-out infinite;
}

.scroll-hint .scroll-line {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, rgba(212,165,116,0.6), transparent);
}

@keyframes hint-float {
    0%, 100% { transform: translate(-50%, 0); opacity: 0.4; }
    50%      { transform: translate(-50%, 8px); opacity: 0.7; }
}

/* ---------------------------------------------------------
   Blobs (twilight content)
   --------------------------------------------------------- */
.blob {
    position: relative;
    width: min(60vw, 620px);
    padding: 3.2rem 3rem;
    background: rgba(201, 168, 124, 0.14);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow:
        inset 0 0 60px rgba(240, 230, 211, 0.06),
        0 20px 60px rgba(10, 26, 31, 0.35);
    opacity: 0;
    transform: translateY(36px);
    transition:
        opacity 1.5s var(--ease),
        transform 1.5s var(--ease);
}

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

.blob[data-shape="1"] { border-radius: 52% 48% 43% 57% / 45% 58% 42% 55%; animation: blob-morph-1 14s ease-in-out infinite; }
.blob[data-shape="2"] { border-radius: 38% 62% 55% 45% / 60% 40% 58% 42%; animation: blob-morph-2 16s ease-in-out infinite; }
.blob[data-shape="3"] { border-radius: 62% 38% 48% 52% / 42% 58% 46% 54%; animation: blob-morph-3 13s ease-in-out infinite; }
.blob[data-shape="4"] { border-radius: 44% 56% 60% 40% / 56% 44% 52% 48%; animation: blob-morph-4 15s ease-in-out infinite; }
.blob[data-shape="5"] { border-radius: 50% 50% 45% 55% / 50% 50% 55% 45%; animation: blob-morph-5 18s ease-in-out infinite; }
.blob[data-shape="6"] { border-radius: 55% 45% 50% 50% / 48% 52% 46% 54%; animation: blob-morph-6 17s ease-in-out infinite; }

@keyframes blob-morph-1 {
    0%, 100% { border-radius: 52% 48% 43% 57% / 45% 58% 42% 55%; }
    33%      { border-radius: 46% 54% 60% 40% / 52% 48% 57% 43%; }
    66%      { border-radius: 58% 42% 47% 53% / 40% 60% 48% 52%; }
}

@keyframes blob-morph-2 {
    0%, 100% { border-radius: 38% 62% 55% 45% / 60% 40% 58% 42%; }
    33%      { border-radius: 55% 45% 48% 52% / 42% 58% 46% 54%; }
    66%      { border-radius: 48% 52% 62% 38% / 55% 45% 50% 50%; }
}

@keyframes blob-morph-3 {
    0%, 100% { border-radius: 62% 38% 48% 52% / 42% 58% 46% 54%; }
    40%      { border-radius: 44% 56% 57% 43% / 58% 42% 52% 48%; }
    80%      { border-radius: 50% 50% 40% 60% / 48% 52% 58% 42%; }
}

@keyframes blob-morph-4 {
    0%, 100% { border-radius: 44% 56% 60% 40% / 56% 44% 52% 48%; }
    50%      { border-radius: 58% 42% 45% 55% / 40% 60% 44% 56%; }
}

@keyframes blob-morph-5 {
    0%, 100% { border-radius: 50% 50% 45% 55% / 50% 50% 55% 45%; }
    33%      { border-radius: 42% 58% 55% 45% / 58% 42% 48% 52%; }
    66%      { border-radius: 55% 45% 48% 52% / 46% 54% 58% 42%; }
}

@keyframes blob-morph-6 {
    0%, 100% { border-radius: 55% 45% 50% 50% / 48% 52% 46% 54%; }
    50%      { border-radius: 40% 60% 56% 44% / 60% 40% 52% 48%; }
}

/* Alternating gravitational offset */
.blob-left  { transform: translate(-3vw, 36px); }
.blob-right { transform: translate(3vw, 36px); }

.blob-left.reveal.in-view  { transform: translate(-3vw, 0); }
.blob-right.reveal.in-view { transform: translate(3vw, 0); }

.blob .blob-en {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 400;
    font-size: clamp(0.98rem, 1.7vw, 1.12rem);
    color: var(--cream);
    line-height: 1.75;
    letter-spacing: 0.01em;
    margin-bottom: 1.2rem;
}

.blob .blob-ko {
    font-family: "Noto Serif KR", serif;
    font-weight: 300;
    font-size: clamp(0.92rem, 1.5vw, 1.05rem);
    color: var(--sand);
    line-height: 1.85;
    letter-spacing: 0.02em;
    opacity: 0.85;
}

/* ---------------------------------------------------------
   Midnight content
   --------------------------------------------------------- */
.blob-core {
    width: min(70vw, 720px);
    padding: 5rem 4rem;
    background: rgba(26, 58, 74, 0.45);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow:
        inset 0 0 80px rgba(78, 205, 196, 0.14),
        inset 0 0 140px rgba(78, 205, 196, 0.05),
        0 30px 90px rgba(10, 26, 31, 0.55),
        0 0 60px rgba(78, 205, 196, 0.08);
    text-align: center;
    animation: core-glow 9s ease-in-out infinite;
}

@keyframes core-glow {
    0%, 100% {
        box-shadow:
            inset 0 0 80px rgba(78, 205, 196, 0.14),
            inset 0 0 140px rgba(78, 205, 196, 0.05),
            0 30px 90px rgba(10, 26, 31, 0.55),
            0 0 60px rgba(78, 205, 196, 0.08);
    }
    50% {
        box-shadow:
            inset 0 0 100px rgba(78, 205, 196, 0.22),
            inset 0 0 180px rgba(78, 205, 196, 0.08),
            0 30px 90px rgba(10, 26, 31, 0.55),
            0 0 90px rgba(78, 205, 196, 0.14);
    }
}

.poem-en {
    font-family: "Cormorant Garamond", serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.4rem, 2.6vw, 1.9rem);
    color: var(--cream);
    line-height: 1.7;
    letter-spacing: 0.03em;
    margin-bottom: 2.5rem;
}

.poem-ko {
    font-family: "Noto Serif KR", serif;
    font-weight: 300;
    font-size: clamp(1.05rem, 1.9vw, 1.3rem);
    color: var(--sand);
    line-height: 1.9;
    letter-spacing: 0.04em;
    opacity: 0.82;
    margin-bottom: 2.5rem;
}

.core-tag {
    display: inline-block;
    color: var(--cyan);
    opacity: 0.6;
    letter-spacing: 0.2em;
}

.blob-soft {
    width: min(52vw, 540px);
    padding: 3rem 3rem;
    background: rgba(78, 205, 196, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 48% 52% 58% 42% / 55% 45% 50% 50%;
    box-shadow:
        inset 0 0 50px rgba(78, 205, 196, 0.10),
        0 15px 40px rgba(10, 26, 31, 0.5);
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 1.5s var(--ease), transform 1.5s var(--ease);
    animation: blob-morph-6 20s ease-in-out infinite;
}

.blob-soft.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

.blob-en.soft {
    font-size: clamp(0.92rem, 1.6vw, 1.05rem);
    color: var(--cream);
    opacity: 0.88;
    margin-bottom: 1rem;
}

.blob-ko.soft {
    font-size: clamp(0.88rem, 1.4vw, 1rem);
    color: var(--cyan);
    opacity: 0.55;
}

/* ---------------------------------------------------------
   Bioluminescent dots
   --------------------------------------------------------- */
.biolum-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
    opacity: min(1, calc(var(--depth) * 2));
    transition: opacity 0.8s var(--ease);
}

.biolum {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow:
        0 0 4px 1px var(--cyan),
        0 0 12px 4px rgba(78, 205, 196, 0.40),
        0 0 30px 8px rgba(78, 205, 196, 0.15);
    opacity: 0;
    animation: biolum-drift var(--drift-dur, 24s) var(--ease) infinite,
               biolum-pulse var(--pulse-dur, 6s) ease-in-out infinite;
    animation-delay: var(--drift-delay, 0s), var(--pulse-delay, 0s);
}

.biolum.size-s { width: 6px;  height: 6px;  box-shadow: 0 0 3px 1px var(--cyan), 0 0 10px 3px rgba(78,205,196,0.35), 0 0 22px 6px rgba(78,205,196,0.12); }
.biolum.size-l { width: 14px; height: 14px; box-shadow: 0 0 5px 1px var(--cyan), 0 0 16px 6px rgba(78,205,196,0.45), 0 0 40px 12px rgba(78,205,196,0.18); }

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

@keyframes biolum-pulse {
    0%, 100% { opacity: var(--pulse-low, 0.25); }
    50%      { opacity: var(--pulse-high, 0.95); }
}

.biolum-field.sparse .biolum {
    opacity: 0.4;
}

/* ---------------------------------------------------------
   Fish silhouettes
   --------------------------------------------------------- */
.fish {
    position: absolute;
    width: 60px;
    height: 30px;
    pointer-events: none;
    opacity: 0.3;
    animation-name: swim, bob;
    animation-timing-function: cubic-bezier(0.4, 0.0, 0.2, 1), ease-in-out;
    animation-iteration-count: infinite, infinite;
}

.fish-1 {
    top: 25%;
    animation-duration: 35s, 4s;
    animation-delay: 0s, 0s;
    width: 50px;
    height: 24px;
}

.fish-2 {
    top: 30%;
    animation-duration: 25s, 3.5s;
    animation-delay: -8s, -1s;
    width: 42px;
    height: 20px;
    opacity: 0.22;
}

.fish-3 {
    top: 72%;
    animation-duration: 45s, 5.2s;
    animation-delay: -14s, -2s;
    width: 58px;
    height: 28px;
    opacity: 0.35;
}

.fish-body {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 70%;
    height: 100%;
    border-radius: 50%;
    background: rgba(212, 165, 116, 0.55);
    box-shadow: inset 0 0 8px rgba(240, 230, 211, 0.25);
}

.fish-tail {
    position: absolute;
    right: 0;
    top: 50%;
    width: 22px;
    height: 100%;
    transform: translateY(-50%);
    background: rgba(212, 165, 116, 0.45);
    clip-path: polygon(0 20%, 0 80%, 100% 50%);
    transform-origin: left center;
    animation: tail-flick 0.9s ease-in-out infinite;
}

@keyframes tail-flick {
    0%, 100% { transform: translateY(-50%) scaleX(1)   rotate(0deg); }
    50%      { transform: translateY(-50%) scaleX(0.85) rotate(-8deg); }
}

.fish-eye {
    position: absolute;
    left: 18%;
    top: 38%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 4px 1px rgba(78, 205, 196, 0.7);
}

@keyframes swim {
    0%   { transform: translate(110vw, 0); }
    100% { transform: translate(-20vw, 0); }
}

@keyframes bob {
    0%, 100% { margin-top: 0; }
    50%      { margin-top: -18px; }
}

/* ---------------------------------------------------------
   Abyss
   --------------------------------------------------------- */
.abyss-line {
    font-family: "Noto Serif KR", serif;
    font-weight: 300;
    font-size: clamp(1.6rem, 3.6vw, 2.6rem);
    color: var(--sand);
    letter-spacing: 0.18em;
    margin-bottom: 1.5rem;
    opacity: 0.82;
    animation: abyss-glow 6.5s ease-in-out infinite;
}

@keyframes abyss-glow {
    0%, 100% { text-shadow: 0 0 12px rgba(212, 165, 116, 0.25); opacity: 0.72; }
    50%      { text-shadow: 0 0 28px rgba(212, 165, 116, 0.55); opacity: 0.95; }
}

.abyss-sub {
    color: var(--sand);
    opacity: 0.4;
    letter-spacing: 0.26em;
}

/* ---------------------------------------------------------
   Surface caustic pseudo-ish elements (layered)
   --------------------------------------------------------- */
.caustic-a,
.caustic-b {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.55;
}

.caustic-a {
    background:
        radial-gradient(circle at 30% 20%, rgba(240,230,211,0.10) 0%, transparent 18%),
        radial-gradient(circle at 70% 40%, rgba(240,230,211,0.08) 0%, transparent 22%);
    animation: caustic-a-move 24s ease-in-out infinite;
}

.caustic-b {
    background:
        radial-gradient(circle at 60% 15%, rgba(240,230,211,0.07) 0%, transparent 18%),
        radial-gradient(circle at 18% 55%, rgba(240,230,211,0.09) 0%, transparent 26%);
    animation: caustic-b-move 32s ease-in-out infinite;
}

@keyframes caustic-a-move {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(3vw, 2vh) scale(1.08); }
}

@keyframes caustic-b-move {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-2vw, 3vh) scale(0.95); }
}

/* ---------------------------------------------------------
   Responsive tuning
   --------------------------------------------------------- */
@media (max-width: 720px) {
    .blob {
        width: min(88vw, 520px);
        padding: 2.4rem 2rem;
    }
    .blob-core {
        width: min(90vw, 560px);
        padding: 3rem 2rem;
    }
    .blob-soft {
        width: min(82vw, 440px);
        padding: 2rem 2rem;
    }
    .hero-blob {
        width: min(86vw, 420px);
        height: min(86vw, 420px);
        padding: 3rem 2rem;
    }
    .blob-left  { transform: translate(-2vw, 36px); }
    .blob-right { transform: translate(2vw, 36px); }
    .blob-left.reveal.in-view  { transform: translate(-2vw, 0); }
    .blob-right.reveal.in-view { transform: translate(2vw, 0); }
    .depth-marker {
        top: 1rem;
        right: 1rem;
    }
}
