/* ===========================================================
   bada.moe — Pastel Cyberpunk Aquarium
   Fonts: Caveat, Nanum Pen Script, Quicksand, Share Tech Mono
   Palette: #0b0e17 #1a1035 #ffc8dd #cdb4db #e2e8f0 #bde0fe #80ffdb #ffafcc
   Interactive elements use IntersectionObserver and IntersectionObserver` trigger animations when panels enter the viewport.
   =========================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Quicksand', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0b0e17;
    color: #e2e8f0;
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Layered stage ---------- */
.stage {
    perspective: 1000px;
    perspective-origin: 50% 50%;
    position: relative;
    z-index: 5;
}

.layer {
    position: relative;
    transform-style: preserve-3d;
}

.layer-abyss {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.layer-glass {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    overflow: hidden;
}

.layer-mid {
    position: relative;
    z-index: 10;
    transform: translateZ(0);
}

/* ---------- Abyss gradient + ghost creatures ---------- */
.gradient-field {
    position: absolute;
    inset: -10%;
    background:
        radial-gradient(ellipse at 20% 10%, rgba(26,16,53,0.9) 0%, rgba(11,14,23,0.95) 55%, #0b0e17 100%),
        radial-gradient(ellipse at 80% 90%, rgba(26,16,53,0.7) 0%, rgba(11,14,23,0.9) 60%, #0b0e17 100%);
    animation: drift-bg 40s ease-in-out infinite alternate;
}

@keyframes drift-bg {
    0% { transform: translate(0, 0) scale(1.02); }
    100% { transform: translate(-2%, 1%) scale(1.05); }
}

.ghost-creature {
    position: absolute;
    width: 420px;
    height: auto;
    opacity: 0.35;
    filter: drop-shadow(0 0 20px rgba(205,180,219,0.25));
}

.ghost-anglerfish {
    top: 35%;
    left: -30%;
    animation: drift-across 85s linear infinite;
}

.ghost-jellyfish {
    top: 8%;
    left: -25%;
    width: 280px;
    animation: drift-across-slow 65s linear infinite;
    animation-delay: -20s;
}

@keyframes drift-across {
    0% { transform: translateX(0) translateY(0) rotate(-2deg); }
    50% { transform: translateX(80vw) translateY(20px) rotate(2deg); }
    100% { transform: translateX(160vw) translateY(0) rotate(-2deg); }
}

@keyframes drift-across-slow {
    0% { transform: translateX(0) translateY(0); }
    50% { transform: translateX(70vw) translateY(40px); }
    100% { transform: translateX(150vw) translateY(0); }
}

/* ---------- Particles ---------- */
.particles {
    position: absolute;
    inset: 0;
}

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

@keyframes float-particle {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: var(--p-opacity-min, 0.12);
    }
    100% {
        transform: translate(var(--p-dx, 20px), var(--p-dy, -30px)) scale(1.15);
        opacity: var(--p-opacity-max, 0.4);
    }
}

/* ---------- Glass layer ---------- */
.glass-reflection {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 40% at 20% 10%, rgba(255,255,255,0.05) 0%, transparent 70%),
        radial-gradient(ellipse 60% 30% at 80% 80%, rgba(189,224,254,0.04) 0%, transparent 70%);
    mix-blend-mode: screen;
}

.drops {
    position: absolute;
    inset: 0;
}

.drop {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(ellipse at 35% 30%, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.15) 55%, rgba(255,255,255,0) 100%);
    box-shadow: inset -2px -3px 4px rgba(189,224,254,0.2);
    will-change: transform;
    animation: slide-drop linear infinite;
}

@keyframes slide-drop {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    10% { opacity: 0.8; }
    90% { opacity: 0.6; }
    100% {
        transform: translateY(110vh);
        opacity: 0;
    }
}

