html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    background: #0a0a0a;
    overflow: hidden;
    font-family: 'Space Grotesk', sans-serif;
}

/* Pause State for Animations */
body.is-paused *, body.is-paused *:before, body.is-paused *:after {
    animation-play-state: paused !important;
}

/* Hide Garden Initially */
.garden-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    opacity: 0;
    transition: opacity 4s ease-in-out;
}

body.garden-active .garden-svg {
    opacity: 1;
}

/* Pause all animations if the garden is not active */
body:not(.garden-active) .garden-svg * {
    animation-play-state: paused !important;
}

/* Animations */
.stem {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: growStem 3s ease-in-out forwards;
}

.flower-head {
    transform: scale(0);
    animation: bloomHead 2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.branch-stem {
    opacity: 0;
    animation: fadeBranch 1s ease-in-out forwards;
}

/* Add different delays to make it look organic */
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.5s; }
.delay-3 { animation-delay: 0.8s; }
.delay-4 { animation-delay: 1.1s; }
.delay-5 { animation-delay: 1.4s; }

.head-delay-1 { animation-delay: 2.2s; }
.head-delay-2 { animation-delay: 2.5s; }
.head-delay-3 { animation-delay: 2.8s; }
.head-delay-4 { animation-delay: 3.1s; }
.head-delay-5 { animation-delay: 3.4s; }

/* Global sway for the whole garden to feel alive */
.garden-group {
    transform-origin: 500px 1600px;
    animation: gentleSway 8s ease-in-out infinite alternate;
}

.sway-fast {
    transform-origin: 50% 100%;
    animation: gentleSway 5s ease-in-out infinite alternate;
}

.individual-sway-1 { animation: indSway 4s ease-in-out infinite alternate 0s; }
.individual-sway-2 { animation: indSway 4.5s ease-in-out infinite alternate 0.5s; }
.individual-sway-3 { animation: indSway 5s ease-in-out infinite alternate 1s; }
.individual-sway-4 { animation: indSway 3.8s ease-in-out infinite alternate 1.5s; }
.individual-sway-5 { animation: indSway 4.2s ease-in-out infinite alternate 0.2s; }

@keyframes growStem {
    to { stroke-dashoffset: 0; }
}

@keyframes bloomHead {
    to { transform: scale(1); }
}

@keyframes fadeBranch {
    to { opacity: 1; }
}

@keyframes gentleSway {
    0% { transform: rotate(-0.4deg); }
    100% { transform: rotate(0.4deg); }
}

@keyframes indSway {
    0% { transform: rotate(-0.8deg); }
    100% { transform: rotate(0.8deg); }
}

.pollen {
    opacity: 0;
    animation-name: drift;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes drift {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 0.6; }
    50% { transform: translateY(-100px) translateX(50px); opacity: 0.8; }
    90% { opacity: 0; }
    100% { transform: translateY(-200px) translateX(100px); opacity: 0; }
}

.bee-flight {
    animation: flyAcross 20s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    opacity: 0; 
    animation-fill-mode: both;
    animation-delay: 3s;
}

.bee-flight-2 {
    animation: flyAcross2 25s ease-in-out infinite;
    animation-delay: 8s;
    opacity: 0;
    animation-fill-mode: both;
}

@keyframes flyAcross {
    0% { transform: translate(-100px, 400px); opacity: 0; }
    5% { opacity: 1; }
    20% { transform: translate(300px, 350px) translateY(-50px); }
    40% { transform: translate(500px, 200px) translateY(50px); }
    60% { transform: translate(750px, 300px) translateY(-30px); }
    80% { transform: translate(900px, 150px) translateY(20px); }
    95% { opacity: 1; }
    100% { transform: translate(1150px, 250px); opacity: 0; }
}

@keyframes flyAcross2 {
    0% { transform: translate(1150px, 200px) scaleX(-1); opacity: 0; }
    5% { opacity: 1; }
    25% { transform: translate(800px, 300px) scaleX(-1) translateY(40px); }
    50% { transform: translate(450px, 150px) scaleX(-1) translateY(-60px); }
    75% { transform: translate(200px, 250px) scaleX(-1) translateY(30px); }
    95% { opacity: 1; }
    100% { transform: translate(-100px, 100px) scaleX(-1); opacity: 0; }
}

.bee-hover {
    animation: hover 1.5s ease-in-out infinite alternate;
}

.wing {
    animation: flutter 0.05s linear infinite alternate;
}

@keyframes flutter {
    from { transform: rotate(20deg) scaleY(1); }
    to { transform: rotate(-20deg) scaleY(0.2); }
}

/* Audio Controls */
.controls-container {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 1000;
    display: flex;
    gap: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.controls-container.visible {
    opacity: 1;
    pointer-events: auto;
}

.icon-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 0;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.icon-btn span {
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Story Sequence */
#sentence-container {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.sentence {
    position: absolute;
    max-width: 800px;
    padding: 2rem;
    text-align: center;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    line-height: 1.6;
    font-weight: 300;
    opacity: 0;
    transform: translateY(20px);
    transition: all 1.5s ease-in-out;
}

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

.sentence.fade-out {
    opacity: 0;
    transform: translateY(-20px);
}

.yello-text {
    font-size: clamp(2rem, 6vw, 4rem);
    font-style: italic;
    color: #FFD166;
    font-family: 'Outfit', sans-serif;
    font-weight: bold;
}
