.hero {
    position: relative;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(120deg, #3498db, #8e44ad); /* Couleur de fond en gradient */
    color: white;
}

/* Parallax banner image using ::before */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/bannerheroport.png'); /* Image de bannière */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: 800px;
    background-attachment: fixed; /* Parallax effect */
    z-index: 1; /* Derrière tout le contenu */
    opacity: 0.7; /* Facultatif : ajuster l'opacité pour un effet visuel */
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Overlay sombre avec 40% d'opacité */
    z-index: 1; /* Même que l'image mais en dessous du texte */
}

/* Hero text and buttons */
.hero h1, .hero p, .projet-btn {
    position: relative;
    z-index: 2; /* Placer les éléments textuels au-dessus de l'image */
    color: white;
}

.hero h1 {
    font-size: 4rem;
    animation: fadeInUp 2s ease-in-out;
}

.hero p {
    font-size: 1.5rem;
    margin-top: 25px;
    animation: fadeInUp 3s ease-in-out;
}

/* Animation for the button */
.projet-btn {
    width: 150px;
    height: 50px;
    color: #fff;
    border-radius: 5px;
    font-weight: 500;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center; /* Ajuster pour centrer le texte horizontalement */
    text-align: center; /* Centrer le texte */
    text-decoration: none;
    box-shadow: inset 2px 2px 2px 0px rgba(255, 255, 255, .5),
                7px 7px 20px 0px rgba(0, 0, 0, .1),
                4px 4px 5px 0px rgba(0, 0, 0, .1);
    outline: none;
    background: linear-gradient(0deg, rgba(96, 9, 240, 1) 0%, rgba(129, 5, 240, 1) 100%);
    opacity: 0;
    animation: vanishIn 3s ease-in forwards;
    animation-delay: 1.5s;
    z-index: 2;
    margin: 50px auto;
}


.projet-btn:hover {
    box-shadow: 4px 4px 6px 0 rgba(255, 255, 255, .5),
                -4px -4px 6px 0 rgba(116, 125, 136, .5), 
                inset -4px -4px 6px 0 rgba(255, 255, 255, .2),
                inset 4px 4px 6px 0 rgba(0, 0, 0, .4);
}

@keyframes fadeInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes vanishIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


/* --- Media Queries pour la Responsiveness --- */

@media (max-width: 768px) {
    .hero {
        height: auto;
        padding: 50px 20px;
    }

    /* Supprimer le fixed background attachment pour les mobiles */
    .hero::before {
        background-position: top;
        background-size: 70%; /* Réduire la taille de l'image à 70% */
        z-index: 1; /* S'assurer que l'image est derrière le texte */
        background-attachment: scroll; /* Assurez-vous que l'image suit le scroll */
    }

    /* Ajuster la taille du texte */
    .hero h1, .hero p, .projet-btn {
        z-index: 2; /* Assurer que le texte est au-dessus de l'image */
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1rem;
    }

    /* Ajuster la taille du bouton */
    .projet-btn {
        width: 100px;
        height: 35px;
        font-size: 1rem;
        padding: 8px 20px;
    }
}

/* Pour les écrans de moins de 480px */
@media (max-width: 480px) {
    .hero::before {
        background-position: top;
        background-size: 50%; /* Réduire encore plus la taille de l'image */
        z-index: 1; /* S'assurer que l'image est derrière le texte */
        background-attachment: scroll; /* Assurez-vous que l'image suit le scroll */
    }

    .hero h1, .hero p, .projet-btn {
        z-index: 2; /* Assurer que le texte est au-dessus de l'image */
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 0.875rem;
    }

    .projet-btn {
        width: 90px;
        height: 30px;
        font-size: 0.875rem;
        padding: 5px 15px;
    }
}
