/****************************************/
/****************************************/
/***************** ROOT *****************/
/****************************************/
/****************************************/

:root {
    --bg1: #F3F3F5;
    --bg2: #e2e2e2;
    --bg3: #2c57e7;
    --bg4: #dfe2e9;
    --color1: #374252;
    --color2: #F3F3F5;
    --color3: #2c57e7;
    --color4: linear-gradient(to right, #2c57e7, #de58e2);
    --primary_police: "Inter", sans-serif;
}

/****************************************/
/****************************************/
/***************** BASE *****************/
/****************************************/
/****************************************/

body, * {
    transition:
    background-color .6s ease, 
    color .6s ease, 
    fill .6s ease, 
    border-color .6s ease,
    box-shadow .6s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg1);
    font-size: 16px;
    font-family: var(--primary_police);
    margin: 0;
    user-select: none;
}

html, body {
    overflow-x: hidden;
}

main {
    max-width: 1600px;
    margin: 0 auto;
    padding-top: 0rem;
}

section {
    scroll-margin-top: 70px;
}

h1 {
    margin: 0;
    text-align: center;
    font-size: 3rem;
    background: var(--color4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--color1);
}

a {
    text-decoration: none;
    color: inherit;
    &:hover {
        color: var(--color3);
    }
}

ul {
    list-style-type: none;
}

textarea {
    resize: none;
}

p {
    color: var(--color1);
}

/****************************************/
/****************************************/
/************** COMPONENTS **************/
/****************************************/
/****************************************/

/* ------ BOUTONS FLOTANTS ------ */

/* Bouton Retour en Hautack to top */
#topBtn {
    position: fixed;
    right: 25px;
    bottom: 25px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--color1);
    color: var(--color2);
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 -2px 30px rgba(0, 0, 0, 0.55);
    transition: transform .2s ease, background .7s ease;
}

#topBtn:hover {
    transform: scale(1.1);
    background: var(--color3);
}

/* Bouton Télécharger CV */
#cvBtn {
    position: fixed;
    right: 25px;
    bottom: 80px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--color1);
    color: var(--color2);
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 -2px 30px rgba(0, 0, 0, 0.55);
    transition: transform .2s ease, background .7s ease;
}

#cvBtn:hover {
    transform: scale(1.1);
    background: var(--color3);
}

.theme-btn {
    position: fixed;
    right: 25px;
    bottom: 140px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--color1);
    color: var(--color2);
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: transform .2s ease, background .7s ease;
    z-index: 1000;
}

.theme-btn:hover {
    transform: scale(1.1);
    background: var(--color3);
}

#langBtn {
    position: fixed;
    right: 25px;
    bottom: 200px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--color1);
    color: var(--color2);
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 -2px 30px rgba(0, 0, 0, 0.55);
    transition: transform .2s ease, background .7s ease;
    z-index: 1000;
}

#langBtn:hover {
    transform: scale(1.1);
    background: var(--color3);
}

.btn-active {
    background: var(--color3) !important;
    transform: scale(1.1);
    color: var(--color2) !important;
}

/****************************************/
/****************************************/
/***************** STYLES ***************/
/****************************************/
/****************************************/

/****************************************/
/***************** ABOUT ****************/
/****************************************/

.header-main {
    text-align: center;
}

.header-main-logo {
    width: 300px;
    max-width: 40%;
    height: auto;
    margin: 0 auto;
}

.logo {
    width: 25%;
    display: block;
    margin: 0 auto;
    margin-bottom: -6rem;
    margin-top: -5rem;
}

.header-icons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    top: -80px;
    position: relative;
}

