/* ============================================
   bada.moe - Deep Sea Descent
   Color Palette:
   - Abyssal Black:       #050A14
   - Deep Cerulean:       #0B3D6E
   - Bioluminescent Teal: #00FFCC
   - Jellyfish Pink:      #FF6EC7
   - Electric Ice:        #7DF9FF
   - Pearl White:         #E8F0F8
   - Seafoam Gray:        #8BA7BF
   - Deep Violet:         #0D0015
   - Golden Caustic:      #F0D68A
   - Dark Cerulean:       #071E3D
   ============================================ */

/* === CSS Custom Properties === */
:root {
    --abyssal-black: #050A14;
    --deep-cerulean: #0B3D6E;
    --dark-cerulean: #071E3D;
    --bio-teal: #00FFCC;
    --jelly-pink: #FF6EC7;
    --electric-ice: #7DF9FF;
    --pearl-white: #E8F0F8;
    --seafoam-gray: #8BA7BF;
    --deep-violet: #0D0015;
    --golden-caustic: #F0D68A;

    --scroll-depth: 0;
    --zone-progress: 0;

    --font-display: 'Quicksand', sans-serif;
    --font-body: 'Crimson Pro', serif;
    --font-accent: 'Zen Kaku Gothic New', sans-serif;
}

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

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

body {
    background-color: var(--deep-cerulean);
    color: var(--pearl-white);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.75;
    font-size: clamp(16px, 1.8vw, 20px);
    overflow-x: hidden;
    position: relative;
}

/* === Caustic SVG Filter Defs (hidden) === */
.caustic-filter-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* === Particle Field === */
.particle-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: particle-float linear infinite, particle-pulse ease-in-out infinite;
    will-change: transform, opacity;
}

.particle--teal {
    background: radial-gradient(circle, var(--bio-teal), transparent 70%);
    box-shadow: 0 0 6px var(--bio-teal);
}

.particle--pink {
    background: radial-gradient(circle, var(--jelly-pink), transparent 70%);
    box-shadow: 0 0 6px var(--jelly-pink);
}

.particle--ice {
    background: radial-gradient(circle, var(--electric-ice), transparent 70%);
    box-shadow: 0 0 6px var(--electric-ice);
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) translateX(0);
    }
    100% {
        transform: translateY(-20vh) translateX(var(--particle-drift, 20px));
    }
}

@keyframes particle-pulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: var(--particle-max-opacity, 0.6); }
}

/* === Bubble Columns === */
.bubble-column {
    position: fixed;
    top: 0;
    width: 60px;
    height: 100vh;
    pointer-events: none;
    z-index: 4;
    overflow: hidden;
}

.bubble-column-left {
    left: 0;
}

.bubble-column-right {
    right: 0;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.4), transparent 70%);
    border: 1px solid rgba(255,255,255,0.2);
    bottom: -20px;
    animation: bubble-rise linear infinite;
    will-change: transform;
}

@keyframes bubble-rise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    5% {
        opacity: 0.7;
    }
    95% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(-110vh) translateX(var(--bubble-wobble, 10px));
        opacity: 0;
    }
}

/* === Depth Gauge Navigation === */
.depth-gauge {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    height: 300px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.depth-gauge.visible {
    opacity: 1;
}

.depth-gauge-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: rgba(0, 255, 204, 0.3);
    clip-path: inset(0 0 100% 0);
    transition: clip-path 1.2s ease;
}

.depth-gauge.visible .depth-gauge-line {
    clip-path: inset(0 0 0% 0);
}

.depth-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px;
    transition: all 0.3s ease;
}

.depth-marker:nth-child(2) { top: 0; }
.depth-marker:nth-child(3) { top: 33%; }
.depth-marker:nth-child(4) { top: 66%; }
.depth-marker:nth-child(5) { top: 100%; }

.depth-marker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 255, 204, 0.3);
    border: 1px solid rgba(0, 255, 204, 0.5);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.depth-marker.active .depth-marker-dot {
    background: var(--bio-teal);
    box-shadow: 0 0 12px var(--bio-teal);
    transform: scale(1.3);
}

.depth-marker-label {
    font-family: var(--font-accent);
    font-size: 11px;
    color: var(--seafoam-gray);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.3s ease;
    position: absolute;
    right: 24px;
}

.depth-marker:hover .depth-marker-label,
.depth-marker.active .depth-marker-label {
    opacity: 1;
    transform: translateX(0);
}

.depth-marker.active .depth-marker-label {
    color: var(--bio-teal);
}

