/* ============================================
   bada.city v2 -- Deep Sea Descent
   Fonts: Tenor Sans, Cormorant Garamond, Noto Serif KR
   ============================================ */

/* ---- Depth Color Palette Reference ----
   Surface:    #C8F0F4
   Shallow:    #7ECEC9
   Mid-depth:  #1B4D6E
   Twilight:   #0A1628
   Abyss:      #030810
   Bio-A:      #00E5FF
   Bio-B:      #00BFA5
   Text:       #FFFFFF
   ---------------------------------------- */

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    --color-surface: #C8F0F4;
    --color-shallow: #7ECEC9;
    --color-mid: #1B4D6E;
    --color-twilight: #0A1628;
    --color-abyss: #030810;
    --color-bio-a: #00E5FF;
    --color-bio-b: #00BFA5;
    --color-text: #FFFFFF;
}

body {
    background-color: #C8F0F4;
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: clamp(16px, 1.8vw, 22px);
    line-height: 1.9;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---- Particle Canvas (fixed behind everything) ---- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

/* ---- Depth Gauge ---- */
#depth-gauge {
    position: fixed;
    right: 20px;
    top: 10vh;
    height: 80vh;
    width: 1px;
    z-index: 100;
}

#depth-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 100%;
    background: #00E5FF;
    opacity: 0.3;
}

#depth-indicator {
    position: absolute;
    top: 0;
    left: -4px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #00E5FF;
    opacity: 0.6;
    transition: top 0.1s linear;
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

/* ---- Main Container ---- */
#ocean-descent {
    position: relative;
    z-index: 2;
    width: 100%;
}

/* ---- SVG Filter (hidden) ---- */
#refraction-filter {
    position: absolute;
    width: 0;
    height: 0;
}

/* ============================================
   SURFACE ZONE (0-100vh)
   ============================================ */
#surface-zone {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#surface-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* Logotype */
.logotype {
    font-family: 'Tenor Sans', 'Helvetica Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(36px, 6vw, 96px);
    letter-spacing: 0.08em;
    color: #FFFFFF;
    opacity: 0;
    transition: opacity 1200ms ease-out;
    text-transform: lowercase;
}

.logotype.visible {
    opacity: 0.6;
}

/* Korean anchor */
.korean-anchor {
    font-family: 'Noto Serif KR', serif;
    font-weight: 300;
    font-size: clamp(28px, 4vw, 64px);
    color: rgba(255, 255, 255, 0.5);
    opacity: 0;
    transition: opacity 1200ms ease-out;
    animation: korean-pulse 4s ease-in-out infinite;
    animation-play-state: paused;
}

.korean-anchor.visible {
    opacity: 0.5;
    animation-play-state: running;
}

@keyframes korean-pulse {
    0%, 100% { transform: scale(1.0); }
    50% { transform: scale(1.02); }
}

/* Scroll chevrons */
.scroll-chevrons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-top: 2rem;
    opacity: 0;
    transition: opacity 800ms ease-out;
}

.scroll-chevrons.visible {
    opacity: 1;
}

.chevron {
    display: block;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.4);
    line-height: 0.8;
    animation: chevron-fade 2s ease-in-out infinite;
}

.chevron-1 { animation-delay: 0s; }
.chevron-2 { animation-delay: 0.3s; }
.chevron-3 { animation-delay: 0.6s; }

@keyframes chevron-fade {
    0%, 100% { opacity: 0.15; transform: translateY(0); }
    50% { opacity: 0.6; transform: translateY(3px); }
}

/* ============================================
   PHOTIC ZONE (100vh-300vh)
   ============================================ */
#photic-zone {
    min-height: 200vh;
    position: relative;
    padding: 10vh 5vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30vh;
}

/* Floating cards */
.floating-card {
    position: sticky;
    max-width: 520px;
    width: 90%;
    padding: 2.5rem 3rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    opacity: 0;
    filter: blur(8px);
    transition: opacity 600ms ease-out, filter 600ms ease-out, transform 300ms ease-out;
}

.floating-card.in-view {
    opacity: 1;
    filter: blur(0);
}

.card-1 { top: 20vh; align-self: flex-start; margin-left: 10%; }
.card-2 { top: 35vh; align-self: flex-end; margin-right: 10%; }
.card-3 { top: 50vh; align-self: flex-start; margin-left: 15%; }
.card-4 { top: 25vh; align-self: flex-end; margin-right: 5%; }

.floating-card p {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: clamp(16px, 1.8vw, 22px);
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.85);
}

/* ============================================
   TWILIGHT ZONE (300vh-500vh)
   ============================================ */
#twilight-zone {
    min-height: 200vh;
    position: relative;
    padding: 10vh 5vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
}

.twilight-text {
    text-align: center;
    max-width: 600px;
    opacity: 0;
    transition: opacity 800ms ease-out;
}