.header-icons i {
    font-size: clamp(1.3rem, 2vw, 2rem);
    background: var(--color1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform .4s ease, color .7s ease;
    cursor: pointer;
    filter: drop-shadow(0 -2px 30px rgba(0, 0, 0, 0.75));
}

.header-icons i:hover {
    transform: scale(1.08);
    background: linear-gradient(to right, #2c57e7, #a552a8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes bounce {
  0%, 100% { transform: rotate(-20deg) translateY(-20px) translateX(50px); }
  50%      { transform: rotate(-20deg) translateY(-40px) translateX(50px); }
}

.click {
    font-size: 1.5rem;
    animation: bounce 1.5s infinite;
    color: var(--color1);
}

.about {
    padding-top: 1rem;
    p {
        max-width: 800px;
        margin: 0 auto;
        padding: 2rem;
        padding-bottom: 1rem;
        line-height: 1.5rem;
        font-size: 1.3rem;
        color: var(--color1);
        font-weight: 500;
    }
}

.about-text {
    margin-bottom: 5rem;
}

.button {
    display: block;
    width: fit-content;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    background: var(--bg1);
    color: var(--color3);
    border: 1px solid var(--color3);
    border-radius: 30px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s ease;
    box-shadow: 0 -2px 30px rgba(0, 0, 0, 0.25);
}

.button:hover {
        background: var(--bg3);
        color: var(--color2)
}

/******************** GRID ********************/

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem 0;
}

.stacks {
    padding-bottom: 4rem;
}

.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.stack-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stack-item:hover {
    transform: scale(1.1);
    transition: transform 0.4s ease;
}

.stack-item:hover img,
.stack-item:hover i {
    filter: drop-shadow(0 -2px 20px rgba(0, 0, 0, 0.35));
}

.stack-item i,
.stack-item img {
    font-size: 3rem;
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.stack-item p {
    padding: 1rem;
    margin-top: 0.1rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--color1);
}

/****************************************/
/*************** PROJECTS ***************/
/****************************************/

.projects {
    width: 100vw;
    padding: 2rem 0;
    background-color: var(--bg1);
    box-shadow: 0 -2px 30px rgba(0, 0, 0, 0.15);
    color: var(--color2);
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.projects-title {
    margin-bottom: 2rem;

}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* COMMUN (light + dark) */
.project-card { 
    position: relative;
    background: var(--color2);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Contour dégradé */
.project-card::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 3px;
    border-radius: inherit;
    background: linear-gradient(to right, #2c57e7, #a552a8);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}


.project-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.30);
}

.project-img img {
    width: 100%;
    display: block;
}

.project-content {
    padding: 1.5rem;
    color: var(--color1);
}

.project-content h3 {
    margin-top: 0.5rem;
    margin-bottom: .5rem;
    font-size: 1.4rem;
    color: var(--color1);
    min-height: 3.2rem;
}

.project-content p {
    margin: 0 0 1rem 0;
    line-height: 1.5rem;
    font-size: 1rem;
    color: var(--color1);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 2rem;
    margin-left: 2rem;
    align-content: flex-start;
    min-height: 6.5rem;
}

.project-tags span {
    background: var(--bg4);
    padding: .35rem .7rem;
    border-radius: 6px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--color3);
}

.project-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn-outline,
.btn-fill {
    padding: .6rem 1.1rem;
    border-radius: 6px;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    display: inline-block;
    transition: .25s ease;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.15);
}

.btn-outline {
    border: 1.5px solid #2c57e7;
    color: #2c57e7;
}

.btn-outline:hover {
    background: #2c57e7;
    color: var(--color2);
}

.btn-fill {
    background: #2c57e7;
    color: var(--color2);
}

.btn-fill:hover {
    background: var(--color1);
    color: var(--color2);
}


/****************************************/
/**************** CONTACT ***************/
/****************************************/

.contact {
    padding: 10rem 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.contact h2 {
    font-size: 2.2rem;
    color: var(--color1);
    margin-bottom: 2rem;
}

.contact-form {
    background: var(--color2);
    padding: 3rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-form label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-form input,
.contact-form textarea {
    padding: 0.9rem 1.2rem;
    border: 1.5px solid #d3d6e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: var(--primary_police);
    color: var(--color1);
    background: #f6f7fb;
    transition: all 0.25s ease;
    outline: none;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.10);
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--color3);
    background: white;
    box-shadow: 0 0 0 4px rgba(44, 87, 231, 0.15);
}

.contact-form button {
    background: var(--color3);
    color: var(--color2);
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s ease;
    width: fit-content;
    align-self: center;
    box-shadow: 0 -2px 30px rgba(0, 0, 0, 0.25);
}

.contact-form button:hover {
    background: var(--color1);
    transform: translateY(-2px);
}

.form-message {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: green;
    opacity: 0;
    transition: opacity .4s ease;
}

/****************************************/
/****************************************/
/**************** PARTIALS **************/
/****************************************/
/****************************************/

/***************** HEADER *****************/

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--color2);
    box-shadow: 0 -2px 30px rgba(0, 0, 0, 0.25);
    z-index: 999;
}

.menu {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    position: relative;
}

.logo-menu {
    height: 30px;
    position: absolute;
    left: 6rem;
    top: 50%;
    transform: translateY(-50%);
    transition: transform .25s ease;
    filter: drop-shadow(0 -2px 20px rgba(0, 0, 0, 0.55));
}

.logo-menu:hover {
    transform: translateY(-50%) scale(1.3);
    cursor: pointer;
}