/* === Zones === */
.zone {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* === Surface Zone === */
.zone-surface {
    height: 100vh;
    background: var(--deep-cerulean);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.caustic-overlay {
    position: absolute;
    top: 0;
    left: -10%;
    width: 120%;
    height: 40%;
    background: repeating-conic-gradient(
        from 0deg at 50% 50%,
        rgba(240, 214, 138, 0.04) 0deg,
        transparent 8deg,
        transparent 16deg
    ),
    repeating-linear-gradient(
        45deg,
        rgba(240, 214, 138, 0.03) 0px,
        transparent 3px,
        transparent 7px
    ),
    repeating-linear-gradient(
        -30deg,
        rgba(240, 214, 138, 0.025) 0px,
        transparent 5px,
        transparent 10px
    );
    filter: url(#caustic-filter);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
    will-change: transform, filter;
    z-index: 2;
}

.caustic-overlay.active {
    opacity: 0.7;
}

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

.site-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(48px, 8vw, 120px);
    letter-spacing: 0.05em;
    color: var(--pearl-white);
    text-shadow: 0 0 40px rgba(0, 255, 204, 0.3), 0 0 80px rgba(0, 255, 204, 0.1);
    opacity: 0;
    transform: translateY(20px);
    animation: title-fade-in 0.8s ease-out 0.4s forwards;
}

@keyframes title-fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-title.bobbing {
    animation: title-bob 4s ease-in-out infinite;
    opacity: 1;
}

@keyframes title-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.site-subtitle {
    font-family: var(--font-accent);
    font-size: clamp(14px, 2vw, 22px);
    color: var(--seafoam-gray);
    margin-top: 16px;
    opacity: 0;
    transform: translateY(15px);
    animation: subtitle-fade-in 0.8s ease-out 1s forwards;
}

@keyframes subtitle-fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Chevron */
.scroll-chevron {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    animation: chevron-blur 2s ease-in-out infinite;
    cursor: pointer;
}

@keyframes chevron-blur {
    0%, 100% { filter: blur(0px); opacity: 0.8; }
    50% { filter: blur(2px); opacity: 0.4; }
}

/* === Twilight Zone === */
.zone-twilight {
    min-height: 150vh;
    padding: 10vh 0;
    background: linear-gradient(180deg, var(--deep-cerulean) 0%, var(--dark-cerulean) 30%, var(--abyssal-black) 100%);
    position: relative;
}

/* === Midnight Zone === */
.zone-midnight {
    min-height: 150vh;
    padding: 10vh 0;
    background: var(--abyssal-black);
    position: relative;
}

/* === Abyss Zone === */
.zone-abyss {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--abyssal-black) 0%, var(--deep-violet) 40%, var(--deep-violet) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* === Watermarks === */
.watermark {
    position: absolute;
    font-family: var(--font-accent);
    font-size: clamp(200px, 30vw, 400px);
    font-weight: 700;
    opacity: 0.05;
    pointer-events: none;
    user-select: none;
    z-index: 1;
    line-height: 1;
}

.watermark-surface {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--golden-caustic);
    opacity: 0.06;
}

.watermark-twilight {
    top: 20%;
    right: 5%;
    color: var(--bio-teal);
    opacity: 0.05;
}

.watermark-midnight {
    top: 30%;
    left: 5%;
    color: var(--jelly-pink);
    opacity: 0.04;
}

.watermark-abyss {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--electric-ice);
    opacity: 0.03;
}

/* === Content Panels === */
.panel {
    position: relative;
    z-index: 10;
    max-width: 45vw;
    padding: 32px 36px;
    margin-bottom: 20vh;
    background: rgba(11, 61, 110, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 255, 204, 0.15);
    border-radius: 50%;
    width: 6px;
    height: 6px;
    opacity: 0;
    overflow: hidden;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                border-radius 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                padding 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bio-teal);
    opacity: 1;
    transition: opacity 0.3s ease 0.2s;
    pointer-events: none;
}

.panel.morphed {
    width: 45vw;
    height: auto;
    opacity: 1;
    border-radius: 8px;
    padding: 32px 36px;
}

.panel.morphed::before {
    opacity: 0;
}

.panel .panel-title,
.panel .panel-text {
    opacity: 0;
    transition: opacity 0.4s ease 0.35s;
}

.panel.morphed .panel-title,
.panel.morphed .panel-text {
    opacity: 1;
}

.panel-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(20px, 3vw, 36px);
    letter-spacing: 0.05em;
    color: var(--pearl-white);
    margin-bottom: 16px;
}

