@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800&display=swap');

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    font-family: 'Poppins', sans-serif;
    scroll-behavior: smooth;
}

html{
    font-size: 62.5%;
}

/* ============================================
   THEME VARIABLES (mode sombre par défaut)
   ============================================ */
:root{
    --bg: #000000;
    --bg-alt: #161616;
    --bg-card: #161616;
    --text: #ffffff;
    --text-muted: #b3b3b3;
    --accent: #b74b4b;
    --accent-soft: rgba(183, 75, 75, 0.15);
    --shadow-glow: rgba(183, 75, 75, 0.5);
    --border-color: #2a2a2a;
    --transition-theme: 0.4s ease;
}

[data-theme="light"]{
    --bg: #f7f5f3;
    --bg-alt: #ffffff;
    --bg-card: #ffffff;
    --text: #17181c;
    --text-muted: #5a5a5a;
    --accent: #b74b4b;
    --accent-soft: rgba(183, 75, 75, 0.1);
    --shadow-glow: rgba(183, 75, 75, 0.35);
    --border-color: #e6e2de;
}

body{
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    background-color: var(--bg);
    color: var(--text);
    transition: background-color var(--transition-theme), color var(--transition-theme);
}

::selection{
    background-color: var(--accent);
    color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar{
    width: 8px;
}
::-webkit-scrollbar-track{
    background: var(--bg-alt);
}
::-webkit-scrollbar-thumb{
    background: var(--accent);
    border-radius: 10px;
}

/* ============================================
   HEADER / NAV
   ============================================ */
header{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 9%;
    background-color: var(--bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    transition: background-color var(--transition-theme), border-color var(--transition-theme);
}

.logo{
    font-size: 2.6rem;
    color: var(--accent);
    font-weight: 800;
    cursor: pointer;
    transition: 0.5s ease;
}

.logo:hover{
    transform: scale(1.1);
}

.nav-wrapper{
    display: flex;
    align-items: center;
    gap: 3rem;
}

nav{
    display: flex;
    align-items: center;
}

nav a{
    position: relative;
    font-size: 1.7rem;
    color: var(--text);
    margin-left: 3.5rem;
    font-weight: 500;
    transition: color 0.3s ease;
    border-bottom: 3px solid transparent;
    padding-bottom: 0.4rem;
}

nav a:hover,
nav a.active{
    color: var(--accent);
    border-bottom: 3px solid var(--accent);
}

/* Bouton mode clair / sombre */
.theme-toggle{
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    border: 0.2rem solid var(--accent);
    background-color: transparent;
    color: var(--accent);
    font-size: 1.8rem;
    cursor: pointer;
    transition: 0.3s ease;
    flex-shrink: 0;
}

.theme-toggle:hover{
    background-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 20px var(--shadow-glow);
    transform: rotate(15deg);
}

.theme-toggle i.bx-sun{ display: none; }
[data-theme="light"] .theme-toggle i.bx-moon{ display: none; }
[data-theme="light"] .theme-toggle i.bx-sun{ display: inline-block; }

#menu-icon{
    font-size: 3.6rem;
    color: var(--text);
    cursor: pointer;
    display: none;
}

@media(max-width:995px){
    #menu-icon{
        display: block;
    }

    nav{
        position: absolute;
        display: none;
        flex-direction: column;
        top: 100%;
        right: 0;
        width: 60%;
        border-left: 3px solid var(--accent);
        border-bottom: 3px solid var(--accent);
        border-bottom-left-radius: 2rem;
        padding: 2rem 0;
        background-color: var(--bg-alt);
    }

    nav.active{
        display: flex;
    }

    nav a{
        display: block;
        font-size: 2rem;
        margin: 2rem 3rem;
    }

    nav a:hover,
    nav a.active{
        padding: 1rem;
        border-radius: 0.5rem;
        border-bottom: 0.5rem solid var(--accent);
    }
}

/* ============================================
   SECTIONS - BASE
   ============================================ */
section{
    min-height: 100vh;
    padding: 12rem 9% 6rem;
}

