/* bada.quest - Ocean Descent Experience */

:root {
    --bg-primary: #7ECFC0;
    --text-primary: #1B3B4A;
    --accent: #F0E6D2;

    /* Zone Colors */
    --surface-bg: #7ECFC0;
    --surface-text: #1B3B4A;
    --surface-accent: #F0E6D2;

    --photic-bg: #2A8B9A;
    --photic-text: #E8F4F0;
    --photic-accent: #C9A96E;

    --twilight-bg: #0E3B5E;
    --twilight-text: #A8D8E0;
    --twilight-accent: #4ECDC4;

    --midnight-bg: #061425;
    --midnight-text: #6BCCC8;
    --midnight-accent: #E8F5A3;

    --hadal-bg: #020208;
    --hadal-text: #3AAFA9;
    --hadal-accent: #F7F7F7;

    --ascent-bg: #7ECFC0;
    --ascent-text: #1B3B4A;
    --ascent-accent: #FF8C6B;

    --driftwood: #D4A574;
    --urchin-purple: #8B5E83;
}

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

html {
    scroll-behavior: auto;
    overflow-x: hidden;
}

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    cursor: default;
}

/* Depth Gauge */
.depth-gauge {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
}

.depth-value {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-primary);
    opacity: 0.6;
    transition: color 1s ease;
}