.panel-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(15px, 1.6vw, 18px);
    color: var(--seafoam-gray);
    line-height: 1.8;
}

/* Panel positioning - Asymmetric layout */
.panel-left {
    margin-left: 8vw;
    margin-right: auto;
}

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

.panel-left-far {
    margin-left: 5vw;
    margin-right: auto;
}

.panel-right-near {
    margin-left: auto;
    margin-right: 12vw;
}

.panel-center-left {
    margin-left: 10vw;
    margin-right: auto;
}

.panel-center-right {
    margin-left: auto;
    margin-right: 6vw;
}

.panel-far-left {
    margin-left: 6vw;
    margin-right: auto;
}

/* Midnight Zone Panels - Glowing borders */
.panel-midnight {
    background: rgba(5, 10, 20, 0.6);
    border-color: rgba(0, 255, 204, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.1);
}

.panel-midnight.morphed {
    animation: midnight-glow 8s ease-in-out infinite;
}

.panel-midnight.morphed:nth-of-type(odd) {
    animation-delay: -3s;
}

.panel-midnight.morphed:nth-of-type(3n) {
    animation-delay: -5s;
}

@keyframes midnight-glow {
    0%, 100% {
        border-color: rgba(0, 255, 204, 0.2);
        box-shadow: 0 0 10px rgba(0, 255, 204, 0.1);
    }
    33% {
        border-color: rgba(255, 110, 199, 0.25);
        box-shadow: 0 0 15px rgba(255, 110, 199, 0.12);
    }
    66% {
        border-color: rgba(125, 249, 255, 0.25);
        box-shadow: 0 0 15px rgba(125, 249, 255, 0.12);
    }
}

.panel-midnight:hover {
    box-shadow: 0 0 30px rgba(0, 255, 204, 0.4) !important;
    border-color: rgba(0, 255, 204, 0.4) !important;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

/* === Jellyfish === */
.jellyfish-drift {
    position: absolute;
    z-index: 3;
    pointer-events: none;
}

.jellyfish-large {
    top: 20%;
    left: -20vw;
    width: 200px;
    height: 300px;
    opacity: 0.55;
    animation: jellyfish-swim-1 30s linear infinite;
    filter: drop-shadow(0 0 40px rgba(255, 110, 199, 0.3));
}

.jellyfish-small {
    top: 65%;
    left: -15vw;
    width: 100px;
    height: 150px;
    opacity: 0.25;
    animation: jellyfish-swim-2 45s linear infinite;
    animation-delay: -15s;
    filter: drop-shadow(0 0 20px rgba(125, 249, 255, 0.2));
}

.jellyfish-medium {
    top: 40%;
    left: -18vw;
    width: 150px;
    height: 225px;
    opacity: 0.35;
    animation: jellyfish-swim-3 38s linear infinite;
    animation-delay: -8s;
    filter: drop-shadow(0 0 30px rgba(0, 255, 204, 0.25));
}

@keyframes jellyfish-swim-1 {
    0% {
        transform: translateX(0) translateY(0);
    }
    25% {
        transform: translateX(35vw) translateY(-25px);
    }
    50% {
        transform: translateX(70vw) translateY(12px);
    }
    75% {
        transform: translateX(105vw) translateY(-18px);
    }
    100% {
        transform: translateX(140vw) translateY(0);
    }
}

@keyframes jellyfish-swim-2 {
    0% {
        transform: translateX(0) translateY(0);
    }
    20% {
        transform: translateX(30vw) translateY(15px);
    }
    40% {
        transform: translateX(55vw) translateY(-10px);
    }
    60% {
        transform: translateX(80vw) translateY(20px);
    }
    80% {
        transform: translateX(110vw) translateY(-8px);
    }
    100% {
        transform: translateX(140vw) translateY(0);
    }
}

@keyframes jellyfish-swim-3 {
    0% {
        transform: translateX(0) translateY(0);
    }
    30% {
        transform: translateX(40vw) translateY(-15px);
    }
    50% {
        transform: translateX(65vw) translateY(18px);
    }
    70% {
        transform: translateX(95vw) translateY(-12px);
    }
    100% {
        transform: translateX(140vw) translateY(0);
    }
}

.jelly-bell {
    animation: jelly-pulse 3s ease-in-out infinite;
}

@keyframes jelly-pulse {
    0%, 100% { ry: 55; }
    50% { ry: 48; }
}

.tentacle {
    animation: tentacle-sway 4s ease-in-out infinite;
    transform-origin: top;
}

.tentacle-1 { animation-delay: 0s; }
.tentacle-2 { animation-delay: -0.8s; }
.tentacle-3 { animation-delay: -1.6s; }
.tentacle-4 { animation-delay: -2.4s; }
.tentacle-5 { animation-delay: -3.2s; }

@keyframes tentacle-sway {
    0%, 100% { transform: skewX(0deg); }
    25% { transform: skewX(3deg); }
    75% { transform: skewX(-3deg); }
}

/* === Abyss Content === */
.abyss-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0 20px;
    filter: blur(8px);
    opacity: 0.3;
    transition: filter 1s ease, opacity 1s ease;
}

