:root {
    --primary-color: #111a37;
    --second-color: #B9DBDC;
    --body: rgb(255, 255, 255);
    --font-title: "railroad-gothic-atf", sans-serif;
    --font-text: "new-hero", sans-serif;
}

body{
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: auto;
}

main {
    position: relative;
    z-index: 5;
}
/*margin: haut droite bas gauche;*/


/*--------------------------- BIENVENUE ---------------------------------*/
header{
    margin: 0;
    padding: 0;
}

/*--------------------------- BIENVENUE ---------------------------------*/
#bienvenue h1{
    font-family: var(--font-title);
    font-size: 3em;
    font-weight: 700;
    margin: 0;
    padding: 0;
    color: var(--primary-color);
}

#bienvenue p{
    font-family: var(--font-text);
    font-weight: 400;
    font-style: normal;
    font-size: 16px;
    text-align: center;
    margin: 0;
    padding: 0;
    color: var(--primary-color);
}

#bienvenue {
    position: relative;
    z-index: 5;

    display: flex;
    flex-direction: column;
    align-items: center;

    margin: 0;
    padding: 6em 0;

    background-color: white;
}

#trait{
    width: 80px;
    height: 2px;
    background-color: #B9DBDC;
    margin: 1em 0;
}

.gras{
    font-weight: 600;
}


/*----------------------------------- ANIMATION D'APPARITION ---------------------------------*/
#bienvenue h1,
#bienvenue #trait,
#bienvenue p, #projet #titre_projet,
#projet .btn-filtre {
    opacity: 0;
    transform: translateY(35px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* Quand la section est visible */
#bienvenue.visible h1 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

#bienvenue.visible #trait {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.5s;
}

#bienvenue.visible p {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.7s;
}

/* PROJETS TITRES */

#projet.visible #titre_projet {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

#projet.visible .btn-filtre {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.5s;
}


/* Réalisations cachées au départ */

.projet {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.projet.visible {
    opacity: 1;
    transform: translateY(0);
}


/* CONTACT */

#contact > .titre,
#contact .container_titre_contact,
#contact .formulaire {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}


/* Titre */

#contact.visible > .titre {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}


/* Texte */

#contact.visible .container_titre_contact {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.4s;
}


/* Formulaire */

#contact.visible .formulaire {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.6s;
}


/*---------------------------------- PROJET ---------------------------------*/
#projet{
    margin: 2em 5em;
}

#titre_projet{
    display: flex;
    align-items: baseline;
}

.titre{
    font-family: var(--font-title);
    font-size: 7em;
    font-weight: 700;
    margin: 0;
    padding: 0;
    color: var(--primary-color);
}

#chiffre{
    color: var(--second-color);
    font-family: var(--font-text);
    font-weight: 500;
    font-style: normal;
    font-size: 2em;
    padding-left: 20px;
}

.grille-projets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 250px;
    gap: 35px;
}

.projet {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.projet img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;

    transition: transform 0.5s ease;
}

.projet::after {
    content: "";
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0.5);

    opacity: 0;
    transition: opacity 0.5s ease;
}

.projet:hover img {
    transform: scale(1.03);
}

.projet:hover::after {
    opacity: 1;
}

.projet-infos {
    position: absolute;
    left: 30px;
    right: 30px;
    bottom: 25px;

    color: white;

    opacity: 0;
    transform: translateY(20px);

    transition:
            opacity 0.5s ease,
            transform 0.5s ease;

    z-index: 2;
}

.projet-infos h2 {
    font-family: var(--font-title);
    font-size: 2.5em;
    font-weight: 400;

    margin: 0 0 10px 0;
    padding: 0;
}

.projet-trait {
    width: 100%;
    height: 1px;

    background-color: white;

    margin: 0 0 10px 0;
}

.projet-infos p {
    font-family: var(--font-text);
    font-size: 1em;
    font-weight: 400;

    margin: 0;
}

.projet:hover .projet-infos {
    opacity: 1;
    transform: translateY(0);
}



/*------------------------------------- BOUTON DE FILTRE -------------------------------------*/
.btn-filtre {
    display: flex;
    justify-content: left;
    padding: 0.5em 0;
}

.filtre-controls {
    display: flex;
    gap: 1.5em;
}