.depth-ticks {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.depth-tick {
    width: 20px;
    height: 1px;
    background: currentColor;
    opacity: 0.25;
    transition: opacity 0.3s;
}

.depth-tick.active {
    opacity: 0.7;
    width: 30px;
}

/* Zone Base */
.zone {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.zone-surface {
    height: 100vh;
    background: linear-gradient(180deg, #7ECFC0 0%, #5BB8B0 50%, #3DA8A0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.zone-photic {
    min-height: 200vh;
    background: linear-gradient(180deg, #3DA8A0 0%, #2A8B9A 30%, #1A6B7A 70%, #0E3B5E 100%);
    padding: 10vh 0;
}

.zone-twilight {
    min-height: 200vh;
    background: linear-gradient(180deg, #0E3B5E 0%, #092D4A 40%, #061425 100%);
    padding: 10vh 0;
}

.zone-midnight {
    min-height: 200vh;
    background: linear-gradient(180deg, #061425 0%, #040E1A 30%, #030A12 60%, #020208 100%);
    padding: 10vh 0;
}

.zone-hadal {
    height: 200vh;
    background: #020208;
    position: relative;
    cursor: none;
}

.zone-ascent {
    min-height: 100vh;
    background: linear-gradient(180deg, #020208 0%, #0E3B5E 20%, #2A8B9A 50%, #7ECFC0 80%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10vh 0;
}

/* Watercolor Washes */
.watercolor-wash {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: filter;
}

.wash-1 {
    width: 60vw;
    height: 60vw;
    top: -10vw;
    left: -10vw;
    background: radial-gradient(ellipse, rgba(126, 207, 192, 0.4) 0%, transparent 70%);
    filter: blur(80px);
}

.wash-2 {
    width: 50vw;
    height: 50vw;
    bottom: -5vw;
    right: -5vw;
    background: radial-gradient(ellipse, rgba(240, 230, 210, 0.3) 0%, transparent 70%);
    filter: blur(100px);
}

.wash-3 {
    width: 40vw;
    height: 40vw;
    top: 30%;
    left: 40%;
    background: radial-gradient(ellipse, rgba(91, 184, 176, 0.35) 0%, transparent 70%);
    filter: blur(90px);
}

.wash-photic-1 {
    width: 70vw;
    height: 70vw;
    top: 5%;
    left: -15vw;
    background: radial-gradient(ellipse, rgba(42, 139, 154, 0.35) 0%, transparent 70%);
    filter: blur(100px);
}

.wash-photic-2 {
    width: 55vw;
    height: 55vw;
    top: 40%;
    right: -10vw;
    background: radial-gradient(ellipse, rgba(201, 169, 110, 0.2) 0%, transparent 70%);
    filter: blur(120px);
}

.wash-photic-3 {
    width: 45vw;
    height: 45vw;
    bottom: 10%;
    left: 20%;
    background: radial-gradient(ellipse, rgba(14, 59, 94, 0.3) 0%, transparent 70%);
    filter: blur(90px);
}

.wash-twilight-1 {
    width: 80vw;
    height: 80vw;
    top: -20%;
    left: -20vw;
    background: radial-gradient(ellipse, rgba(14, 59, 94, 0.3) 0%, transparent 70%);
    filter: blur(120px);
}

.wash-twilight-2 {
    width: 60vw;
    height: 60vw;
    bottom: 0;
    right: -10vw;
    background: radial-gradient(ellipse, rgba(78, 205, 196, 0.15) 0%, transparent 70%);
    filter: blur(100px);
}

.wash-ascent-1 {
    width: 70vw;
    height: 70vw;
    top: 20%;
    left: -10vw;
    background: radial-gradient(ellipse, rgba(126, 207, 192, 0.3) 0%, transparent 70%);
    filter: blur(100px);
}

.wash-ascent-2 {
    width: 50vw;
    height: 50vw;
    top: 40%;
    right: -5vw;
    background: radial-gradient(ellipse, rgba(255, 140, 107, 0.2) 0%, transparent 70%);
    filter: blur(80px);
}

/* Caustic Light */
.caustic-light {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 30% 40% at 20% 30%, rgba(255,255,255,0.08) 0%, transparent 100%),
        radial-gradient(ellipse 25% 35% at 70% 60%, rgba(255,255,255,0.06) 0%, transparent 100%),
        radial-gradient(ellipse 20% 30% at 50% 80%, rgba(255,255,255,0.05) 0%, transparent 100%);
    animation: causticMove1 17s ease-in-out infinite, causticMove2 23s ease-in-out infinite;
}

.caustic-photic {
    animation: causticMove1 23s ease-in-out infinite, causticMove2 31s ease-in-out infinite;
    opacity: 0.7;
}

@keyframes causticMove1 {
    0%, 100% { background-position: 0% 0%, 100% 100%, 50% 50%; }
    50% { background-position: 100% 50%, 0% 0%, 80% 20%; }
}

@keyframes causticMove2 {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(3deg); }
}

/* Surface Content */
.surface-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.site-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: clamp(48px, 8vw, 72px);
    letter-spacing: 0.08em;
    color: var(--surface-text);
    animation: waveFloat 4s ease-in-out infinite;
}

.korean-title {
    font-family: 'Noto Serif KR', serif;
    font-weight: 300;
    font-size: clamp(60px, 12vw, 100px);
    color: var(--surface-text);
    opacity: 0.4;
    margin-top: 10px;
    animation: waveFloat 4s ease-in-out infinite 0.5s;
}

@keyframes waveFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.chevron-down, .chevron-up {
    margin-top: 40px;
    color: var(--surface-text);
    opacity: 0.5;
    animation: chevronPulse 2.5s ease-in-out infinite;
    cursor: pointer;
}

.chevron-up {
    margin-top: 30px;
    color: var(--ascent-text);
}

@keyframes chevronPulse {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 0.7; transform: translateY(5px); }
}

/* Ripple Effect */
.ripple-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

.ripple {
    position: absolute;
    border: 1.5px solid rgba(27, 59, 74, 0.3);
    border-radius: 50%;
    animation: rippleExpand 2s ease-out forwards;
    pointer-events: none;
}

@keyframes rippleExpand {
    0% { width: 0; height: 0; opacity: 0.6; }
    100% { width: 300px; height: 300px; opacity: 0; }
}

/* Water Calligraphy */
.water-calligraphy {
    position: absolute;
    top: 20%;
    left: 10%;
    font-family: 'Noto Serif KR', serif;
    font-size: 40vw;
    color: var(--photic-text);
    opacity: 0.03;
    pointer-events: none;
    line-height: 1;
    z-index: 0;
}

/* Text Passages */
.passage {
    position: relative;
    z-index: 10;
    max-width: 500px;
    padding: 5vh 5vw;
}

.passage-left {
    margin-right: auto;
    margin-left: 8vw;
}

.passage-right {
    margin-left: auto;
    margin-right: 8vw;
}

.passage-center {
    margin: 0 auto;
    text-align: center;
    max-width: 600px;
}

.text-en {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: 20px;
    line-height: 1.85;
    color: var(--photic-text);
    margin-bottom: 12px;
}

.text-kr {
    font-family: 'Noto Serif KR', serif;
    font-weight: 300;
    font-size: 18px;
    line-height: 2.0;
    color: var(--photic-text);
    opacity: 0.8;
}

.zone-twilight .text-en {
    color: var(--twilight-text);
}

.zone-twilight .text-kr {
    color: var(--twilight-text);
}

/* Blur Reveal Animation */
.blur-reveal {
    opacity: 0;
    filter: blur(8px);
    transition: opacity 2.5s ease-out, filter 2.5s ease-out;
    will-change: filter, opacity;
}

.blur-reveal.revealed {
    opacity: 1;
    filter: blur(0);
}

/* Marine Creatures (SVG) */
.creature {
    position: absolute;
    z-index: 5;
    pointer-events: none;
}

.creature-jellyfish {
    width: 100px;
    right: 10vw;
    top: 15%;
    stroke: rgba(232, 244, 240, 0.3);
    animation: creatureDrift1 25s ease-in-out infinite;
}

.creature-turtle {
    width: 120px;
    left: 5vw;
    top: 50%;
    stroke: rgba(232, 244, 240, 0.25);
    animation: creatureDrift2 30s ease-in-out infinite;
}

.creature-anglerfish {
    width: 140px;
    right: 15vw;
    top: 10%;
    stroke: var(--midnight-text);
    opacity: 0.4;
}

.creature-squid {
    width: 100px;
    left: 10vw;
    top: 40%;
    stroke: var(--midnight-text);
    opacity: 0.35;
}

.creature-tubeworms {
    width: 90px;
    right: 25vw;
    top: 70%;
    stroke: var(--midnight-accent);
    opacity: 0.3;
}

.creature-jellyfish-sm {
    width: 60px;
    position: relative;
    stroke: rgba(27, 59, 74, 0.4);
    display: inline-block;
    margin: 20px;
}

.creature-turtle-sm {
    width: 80px;
    position: relative;
    stroke: rgba(27, 59, 74, 0.35);
    display: inline-block;
    margin: 20px;
}

.draw-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 5s ease-out;
}

.draw-path.drawn {
    stroke-dashoffset: 0;
}

@keyframes creatureDrift1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-30px, 15px) rotate(2deg); }
    50% { transform: translate(10px, -10px) rotate(-1deg); }
    75% { transform: translate(-15px, 5px) rotate(1deg); }
}

