/* =========================================
   ggoomimi.com - Styles
   A handmade pop-up storybook aesthetic
   Palette: pastel flat-fill with shadow-depth
   Fonts: Nunito (display), Quicksand (body), Baloo 2 (accent)
   ========================================= */

/* --- CSS Custom Properties --- */
:root {
    --sky-bg: #FFF5E6;
    --lavender-mist: #D8C5F0;
    --mint-foam: #B8E8D2;
    --peach-bloom: #F5B8A8;
    --baby-sky: #A8D4F5;
    --charcoal-plum: #3D3347;
    --dusty-mauve: #8B7A96;
    --buttercup: #F5D86E;
    --lavender-wash: #F0E8F7;
    --mint-wash: #E8F5EE;
    --peach-wash: #FFF0EC;
    --spring-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    letter-spacing: 0.01em;
    line-height: 1.75;
    color: var(--charcoal-plum);
    background-color: var(--sky-bg);
    overflow-x: hidden;
}

/* --- Typography --- */
.headline {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 4.5vw, 3.8rem);
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: var(--charcoal-plum);
    margin-bottom: 0.5em;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s ease, transform 0.8s var(--spring-ease);
}

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

.body-text {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    letter-spacing: 0.01em;
    line-height: 1.75;
    color: var(--charcoal-plum);
}

.accent-label {
    font-family: 'Baloo 2', cursive;
    font-weight: 600;
    font-size: clamp(0.75rem, 1.2vw, 0.95rem);
    color: var(--dusty-mauve);
    text-transform: lowercase;
    letter-spacing: 0.02em;
}

/* --- Story Sections --- */
.story-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 5vw;
    overflow: hidden;
}

.section-sky {
    background-color: var(--sky-bg);
}

.section-lavender {
    background-color: var(--lavender-wash);
}

.section-mint {
    background-color: var(--mint-wash);
}

.section-peach {
    background-color: var(--peach-wash);
}

.section-lavender-deep {
    background-color: var(--lavender-wash);
}

/* --- Bubble Clusters --- */
.bubble-cluster {
    position: relative;
    max-width: 65vw;
    width: 100%;
    z-index: 2;
}

.bubble {
    position: relative;
    padding: 2.5rem 3rem;
    border-radius: 42% 58% 55% 45% / 48% 52% 58% 42%;
    box-shadow: inset 0 4px 16px rgba(0,0,0,0.04);
    transition: all 0.4s var(--spring-ease);
    cursor: default;
}

.bubble:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 12px 32px rgba(61,51,71,0.12), inset 0 4px 16px rgba(0,0,0,0.04);
}

/* Staggered bubble placement */
.bubble + .bubble {
    margin-top: 2rem;
}

.bubble-side-hero,
.bubble-story-2,
.bubble-story-3,
.bubble-meadow-2,
.bubble-meadow-3,
.bubble-bubbles-2,
.bubble-bubbles-3,
.bubble-goodnight-side,
.bubble-goodnight-tiny {
    position: relative;
    left: var(--offset-x, 0);
    top: var(--offset-y, 0);
    max-width: 480px;
}

.bubble-main-hero,
.bubble-story-1,
.bubble-meadow-1,
.bubble-bubbles-1,
.bubble-goodnight-main {
    max-width: 620px;
}

/* Bubble color variants */
.bubble-primary {
    background-color: var(--lavender-mist);
}

.bubble-secondary {
    background-color: var(--mint-foam);
}

.bubble-lavender {
    background-color: var(--lavender-mist);
}

.bubble-mint {
    background-color: var(--mint-foam);
}

.bubble-peach {
    background-color: var(--peach-bloom);
}

.bubble-sky {
    background-color: var(--baby-sky);
}

.bubble-buttercup {
    background-color: var(--buttercup);
}

/* --- Hover-lift Peach Bloom Mix --- */
.bubble-lavender:hover,
.bubble-primary:hover {
    background-color: color-mix(in srgb, var(--lavender-mist) 85%, var(--peach-bloom) 15%);
}

.bubble-mint:hover,
.bubble-secondary:hover {
    background-color: color-mix(in srgb, var(--mint-foam) 85%, var(--peach-bloom) 15%);
}

.bubble-peach:hover {
    background-color: color-mix(in srgb, var(--peach-bloom) 90%, #fff 10%);
}

.bubble-sky:hover {
    background-color: color-mix(in srgb, var(--baby-sky) 85%, var(--peach-bloom) 15%);
}

.bubble-buttercup:hover {
    background-color: color-mix(in srgb, var(--buttercup) 85%, var(--peach-bloom) 15%);
}

/* --- Bubble Particles (CSS-only floating bubbles) --- */
.bubble-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: var(--size);
    height: var(--size);
    left: var(--left);
    bottom: -80px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8), rgba(216,197,240,0.2));
    animation: particleFloat var(--dur) var(--delay) linear infinite;
    pointer-events: none;
    opacity: 0;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    30% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.4;
    }
    70% {
        opacity: 0.35;
    }
    90% {
        opacity: 0.15;
    }
    100% {
        transform: translateY(calc(-100vh - 100px)) translateX(calc(var(--drift) * 1px));
        opacity: 0;
    }
}

/* Mint-tinted particles for mint sections */
.section-mint .particle {
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8), rgba(184,232,210,0.25));
}

/* Peach-tinted particles for peach sections */
.section-peach .particle {
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8), rgba(245,184,168,0.2));
}

/* Sky-tinted particles for hero section */
.section-sky .particle {
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.85), rgba(168,212,245,0.2));
}

/* --- Wave Dividers --- */
.wave-divider {
    position: relative;
    margin-top: -2px;
    z-index: 1;
    line-height: 0;
}

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