/* ---------- Porthole nav ---------- */
.porthole {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #80ffdb;
    background: rgba(11, 14, 23, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow:
        0 0 18px rgba(128,255,219,0.35),
        inset 0 0 20px rgba(128,255,219,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    cursor: pointer;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    animation: porthole-pulse 5s ease-in-out infinite alternate;
}

.porthole:hover {
    transform: scale(1.06);
    box-shadow:
        0 0 28px rgba(128,255,219,0.55),
        inset 0 0 30px rgba(128,255,219,0.15);
}

@keyframes porthole-pulse {
    0% { box-shadow: 0 0 18px rgba(128,255,219,0.3), inset 0 0 20px rgba(128,255,219,0.08); }
    100% { box-shadow: 0 0 26px rgba(128,255,219,0.5), inset 0 0 26px rgba(128,255,219,0.15); }
}

.porthole-ring {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 1px dashed rgba(128,255,219,0.3);
    animation: ring-spin 20s linear infinite;
}

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

.porthole-label {
    font-family: 'Share Tech Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.72rem;
    color: #bde0fe;
    text-shadow: 0 0 10px rgba(189,224,254,0.6);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.6s ease;
    line-height: 1;
    margin-bottom: 0;
    letter-spacing: 0.08em;
}

.porthole-depth {
    font-family: 'Share Tech Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.48rem;
    color: #80ffdb;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-shadow: 0 0 6px rgba(128,255,219,0.6);
}

/* ---------- Scene layout ---------- */
.scene {
    position: relative;
    min-height: 100vh;
    padding: 10vh 5vw 10vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
}

.scene-surface {
    min-height: 110vh;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.scene-deep {
    background: linear-gradient(180deg, rgba(11,14,23,0) 0%, rgba(11,14,23,0.85) 40%, rgba(11,14,23,0.95) 60%, rgba(11,14,23,0.85) 100%);
}

.scene-ascent {
    background: linear-gradient(180deg, rgba(11,14,23,0) 0%, rgba(26,16,53,0.35) 40%, rgba(26,55,70,0.45) 80%, rgba(18,70,75,0.3) 100%);
    min-height: 110vh;
}

.scene-title-row {
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
}

.scene-title-row.offset-left { justify-content: flex-start; padding-left: 8vw; }
.scene-title-row.offset-right { justify-content: flex-end; padding-right: 8vw; }

/* ---------- Hangul title SVG ---------- */
.hangul-title {
    width: clamp(160px, 22vw, 280px);
    height: auto;
    filter: drop-shadow(0 0 12px rgba(205,180,219,0.4));
}

.scene-light .hangul-title { width: clamp(240px, 34vw, 440px); filter: drop-shadow(0 0 12px rgba(162,210,255,0.5)); /* #a2d2ff sky */ }
.scene-surface .hangul-title { filter: drop-shadow(0 0 12px rgba(189,224,254,0.5)); }
.scene-deep .hangul-title { filter: drop-shadow(0 0 14px rgba(205,180,219,0.55)); }
.scene-ascent .hangul-title { filter: drop-shadow(0 0 14px rgba(255,200,221,0.55)); }

.hangul-stroke {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke-dashoffset 1.8s ease-in-out;
}

.hangul-title.drawn .hangul-stroke {
    stroke-dashoffset: 0;
}

/* ---------- Hero (수면) ---------- */
.site-title {
    font-family: 'Caveat', 'Comic Sans MS', 'Segoe Print', cursive;
    font-weight: 600;
    font-size: clamp(3rem, 8vw, 6rem);
    color: #ffc8dd;
    letter-spacing: 0.02em;
    line-height: 1;
    margin-top: 1rem;
    text-shadow:
        0 0 10px #ffc8dd,
        0 0 30px rgba(255,200,221,0.5),
        0 0 60px rgba(255,200,221,0.25),
        2px 2px 0 #7209b7;
    animation: glow-pulse 4.5s ease-in-out infinite alternate;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.6s ease 0.4s, transform 1.6s ease 0.4s;
}

.site-title.revealed {
    opacity: 1;
    transform: translateY(0);
}

@keyframes glow-pulse {
    0% {
        text-shadow:
            0 0 10px #ffc8dd,
            0 0 28px rgba(255,200,221,0.45),
            0 0 55px rgba(255,200,221,0.25),
            2px 2px 0 #7209b7;
    }
    100% {
        text-shadow:
            0 0 14px #ffc8dd,
            0 0 42px rgba(255,200,221,0.65),
            0 0 80px rgba(255,200,221,0.35),
            2px 2px 0 #7209b7;
    }
}

.site-subtitle {
    font-family: 'Nanum Pen Script', 'Apple SD Gothic Neo', 'Malgun Gothic', cursive;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: #bde0fe;
    margin-top: 0.5rem;
    letter-spacing: 0.05em;
    text-shadow: 0 0 10px rgba(189,224,254,0.5);
    opacity: 0;
    transition: opacity 1.4s ease 1.2s;
}

.site-title.revealed + .site-subtitle {
    opacity: 0.92;
}

.hero-fish-stage {
    width: min(520px, 80vw);
    height: 200px;
    margin: 4rem auto 2rem;
    position: relative;
}

.fish {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 12px rgba(255,200,221,0.6));
    transition: filter 0.4s ease, transform 0.4s ease;
}

.fish-path {
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke-dashoffset 2.6s ease-in-out;
    fill: transparent;
}

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

.hero-fish {
    animation: hero-swim 14s ease-in-out infinite alternate;
}

@keyframes hero-swim {
    0%   { transform: translate(-10%, 0) rotate(-2deg); }
    50%  { transform: translate(5%, -8px) rotate(1deg); }
    100% { transform: translate(10%, 4px) rotate(-1deg); }
}

.scroll-prompt {
    position: absolute;
    bottom: 4vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: chevron-bounce 2.4s ease-in-out infinite;
}

.scroll-label {
    font-family: 'Share Tech Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: #80ffdb;
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    opacity: 0.8;
    text-shadow: 0 0 8px rgba(128,255,219,0.5);
}

.chevron {
    width: 36px;
    height: auto;
    filter: drop-shadow(0 0 6px rgba(128,255,219,0.7));
}

@keyframes chevron-bounce {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, 8px); }
}

