/* style.css - Version Corrigée */

/* --- RESET DE BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hind', sans-serif;
    background-color: #E8D7B8;
    color: #333;
    overflow-x: hidden; /* Sécurité pour éviter le scroll horizontal */
}

/* --- GESTION DU HEADER & NAV --- */
nav {
    background-color: #1B1D1E;
    padding: 1.2rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Le Logo */
.logo {
    color: white;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    font-style: italic;
    line-height: 1.2;
    cursor: pointer;
}

/* Le Menu Desktop */
.nav-links {
    display: flex;
    gap: 3rem;
    list-style: none;
    margin: 0;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    transition: opacity 0.3s;
}

.nav-links a:hover { opacity: 0.7; }

/* Les Contrôles (Switch + Burger) */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Toggle Switch */
.theme-toggle {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    height: 36px;
    transition: transform 0.3s;
}
.theme-toggle:hover { transform: scale(1.05); }

/* Visibilité Switch */
.hide-on-mobile { display: flex; }
.show-on-mobile { display: none; }

/* Bouton Burger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 2000; 
}

.hamburger .bar {
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

/* Animation Burger */
.hamburger.active .bar:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
    background-color: #1B1D1E;
}
.hamburger.active .bar:nth-child(2) { opacity: 0; }
.hamburger.active .bar:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
    background-color: #1B1D1E;
}


/* --- MENU MOBILE OVERLAY --- */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #E8D7B8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4rem;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1), background-color 0.3s ease;
    z-index: 1500;
}

.mobile-menu-overlay.active { transform: translateX(0); }

body.dark-mode .mobile-menu-overlay {
    background-color: #121212;
}

/* Croix Fermeture Menu */
.close-menu-btn {
    position: absolute;
    top: 1.5rem; 
    right: 1.5rem; 
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1600;
}

