/* Enhancements for the name "Lucine" */
.name {
    position: fixed;
    top: 5vmin;
    left: 50%;
    transform: translateX(-50%);
    font-size: 5vmin;
    color: #fff;
    font-family: 'Pacifico', cursive;
    text-shadow: 
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 20px #ff00de,
        0 0 30px #ff00de,
        0 0 40px #ff00de;
    z-index: 9999;
    animation: floatText 3s ease-in-out infinite;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 2s ease; /* Fade in transition */
}

@keyframes floatText {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
        text-shadow: 
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 20px #ff00de,
        0 0 30px #ff00de,
        0 0 40px #ff00de;
    }
    50% {
        transform: translateX(-50%) translateY(-10px);
        text-shadow: 
        0 0 10px #fff,
        0 0 20px #ff00de,
        0 0 30px #ff00de,
        0 0 40px #ff00de,
        0 0 50px #ff00de;
    }
}

/* --- Fireflies --- */
.fireflies {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1; /* Behind flowers but above video */
    transition: opacity 2s ease;
}

.firefly {
    position: absolute;
    width: 0.5vmin;
    height: 0.5vmin;
    background: #ffff00;
    border-radius: 50%;
    box-shadow: 0 0 1vmin #ffff00, 0 0 2vmin #ffff00;
    animation: moveFirefly 15s linear infinite;
    opacity: 0;
}

/* Randomize firefly positions and delays */
.firefly:nth-child(1) { left: 10%; top: 20%; animation-duration: 12s; animation-delay: 0s; }
.firefly:nth-child(2) { left: 80%; top: 10%; animation-duration: 15s; animation-delay: 1s; }
.firefly:nth-child(3) { left: 40%; top: 60%; animation-duration: 18s; animation-delay: 2s; }
.firefly:nth-child(4) { left: 70%; top: 80%; animation-duration: 20s; animation-delay: 0.5s; }
.firefly:nth-child(5) { left: 20%; top: 90%; animation-duration: 14s; animation-delay: 3s; }
.firefly:nth-child(6) { left: 90%; top: 30%; animation-duration: 16s; animation-delay: 1.5s; }
.firefly:nth-child(7) { left: 50%; top: 50%; animation-duration: 22s; animation-delay: 4s; }
.firefly:nth-child(8) { left: 15%; top: 40%; animation-duration: 19s; animation-delay: 2.5s; }
.firefly:nth-child(9) { left: 85%; top: 70%; animation-duration: 17s; animation-delay: 0.2s; }
.firefly:nth-child(10) { left: 30%; top: 15%; animation-duration: 13s; animation-delay: 5s; }

@keyframes moveFirefly {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(1);
    }
    10% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(10vmin, -20vmin) scale(0);
    }
}


/* --- Butterflies --- */
.butterflies {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100; /* Above everything */
    transition: opacity 2s ease;
}

.butterfly {
    position: absolute;
    width: 5vmin;
    height: 5vmin;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    animation: fly 10s linear infinite;
}

/* Butterfly 1 */
.butterfly:nth-child(1) {
    top: 80%;
    left: -10%;
    animation-duration: 15s;
    animation-delay: 0s;
    background: url('https://upload.wikimedia.org/wikipedia/commons/3/3d/Blue_Morpho_Butterfly_Icon.png') no-repeat center/contain;
    filter: hue-rotate(290deg) drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

/* Butterfly 2 */
.butterfly:nth-child(2) {
    top: 60%;
    left: -10%;
    animation-duration: 18s;
    animation-delay: 5s;
     background: url('https://upload.wikimedia.org/wikipedia/commons/3/3d/Blue_Morpho_Butterfly_Icon.png') no-repeat center/contain;
     filter: hue-rotate(50deg) drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

/* Butterfly 3 (smaller) */
.butterfly:nth-child(3) {
    top: 90%;
    left: -10%;
    width: 3vmin;
    height: 3vmin;
    animation-duration: 20s;
    animation-delay: 2s;
     background: url('https://upload.wikimedia.org/wikipedia/commons/3/3d/Blue_Morpho_Butterfly_Icon.png') no-repeat center/contain;
     filter: hue-rotate(180deg) drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

/* Butterfly 4 (fast) */
.butterfly:nth-child(4) {
    top: 40%;
    left: -10%;
    width: 4vmin;
    height: 4vmin;
    animation-duration: 12s;
    animation-delay: 8s;
    background: url('https://upload.wikimedia.org/wikipedia/commons/3/3d/Blue_Morpho_Butterfly_Icon.png') no-repeat center/contain;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}


@keyframes fly {
    0% {
        left: -10%;
        transform: translateY(0) rotate(20deg);
    }
    25% {
        transform: translateY(-10vmin) rotate(45deg);
    }
    50% {
        transform: translateY(0) rotate(20deg);
    }
    75% {
        transform: translateY(-10vmin) rotate(0deg);
    }
    100% {
        left: 110%;
        transform: translateY(0) rotate(20deg);
    }
}

/* --- Intro Overlay --- */
#intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* Highest priority */
    cursor: pointer;
    transition: opacity 1.5s ease;
}

.intro-content {
    text-align: center;
    color: #fff;
    font-family: 'Dancing Script', cursive;
}

.intro-content p {
    font-size: 8vmin;
    text-shadow: 0 0 20px rgba(255, 0, 222, 0.8), 0 0 10px white;
    margin-bottom: 20px;
}

.click-hint {
    font-size: 3vmin;
    opacity: 0.8;
    font-family: 'Arial', sans-serif;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Hide elements initially */
body.not-loaded .flowers,
body.not-loaded .butterflies,
body.not-loaded .fireflies,
body.not-loaded .name {
    opacity: 0;
    animation-play-state: paused !important;
}

/* Also pause nested animations */
body.not-loaded .flowers *,
body.not-loaded .butterflies *,
body.not-loaded .fireflies *,
body.not-loaded .name * {
    animation-play-state: paused !important;
}

body.not-loaded #intro {
    opacity: 1;
}

/* Class to hide intro */
#intro.fade-out {
    opacity: 0;
    pointer-events: none;
}