.abyss-content.revealed {
    filter: blur(0px);
    opacity: 1;
}

.abyss-text-korean {
    font-family: var(--font-accent);
    font-size: clamp(24px, 4vw, 52px);
    font-weight: 700;
    color: var(--pearl-white);
    margin-bottom: 16px;
    text-shadow: 0 0 30px rgba(0, 255, 204, 0.2);
}

.abyss-text-english {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(18px, 2.5vw, 32px);
    color: var(--seafoam-gray);
    font-style: italic;
}

/* === Sea Anemone Emblem === */
.anemone-emblem {
    margin-top: 60px;
    position: relative;
    z-index: 10;
    width: 160px;
    height: 160px;
}

.anemone-svg {
    width: 100%;
    height: 100%;
}

.anemone-emblem.assembled .anemone-svg {
    animation: anemone-rotate 60s linear infinite, anemone-pulse 3s ease-in-out infinite;
}

@keyframes anemone-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes anemone-pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.anemone-tendril {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 0.3s ease;
}

.anemone-emblem.assembled .anemone-tendril {
    stroke-dashoffset: 0;
}

/* Stagger tendril draw-in: 12 tendrils, 100ms apart = 1.2s total assembly */
.anemone-emblem.assembled .anemone-tendril:nth-child(2) { transition-delay: 0.0s; }
.anemone-emblem.assembled .anemone-tendril:nth-child(3) { transition-delay: 0.1s; }
.anemone-emblem.assembled .anemone-tendril:nth-child(4) { transition-delay: 0.2s; }
.anemone-emblem.assembled .anemone-tendril:nth-child(5) { transition-delay: 0.3s; }
.anemone-emblem.assembled .anemone-tendril:nth-child(6) { transition-delay: 0.4s; }
.anemone-emblem.assembled .anemone-tendril:nth-child(7) { transition-delay: 0.5s; }
.anemone-emblem.assembled .anemone-tendril:nth-child(8) { transition-delay: 0.6s; }
.anemone-emblem.assembled .anemone-tendril:nth-child(9) { transition-delay: 0.7s; }
.anemone-emblem.assembled .anemone-tendril:nth-child(10) { transition-delay: 0.8s; }
.anemone-emblem.assembled .anemone-tendril:nth-child(11) { transition-delay: 0.9s; }
.anemone-emblem.assembled .anemone-tendril:nth-child(12) { transition-delay: 1.0s; }
.anemone-emblem.assembled .anemone-tendril:nth-child(13) { transition-delay: 1.1s; }

/* === Bioluminescent Ring === */
.bioluminescent-ring {
    position: relative;
    z-index: 10;
    width: 200px;
    height: 200px;
    margin-top: 40px;
    animation: ring-rotate 40s linear infinite;
}

.ring-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--bio-teal);
    box-shadow: 0 0 8px var(--bio-teal);
    animation: ring-dot-pulse 3s ease-in-out infinite;
}

@keyframes ring-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes ring-dot-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* === Responsive === */
@media (max-width: 768px) {
    .panel {
        max-width: 85vw;
    }

    .panel.morphed {
        width: 85vw;
        padding: 24px 20px;
        margin-bottom: 15vh;
    }

    .panel-left,
    .panel-left-far,
    .panel-center-left,
    .panel-far-left {
        margin-left: 5vw;
    }

    .panel-right,
    .panel-right-near,
    .panel-center-right {
        margin-right: 5vw;
        margin-left: auto;
    }

    .depth-gauge {
        right: 10px;
    }

    .depth-marker-label {
        display: none;
    }

    .jellyfish-large {
        width: 140px;
        height: 210px;
    }

    .jellyfish-small {
        width: 70px;
        height: 105px;
    }

    .jellyfish-medium {
        width: 100px;
        height: 150px;
    }
}

/* === Selection Color === */
::selection {
    background: rgba(0, 255, 204, 0.3);
    color: var(--pearl-white);
}

/* === Scrollbar Styling === */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--abyssal-black);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 204, 0.2);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 204, 0.4);
}
