@import url('https://fonts.googleapis.com/css2?family=Sunflower:wght@300;500;700&display=swap');

body {
    font-family: 'Sunflower', sans-serif; /* Applying Sunflower throughout the body */
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #ffffff; /* Initial background color */
    color: #000000; /* Initial text color */
    opacity: 0;
    transition: opacity 1s ease-in-out;
    overflow: hidden; /* Ensure the petals stay within the viewport */
}

body.loaded {
    opacity: 1;
    animation: colorTransition 1s forwards;
    overflow: auto; /* Enable scrolling */
}

@keyframes colorTransition {
    0% {
        background-color: #ffffff;
        color: #000000;
    }
    100% {
        background-color: #000000;
        color: #ffffff;
    }
}

header {
    position: relative;
    color: #535353;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('background.jpg') no-repeat center center/cover;
    filter: brightness(1) blur(8px);
    transition: filter 1s ease-in-out;
    z-index: -1;
}

body.loaded header::before {
    filter: brightness(0.5) blur(8px); /* Apply a dark filter */
}

header:hover::before {
    filter: brightness(1) blur(0); /* Remove dark filter and blur on hover */
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-around;
    max-width: 960px;
    margin: 0 auto;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
}

body.loaded .header-content {
    opacity: 1;
    transform: translateY(0);
}

.profile-pic {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    margin-right: 20px;
    box-shadow: 0 0 8px 8px rgba(0, 0, 0, 0.6); /* Shadow around the image for depth */
    border-radius: 10px; /* Slightly round the corners */
}

.header-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255, 255, 255, 0.8); /* White background with opacity */
    padding: 20px;
    border-radius: 10px;
    color: #000000;
}

body.loaded .header-text {
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
}

.header-text h1, .header-text p {
    margin: 0;
    text-align: left;
}

nav ul {
    list-style: none;
    padding: 0;
    text-align: center;
    background-color: #ffffff; /* Keep nav bar white */
    margin-top: auto;
    transition: background-color 1s;
}

body.loaded nav ul {
    background-color: #ffffff; /* Keep nav bar white */
}

nav ul li {
    display: inline-block;
}

nav ul li a {
    text-decoration: none;
    padding: 15px 20px;
    display: inline-block;
    color: #000000; /* Initial text color */
    transition: color 1s, background-color 1s;
}

body.loaded nav ul li a {
    color: #000000; /* Keep text color black */
}

nav ul li a:hover {
    background-color: #003366; /* Change hover color to dark blue */
    color: #ffffff; /* Change text color to white on hover */
}

main .section {
    display: none;
    padding: 20px;
    text-align: center;
}

main .section:target {
    display: block;
    overflow: auto; /* Enable scrolling if content is too long */
}

footer {
    background-color: #ffffff;
    color: #000000;
    text-align: center;
    padding: 10px;
    border-top: 1px solid #cccccc;
    transition: background-color 1s, color 1s;
}

body.loaded footer {
    background-color: #000000;
    color: #ffffff;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        padding: 0 20px;
    }

    .profile-pic {
        margin: 0 auto 20px;
        width: 150px;
        height: 150px;
    }

    .header-text {
        text-align: center;
        padding: 20px 10px;
    }

    nav ul li {
        display: block;
        padding: 10px 0;
    }

    nav ul li a {
        padding: 10px 0;
        display: block;
        color: #000000; /* Keep text color black */
    }
}

/* Petals Falling Animation */
@keyframes fall {
    0% {
        transform: translateY(-100px);
        opacity: 1;
    }
    100% {
        transform: translateY(calc(100vh + 100px));
        opacity: 0;
    }
}

.petal {
    position: absolute;
    top: -100px;
    background: url('cerisier.png') no-repeat center center;
    background-size: contain;
    width: 25px;
    height: 25px;
    opacity: 0;
    animation: fall linear infinite;
}

.petal:nth-child(1) { left: 10%; animation-duration: 7s; animation-delay: 1s; }
.petal:nth-child(2) { left: 20%; animation-duration: 8s; animation-delay: 3s; }
.petal:nth-child(3) { left: 30%; animation-duration: 6s; animation-delay: 5s; }
.petal:nth-child(4) { left: 40%; animation-duration: 10s; animation-delay: 2s; }
.petal:nth-child(5) { left: 50%; animation-duration: 5s; animation-delay: 4s; }
.petal:nth-child(6) { left: 60%; animation-duration: 9s; animation-delay: 6s; }
.petal:nth-child(7) { left: 70%; animation-duration: 7s; animation-delay: 1s; }
.petal:nth-child(8) { left: 80%; animation-duration: 8s; animation-delay: 3s; }
.petal:nth-child(9) { left: 90%; animation-duration: 6s; animation-delay: 5s; }