.filtre-controls > button {
    position: relative;
    overflow: hidden;

    text-decoration: none;
    color: var(--primary-color);
    font-family: var(--font-text);
    font-size: 1em;

    border: 1px solid var(--primary-color);
    border-radius: 1.5em;

    padding: 0.4em 0.8em;
    background-color: transparent;

    cursor: pointer;
}

/* Les deux textes */

.filtre-controls button span {
    display: block;
    line-height: 20px;
    transition: transform 0.4s ease-out;
}

/* Le deuxième texte est placé sous le bouton */

.filtre-controls button span:last-child {
    position: absolute;
    left: 0;
    top: 0;

    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    transform: translateY(150%);
}

/* Au survol */

.filtre-controls button:hover span:first-child {
    transform: translateY(-150%);
}

.filtre-controls button:hover span:last-child {
    transform: translateY(0);
}

.filtre-controls button.active {
    background-color: var(--primary-color);
    color: white;
}


/*------------------------------------- GRILLE REALISATION -------------------------------------*/
#realisations{
    margin: 0 5em;
}

.grille-projets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 250px;
    gap: 35px;
}

/* Chaque projet */
.projet {
    overflow: hidden;
    border-radius: 8px;
}

.projet img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* GRAND carré en haut à gauche */
.projet-1 {
    grid-column: span 2;
    grid-row: span 2;
}

/* Petit projet en haut à droite */
.projet-2 {
    grid-column: span 2;
}

/* Petit projet sous le précédent */
.projet-3 {
    grid-column: span 2;
}

/* Grande bande */
.projet-4 {
    grid-column: span 4;
    grid-row: span 2;
}

/* Petits projets */
.projet-5 {
    grid-column: span 1;
}

.projet-6 {
    grid-column: span 1;
}

/* Grand projet à droite */
.projet-7 {
    grid-column: span 2;
    grid-row: span 2;
}

/* Grand projet en bas à gauche */
.projet-8 {
    grid-column: span 2;
}

.hidden {
    display: none;
}


/*------------------------------------- CONTACT -------------------------------------*/
#contact{
    margin: 8em 5em 0 5em;
}

#contact p {
    font-family: var(--font-text);
    font-style: normal;
    color: var(--primary-color);
    padding: 0;
    margin: 0;
}

.text1 {
    font-size: 2em;
    font-weight: 400;
}

.text2{
    font-size: 1.8em;
    font-weight: 600;
}

#container_contact{
    display: grid;
    grid-template-columns: 3fr 4fr;
    gap: 6em;
    margin: 4em 0 0 0;
}

#contactForm p {
    display: flex;
    flex-direction: column;
    margin: 0 0 50px 0;

}

#nom_prenom{
    display: flex;
    gap: 50px;
}

#nom_prenom p {
    flex: 1;
}

#contactForm input[type="text"],
#contactForm input[type="email"],
#contactForm textarea {
    width: 100%;
    box-sizing: border-box;

    border: none;
    border-bottom: 2px solid var(--primary-color);

    outline: none;
    resize: none;

    font-family: var(--font-text);
    font-size: 1em;
}

#message {
    height: 140px;
}

.bouton_envoyer {
    margin-top: 0;
}

.bouton_envoyer .bouton {
    width: 120px;
    padding: 10px 10px;

    border: none;
    border-radius: 50px;

    background-color: var(--primary-color);
    color: white;

    font-family: var(--font-text);
    font-size: 0.9em;
    cursor: pointer;
}

.bouton_formulaire {
    position: relative;
    overflow: hidden;

    width: 110px;
    height: 35px;
    padding: 0;
    margin: 0;

    border: none;
    border-radius: 50px;

    background-color: var(--primary-color);
    color: white;

    font-family: var(--font-text);
    font-size: 0.9em;
    cursor: pointer;
}

.bouton_formulaire span {
    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: transform 0.4s ease-out;
}

.bouton_formulaire span:first-child {
    transform: translateY(0);
}

.bouton_formulaire span:last-child {
    transform: translateY(100%);
}

.bouton_formulaire:hover span:first-child {
    transform: translateY(-100%);
}

.bouton_formulaire:hover span:last-child {
    transform: translateY(0);
}



/*--------------------------- MESSAGE -------------------------------*/
#responseMessage {
    font-family: "elza", sans-serif;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    padding: 1em 1.5em;
    border-radius: 1em;
    will-change: transform, opacity;
    display: none; /* caché par défaut */
    text-align: center;
}