.twilight-text.in-view {
    opacity: 1;
}

.twilight-text p {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: clamp(18px, 2.2vw, 28px);
    line-height: 2;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

/* Wave dividers */
.wave-divider {
    width: 100%;
    height: 60px;
    overflow: visible;
}

.wave-path {
    animation: wave-undulate 6s ease-in-out infinite;
}

@keyframes wave-undulate {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

.wave-bottom .wave-path {
    animation-duration: 8s;
}

/* Jellyfish */
#jellyfish-container {
    width: 100%;
    max-width: 400px;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5vh 0;
}

#jellyfish-svg {
    width: 100%;
    height: 100%;
}

.jelly-bell,
.jelly-bell-detail-1,
.jelly-bell-detail-2,
.jelly-tentacle,
.jelly-oral {
    stroke-dasharray: var(--path-length);
    stroke-dashoffset: var(--path-length);
    transition: stroke-dashoffset 3s ease-in-out;
}

.jellyfish-drawn .jelly-bell,
.jellyfish-drawn .jelly-bell-detail-1,
.jellyfish-drawn .jelly-bell-detail-2,
.jellyfish-drawn .jelly-tentacle,
.jellyfish-drawn .jelly-oral {
    stroke-dashoffset: 0;
}

/* Tentacle wave animation */
.jellyfish-drawn .tentacle-1 { animation: wave-tentacle 4s ease-in-out infinite; }
.jellyfish-drawn .tentacle-2 { animation: wave-tentacle 4s ease-in-out infinite 0.3s; }
.jellyfish-drawn .tentacle-3 { animation: wave-tentacle 4s ease-in-out infinite 0.6s; }
.jellyfish-drawn .tentacle-4 { animation: wave-tentacle 4s ease-in-out infinite 0.9s; }
.jellyfish-drawn .tentacle-5 { animation: wave-tentacle 4s ease-in-out infinite 1.2s; }

.jellyfish-drawn .oral-1 { animation: wave-tentacle 5s ease-in-out infinite 0.2s; }
.jellyfish-drawn .oral-2 { animation: wave-tentacle 5s ease-in-out infinite 0.5s; }

@keyframes wave-tentacle {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}

/* ============================================
   ABYSSAL ZONE (500vh-700vh)
   ============================================ */
#abyssal-zone {
    min-height: 200vh;
    position: relative;
    padding: 10vh 5vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
}

.abyss-text {
    text-align: center;
    max-width: 700px;
    opacity: 0;
    transition: opacity 1500ms ease-out, text-shadow 1500ms ease-out;
}

.abyss-text p {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: clamp(18px, 2.5vw, 32px);
    line-height: 2;
    color: #00BFA5;
    text-shadow: 0 0 0px rgba(0, 191, 165, 0);
}

.abyss-text.glow-in p {
    text-shadow: 0 0 30px rgba(0, 191, 165, 0.6);
}

.abyss-text.glow-in {
    opacity: 1;
}

.abyss-text.glow-out {
    opacity: 0;
    transition: opacity 2000ms ease-out;
}

/* Korean abyss text */
.abyss-text-5 p {
    font-family: 'Noto Serif KR', serif;
    font-weight: 300;
}

/* Final deep point */
#abyss-final {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10vh 0;
    width: 100%;
}

#deep-glow {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.15) 0%, rgba(0, 229, 255, 0.05) 40%, transparent 70%);
    animation: deep-pulse 4s ease-in-out infinite;
    position: absolute;
}

@keyframes deep-pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 1; }
}

#final-text {
    position: relative;
    z-index: 5;
}

#final-text,
.abyss-text-final {
    font-family: 'Noto Serif KR', serif;
    font-weight: 300;
    font-size: clamp(20px, 3vw, 40px);
    color: #00E5FF;
    text-shadow: 0 0 40px rgba(0, 229, 255, 0.5);
}

/* ============================================
   WATERMARK GLYPHS
   ============================================ */
.watermark-glyph {
    position: absolute;
    font-family: 'Noto Serif KR', serif;
    font-weight: 400;
    font-size: 20vw;
    opacity: 0.03;
    color: #FFFFFF;
    pointer-events: none;
    z-index: 0;
    user-select: none;
    line-height: 1;
}

.watermark-1 {
    top: 20%;
    left: -5%;
}

.watermark-2 {
    top: 30%;
    right: -5%;
}

.watermark-3 {
    top: 40%;
    left: 10%;
    color: #00E5FF;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .floating-card {
        margin-left: 5% !important;
        margin-right: 5% !important;
        padding: 1.5rem 2rem;
    }

    #depth-gauge {
        right: 10px;
    }

    #jellyfish-container {
        max-width: 280px;
        height: 45vh;
    }

    .watermark-glyph {
        font-size: 30vw;
    }
}