/* Wave creatures peeking */
.wave-creature {
    position: absolute;
    z-index: 3;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
}

.wave-creature-1 {
    left: 38%;
    top: 5%;
}

.wave-creature-2 {
    left: 55%;
    top: 8%;
}

.wave-creature-3 {
    left: 42%;
    top: 6%;
}

.wave-creature-4 {
    left: 60%;
    top: 4%;
}

.wave-creature svg.peeking {
    width: 50px;
    height: 34px;
}

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

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

.creature-hero .creature-svg {
    width: 120px;
}

.creature-goodnight .creature-svg {
    width: 120px;
}

/* Breathing animation */
.creature-body {
    animation: breathe 4s ease-in-out infinite;
    transform-origin: center bottom;
}

@keyframes breathe {
    0%, 100% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(1.03);
    }
}

/* Eye blinking */
.eye {
    animation: blink 5s ease-in-out infinite;
}

.eye-left {
    animation-delay: 0.05s;
}

@keyframes blink {
    0%, 93%, 100% {
        transform: scaleY(1);
    }
    95% {
        transform: scaleY(0.05);
    }
    97% {
        transform: scaleY(1);
    }
}

/* Closed eyes (goodnight creature) - gentle bounce */
.eye-closed {
    animation: sleepyBounce 3s ease-in-out infinite;
}

@keyframes sleepyBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(1px);
    }
}

/* --- Doodles --- */
.doodle {
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

.doodle svg {
    display: block;
}

/* --- Floating Navigation --- */
.floating-nav {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background-color: var(--lavender-mist);
    color: var(--charcoal-plum);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(61,51,71,0.1);
    transition: all 0.4s var(--spring-ease);
    position: relative;
}

.nav-btn:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 12px 32px rgba(61,51,71,0.12);
    background-color: color-mix(in srgb, var(--lavender-mist) 85%, var(--peach-bloom) 15%);
}

.nav-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.nav-btn svg {
    width: 22px;
    height: 22px;
}

.nav-btn.active {
    background-color: var(--peach-bloom);
    box-shadow: 0 4px 16px rgba(245,184,168,0.3);
}

/* --- Hero Section Special --- */
.cluster-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bubble-main-hero {
    text-align: center;
}

.cluster-hero .bubble-side-hero {
    align-self: flex-end;
}

/* --- Stories Section --- */
.cluster-stories {
    display: flex;
    flex-direction: column;
}

.cluster-stories .bubble-story-1 {
    align-self: flex-start;
}

.cluster-stories .bubble-story-2 {
    align-self: flex-end;
}

.cluster-stories .bubble-story-3 {
    align-self: center;
}

/* --- Meadow Section --- */
.cluster-meadow {
    display: flex;
    flex-direction: column;
}

.cluster-meadow .bubble-meadow-1 {
    align-self: flex-end;
}

.cluster-meadow .bubble-meadow-2 {
    align-self: flex-start;
}

.cluster-meadow .bubble-meadow-3 {
    align-self: flex-end;
}

/* --- Bubbles Section --- */
.cluster-bubbles {
    display: flex;
    flex-direction: column;
}

.cluster-bubbles .bubble-bubbles-1 {
    align-self: flex-start;
}

.cluster-bubbles .bubble-bubbles-2 {
    align-self: flex-end;
}

.cluster-bubbles .bubble-bubbles-3 {
    align-self: center;
}

/* --- Goodnight Section --- */
.cluster-goodnight {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cluster-goodnight .bubble-goodnight-main {
    text-align: center;
}

.cluster-goodnight .bubble-goodnight-side {
    align-self: flex-start;
}

.cluster-goodnight .bubble-goodnight-tiny {
    align-self: flex-end;
}

/* --- Touch Lift Class --- */
.touch-lifted {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 12px 32px rgba(61,51,71,0.12);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .bubble-cluster {
        max-width: 92vw;
    }

    .bubble {
        padding: 1.8rem 2rem;
    }

    .bubble-side-hero,
    .bubble-story-2,
    .bubble-story-3,
    .bubble-meadow-2,
    .bubble-meadow-3,
    .bubble-bubbles-2,
    .bubble-bubbles-3,
    .bubble-goodnight-side,
    .bubble-goodnight-tiny {
        left: 0;
        top: 0;
    }

    .story-section {
        padding: 80px 4vw;
    }

    .floating-nav {
        bottom: 16px;
        right: 16px;
        gap: 8px;
    }

    .nav-btn {
        width: 40px;
        height: 40px;
    }

    .nav-btn svg {
        width: 18px;
        height: 18px;
    }

    .creature-svg {
        width: 80px;
    }

    .creature-hero .creature-svg,
    .creature-goodnight .creature-svg {
        width: 100px;
    }

    .cluster-stories .bubble-story-1,
    .cluster-stories .bubble-story-2,
    .cluster-stories .bubble-story-3,
    .cluster-meadow .bubble-meadow-1,
    .cluster-meadow .bubble-meadow-2,
    .cluster-meadow .bubble-meadow-3,
    .cluster-bubbles .bubble-bubbles-1,
    .cluster-bubbles .bubble-bubbles-2,
    .cluster-bubbles .bubble-bubbles-3,
    .cluster-goodnight .bubble-goodnight-side,
    .cluster-goodnight .bubble-goodnight-tiny {
        align-self: center;
    }
}

@media (max-width: 480px) {
    .headline {
        font-size: clamp(1.6rem, 6vw, 2.2rem);
    }

    .bubble {
        padding: 1.4rem 1.5rem;
        border-radius: 32% 68% 50% 50% / 45% 55% 52% 48%;
    }

    .floating-nav {
        flex-direction: row;
        bottom: 12px;
        right: 50%;
        transform: translateX(50%);
    }
}
