/* ============================================
   namu.day - Japanese-Minimal Candy Aquarium
   A visual poem in five sections
   ============================================ */


/* ---- Color Variables ---- */
:root {
    --color-hot-pink: #ff6b9d;
    --color-electric-cyan: #00e5ff;
    --color-lemon-drop: #ffd93d;
    --color-mint-green: #6bcb77;
    --color-soft-violet: #c084fc;
    --color-deep-twilight: #1a1a2e;
    --color-blush-white: #fff0f5;
    --color-ice-mint: #e0f7fa;
    --color-cream-butter: #fff8e7;
    --color-warm-bark: #8b5e3c;
    --color-pale-mint: #a8e6cf;
}

/* ---- 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: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 400;
    color: #1a1a2e;
    overflow-x: hidden;
    background: #fff0f5;
}

/* ---- Typography ---- */
.domain-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 9vw, 8rem);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #1a1a2e;
    line-height: 1;
}

.poetic-text {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 2.2vw, 1.4rem);
    line-height: 1.9;
    letter-spacing: 0.03em;
    color: #1a1a2e;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.poetic-text:hover {
    transform: translateY(-12px) scale(1.08);
    filter: brightness(1.15);
}

.accent-text {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(0.8rem, 1.5vw, 1.1rem);
    color: #c084fc;
}

/* ---- Section Base ---- */
.section {
    position: relative;
    width: 100%;
    scroll-snap-align: start;
    overflow: hidden;
}

/* ---- Wave Dividers ---- */
.wave-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    line-height: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wave-divider:hover {
    transform: translateY(-4px);
}

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

/* ================================================
   SECTION 1: SURFACE
   ================================================ */
#surface {
    min-height: 100vh;
    background: #fff0f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding-bottom: 80px;
}

.scroll-hint {
    display: block;
    margin-top: 0.5rem;
}

.surface-fish {
    position: absolute;
    bottom: 25%;
    left: 10%;
}

/* ================================================
   SECTION 2: CANOPY
   ================================================ */
#canopy {
    min-height: 120vh;
    background: #e0f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(4rem, 10vh, 10rem) 0;
    padding-bottom: calc(clamp(4rem, 10vh, 10rem) + 80px);
}

.canopy-content {
    display: flex;
    flex-direction: column;
    gap: clamp(4rem, 8vh, 12rem);
    padding: 0 10%;
    width: 100%;
}

.canopy-content .poetic-text {
    margin-left: calc(15% + var(--offset, 0%));
}

/* Tree marginalia */
.tree-marginalia {
    position: absolute;
    width: 16px;
    height: 16px;
    clip-path: polygon(50% 0%, 0% 60%, 20% 60%, 20% 100%, 80% 100%, 80% 60%, 100% 60%);
    background: #6bcb77;
    opacity: 0.4;
}

.tree-mark-1 { top: 15%; left: 5%; }
.tree-mark-2 { top: 45%; right: 8%; }
.tree-mark-3 { bottom: 20%; left: 12%; }

/* ================================================
   SECTION 3: REEF
   ================================================ */
#reef {
    min-height: 100vh;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 80px;
}

.aquarium {
    position: relative;
    width: 80vw;
    height: 50vh;
    box-shadow: inset 0 0 100px rgba(0, 229, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

/* ---- Fish Animations ---- */
@keyframes drift {
    from { transform: translateX(0); }
    to { transform: translateX(var(--drift-x, 50vw)); }
}

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

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

@keyframes sway {
    0%, 100% { transform: skewX(0deg); }
    50% { transform: skewX(5deg); }
}

@keyframes bubble-rise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
        transform: translateY(-50vh) translateX(var(--b-drift, 10px));
        opacity: 0;
    }
}

@keyframes firefly-float {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% { opacity: 0.8; }
    50% { transform: translateY(-30vh) translateX(15px); opacity: 0.6; }
    90% { opacity: 0.3; }
    100% {
        transform: translateY(-60vh) translateX(-10px);
        opacity: 0;
    }
}

@keyframes canopy-breathe-1 {
    0%, 100% { transform: scale(0.95); }
    50% { transform: scale(1.05); }
}

@keyframes canopy-breathe-2 {
    0%, 100% { transform: scale(1.05); }
    50% { transform: scale(0.95); }
}

/* ---- Fish Container (applies drift) ---- */
.fish-container {
    position: absolute;
    top: var(--start-y, 50%);
    left: var(--start-x, 0%);
    padding: 15px;
    animation: drift var(--drift-dur, 60s) linear infinite alternate;
    z-index: 5;
    cursor: pointer;
}

.surface-fish {
    top: auto;
    left: 10%;
}

/* ---- Fish Inner (applies bob + wiggle) ---- */
.fish {
    position: relative;
    animation:
        bob var(--bob-dur, 4s) ease-in-out infinite,
        wiggle var(--wiggle-dur, 2s) ease-in-out infinite;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(2px 4px 6px rgba(26, 26, 46, 0.2));
}