.close-menu-btn svg path {
    stroke: #1B1D1E;
    transition: stroke 0.3s;
}
body.dark-mode .close-menu-btn svg path { stroke: #ffffff; }

/* Liens Menu Mobile */
.mobile-links {
    list-style: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    padding: 0;
}

.mobile-links a {
    font-family: 'Clash Display', sans-serif;
    font-size: 3rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.3s;
    color: #1B1D1E;
}

body.dark-mode .mobile-links a { color: #E8D7B8; }


/* --- VARIABLES MODE SOMBRE --- */
body.dark-mode {
    background-color: #121212;
    color: #f1f1f1;
}

body.dark-mode nav, 
body.dark-mode .intro-section,
body.dark-mode .skills-section,
body.dark-mode footer {
    background-color: #000000;
}

body.dark-mode .project-card,
body.dark-mode .about-text {
    background-color: #1e1e1e;
    color: white;
}

body.dark-mode .projects-section h2,
body.dark-mode .project-info h3,
body.dark-mode .project-info p { 
    color: white; 
}

body.dark-mode input, 
body.dark-mode textarea {
    background-color: #2D2D2D;
    color: white;
    border-color: #444;
}


/* --- HERO SECTION --- */
.hero {
    background-size: cover; 
    background-position: center;
    background-repeat: no-repeat;
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero h1 {
    font-family: 'Clash Display', sans-serif;
    font-size: 5rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin: 0; 
}

.hero-home {
    background-image: url('/Images/hero-bg.svg');
    padding: 3rem 2rem;
}

.hero-contact {
    background-image: url('/Images/contact-bg.svg'); 
    padding: 3rem 2rem;
}

.hero-works {
    background-image: url('/Images/travaux-bg.svg');
    padding: 3rem 2rem;
}


/* --- INTRO SECTION --- */
.intro-section {
    background-color: #1B1D1E; 
    padding: 2rem 4rem 4rem 4rem;        
    width: 100%;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: flex-start; 
    margin-bottom: 20px;
}

.intro-box {
    max-width: 1000px;         
    width: 100%;
    color: white;
    font-family: 'Inter', sans-serif;
    font-weight: 700;          
    font-style: italic;        
    font-size: 1.8rem;         
    line-height: 1.4;          
    text-align: left;          
    display: flex;
    flex-direction: column;
    gap: 1.5rem;            
}
.intro-box p { margin: 0; }


/* --- ABOUT SECTION --- */
.about-section {
    padding: 4rem 2rem; 
    max-width: 1400px;
    margin: 0 auto;
    margin-bottom: 50px;
}

.about-content {
    display: grid;
    grid-template-columns: minmax(300px, 500px) 1fr;
    gap: 4rem; 
    align-items: center; 
}

.profile-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px; 
    aspect-ratio: 1 / 1; 
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.profile-img {
    width: 63%;
    height: 63%;
    object-fit: cover;
    border-radius: 50%;
    z-index: 5;
}

.custom-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;  
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.about-badge {
    position: absolute;
    top: 0;           
    left: -20px;      
    z-index: 10;
    background-color: #FF8A65;
    padding: 0.5rem 2rem;
    transform: rotate(-8deg) skewX(-8deg);
    box-shadow: 5px 8px 0px rgba(0,0,0,0.2);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.15'/%3E%3C/svg%3E");
    max-width: 90%; 
    white-space: nowrap;
}

.about-badge h2 {
    font-family: 'Clash Display', sans-serif;
    font-size: clamp(2.5rem, 5vw, 4rem); 
    font-weight: 600;
    color: #000;
    margin: 0;
    line-height: 1;
}

.about-text {
    background-color: #2D2D2D;
    color: white;
    padding: 2.5rem;
    width: 600px;       
    height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.about-text p { 
    font-family: 'Hind', sans-serif;
    font-weight: 500;
    font-size: clamp(1rem, 2vw, 1.2rem); 
    color: white;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.btn-group {
    display: flex;
    gap: 15px;
    margin-top: 1.5rem;
    flex-wrap: wrap; 
}

.cv-button, .linkedin-button {
    background-color: #000;
    color: white;
    padding: 0.8rem 1rem; 
    font-size: 0.95rem; 
    text-decoration: none;
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    transition: background-color 0.3s ease;
    flex: 1; 
    text-align: center;
    border: 1px solid transparent;
}

.cv-button:hover { background-color: #FF9A00; transform: none; }
.linkedin-button:hover { background-color: #0077B5; transform: none; }


/* --- SKILLS SECTION --- */
.skills-section {
    background-color: #262626; 
    padding: 4rem 0;           
    color: white;
    width: 100%;
    margin-bottom: 10px;
}

.skills-container {
    max-width: 1000px;         
    margin: 0 auto;
    display: flex;
    justify-content: space-around; 
    align-items: flex-start;
    gap: 4rem;
    padding: 0 2rem;
}

.skills-title {
    font-family: 'Inter', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

.tools-icons {
    display: flex;
    gap: 2rem;              
    align-items: center;
    justify-content: center;
}

.tool-svg {
    width: 60px;            
    height: 60px;
    object-fit: contain;
    transition: transform 0.3s;
}
.tool-svg:hover { transform: scale(1.1); }

.skills-tags-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 1rem 1.5rem;      
}

.skill-tag {
    background-color: white;
    color: #262626;         
    padding: 0.6rem 1.5rem;
    border-radius: 50px;    
    font-family: 'Inter', sans-serif;
    font-weight: 700;       
    font-size: 0.95rem;
    text-align: center;
    white-space: nowrap;    
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}


/* --- PROJECTS SECTION --- */
.projects-section {
    padding: 4rem 2rem; 
    max-width: 1200px;  
    margin: 0 auto;
    margin-bottom: 100px;
}

.projects-title {
    font-family: 'Inter', sans-serif;
    font-size: 2.5rem;    
    font-weight: 700;     
    text-align: left;     
    margin-bottom: 3rem;  
    color: #000;          
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); 
    gap: 2rem;
    margin-bottom: 3rem;
}

.project-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); 
    transition: transform 0.3s;
    position: relative;
    cursor: pointer;
}
.project-card:hover { transform: translateY(-5px); }

.project-image {
    width: 100%;
    height: 200px; 
    background-color: #ddd;
    position: relative;
    overflow: hidden;
}
.project-image img { width: 100%; height: 100%; object-fit: cover; }

.project-info { padding: 1.5rem; }

.project-info h3 {
    font-family: 'Clash Display', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color:#000;
}

.project-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: #000;
    color: white;
    padding: 0.5rem 1.2rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    transform: rotate(-5deg);
}

.project-info .year {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #666;
}

.project-tags { display: flex; gap: 0.8rem; flex-wrap: wrap; }

.tag {
    background-color: #000;
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
}

.see-more { text-align: center; margin-top: 3rem; }

.see-more-btn {
    background-color: #000;
    color: white;
    padding: 1.2rem 5rem;
    font-size: 1.1rem;      
    text-decoration: none;
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    transition: background-color 0.3s ease;
    border: 1px solid transparent;
}
.see-more-btn:hover { background-color: #FF9A00; transform: none; }


/* --- FOOTER --- */
footer {
    background-color: #1B1D1E;
    color: white;
    padding: 5rem 3rem 2rem 3rem;
    margin-top: 0;
}

.footer-cta {
    text-align: center;
    padding-bottom: 4rem;
    margin-bottom: 4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-cta h2 {
    font-family: 'Clash Display', sans-serif;
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: white;
}

.footer-btn {
    display: inline-block;
    background-color: white;
    color: #1B1D1E;
    padding: 1rem 3rem;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.3s, background-color 0.3s;
}
.footer-btn:hover {
    transform: scale(1.05);
    background-color: #FF8A65;
    color: white;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 3rem;
}

.footer-brand .logo { font-size: 1.5rem; }

.footer-links, .footer-legal {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-links a, .footer-legal a {
    color: #ccc;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: color 0.3s;
}
.footer-links a:hover, .footer-legal a:hover { color: #FF8A65; }

.footer-legal p {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}


/* --- PAGE CONTACT STYLES --- */
.contact-page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 6rem 4rem;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 6rem;
    align-items: start;
    min-height: 80vh;
}

.contact-title {
    font-family: 'Clash Display', sans-serif;
    font-size: 4.5rem;
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 2rem;
    color: #1B1D1E;
}

.contact-subtitle {
    font-family: 'Hind', sans-serif;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 4rem;
    color: #444;
    max-width: 400px;
}

.contact-email-link {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    text-decoration: none;
    color: #1B1D1E;
    border-bottom: 2px solid #1B1D1E;
    padding-bottom: 5px;
    transition: all 0.3s;
}
.contact-email-link:hover {
    color: #FF8A65;
    border-color: #FF8A65;
}

.contact-form-wrapper form {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group label {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.05em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.2);
    padding: 1rem 0;
    font-family: 'Clash Display', sans-serif;
    font-size: 1.5rem;
    color: #1B1D1E;
    resize: none;
    transition: border-color 0.3s;
}

.form-group textarea { min-height: 100px; }

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-bottom-color: #FF8A65;
}

.form-group input::placeholder, .form-group textarea::placeholder {
    color: rgba(0,0,0,0.3);
    font-family: 'Clash Display', sans-serif;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-radio input { display: none; }

.tag-radio span {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    color: #444;
}

.tag-radio input:checked + span {
    background-color: #1B1D1E;
    color: white;
    border-color: #1B1D1E;
}
.tag-radio span:hover { border-color: #1B1D1E; }

.submit-btn {
    align-self: flex-start;
    background-color: white;
    color: #1B1D1E;
    border: 1px solid #1B1D1E;
    padding: 1.2rem 3rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1rem;
}
.submit-btn:hover {
    background-color: #1B1D1E;
    color: white;
}

/* Contact Dark Mode */
body.dark-mode .contact-title { color: white; }
body.dark-mode .contact-subtitle { color: #aaa; }
body.dark-mode .contact-email-link { color: white; border-color: white; }
body.dark-mode .contact-email-link:hover { color: #FF8A65; border-color: #FF8A65; }
body.dark-mode .form-group label { color: #888; }
body.dark-mode .form-group input[type="text"],
body.dark-mode .form-group input[type="email"],
body.dark-mode .form-group textarea {
    border-bottom-color: rgba(255,255,255,0.2);
    color: white;
}
body.dark-mode .form-group input::placeholder,
body.dark-mode .form-group textarea::placeholder { color: rgba(255,255,255,0.2); }
body.dark-mode .tag-radio span {
    border-color: rgba(255,255,255,0.3);
    color: #ccc;
}
body.dark-mode .tag-radio input:checked + span {
    background-color: white;
    color: #1B1D1E;
    border-color: white;
}
body.dark-mode .tag-radio span:hover { border-color: white; }
body.dark-mode .submit-btn {
    background-color: white;
    color: black;
    border: none;
}
body.dark-mode .submit-btn:hover {
    background-color: #FF8A65;
    color: white;
}


/* --- ANIMATION SCROLL REVEAL --- */
.reveal {
    opacity: 1;
    transform: none;
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1); 
}

/* On ne cache les éléments QUE si le JavaScript a bien ajouté la classe "js-loaded" */
body.js-loaded .reveal {
    opacity: 0;
    transform: translateY(50px);
}

body.js-loaded .reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }


/* --- RESPONSIVE GENERAL ET MOBILE (< 968px) --- */
@media (max-width: 968px) {
    
    /* 1. NAVIGATION & MENU */
    nav { padding: 1rem 1.5rem; }
    .desktop-menu { display: none; }
    .hamburger { display: flex; }
    .hide-on-mobile { display: none !important; }
    .show-on-mobile { display: flex !important; }

    /* 2. HERO SECTION (Titre responsive) */
    .hero { 
        padding: 4rem 1rem; 
    }
    
    .hero h1 { 
        /* Utilisation de 'vw' pour que le texte s'adapte à la largeur de l'écran */
        font-size: 13vw; 
        line-height: 1;
    }

    /* 3. PAGE CONTACT (Correction de l'affichage) */
    .contact-page-container {
        /* On passe en colonne unique */
        display: flex;
        flex-direction: column;
        padding: 3rem 1.5rem; /* Marges réduites */
        gap: 3rem;
        width: 100%;
        overflow-x: hidden; /* Empêche le dépassement horizontal */
    }

    .contact-info {
        width: 100%;
    }

    .contact-title {
        /* Taille dynamique pour ne pas dépasser */
        font-size: clamp(2.5rem, 10vw, 3.5rem); 
        line-height: 1.1;
        word-wrap: break-word; /* Coupe le mot si vraiment trop long */
    }

    .contact-subtitle {
        font-size: 1rem;
        max-width: 100%;
        margin-bottom: 2rem;
    }

    /* Formulaire */
    .contact-form-wrapper {
        width: 100%;
    }

    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group textarea {
        font-size: 1.1rem;
        width: 100%; /* S'assure que le champ ne dépasse pas */
    }

    .submit-btn {
        width: 100%;
        margin-top: 1rem;
    }
    
    /* Tags (Sujets) */
    .tags-container {
        gap: 8px;
    }
    
    .tag-radio span {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap; /* Empêche le texte du tag de se casser bizarrement */
    }

    /* 4. AUTRES SECTIONS (Accueil, About, etc.) */
    .intro-box {
        font-size: 1.2rem;
        padding: 0 1rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .profile-wrapper { width: 100%; max-width: 300px; } /* Image un peu plus petite */

    .about-text {
        width: 100% !important;
        height: auto !important;
        padding: 2rem 1.5rem;
    }

    .skills-container { flex-direction: column; align-items: center; gap: 3rem; }
    .skills-tags-grid { grid-template-columns: 1fr; }

    /* --- CARROUSEL PROJETS (Correction Mobile) --- */
    .projects-grid {
        display: flex !important;  /* Force l'affichage en ligne */
        flex-direction: row;       /* Aligne horizontalement */
        flex-wrap: nowrap;         /* Empêche le retour à la ligne (Vital !) */
        
        overflow-x: auto;          /* Active le scroll horizontal */
        scroll-snap-type: x mandatory; /* Active l'effet d'aimant */
        
        gap: 20px;
        padding: 10px 20px 40px 20px; /* Padding bas plus grand pour l'ombre des cartes */
        
        /* Propriété magique pour iPhone/iOS pour que le scroll soit fluide */
        -webkit-overflow-scrolling: touch; 
        
        /* Cache la barre de défilement */
        scrollbar-width: none; 
        -ms-overflow-style: none;
    }
    
    .projects-grid::-webkit-scrollbar { 
        display: none; 
    }

    .project-card {
        /* Force la taille de la carte */
        width: 85vw;       /* Prend 85% de la largeur de l'écran */
        flex: 0 0 auto;    /* "0 0 auto" = Ne jamais rétrécir, ne jamais grandir, garder sa taille */
        
        scroll-snap-align: center; /* La carte se centre à l'arrêt */
        margin-right: 0;
        
        /* S'assure que la hauteur s'adapte au contenu */
        height: auto;
        min-height: 400px; /* Hauteur minimale pour éviter l'écrasement */
    }

    /* Footer Mobile */
    footer {
        padding: 4rem 1.5rem 2rem 1.5rem;
        text-align: left;
    }
    .footer-cta h2 { font-size: 2rem; }
    .footer-cta { text-align: center; }
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 2.5rem;
    }
}