/* ========================================
   bada.moe - Watercolor Sea Storybook
   Color Palette:
   Dawn Blush:          #f2c4c4
   Sea Glass:           #a8d8c8
   Tidal Ink:           #2d4a5e
   Coral Bloom:         #e8856c
   Deep Current:        #1a3347
   Foam White:          #faf6f0
   Kelp Whisper:        #6b9e7a
   Sunset Wash:         #f5d4a0
   Bioluminescent Teal: #3de8c7
   ======================================== */

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
    overflow-x: hidden;
}

body {
    font-family: 'Nanum Myeongjo', serif;
    font-size: 17px;
    line-height: 1.85;
    color: #2d4a5e;
    background-color: #faf6f0;
    overflow-x: hidden;
}

.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Zones Common --- */
.zone {
    position: relative;
    min-height: 100vh;
    scroll-snap-align: start;
    overflow: hidden;
}

.zone-content {
    position: relative;
    z-index: 2;
}

/* --- Watercolor Wash Layers --- */
.watercolor-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    filter: url(#watercolor-wash);
    pointer-events: none;
}

.paper-grain-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    filter: url(#paper-grain);
    pointer-events: none;
    opacity: 0.5;
}

/* Sky Zone Wash */
.sky-wash {
    background:
        radial-gradient(ellipse 80% 60% at 20% 30%, rgba(242, 196, 196, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 70% 50% at 80% 20%, rgba(245, 212, 160, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse 90% 70% at 50% 80%, rgba(168, 216, 200, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 70% 60%, rgba(242, 196, 196, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, #f2c4c4 0%, #f5d4a0 40%, #faf6f0 100%);
}

/* Tideline Zone Wash */
.tideline-wash {
    background:
        radial-gradient(ellipse 70% 50% at 25% 40%, rgba(168, 216, 200, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 75% 30%, rgba(242, 196, 196, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 80% 60% at 50% 70%, rgba(107, 158, 122, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, #faf6f0 0%, #a8d8c8 40%, #faf6f0 100%);
}

/* Reef Zone Wash */
.reef-wash {
    background:
        radial-gradient(ellipse 60% 50% at 30% 25%, rgba(168, 216, 200, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 70% 60%, rgba(232, 133, 108, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 80% 50% at 50% 50%, rgba(107, 158, 122, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse 40% 30% at 80% 20%, rgba(245, 212, 160, 0.04) 0%, transparent 40%),
        linear-gradient(180deg, #faf6f0 0%, #faf6f0 100%);
}

/* Deep Current Zone Wash */
.deep-wash {
    background:
        radial-gradient(ellipse 80% 60% at 30% 30%, rgba(45, 74, 94, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse 70% 50% at 70% 60%, rgba(26, 51, 71, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 50% 80%, rgba(61, 232, 199, 0.04) 0%, transparent 40%),
        linear-gradient(180deg, #2d4a5e 0%, #1a3347 100%);
}

/* Abyssal Zone Wash */
.abyssal-wash {
    background:
        radial-gradient(ellipse 70% 50% at 40% 30%, rgba(61, 232, 199, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 70% 70%, rgba(61, 232, 199, 0.04) 0%, transparent 40%),
        radial-gradient(ellipse 80% 60% at 20% 60%, rgba(45, 74, 94, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, #1a3347 0%, #0f2233 100%);
}

/* --- Zone Titles --- */
.zone-title {
    font-family: 'Gaegu', cursive;
    font-weight: 700;
    font-size: clamp(2.5rem, 7vw, 6rem);
    letter-spacing: 0.04em;
    text-align: center;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.zone-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.deep-title,
.abyssal-title {
    color: #faf6f0;
}

/* --- Ink Splatters --- */
.ink-splatter {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    border-radius: 50%;
    filter: url(#ink-splatter);
}

.splatter-sky-1 {
    width: 40px;
    height: 35px;
    top: 15%;
    left: 8%;
    background: radial-gradient(circle, #a8d8c8 0%, transparent 70%);
    opacity: 0.3;
}

.splatter-sky-2 {
    width: 25px;
    height: 28px;
    top: 60%;
    right: 12%;
    background: radial-gradient(circle, #e8856c 0%, transparent 70%);
    opacity: 0.25;
}

.splatter-tideline-1 {
    width: 30px;
    height: 32px;
    top: 20%;
    right: 15%;
    background: radial-gradient(circle, #6b9e7a 0%, transparent 70%);
    opacity: 0.25;
}

.splatter-reef-1 {
    width: 35px;
    height: 30px;
    top: 10%;
    left: 5%;
    background: radial-gradient(circle, #e8856c 0%, transparent 70%);
    opacity: 0.2;
}

.splatter-reef-2 {
    width: 20px;
    height: 22px;
    bottom: 18%;
    right: 8%;
    background: radial-gradient(circle, #a8d8c8 0%, transparent 70%);
    opacity: 0.25;
}

.splatter-deep-1 {
    position: relative;
    display: inline-block;
    width: 28px;
    height: 25px;
    background: radial-gradient(circle, #3de8c7 0%, transparent 70%);
    opacity: 0.2;
    margin: 1rem auto;
}

/* --- Sky Zone (Hero) --- */
.zone-sky {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sky-content {
    text-align: center;
    padding: 2rem;
}

.site-title {
    font-family: 'Gaegu', cursive;
    font-weight: 700;
    font-size: clamp(3.5rem, 10vw, 8rem);
    letter-spacing: 0.04em;
    color: #2d4a5e;
    text-shadow: 2px 2px 8px rgba(242, 196, 196, 0.4);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeRiseIn 1.2s ease 0.3s forwards;
}

.site-subtitle {
    font-family: 'Nanum Myeongjo', serif;
    font-size: clamp(1rem, 3vw, 1.6rem);
    color: #2d4a5e;
    margin-top: 0.8rem;
    opacity: 0;
    transform: translateY(15px);
    animation: fadeRiseIn 1s ease 1s forwards;
}

/* Clouds */
.clouds-container {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.cloud {
    position: absolute;
    will-change: transform;
}

.cloud-1 {
    top: 12%;
    left: -15%;
    width: 250px;
    animation: driftCloud 35s linear infinite;
}

.cloud-2 {
    top: 25%;
    left: -20%;
    width: 200px;
    animation: driftCloud 50s linear infinite;
    animation-delay: -15s;
}

.cloud-3 {
    top: 8%;
    left: -10%;
    width: 180px;
    animation: driftCloud 42s linear infinite;
    animation-delay: -25s;
}

@keyframes driftCloud {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(100vw + 300px)); }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    animation: pulseScroll 2.5s ease-in-out infinite;
    opacity: 0;
    animation: pulseScroll 2.5s ease-in-out infinite, fadeRiseIn 1s ease 1.8s forwards;
}

.scroll-indicator svg {
    width: 60px;
    height: 30px;
}

@keyframes pulseScroll {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
    50% { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

/* --- Wave Dividers --- */
.wave-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    z-index: 3;
    pointer-events: none;
}

.wave-divider svg {
    display: block;
    width: 100%;
    height: 100%;
}

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

.wave-path-2 {
    animation-delay: -2s;
}

.wave-path-3 {
    animation-delay: -4s;
}

@keyframes waveShift {
    0% { transform: translateX(0); }
    100% { transform: translateX(-20px); }
}

/* --- Tideline Zone --- */
.zone-tideline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem 8rem;
}

.tideline-content {
    max-width: 1100px;
    width: 100%;
}

.tideline-split {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-top: 2rem;
}

.above-water,
.below-water {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
}

.above-water {
    background: rgba(250, 246, 240, 0.3);
}

.below-water {
    background: rgba(168, 216, 200, 0.15);
}

.waterline-divider {
    width: 8px;
    flex-shrink: 0;
    position: relative;
}

.waterline-divider svg {
    width: 8px;
    height: 100%;
}

.waterline-path {
    animation: waterlineUndulate 4s ease-in-out infinite alternate;
}

@keyframes waterlineUndulate {
    0% { d: path("M4,0 C8,40 0,80 4,120 C8,160 0,200 4,240 C8,280 0,320 4,360 C8,380 4,400 4,400"); }
    100% { d: path("M4,0 C0,40 8,80 4,120 C0,160 8,200 4,240 C0,280 8,320 4,360 C0,380 4,400 4,400"); }
}

.vignette {
    text-align: center;
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.vignette.visible {
    opacity: 1;
    transform: translateY(0);
}

.vignette svg {
    width: 120px;
    height: auto;
    margin-bottom: 0.5rem;
}

.vignette-label {
    font-family: 'Patrick Hand', cursive;
    font-size: 15px;
    color: #2d4a5e;
    opacity: 0.7;
}

/* --- Reef Zone --- */
.zone-reef {
    padding: 6rem 2rem 8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.reef-content {
    max-width: 1200px;
    width: 100%;
}

.specimen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
    padding: 0 1rem;
}

/* Specimen Cards */
.specimen-card {
    background: #faf6f0;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 4px 6px 16px rgba(45, 74, 94, 0.08);
    position: relative;
    cursor: default;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: url(#torn-edge);
}

.specimen-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card-tilt-left { transform: translateY(30px) rotate(-2deg); }
.card-tilt-left.visible { transform: translateY(0) rotate(-2deg); }
.card-tilt-right { transform: translateY(30px) rotate(2deg); }
.card-tilt-right.visible { transform: translateY(0) rotate(2deg); }
.card-tilt-left-sm { transform: translateY(30px) rotate(-1deg); }
.card-tilt-left-sm.visible { transform: translateY(0) rotate(-1deg); }
.card-tilt-right-sm { transform: translateY(30px) rotate(1.5deg); }
.card-tilt-right-sm.visible { transform: translateY(0) rotate(1.5deg); }
.card-tilt-center { transform: translateY(30px) rotate(0deg); }
.card-tilt-center.visible { transform: translateY(0) rotate(0deg); }

.specimen-card:hover {
    transform: translateY(-6px) rotate(0deg) !important;
    box-shadow: 6px 10px 24px rgba(45, 74, 94, 0.12);
}

.card-inner {
    text-align: center;
}

.specimen-number {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    font-weight: 400;
    color: #2d4a5e;
    opacity: 0.6;
    text-align: right;
    margin-bottom: 0.5rem;
}

.creature {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.creature svg {
    width: 100px;
    height: auto;
}

.creature-name {
    font-family: 'Gaegu', cursive;
    font-weight: 700;
    font-size: 1.4rem;
    color: #2d4a5e;
    margin-bottom: 0.5rem;
}

.creature-poem {
    font-family: 'Nanum Myeongjo', serif;
    font-size: 14px;
    line-height: 1.7;
    color: #2d4a5e;
    opacity: 0.8;
}

/* Creature micro-interactions */
.specimen-card:hover .jellyfish-svg {
    animation: jellyfishWobble 1.2s ease-in-out infinite;
    animation-delay: 0.15s;
}

@keyframes jellyfishWobble {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(3deg); }
    75% { transform: rotate(-3deg); }
}

.specimen-card:hover .puffer-body {
    animation: pufferInflate 0.6s ease-in-out;
    animation-delay: 0.15s;
    animation-fill-mode: both;
}

@keyframes pufferInflate {
    0%, 100% { r: 32; }
    50% { r: 38; }
}

.specimen-card:hover .starfish-arm-wiggle {
    animation: starfishWiggle 0.8s ease-in-out infinite;
    animation-delay: 0.15s;
    transform-origin: 55px 42px;
}

@keyframes starfishWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(8deg); }
    75% { transform: rotate(-8deg); }
}

.specimen-card:hover .wave-tentacle {
    animation: octopusWave 1s ease-in-out infinite;
    animation-delay: 0.15s;
    transform-origin: 85px 60px;
}

@keyframes octopusWave {
    0%, 100% { d: path("M85,60 Q90,80 95,100 Q98,110 92,115"); }
    50% { d: path("M85,60 Q95,75 100,90 Q105,100 98,108"); }
}

/* --- Deep Current Zone --- */
.zone-deep {
    padding: 6rem 2rem 8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #faf6f0;
}

.deep-content {
    max-width: 680px;
    width: 100%;
}

.text-passage {
    margin-bottom: 2.5rem;
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.text-passage.visible {
    opacity: 1;
    transform: translateY(0);
}

.text-passage p {
    font-family: 'Nanum Myeongjo', serif;
    font-size: 17px;
    line-height: 1.85;
    color: #faf6f0;
    margin-bottom: 1rem;
}

.passage-translation {
    font-size: 15px;
    opacity: 0.7;
}

.spot-illustration {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.spot-illustration.visible {
    opacity: 1;
}

.spot-illustration svg {
    width: 180px;
    height: auto;
}

/* Waveform Decoration */
.waveform-decoration {
    position: absolute;
    left: 2rem;
    top: 10%;
    height: 80%;
    width: 40px;
    z-index: 1;
    pointer-events: none;
}

.waveform-decoration svg {
    width: 40px;
    height: 100%;
}

.waveform-path {
    animation: waveformMorph 8s ease-in-out infinite;
}

@keyframes waveformMorph {
    0% { d: path("M20,0 C30,30 10,60 20,90 C30,120 10,150 20,180 C30,210 10,240 20,270 C30,300 10,330 20,360 C30,390 10,420 20,450 C30,480 10,510 20,540 C30,570 20,600 20,600"); }
    33% { d: path("M20,0 C10,30 30,60 20,90 C10,120 30,150 20,180 C10,210 30,240 20,270 C10,300 30,330 20,360 C10,390 30,420 20,450 C10,480 30,510 20,540 C10,570 20,600 20,600"); }
    66% { d: path("M20,0 C25,30 15,60 20,90 C35,120 5,150 20,180 C35,210 5,240 20,270 C35,300 5,330 20,360 C35,390 5,420 20,450 C25,480 15,510 20,540 C25,570 20,600 20,600"); }
    100% { d: path("M20,0 C30,30 10,60 20,90 C30,120 10,150 20,180 C30,210 10,240 20,270 C30,300 10,330 20,360 C30,390 10,420 20,450 C30,480 10,510 20,540 C30,570 20,600 20,600"); }
}

/* Bubble containers */
.bubble-container {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.3), rgba(168,216,200,0.1));
    border: 1px solid rgba(255,255,255,0.15);
    pointer-events: none;
    will-change: transform, opacity;
}

/* --- Abyssal Garden Zone --- */
.zone-abyssal {
    padding: 6rem 2rem 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: #faf6f0;
}

.abyssal-content {
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.abyssal-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin: 3rem 0;
}

.bioluminescent-link {
    font-family: 'Patrick Hand', cursive;
    font-size: 16px;
    color: #3de8c7;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(61, 232, 199, 0.2);
    transition: all 0.4s ease;
    position: relative;
}

.bioluminescent-link:hover {
    background: rgba(61, 232, 199, 0.1);
    box-shadow: 0 0 20px rgba(61, 232, 199, 0.3), 0 0 40px rgba(61, 232, 199, 0.1);
    color: #3de8c7;
    border-color: rgba(61, 232, 199, 0.5);
}

.sleeping-creature {
    margin: 3rem auto;
    opacity: 0;
    transition: opacity 1s ease;
}

.sleeping-creature.visible {
    opacity: 1;
}

.sleeping-creature svg {
    width: 220px;
    height: auto;
}

.zzz {
    animation: zzzFloat 3s ease-in-out infinite;
}

.zzz-1 { animation-delay: 0s; }
.zzz-2 { animation-delay: 0.6s; }
.zzz-3 { animation-delay: 1.2s; }

@keyframes zzzFloat {
    0%, 100% { opacity: 0.15; transform: translateY(0); }
    50% { opacity: 0.5; transform: translateY(-5px); }
}

.bio-dot {
    animation: bioDotPulse 4s ease-in-out infinite;
}

.bio-dot:nth-child(odd) { animation-delay: -1s; }
.bio-dot:nth-child(even) { animation-delay: -2.5s; }

@keyframes bioDotPulse {
    0%, 100% { opacity: 0.1; r: 1.5; }
    50% { opacity: 0.5; r: 3; }
}

.abyssal-farewell {
    font-family: 'Gaegu', cursive;
    font-weight: 700;
    font-size: clamp(1.2rem, 4vw, 2rem);
    color: #faf6f0;
    opacity: 0.5;
    margin-top: 2rem;
}

/* --- Zone Navigation --- */
.zone-nav {
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem 0.5rem;
    opacity: 0.3;
    transition: opacity 0.4s ease;
}

.zone-nav:hover {
    opacity: 1;
}

.nav-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    z-index: -1;
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #a8d8c8;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.nav-dot:hover {
    background: #a8d8c8;
    transform: scale(1.3);
}

.nav-dot.active {
    background: #a8d8c8;
    animation: navDotPulse 2s ease-in-out infinite;
}

@keyframes navDotPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(168, 216, 200, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(168, 216, 200, 0); }
}

/* --- Animations --- */
@keyframes fadeRiseIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered entrance for zone items */
.zone-content .stagger-1 { transition-delay: 0.08s; }
.zone-content .stagger-2 { transition-delay: 0.16s; }
.zone-content .stagger-3 { transition-delay: 0.24s; }
.zone-content .stagger-4 { transition-delay: 0.32s; }
.zone-content .stagger-5 { transition-delay: 0.40s; }
.zone-content .stagger-6 { transition-delay: 0.48s; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .tideline-split {
        flex-direction: column;
    }

    .waterline-divider {
        width: 100%;
        height: 8px;
    }

    .waterline-divider svg {
        width: 100%;
        height: 8px;
    }

    .specimen-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .waveform-decoration {
        display: none;
    }

    .zone-nav {
        right: auto;
        bottom: 1rem;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        gap: 1rem;
        padding: 0.5rem 1rem;
        background: rgba(26, 51, 71, 0.5);
        border-radius: 20px;
        backdrop-filter: blur(4px);
    }

    .nav-line {
        display: none;
    }

    .zone-sky {
        min-height: 100vh;
    }

    .abyssal-nav {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    .zone-title {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }

    .site-title {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    .vignette svg {
        width: 90px;
    }
}