/* ---------- Korean caption ---------- */
.korean-caption {
    font-family: 'Nanum Pen Script', 'Apple SD Gothic Neo', 'Malgun Gothic', cursive;
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: var(--caption-color, #bde0fe);
    text-align: center;
    margin: 1.5rem 0 1rem;
    letter-spacing: 0.04em;
    text-shadow:
        0 0 12px color-mix(in srgb, var(--caption-color, #bde0fe) 70%, transparent),
        0 0 28px color-mix(in srgb, var(--caption-color, #bde0fe) 35%, transparent);
    animation: caption-glow 5s ease-in-out infinite alternate;
}

@keyframes caption-glow {
    0% { filter: brightness(0.95); }
    100% { filter: brightness(1.15); }
}

.body-intro {
    font-family: 'Quicksand', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    color: #e2e8f0;
    opacity: 0.85;
    text-align: center;
    max-width: 640px;
    margin: 0 auto 4rem;
    line-height: 1.75;
}

/* ---------- Panels ---------- */
.observation-panels {
    position: relative;
    width: 100%;
    padding: 2rem 0;
}

.panel {
    position: relative;
    width: var(--panel-width, 60%);
    margin-left: var(--panel-offset-left, 10%);
    margin-top: var(--panel-margin-top, 2rem);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    background: rgba(180, 200, 230, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    box-shadow:
        0 0 1px rgba(255,255,255,0.1),
        0 20px 50px rgba(0,0,0,0.35),
        inset 0 1px 0 rgba(255,255,255,0.05);
    opacity: 0;
    transform: translateY(30px) scale(0.97);
    transition: opacity 0.8s ease, transform 0.8s ease, border-color 0.4s ease;
}

.panel.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.panel:hover {
    border-color: rgba(255, 200, 221, 0.25);
    background: rgba(180, 200, 230, 0.09);
}

.panel-fish-stage {
    width: 100%;
    max-width: 260px;
    margin: 0 0 1.25rem;
    position: relative;
    animation: panel-fish-drift 9s ease-in-out infinite alternate;
}

.panel-narrow .panel-fish-stage {
    max-width: 200px;
    margin: 0 auto 1.25rem;
}

@keyframes panel-fish-drift {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(20px, -8px); }
}

.fish-mandarin {
    filter: drop-shadow(0 0 12px rgba(255,200,221,0.6));
}

.fish-betta {
    filter: drop-shadow(0 0 12px rgba(205,180,219,0.7));
}

.fish-moorish {
    filter: drop-shadow(0 0 12px rgba(128,255,219,0.65));
}

.fish:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 22px rgba(255,175,204,0.9));
}

.archetype-name {
    font-family: 'Caveat', 'Comic Sans MS', 'Segoe Print', cursive;
    font-weight: 500;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    color: #ffc8dd;
    line-height: 1.1;
    text-shadow: 0 0 10px rgba(255,200,221,0.5);
    margin-bottom: 0.1rem;
}

.panel-betta .archetype-name { color: #cdb4db; text-shadow: 0 0 10px rgba(205,180,219,0.55); }
.panel-moorish .archetype-name { color: #80ffdb; text-shadow: 0 0 10px rgba(128,255,219,0.55); }

.archetype-kanji {
    font-family: 'Nanum Pen Script', 'Apple SD Gothic Neo', 'Malgun Gothic', cursive;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    color: #bde0fe;
    opacity: 0.9;
    margin-bottom: 0.9rem;
    letter-spacing: 0.06em;
}

.archetype-desc {
    font-family: 'Quicksand', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.6vw, 1rem);
    color: #e2e8f0;
    opacity: 0.85;
    line-height: 1.75;
    margin-bottom: 1rem;
}

.archetype-tag {
    display: inline-block;
    font-family: 'Share Tech Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #80ffdb;
    text-shadow: 0 0 8px rgba(128,255,219,0.6);
    border: 1px solid rgba(128,255,219,0.3);
    padding: 4px 10px;
    border-radius: 2px;
    background: rgba(128,255,219,0.05);
}

/* ---------- Coral ---------- */
.coral {
    position: absolute;
    width: 180px;
    height: 320px;
    background: linear-gradient(180deg, rgba(205,180,219,0.12) 0%, rgba(255,200,221,0.06) 60%, rgba(189,224,254,0.02) 100%);
    clip-path: polygon(
        50% 0%, 55% 8%, 62% 5%, 60% 14%, 68% 12%, 64% 22%,
        72% 24%, 66% 32%, 74% 38%, 65% 44%, 72% 52%, 62% 58%,
        68% 68%, 58% 72%, 62% 82%, 52% 86%, 55% 96%, 50% 100%,
        45% 96%, 48% 86%, 38% 82%, 42% 72%, 32% 68%, 38% 58%,
        28% 52%, 35% 44%, 26% 38%, 34% 32%, 28% 24%, 36% 22%,
        32% 12%, 40% 14%, 38% 5%, 45% 8%
    );
    opacity: 0.7;
    filter: blur(0.5px) drop-shadow(0 0 22px rgba(205,180,219,0.25));
    pointer-events: none;
}

.coral-left { left: -40px; top: 10vh; }
.coral-right { right: -40px; bottom: 10vh; transform: scaleX(-1); }

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

.wave-divider svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.wave-path {
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
    transition: stroke-dashoffset 2.4s ease-in-out;
    filter: drop-shadow(0 0 6px rgba(205,180,219,0.45));
}

.wave-divider.revealed .wave-path {
    stroke-dashoffset: 0;
}

/* ---------- Deep sea panel ---------- */
.panel-deep {
    text-align: left;
    padding: clamp(2rem, 4vw, 3.5rem);
}

.deep-body {
    font-family: 'Quicksand', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    color: #e2e8f0;
    opacity: 0.88;
    line-height: 1.9;
    margin-bottom: 1.5rem;
}

.deep-body em {
    font-family: 'Caveat', 'Comic Sans MS', 'Segoe Print', cursive;
    font-style: normal;
    font-size: 1.3em;
    color: #ffc8dd;
    text-shadow: 0 0 10px rgba(255,200,221,0.5);
    letter-spacing: 0.02em;
}

.english-line {
    padding-left: 1.2rem;
    border-left: 1px solid rgba(205,180,219,0.3);
    opacity: 0.78;
    font-style: italic;
}

.deep-signature {
    margin-top: 2rem;
    text-align: right;
}

.tech-label {
    font-family: 'Share Tech Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    color: #80ffdb;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(128,255,219,0.5);
    opacity: 0.85;
}

/* ---------- Ascent ---------- */
.fish-school {
    position: relative;
    width: 100%;
    height: 280px;
    margin: 2rem 0 3rem;
}

.school-fish {
    position: absolute;
    filter: drop-shadow(0 0 14px rgba(255,200,221,0.5));
}

.school-fish-1 {
    width: min(240px, 32vw);
    top: 20%;
    left: 8%;
    animation: swim-path-1 18s ease-in-out infinite alternate;
}

.school-fish-2 {
    width: min(180px, 24vw);
    top: 55%;
    left: 40%;
    animation: swim-path-2 15s ease-in-out infinite alternate;
    animation-delay: -3s;
}

.school-fish-3 {
    width: min(200px, 28vw);
    top: 10%;
    left: 65%;
    animation: swim-path-3 20s ease-in-out infinite alternate;
    animation-delay: -6s;
}

@keyframes swim-path-1 {
    0%   { transform: translate(0, 0) rotate(-3deg); }
    50%  { transform: translate(25vw, 20px) rotate(2deg); }
    100% { transform: translate(50vw, -10px) rotate(-2deg); }
}

@keyframes swim-path-2 {
    0%   { transform: translate(0, 0) rotate(2deg); }
    50%  { transform: translate(-15vw, -20px) rotate(-3deg); }
    100% { transform: translate(-30vw, 10px) rotate(1deg); }
}

@keyframes swim-path-3 {
    0%   { transform: translate(0, 0) rotate(-1deg); }
    50%  { transform: translate(-18vw, 30px) rotate(3deg); }
    100% { transform: translate(-35vw, 0) rotate(-2deg); }
}

.closing-handwritten {
    font-family: 'Nanum Pen Script', 'Caveat', 'Apple SD Gothic Neo', 'Malgun Gothic', cursive;
    font-size: clamp(3rem, 8vw, 6rem);
    color: #ffc8dd;
    text-align: center;
    margin-top: 3rem;
    line-height: 1.1;
    text-shadow:
        0 0 14px #ffc8dd,
        0 0 36px rgba(255,200,221,0.5),
        0 0 70px rgba(255,200,221,0.3);
    animation: glow-pulse 4.5s ease-in-out infinite alternate;
}

.closing-sub {
    font-family: 'Quicksand', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 300;
    color: #e2e8f0;
    opacity: 0.75;
    text-align: center;
    margin-top: 0.5rem;
    font-size: clamp(0.9rem, 1.6vw, 1rem);
    letter-spacing: 0.05em;
}

.footer-line {
    margin-top: 5rem;
    text-align: center;
    opacity: 0.6;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .panel {
        width: 88% !important;
        margin-left: 6% !important;
        margin-top: 2rem !important;
    }
    .scene-title-row,
    .scene-title-row.offset-left,
    .scene-title-row.offset-right {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }
    .porthole {
        width: 68px;
        height: 68px;
        top: 16px;
        right: 16px;
    }
    .porthole-label { font-size: 1.2rem; }
    .porthole-depth { font-size: 0.55rem; }
    .coral { display: none; }
    .hero-fish-stage { margin: 2rem auto 1rem; }
}

@media (max-width: 480px) {
    .scene {
        padding: 8vh 4vw 8vh;
    }
    .site-title {
        font-size: clamp(2.5rem, 14vw, 4rem);
    }
}