.section-title{
    text-align: center;
    font-size: 4.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.section-subtitle{
    text-align: center;
    font-size: 1.6rem;
    color: var(--text-muted);
    max-width: 60rem;
    margin: 0 auto 6rem;
}

span{
    color: var(--accent);
}

/* Fade-in au scroll */
.reveal{
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.show{
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce){
    .reveal{
        opacity: 1;
        transform: none;
        transition: none;
    }
    *{
        scroll-behavior: auto !important;
    }
}

/* ============================================
   HOME
   ============================================ */
.home{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8rem;
    min-height: 100vh;
    padding-top: 14rem;
}

.home .home-content h1{
    font-size: 6rem;
    font-weight: 700;
    line-height: 1.3;
}

.home-content .eyebrow{
    display: inline-block;
    font-size: 1.5rem;
    letter-spacing: 0.3rem;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.home-content h3{
    font-size: 3.4rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    min-height: 4.5rem;
}

.home-content p{
    font-size: 1.6rem;
    color: var(--text-muted);
    max-width: 50rem;
    line-height: 1.7;
}

.home-img img{
    position: relative;
    width: 32vw;
    max-width: 380px;
    border-radius: 50%;
    box-shadow: 0 0 25px var(--shadow-glow);
    cursor: pointer;
    transition: 0.3s ease;
    border: 4px solid var(--accent);
}

.home-img img:hover{
    transform: scale(1.03);
    box-shadow: 0 0 40px var(--shadow-glow);
}

.social-icons{
    margin: 2.5rem 0;
}

.social-icons a{
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4rem;
    height: 4rem;
    background-color: transparent;
    border: 0.2rem solid var(--accent);
    font-size: 1.8rem;
    border-radius: 50%;
    margin: 0 1.5rem 0 0;
    transition: 0.3s ease;
    color: var(--accent);
}

.social-icons a:hover{
    color: #fff;
    transform: scale(1.15) translateY(-5px);
    background-color: var(--accent);
    box-shadow: 0 0 25px var(--shadow-glow);
}

.home-btns{
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.btn{
    display: inline-block;
    padding: 1.2rem 2.8rem;
    background-color: var(--bg);
    border-radius: 4rem;
    font-size: 1.5rem;
    color: var(--accent);
    letter-spacing: 0.2rem;
    font-weight: 600;
    border: 2px solid var(--accent);
    transition: 0.3s ease;
    cursor: pointer;
}

.btn:hover{
    transform: scale(1.03);
    background-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 25px var(--shadow-glow);
}

.btn.btn-solid{
    background-color: var(--accent);
    color: #fff;
}

.btn.btn-solid:hover{
    background-color: transparent;
    color: var(--accent);
}

.typing-text span{
    position: relative;
    color: var(--accent);
    border-right: 3px solid var(--accent);
    padding-right: 4px;
    animation: cursor-blink 0.7s infinite;
}

@keyframes cursor-blink{
    0%, 100%{ border-color: var(--accent); }
    50%{ border-color: transparent; }
}

@media (max-width: 1000px){
    .home{
        gap: 4rem;
    }
}

@media(max-width:995px){
    .home{
        flex-direction: column-reverse;
        text-align: center;
        margin: 0 4rem;
        gap: 3rem;
    }

    .home-content p{
        margin: 0 auto;
    }

    .home-btns, .social-icons{
        justify-content: center;
        display: flex;
    }

    .home .home-content h3{
        font-size: 2.5rem;
    }

    .home-content h1{
        font-size: 5rem;
    }

    .home-img img{
        width: 55vw;
    }
}

/* ============================================
   === SERVICES ===
   ============================================ */
.services{
    background-color: var(--bg);
}

.services-grid{
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
}

.service-card{
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 4rem 2.5rem;
    text-align: center;
    transition: 0.35s ease;
}

.service-card i{
    font-size: 4.5rem;
    color: var(--accent);
    margin-bottom: 2rem;
    display: inline-block;
    transition: 0.35s ease;
}

.service-card h3{
    font-size: 2rem;
    margin-bottom: 1.2rem;
    font-weight: 600;
}

.service-card p{
    font-size: 1.4rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.service-card:hover{
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 15px 35px var(--shadow-glow);
}

.service-card:hover i{
    transform: scale(1.15);
}

@media(max-width:995px){
    .services-grid{
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width:600px){
    .services-grid{
        grid-template-columns: 1fr;
    }
}

/* ============================================
   === SKILLS ===
   ============================================ */
.skills-category{
    margin-bottom: 4.5rem;
}

.skills-category h3{
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.15rem;
}

.badges{
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.badge{
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2rem;
    border: 2px solid var(--accent);
    border-radius: 3rem;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text);
    background-color: transparent;
    transition: 0.3s ease;
    cursor: default;
}

.badge i{
    font-size: 1.8rem;
    color: var(--accent);
    transition: 0.3s ease;
}

.badge:hover{
    background-color: var(--accent);
    color: #fff;
    transform: translateY(-4px);
    box-shadow: 0 10px 20px var(--shadow-glow);
}

.badge:hover i{
    color: #fff;
}

/* ============================================
   === EDUCATION & EXPERIENCE (Timeline) ===
   ============================================ */
.timeline{
    position: relative;
    max-width: 90rem;
    margin: 0 auto;
}

.timeline::before{
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background-color: var(--accent);
    opacity: 0.4;
}

.timeline-item{
    position: relative;
    width: 50%;
    padding: 0 4rem 5rem;
}

.timeline-item:nth-child(odd){
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(even){
    left: 50%;
    text-align: left;
}

.timeline-dot{
    position: absolute;
    top: 0.3rem;
    width: 1.8rem;
    height: 1.8rem;
    background-color: var(--bg);
    border: 3px solid var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--shadow-glow);
}

.timeline-item:nth-child(odd) .timeline-dot{
    right: -0.9rem;
}

.timeline-item:nth-child(even) .timeline-dot{
    left: -0.9rem;
}

.timeline-content{
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1.2rem;
    padding: 2.5rem;
    transition: 0.3s ease;
}

.timeline-content:hover{
    border-color: var(--accent);
    box-shadow: 0 10px 30px var(--shadow-glow);
    transform: translateY(-5px);
}

.timeline-date{
    display: inline-block;
    font-size: 1.3rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.1rem;
    margin-bottom: 0.8rem;
}

.timeline-content h3{
    font-size: 2rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.link-project{
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text);
    position: relative;
    transition: color 0.3s ease;
}

.link-project::after{
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background-color: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.link-project i{
    font-size: 1.5rem;
    color: var(--accent);
    transform: translate(0, 0);
    transition: transform 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
}

.link-project:hover{
    color: var(--accent);
}

.link-project:hover::after{
    transform: scaleX(1);
    transform-origin: left;
}

.link-project:hover i{
    transform: translate(3px, -3px);
}

.timeline-item:nth-child(odd) .link-project::after{
    left: auto;
    right: 0;
    transform-origin: left;
}

.timeline-item:nth-child(odd) .link-project:hover::after{
    transform-origin: right;
}

.timeline-content h4{
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 1rem;
}

.timeline-content p{
    font-size: 1.4rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.timeline-tags{
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.timeline-item:nth-child(odd) .timeline-tags{
    justify-content: flex-end;
}

.timeline-tags span{
    font-size: 1.2rem;
    padding: 0.4rem 1.2rem;
    border-radius: 2rem;
    background-color: var(--accent-soft);
    color: var(--accent);
    font-weight: 500;
}

@media(max-width:995px){
    .timeline::before{
        left: 1rem;
    }

    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even){
        width: 100%;
        left: 0;
        text-align: left;
        padding: 0 0 4rem 4rem;
    }

    .timeline-item:nth-child(odd) .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot{
        left: 0.1rem;
        right: auto;
    }

    .timeline-item:nth-child(odd) .timeline-tags{
        justify-content: flex-start;
    }
}

/* ============================================
   === CONTACT ===
   ============================================ */
.contact-wrapper{
    display: flex;
    gap: 6rem;
    align-items: flex-start;
}

.contact-wrapper--centered{
    justify-content: center;
}

.contact-wrapper--centered .contact-info{
    max-width: 60rem;
    text-align: center;
}

.contact-wrapper--centered .contact-detail{
    justify-content: center;
}

.contact-wrapper--centered .social-icons{
    justify-content: center;
    display: flex;
}

.mail-cta{
    display: flex;
    align-items: center;
    gap: 2rem;
    background-color: var(--bg-card);
    border: 1.5px solid var(--accent);
    border-radius: 1.5rem;
    padding: 2.5rem 3rem;
    margin: 3rem 0;
    transition: 0.3s ease;
}

.mail-cta-icon{
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 6rem;
    height: 6rem;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: var(--accent-soft);
    color: var(--accent);
    font-size: 2.6rem;
    transition: 0.3s ease;
}

.mail-cta-text{
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-align: left;
}

.mail-cta-label{
    font-size: 1.4rem;
    color: var(--text-muted);
}

.mail-cta-address{
    font-size: 1.9rem;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}

.mail-cta-arrow{
    margin-left: auto;
    font-size: 2.4rem;
    color: var(--accent);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.mail-cta:hover{
    transform: translateY(-6px);
    box-shadow: 0 15px 35px var(--shadow-glow);
    background-color: var(--accent);
}

.mail-cta:hover .mail-cta-icon{
    background-color: rgba(255,255,255,0.2);
    color: #fff;
}

.mail-cta:hover .mail-cta-label,
.mail-cta:hover .mail-cta-address{
    color: #fff;
}

.mail-cta:hover .mail-cta-arrow{
    color: #fff;
    transform: translateX(8px);
}

@media(max-width:600px){
    .mail-cta{
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        padding: 2.5rem;
    }

    .mail-cta-text{
        text-align: center;
    }

    .mail-cta-arrow{
        margin-left: 0;
    }
}

.contact-info{
    flex: 1;
}

.contact-info h3{
    font-size: 2.4rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.contact-info p{
    font-size: 1.5rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 3rem;
}

.contact-detail{
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.2rem;
}

.contact-detail i{
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    border: 0.2rem solid var(--accent);
    color: var(--accent);
    font-size: 1.8rem;
    flex-shrink: 0;
}

.contact-detail div span{
    display: block;
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.contact-detail div p{
    font-size: 1.5rem;
    color: var(--text);
    margin: 0;
    font-weight: 500;
}

@media(max-width:995px){
    .contact-wrapper{
        flex-direction: column;
        gap: 4rem;
    }
}

/* ============================================
   FOOTER
   ============================================ */
footer{
    padding: 4rem 9% 3rem;
    background-color: var(--bg-alt);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

footer .footer-social{
    margin-bottom: 2rem;
}

footer p{
    font-size: 1.4rem;
    color: var(--text-muted);
}

footer p span{
    color: var(--accent);
}

/* Back to top */
.back-to-top{
    position: fixed;
    bottom: 3rem;
    right: 3rem;
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    background-color: var(--accent);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.2rem;
    cursor: pointer;
    box-shadow: 0 5px 20px var(--shadow-glow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: 0.3s ease;
    z-index: 99;
}

.back-to-top.show{
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover{
    transform: translateY(-5px) scale(1.05);
}