@keyframes creatureDrift2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(25px, -20px) rotate(-2deg); }
    66% { transform: translate(-20px, 10px) rotate(1.5deg); }
}

/* Wave Dividers */
.wave-divider {
    width: 100%;
    height: 40px;
    position: relative;
    z-index: 10;
    margin: 5vh 0;
}

.wave-path {
    stroke: var(--driftwood);
    opacity: 0.4;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 3s ease-out;
}

.wave-path.drawn {
    stroke-dashoffset: 0;
}

.wave-twilight .wave-path {
    stroke: var(--twilight-accent);
    opacity: 0.3;
}

/* Horizontal Gallery */
.horizontal-gallery {
    position: relative;
    width: 100%;
    height: 50vh;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 10vh 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.horizontal-gallery::-webkit-scrollbar {
    display: none;
}

.gallery-track {
    display: flex;
    height: 100%;
    width: max-content;
}

.gallery-panel {
    width: 80vw;
    height: 100%;
    flex-shrink: 0;
    scroll-snap-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.panel-wash {
    position: absolute;
    inset: 0;
    filter: blur(60px);
}

.panel-mediterranean .panel-wash {
    background: radial-gradient(ellipse at center, rgba(42, 139, 200, 0.4) 0%, rgba(14, 59, 94, 0.6) 100%);
}

.panel-arctic .panel-wash {
    background: radial-gradient(ellipse at center, rgba(192, 210, 220, 0.4) 0%, rgba(14, 59, 94, 0.6) 100%);
}

.panel-redsea .panel-wash {
    background: radial-gradient(ellipse at center, rgba(210, 120, 100, 0.4) 0%, rgba(14, 59, 94, 0.6) 100%);
}

.panel-blacksea .panel-wash {
    background: radial-gradient(ellipse at center, rgba(20, 60, 50, 0.5) 0%, rgba(14, 59, 94, 0.6) 100%);
}

.panel-label {
    position: relative;
    z-index: 10;
    font-family: 'Noto Serif KR', serif;
    font-weight: 300;
    font-size: 22px;
    color: var(--twilight-text);
    text-align: center;
    line-height: 1.8;
}

.panel-label .coords {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.6;
}

/* Glow Fragments (Midnight) */
.glow-fragment {
    position: relative;
    z-index: 10;
    max-width: 500px;
    padding: 5vh 5vw;
    margin: 10vh auto;
}

.glow-fragment .text-en,
.glow-fragment .text-kr {
    color: var(--midnight-text);
    text-shadow: 0 0 20px rgba(107, 204, 200, 0.3), 0 0 40px rgba(107, 204, 200, 0.1);
    text-align: center;
}

.glow-fragment .text-kr {
    color: var(--midnight-text);
}

/* Bioluminescent Dots */
.bio-dot {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: bioPulse var(--pulse-duration, 3s) ease-in-out infinite;
    animation-delay: var(--pulse-delay, 0s);
}

@keyframes bioPulse {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 0.8; transform: scale(1); }
}

/* Hadal Zone */
.hadal-light {
    position: fixed;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(58, 175, 169, 0.15) 0%, rgba(58, 175, 169, 0.05) 40%, transparent 70%);
    pointer-events: none;
    z-index: 20;
    transform: translate(-50%, -50%);
    display: none;
    will-change: transform;
}