/* Couleur si succès */
.success-message {
    background-color: var(--primary-color);
    color: white;
}

/* Couleur si erreur */
.error-message {
    background-color: var(--primary-color);
    color: white;
}

/* Animation apparition */
.show {
    animation: slideUp 0.3s ease-out forwards;
}

/* Animation disparition */
.hide {
    animation: slideDown 0.4s ease-out forwards;
}

/* Keyframes */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(50px);
    }
}






/*------------------------------------- FOOTER -------------------------------------*/
footer{
    font-family: var(--font-text);
    background-color: var(--primary-color);
    color: white;
    padding: 3em 5em 0.5em 0;
}

.logo_blanc{
    width: 15%;
    padding-left: 5em;
    padding-bottom: 3em;
}

.copyright{
    border-top: 1px solid rgba(255, 255, 255, 0.40);
    font-size: 0.8em;
    padding-top: 0.5em;
    padding-left: 6em;
    color: rgba(255, 255, 255, 0.40);
}

.img_mail{
    width: 380px;
    height: auto;
}

.container_info_footer{
    padding-bottom: 0.5em;
}

.container_footer{
    display: flex;
    align-items: end;
    justify-content: space-between;
}

.container_rs{
    display: flex;
    flex-direction: column;
    align-items: end;
}

.container_rs:first-of-type p{
    font-weight: 600;
}
.rs{
    text-decoration: none;
    color: white;
    line-height: 1.7;
}


/*------------------------------------- HEADER -------------------------------------*/

.container_logo{
    display: flex;
    align-items: center;
    gap: 12px;
}

.container_logo p {
    font-size: 15px;
}

.logo_bleu{
    width: 18px;
    height: 30px;
    display: block;
}

header a {
    text-decoration: none;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 5em;
    padding: 5px 17px;
}

header a:last-of-type {
    background-color: var(--primary-color);
    color: white;
}



header {
    position: relative;
    font-family: var(--font-text);
    color: var(--primary-color);

    overflow: hidden;
}

.container_img_header {
    width: 100%;
    overflow: hidden;
}

.img_header {
    width: 100%;
    height: auto;
    display: block;

    will-change: transform;
}
.container_header_text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 30px 50px;
    box-sizing: border-box;
}
.container_prenom {
    position: absolute;
    top: 210px;
    left: 50%;
    transform: translateX(-50%);

    width: 1000px; /* à adapter */

    display: flex;
    align-items: flex-end;
    gap: 2em;
    justify-content: center;
}

.text_prenom {
    font-family: var(--font-title);
    font-size: 3.5em;
    font-weight: 900;
    margin: 0;
    padding: 0;
    line-height: 1.1;
}


.lien {
    display: flex;
    gap: 25px;
}


.bouton {
    position: relative;
    display: inline-block;
    overflow: hidden;

    padding: 5px 17px;

    color: var(--primary-color);
    text-decoration: none;
    border: 1px solid var(--primary-color);
    border-radius: 5em;

    box-sizing: border-box;
}

.bouton span {
    display: block;
    line-height: 20px;
    transition: transform 0.4s ease-out;
}

.bouton span:last-child {
    position: absolute;
    left: 17px;
    top: 5px;
    transform: translateY(150%);
}

.bouton:hover span:first-child {
    transform: translateY(-150%);
}

.bouton:hover span:last-child {
    transform: translateY(0);
}



/* ================================= ANIMATIONS HEADER =================================== */

@keyframes arriveDuBas {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes arriveDuHaut {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* PRÉNOM */

.prenom {
    width: 450px;
    height: auto;

    opacity: 0;

    animation: arriveDuBas 1s ease-out forwards;
    animation-delay: 0.3s;
}


/* TEXTE À CÔTÉ */

.text_prenom {
    font-family: var(--font-title);
    font-size: 3.3em;
    font-weight: 700;
    margin: 0;
    padding: 0;
    line-height: 1.1;

    opacity: 0;
    animation: arriveDuBas 1s ease-out forwards;
}

.text_prenom:nth-child(1) {
    animation-delay: 0.7s;
}

.text_prenom:nth-child(2) {
    animation-delay: 0.7s;
}


/* HEADER DU HAUT */

.container_header_text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 30px 50px;
    box-sizing: border-box;

    opacity: 0;

    animation: arriveDuHaut 1s ease-out forwards;
    animation-delay: 1.4s;

    z-index: 2;

    will-change: transform;
}

