: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;
}







/* =========================================================
   RESPONSIVE MOBILE
   À placer à la fin du fichier CSS
   ========================================================= */

@media (max-width: 768px) {

    /* ---------- GLOBAL ---------- */

    html, body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        font-size: 14px;
    }

    /* ---------- HEADER ---------- */

    .container_img_header {
        width: 100%;
        height: auto;
        min-height: 520px;
        overflow: hidden;
    }

    .img_header {
        width: 100%;
        height: 520px;
        object-fit: cover;
        object-position: center;
    }

    .container_header_text {
        padding: 20px;
        align-items: flex-start;
    }

    .container_logo {
        gap: 7px;
    }

    .logo_bleu {
        width: 15px;
        height: auto;
    }

    .container_logo p {
        font-size: 11px;
    }

    .lien {
        gap: 8px;
    }

    .bouton {
        padding: 4px 11px;
        font-size: 11px;
    }

    .bouton span {
        line-height: 18px;
    }

    .bouton span:last-child {
        left: 11px;
        top: 4px;
    }

    .container_prenom {
        top: 185px;
        width: 100%;
        padding: 0 20px;
        box-sizing: border-box;
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .prenom {
        width: min(80vw, 330px);
    }

    .text_prenom {
        display: none;
    }

    /* ---------- BIENVENUE ---------- */

    #bienvenue {
        padding: 4.5em 20px;
        box-sizing: border-box;
    }

    #bienvenue h1 {
        font-size: clamp(2.2rem, 10vw, 3em);
        text-align: center;
    }

    #bienvenue p {
        font-size: 14px;
        line-height: 1.6;
        max-width: 100%;
    }

    #bienvenue br {
        display: none;
    }

    #trait {
        width: 60px;
        margin: 1em 0 1.5em;
    }

    /* ---------- PROJETS ---------- */

    #projet {
        margin: 2em 20px;
    }

    #titre_projet {
        align-items: baseline;
    }

    .titre {
        font-size: clamp(3.5rem, 18vw, 6em);
        line-height: 0.95;
    }

    #chiffre {
        font-size: 1.5em;
        padding-left: 10px;
    }

    .btn-filtre {
        display: none;
    }

    .btn-filtre::-webkit-scrollbar {
        display: none;
    }

    .filtre-controls {
        gap: 8px;
        flex-wrap: nowrap;
        width: max-content;
    }

    .filtre-controls > button {
        flex: 0 0 auto;
        font-size: 12px;
        padding: 7px 12px;
        white-space: nowrap;
    }

    /* ---------- GRILLE DES PROJETS ---------- */

    #realisations {
        margin: 0 20px;
    }

    .grille-projets {
        display: grid;
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 18px;
    }

    .projet,
    .projet-1,
    .projet-2,
    .projet-3,
    .projet-4,
    .projet-5,
    .projet-6,
    .projet-7,
    .projet-8 {
        grid-column: auto;
        grid-row: auto;
        width: 100%;
        height: 62vw;
        min-height: 220px;
        max-height: 360px;
    }

    .projet-infos {
        left: 18px;
        right: 18px;
        bottom: 18px;
        opacity: 1;
        transform: translateY(0);
    }

    /* Sur téléphone, il n'y a pas de vrai hover.
       On garde donc les infos visibles. */
    .projet::after {
        opacity: 1;
        background: linear-gradient(
                transparent 30%,
                rgba(0, 0, 0, 0.65) 100%
        );
    }

    .projet-infos h2 {
        font-size: clamp(1.7rem, 8vw, 2.5em);
        margin-bottom: 7px;
    }

    .projet-infos p {
        font-size: 13px;
    }

    /* ---------- CONTACT ---------- */

    #contact {
        margin: 6em 20px 0;
    }

    #contact > .titre {
        font-size: clamp(3.2rem, 17vw, 6em);
        line-height: 0.95;
    }

    #container_contact {
        display: flex;
        flex-direction: column;
        gap: 3em;
        margin-top: 3em;
    }

    .text1 {
        font-size: 1.7em;
    }

    .text2 {
        font-size: 1.5em;
    }

    #nom_prenom {
        flex-direction: column;
        gap: 0;
    }

    #contactForm p {
        margin-bottom: 35px;
    }

    #contactForm input[type="text"],
    #contactForm input[type="email"],
    #contactForm textarea {
        width: 100%;
        font-size: 16px;
    }

    #message {
        height: 120px;
    }

    .bouton_formulaire {
        width: 110px;
        height: 35px;
    }

    /* ---------- MESSAGE ---------- */

    #responseMessage {
        width: calc(100% - 40px);
        box-sizing: border-box;
        bottom: 15px;
        padding: 0.9em 1em;
        font-size: 13px;
    }

    /* ---------- BOUTON RETOUR EN HAUT ---------- */

    #btnTop {
        right: 15px;
    }

    .flechehaut {
        max-width: 42px;
        height: auto;
    }

    /* ---------- FOOTER ---------- */

    footer {
        padding: 3em 20px 0.8em;
        margin-top: 5em;
    }

    .container_footer {
        flex-direction: column;
        align-items: stretch;
        gap: 2.5em;
    }

    .logo_blanc {
       display: none;
    }

    .container_info_footer {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 2em;
        padding-bottom: 1em;
    }

    .container_rs {
        align-items: flex-start;
    }

    .container_rs p {
        margin-bottom: 5px;
    }

    .img_mail {
        width: min(100%, 280px);
        height: auto;
    }

    .copyright {
        padding: 1em 0 0;
        font-size: 10px;
        line-height: 1.4;
    }
}


/* =========================================================
   TRÈS PETITS TÉLÉPHONES
   ========================================================= */

@media (max-width: 420px) {

    .container_header_text {
        padding: 16px;
    }

    .container_logo p {
        font-size: 10px;
    }

    .lien {
        gap: 5px;
    }

    .bouton {
        padding: 4px 9px;
        font-size: 10px;
    }

    .bouton span:last-child {
        left: 9px;
    }

    .container_prenom {
        top: 175px;
    }

    .prenom {
        width: 78vw;
    }

    .text_prenom {
        font-size: 1.7rem;
    }

    #bienvenue {
        padding: 3.5em 16px;
    }

    #bienvenue p {
        font-size: 13px;
    }

    #projet,
    #realisations,
    #contact {
        margin-left: 16px;
        margin-right: 16px;
    }

    .projet,
    .projet-1,
    .projet-2,
    .projet-3,
    .projet-4,
    .projet-5,
    .projet-6,
    .projet-7,
    .projet-8 {
        height: 68vw;
        min-height: 200px;
    }

    footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}