.hadal-content {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.hadal-fragment {
    position: absolute;
    opacity: 0;
    transition: opacity 0.5s ease;
    text-align: center;
    pointer-events: none;
}

.hadal-fragment p {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: 24px;
    color: var(--hadal-text);
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.hadal-fragment .text-kr {
    font-family: 'Noto Serif KR', serif;
    color: var(--hadal-text);
}

.hadal-fragment .coords {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 12px;
    letter-spacing: 0.15em;
    color: var(--hadal-text);
    opacity: 0.6;
}

.hadal-fragment .depth-label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.15em;
    color: var(--hadal-accent);
    opacity: 0.5;
    margin-top: 4px;
}

.hadal-fragment.visible {
    opacity: 1;
}

.hadal-fragment.discovered {
    animation: discoveredPulse 1s ease-out;
}

@keyframes discoveredPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.hadal-dots .bio-dot {
    z-index: 5;
}

/* Ascent */
.ascent-montage {
    text-align: center;
    margin-bottom: 40px;
}

.ascent-content {
    text-align: center;
    position: relative;
    z-index: 10;
}

.ascent-title {
    font-family: 'Noto Serif KR', serif;
    font-weight: 400;
    font-size: clamp(36px, 6vw, 60px);
    color: var(--ascent-text);
    letter-spacing: 0.05em;
}

.ascent-subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: 22px;
    color: var(--ascent-text);
    opacity: 0.7;
    margin-top: 10px;
    letter-spacing: 0.08em;
}

/* Interactive link underline-draw */
a.sea-link {
    color: var(--photic-accent);
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;
    transition: background-size 0.4s ease-out;
    padding-bottom: 2px;
}

a.sea-link:hover {
    background-size: 100% 2px;
    color: var(--urchin-purple);
}

/* Responsive */
@media (max-width: 768px) {
    .passage-left {
        margin-left: 5vw;
    }
    .passage-right {
        margin-right: 5vw;
    }
    .depth-gauge {
        right: 10px;
    }
    .gallery-panel {
        width: 90vw;
    }
    .creature {
        transform: scale(0.7);
    }
}