.fish-container:hover .fish,
.tetra-school:hover .neon-tetra {
    transform: translateY(-12px) scale(1.08);
    filter: brightness(1.15) saturate(1.2) drop-shadow(2px 4px 6px rgba(26, 26, 46, 0.2));
}

.fish-container:hover .fish.angelfish {
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.3);
}

.fish-container:hover .fish.clownfish {
    box-shadow: 0 8px 25px rgba(255, 217, 61, 0.3);
}

.fish-container:hover .fish.blue-tang {
    box-shadow: 0 8px 25px rgba(0, 229, 255, 0.3);
}

.fish-container:hover .fish.betta {
    box-shadow: 0 8px 25px rgba(192, 132, 252, 0.3);
}

.fish-container:hover .fish.green-fish {
    box-shadow: 0 8px 25px rgba(107, 203, 119, 0.3);
}

/* ---- Angelfish ---- */
.angelfish {
    width: 60px;
    height: 70px;
}

.angelfish .fish-body {
    position: absolute;
    width: 50px;
    height: 60px;
    left: 5px;
    top: 5px;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    background: radial-gradient(circle at 35% 35%, #ff85b1, #ff6b9d, #e8558a);
    box-shadow: inset 2px -2px 4px rgba(0, 0, 0, 0.1);
}

.angelfish .fish-fin-dorsal {
    position: absolute;
    width: 20px;
    height: 25px;
    top: -5px;
    right: 0;
    clip-path: polygon(0% 100%, 50% 0%, 100% 100%);
    background: linear-gradient(135deg, #ffd93d, #ffcc00);
}

.angelfish .fish-eye {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1a1a2e;
    top: 28px;
    left: 22px;
}

.angelfish .fish-eye-highlight {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #ffffff;
    top: 1px;
    left: 1px;
}

.angelfish-small {
    transform: scale(0.6);
}

/* ---- Clownfish ---- */
.clownfish {
    width: 55px;
    height: 35px;
}

.clown-body {
    position: absolute;
    width: 45px;
    height: 30px;
    top: 2px;
    left: 0;
    border-radius: 60% 40% 40% 60%;
    background: radial-gradient(circle at 35% 35%, #ffe066, #ffd93d, #f0c830);
    box-shadow: inset 2px -2px 4px rgba(0, 0, 0, 0.1);
}

.clown-stripe {
    position: absolute;
    width: 3px;
    height: 26px;
    top: 4px;
    background: #ffffff;
    border-radius: 2px;
}

.stripe-1 { left: 12px; }
.stripe-2 { left: 22px; }
.stripe-3 { left: 32px; }

.clown-tail {
    position: absolute;
    right: 0;
    top: 5px;
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 15px solid #ff6b9d;
}

.clown-eye {
    top: 10px !important;
    left: 8px !important;
}

.clownfish-small {
    transform: scale(0.7);
}

/* ---- Blue Tang ---- */
.blue-tang {
    width: 50px;
    height: 50px;
}

.tang-body {
    position: absolute;
    width: 40px;
    height: 40px;
    top: 5px;
    left: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #33eeff, #00e5ff, #00c4d9);
    box-shadow: inset 2px -2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid #1a1a2e;
}

.tang-line {
    position: absolute;
    width: 30px;
    height: 3px;
    background: #1a1a2e;
    top: 25px;
    left: 5px;
    border-radius: 2px;
}

.tang-tail {
    position: absolute;
    right: 0;
    top: 12px;
    width: 15px;
    height: 20px;
    clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
    background: #ffd93d;
}

.tang-eye {
    top: 16px !important;
    left: 12px !important;
}

/* ---- Betta Fish ---- */
.betta {
    width: 70px;
    height: 50px;
}

.betta-body {
    position: absolute;
    width: 35px;
    height: 22px;
    top: 14px;
    left: 0;
    border-radius: 50% 45% 45% 50%;
    background: radial-gradient(circle at 35% 35%, #d4a0ff, #c084fc, #a86ee8);
    box-shadow: inset 2px -2px 4px rgba(0, 0, 0, 0.1);
}

.betta-fin {
    position: absolute;
    border-radius: 50% 60% 40% 50%;
    opacity: 0.6;
}

.betta-fin-1 {
    width: 35px;
    height: 30px;
    top: 0;
    left: 20px;
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.7), rgba(255, 107, 157, 0.5));
    transform: rotate(-15deg);
}

.betta-fin-2 {
    width: 30px;
    height: 35px;
    top: 15px;
    left: 25px;
    background: linear-gradient(180deg, rgba(192, 132, 252, 0.5), rgba(255, 107, 157, 0.4));
    transform: rotate(10deg);
}

.betta-fin-3 {
    width: 25px;
    height: 20px;
    top: 30px;
    left: 15px;
    background: linear-gradient(225deg, rgba(192, 132, 252, 0.6), rgba(255, 107, 157, 0.3));
    transform: rotate(5deg);
}

.betta-eye {
    top: 20px !important;
    left: 8px !important;
}

/* ---- Green Fish ---- */
.green-fish {
    width: 45px;
    height: 30px;
}

.green-body {
    position: absolute;
    width: 35px;
    height: 25px;
    top: 2px;
    left: 0;
    border-radius: 55% 45% 45% 55%;
    background: radial-gradient(circle at 35% 35%, #82db8a, #6bcb77, #5ab568);
    box-shadow: inset 2px -2px 4px rgba(0, 0, 0, 0.1);
}

.green-eye {
    top: 8px !important;
    left: 8px !important;
}

/* ---- Neon Tetra ---- */
.tetra-school {
    position: absolute;
    top: var(--start-y, 50%);
    left: var(--start-x, 10%);
    animation: drift var(--drift-dur, 35s) linear infinite alternate;
    z-index: 5;
    padding: 15px;
    cursor: pointer;
}

.neon-tetra {
    position: absolute;
    width: 20px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(90deg, #00e5ff 70%, #ff6b9d 100%);
    transform: translate(var(--t-offset-x, 0), var(--t-offset-y, 0));
    animation: bob 3s ease-in-out infinite;
    filter: drop-shadow(1px 2px 3px rgba(26, 26, 46, 0.15));
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Seaweed ---- */
.seaweed {
    position: absolute;
    bottom: 0;
    width: 8px;
    border-radius: 50% 50% 0 0;
    background: linear-gradient(to top, #4a9c5e, #6bcb77);
    animation: sway 4s ease-in-out infinite;
    transform-origin: bottom center;
    z-index: 3;
}

.seaweed-1 { left: 10%; height: 80px; animation-duration: 3.5s; }
.seaweed-2 { left: 25%; height: 100px; animation-duration: 4.2s; animation-delay: 0.5s; }
.seaweed-3 { left: 50%; height: 70px; animation-duration: 3.8s; animation-delay: 1s; }
.seaweed-4 { left: 70%; height: 90px; animation-duration: 4.5s; animation-delay: 0.3s; }
.seaweed-5 { left: 88%; height: 75px; animation-duration: 3.2s; animation-delay: 0.8s; }

/* ---- Bubbles ---- */
.bubble {
    position: absolute;
    bottom: 10%;
    left: var(--b-x, 50%);
    width: var(--b-size, 6px);
    height: var(--b-size, 6px);
    border-radius: 50%;
    background: rgba(0, 229, 255, 0.15);
    animation: bubble-rise var(--b-dur, 15s) ease-in infinite;
    animation-delay: var(--b-delay, 0s);
    z-index: 2;
}

/* ================================================
   SECTION 4: MEADOW
   ================================================ */
#meadow {
    min-height: 100vh;
    background: #fff8e7;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 80px;
}

.tree-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 60vh;
}

.namu-tree {
    height: 60vh;
    max-width: 90%;
}

/* Canopy breathing animations */
.canopy-circle.c1 { animation: canopy-breathe-1 5s ease-in-out infinite; }
.canopy-circle.c2 { animation: canopy-breathe-2 6s ease-in-out infinite; }
.canopy-circle.c3 { animation: canopy-breathe-1 4.5s ease-in-out infinite 0.5s; }
.canopy-circle.c4 { animation: canopy-breathe-2 7s ease-in-out infinite 1s; }
.canopy-circle.c5 { animation: canopy-breathe-1 5.5s ease-in-out infinite 0.3s; }
.canopy-circle.c6 { animation: canopy-breathe-2 4s ease-in-out infinite 0.8s; }
.canopy-circle.c7 { animation: canopy-breathe-1 6.5s ease-in-out infinite 1.2s; }
.canopy-circle.c8 { animation: canopy-breathe-2 3.5s ease-in-out infinite 0.6s; }
.canopy-circle.c9 { animation: canopy-breathe-1 5s ease-in-out infinite 1.5s; }

.canopy-circle {
    transform-origin: center;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.canopy-circle:hover {
    transform: scale(1.12) !important;
    filter: brightness(1.15) saturate(1.2);
}

/* Firefly fish */
.firefly-fish {
    position: absolute;
    left: var(--ff-x, 50%);
    top: var(--ff-y, 50%);
    width: 14px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(90deg, #ff6b9d, #ffd93d);
    opacity: 0;
    animation: firefly-float var(--ff-dur, 12s) ease-in-out infinite;
    animation-delay: var(--ff-delay, 0s);
    filter: drop-shadow(0 0 4px rgba(255, 107, 157, 0.5));
    z-index: 5;
}

/* ================================================
   SECTION 5: DUSK
   ================================================ */
#dusk {
    min-height: 80vh;
    background: linear-gradient(to bottom, #c084fc, #1a1a2e);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.dusk-title {
    color: #ffffff;
}

.dusk-subtitle {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: #ffd93d;
    text-align: center;
}

/* ---- Shared Eye Styles ---- */
.fish-eye {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1a1a2e;
    z-index: 10;
}

.fish-eye-highlight {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #ffffff;
    top: 1px;
    left: 1px;
}