.menu ul {
    display: flex;
    gap: 5rem;
    margin: 0;
    padding: 0;
    font-weight: 500;
}

.menu ul li {
    position: relative;
    color: var(--color1);
}

.menu ul li::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -7px;
    width: 0;
    height: 2px;
    background: var(--color3);
    transition: width 0.4s ease;
}

.menu ul li:hover::after {
    width: 100%;
}


/***************** FOOTER *****************/

footer {
    box-shadow: 0 -2px 30px rgba(0, 0, 0, 0.25);
    padding: 1rem;
    text-align: center;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-content {
    background: var(--bg2);
    color: var(--color1);
    padding: 30px;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
}
.link-modal {
    cursor: pointer;
    text-decoration: underline;
}
.close {
    float: right;
    cursor: pointer;
    font-size: 28px;
}

/****************************************/
/****************************************/
/*************** RESPONSIVE *************/
/***************** MOBILE ***************/
/****************************************/
/****************************************/

@media (max-width: 1000px) {
    
    section {
    scroll-margin-top: 115px;
    }

    main {
        padding-top: 4rem;
    }

    .menu {
        flex-direction: column;
        padding: 1.7rem;
    }

    .logo-menu {
        position: static;
        display: block;
        height: 40px;
        padding-bottom: 0.5rem;
        margin-top: 0.7rem;
        filter: drop-shadow(0 -2px 20px rgba(0, 0, 0, 0.25));
    }

    .menu ul {
        gap: 1.35rem;
    }

    .menu ul li a:hover {
        color: var(--color1);
    }

    .header-main-logo {
        width: 300px;
        max-width: 90%;
    }

    .header-icons i {
        font-size: clamp(1.8rem, 2.6vw, 2.6rem);
        color: var(--color1);

    }

    .header-icons i:hover {
        transform: none;
    }

    .header-icons i:active {
        transform: none;
    }

    .button {
        background: var(--bg3);
        color: var(--color2);
        box-shadow: 0 -2px 30px rgba(0, 0, 0, 0.55);
    }

    .stack-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 1rem;
    }

    .project-card {
        box-shadow: 0 -2px 30px rgba(0, 0, 0, 0.25);
    }

    .contact-form input,
    .contact-form textarea {
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.15);
    }

    .contact {
        padding: 4rem 1rem;
    }

    #themeBtn:hover, #langBtn:hover, #cvBtn:hover, #topBtn:hover {
        transform: none;
        background: none;
    }

    #themeToggle:hover,
    #langBtn:hover,
    #cvBtn:hover,
    #topBtn:hover {
        transform: none !important;
        background: var(--color1) !important;
    }

    #themeToggle.btn-active,
    #langBtn.btn-active {
        background: var(--color3) !important;
        transform: none !important;
    }

    /* Forcer CV et Back to Top à rester gris en mobile */
    #cvBtn.btn-active,
    #topBtn.btn-active {
        background: var(--color1) !important;
        transform: none !important;
    }

    /* Icons sociaux */
    .header-icons i:hover {
        transform: none !important;
        background: var(--color1) !important;
        -webkit-background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
    }

    /* Boutons projets */
    .btn-outline:hover {
        background: var(--bg1) !important;
        color: var(--color3) !important;
    }

    .btn-fill:hover {
        background: #2c57e7 !important;
        color: var(--color2) !important;
    }

    /* Bouton "Discutons de votre projet" */
    .button:hover {
        background: var(--bg3) !important;
        color: var(--color2) !important;
    }

    /* Logo menu */
    .logo-menu:hover {
        transform: translateY(-50%) !important;
    }

    /* Stack items (technologies) */
    .stack-item:hover {
        transform: none !important;
    }

    .stack-item:hover img,
    .stack-item:hover i {
        filter: none !important;
        transform: none !important;
    }

    /* Project cards */
    .project-card:hover {
        transform: none !important;
        box-shadow: 0 -2px 30px rgba(0, 0, 0, 0.25) !important;
    }

    /* Bouton contact form */
    .contact-form button:hover {
        background: var(--color3) !important;
        transform: none !important;
    }

    /* Désactiver le ::after du hover en mobile */
    .menu ul li:hover::after {
        width: 0 !important;
    }
    
    /* Garder uniquement le ::after pour .active */
    .menu ul li a.active::after {
        width: 100% !important;
    }
}

/* Buttons on the top */
@media (max-width: 1000px) {

    .theme-btn {
        position: fixed;
        right: 50px;
        top: 25px;
        bottom: auto;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

 

    #themeToggle i {
        padding-top: 4px;
    }

    #langBtn {
        position: fixed;
        left: 50px;
        top: 25px;
        right: auto;
        bottom: auto;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    #cvBtn {
        right: 15px;
        bottom: 80px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    #topBtn {
        right: 15px;
        bottom: 25px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .menu {
        padding-top: 2.5rem;
    }
}

/****************************************/
/****************************************/
/**************** DARK MODE *************/
/****************************************/
/****************************************/

.dark-mode {
    --bg1: #1b1b1d;
    --bg2: #2a2a2d;
    --bg3: #8ab4f8;
    --bg4: #2c57e7;
    --color1: #e5e5e5;
    --color2: #1b1b1d;
    --color3: #8ab4f8;
    --color4: #F3F3F5;

    h1 {
    background: linear-gradient(to right, #2c57e7, #de58e2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    }

    .button {
        box-shadow: 0 0px 15px var(--color3);
    }

    .symfony-dark {
        filter: invert(1);
    }

    .github-dark {
        filter: invert(1);
    }

    .wordpress-dark {
        filter: invert(1);
    }

    .wix-dark {
        filter: invert(1);
    }

    .wix-dark p {
        filter: invert(1);
    }

    .contact-form input:focus,
    .contact-form textarea:focus {
        border-color: var(--color3);
        box-shadow: 0 0 0 4px var(--color3);
    }

    .btn-outline {
        color: var(--color2);
        background: var(--color1);
    }

    .btn-outline:hover {
        background: #2c57e7;
        color: var(--color1);
    }

    .btn-fill {
        color: var(--color1)
    }

    .btn-fill:hover {
        color: var(--color2)
    }

    .logo-menu {
        content : url("images/byTom_menu_dark.png");
    }

    .header-main-logo {
        content: url("images/byTom_dark.png");
    }

    .header-icons i {
        background: linear-gradient(to right, #2c57e7, #a552a8);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        filter: none;
    }

    .header-icons i:hover {
        background: var(--color3);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .stack-item:hover img,
    .stack-item:hover i:hover {
        filter: drop-shadow(0 -2px 30px rgba(231, 231, 231, 0.75));
    }

    /* Specific for dark mode icons */
    .stack-item:hover img.github-dark,
    .stack-item:hover i.github-dark,
    .stack-item:hover img.symfony-dark,
    .stack-item:hover i.symfony-dark,
    .stack-item:hover img.wordpress-dark,
    .stack-item:hover i.wordpress-dark,
    .stack-item:hover img.wix-dark,
    .stack-item:hover i.wix-dark {
        filter: invert(1) drop-shadow(0 -2px 20px rgba(231,231,231,.75));
    }

    /* Icons sociaux */
    .header-icons i:hover {
        transform: none !important;
        background: linear-gradient(to right, #2c57e7, #a552a8) !important;
        -webkit-background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
    }

    /* Boutons projets */
    .btn-outline:hover {
        background: var(--color1) !important;
        color: var(--color2) !important;
    }

    .btn-fill:hover {
        background: #2c57e7 !important;
        color: var(--color4) !important;
    }

    /* Logo menu */
    .logo-menu:hover {
        transform: translateY(-50%) !important;
    }

    /* Stack items (technologies) */
    .stack-item:hover {
        transform: none !important;
    }

    .stack-item:hover img,
    .stack-item:hover i {
        filter: none !important;
        transform: none !important;
    }

    /* Project cards */
    .project-card:hover {
        box-shadow: 0 -2px 30px rgba(0, 0, 0, 0.25) !important;
    }

    /* Bouton contact form */
    .contact-form button:hover {
        background: var(--color3) !important;
        transform: none !important;
    }

    .menu ul li a:hover {
        color: var(--color1);
    }
}

.dark-mode .project-tags span {
    background: var(--bg4);
    color: var(--color4);
}

.dark-mode .contact-form {
    position: relative;
    z-index: 0;
    background: var(--color2);
    padding: 3rem 2.5rem;
    border-radius: 16px;
}

.dark-mode .contact-form::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 3px;
    border-radius: inherit;
    background: linear-gradient(to right, #2c57e7, #a552a8);
    -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    z-index: -1;
}

.dark-mode .lang-btn img {
    filter: invert(1) brightness(0.9);
}

/****************************************/
/************ MENU ACTIVE LINK ***********/
/****************************************/

.menu ul li a.active {
    color: var(--color3);
    font-weight: 600;
}

/* Le :has() isole et cible mon a.active dans le parent li */
.menu ul li:has(a.active)::after {
    width: 100% !important;
}