:root {
    --primary: #c78d2f;      
    --secondary: #121212;    /* Noir profond Material UI */
    --surface: #1e1e1e;      /* Gris foncé pour les cartes */
    --light: #e0e0e0;        
    --hover-color: #a8721f;  
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

body {
    font-family: 'Roboto', sans-serif;
    margin: 0; padding: 0;
    background-color: var(--secondary);
    color: var(--light);
    scroll-behavior: smooth;
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Fond dynamique --- */
#dynamic-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: -1;
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(199, 141, 47, 0.05), transparent 40%);
}

/* --- Navigation --- */
nav {
    display: flex; justify-content: space-between;
    padding: 1rem 8%; align-items: center;
    background: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(12px);
    position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.logo { font-weight: 700; font-size: 1.5rem; color: var(--primary); text-decoration: none; }
.nav-links { list-style: none; display: flex; gap: 30px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--light); font-weight: 500; transition: var(--transition-smooth); }
.nav-links a:hover { color: var(--primary); }
.nav-btn { border: 1px solid var(--primary); padding: 5px 15px; border-radius: 4px; color: var(--primary) !important; }
.nav-btn:hover { background: var(--primary); color: var(--secondary) !important; }

/* --- Header / Hero --- */
header { min-height: 90vh; display: flex; align-items: center; padding: 40px 10%; }
.hero-content { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 4rem; }
.hero-text { flex: 1.2; opacity: 0; transform: translateY(30px); }

h1 { font-size: 3.5rem; line-height: 1.15; margin-bottom: 0.5rem; font-weight: 700; color: white;}
h1 span { color: var(--primary); }

.typewriter-container { font-size: 1.8rem; font-weight: 400; color: var(--light); margin-bottom: 1.5rem; height: 40px; }
.cursor { animation: blink 0.8s infinite; color: var(--primary); }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.alert-alternance {
    display: inline-block;
    background: rgba(199, 141, 47, 0.15);
    border: 1px solid var(--primary);
    padding: 10px 20px;
    border-radius: 8px;
    margin: 15px 0;
    color: white;
}

.hero-buttons { display: flex; align-items: center; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
.btn {
    padding: 12px 28px; background: var(--primary); color: var(--secondary);
    text-decoration: none; border-radius: 6px; font-weight: 600;
    transition: var(--transition-smooth); display: inline-flex; align-items: center; gap: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3); text-transform: uppercase; letter-spacing: 0.5px;
}
.btn:hover { background: var(--hover-color); box-shadow: 0 6px 12px rgba(0,0,0,0.4); transform: translateY(-2px); }

.social-icons { display: flex; gap: 15px; }
.social-icons a {
    color: var(--light); font-size: 1.8rem;
    background: var(--surface); padding: 10px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}
.social-icons a:hover { color: var(--primary); transform: translateY(-4px); }

/* Avatar Animé */
.hero-image { flex: 0.8; display: flex; justify-content: center; opacity: 0; transform: scale(0.9); }
.hero-image img {
    width: 320px; height: 320px; border-radius: 50%; object-fit: cover;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    border: 4px solid var(--surface);
    animation: float 6s ease-in-out infinite; /* L'animation de flottaison */
}
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

/* --- Sections --- */
.section-padding { padding: 100px 10%; }
.section-title {
    text-align: center; font-size: 2.2rem; margin-bottom: 4rem;
    color: white; position: relative; font-weight: 700;
}
.section-title::after {
    content: ''; display: block; width: 50px; height: 4px;
    background: var(--primary); margin: 15px auto 0; border-radius: 2px;
}

/* --- Cards Dynamiques (Material UI) --- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.card {
    background-color: var(--surface);
    padding: 30px; border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    position: relative; overflow: hidden;
    opacity: 0; transform: translateY(30px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Effet de lueur (glow) au survol de la souris géré par JS */
.card::before {
    content: ""; position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(255,255,255,0.06), transparent 40%);
    opacity: 0; transition: opacity 0.3s; z-index: 0; pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card > * { position: relative; z-index: 1; }
.card:hover { transform: translateY(-5px) !important; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }

.card h3 { color: var(--primary); display: flex; align-items: center; gap: 10px; font-size: 1.4rem; margin-top: 0;}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; color: var(--light); font-size: 0.9rem;}

/* --- Formulaire Contact --- */
.contact-card { max-width: 600px; margin: 0 auto; }
.form-group { margin-bottom: 1.5rem; text-align: left; }
.form-group label { display: block; margin-bottom: 0.5rem; color: var(--light); font-weight: 500;}
.form-group input, .form-group textarea {
    width: 100%; padding: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white; border-radius: 6px; outline: none;
    font-family: inherit; transition: border-color 0.3s;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); }

/* --- Switch --- */
.toggle-container { display: flex; justify-content: center; align-items: center; gap: 15px; margin-bottom: 3rem; }
.switch { position: relative; display: inline-block; width: 60px; height: 34px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.1); transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 4px; bottom: 4px; background-color: var(--light); transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(26px); background-color: var(--secondary);}
.toggle-label { font-weight: 500; color: #888; cursor: pointer; transition: 0.3s; }
.toggle-label.active { color: var(--primary); font-weight: 700;}

/* Classes d'Animation (JS) */
.reveal-visible { opacity: 1 !important; transform: translateY(0) !important; }
.hero-image.reveal-visible { transform: scale(1) !important; }

/* Footer */
footer { text-align: center; padding: 3rem 0; margin-top: 50px; background: rgba(18,18,18,0.9); }
footer h3 { color: var(--primary); margin: 0; font-weight: 700; }

@media (max-width: 768px) {
    .hero-content { flex-direction: column-reverse; text-align: center; gap: 2rem; }
    .hero-text { text-align: center; }
    .hero-buttons { justify-content: center; }
    .nav-links { display: none; }
    h1 { font-size: 2.5rem; }
    .hero-image img { width: 240px; height: 240px; }
    .section-padding { padding: 60px 5%; }
}

/* --- Stylisation des images dans les cartes projets --- */
.card-image {
    /* Élargit l'image pour compenser le padding de 30px de la carte */
    width: calc(100% + 60px); 
    margin: -30px -30px 20px -30px; 
    height: 180px;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Zoom fluide sur l'image quand on survole la carte */
.card:hover .card-image img {
    transform: scale(1.06);
}

/* Gestion du mode noir et blanc pour les archives */
.card-image.grayscale img {
    filter: grayscale(100%);
    opacity: 0.3;
}

/* --- Bouton Premium Projets --- */
.link-btn-premium {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 10px 20px;
    background: rgba(199, 141, 47, 0.08); /* Fond transparent or */
    border: 1px solid var(--primary);
    color: var(--primary);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition-smooth);
    width: fit-content;
}

.link-btn-premium:hover {
    background: var(--primary);
    color: var(--secondary); /* Devient noir sur fond or */
    box-shadow: 0 4px 15px rgba(199, 141, 47, 0.3);
}

/* Petite animation sur la flèche du bouton */
.link-btn-premium i:last-child {
    transition: transform 0.3s ease;
}

.link-btn-premium:hover i:last-child {
    transform: translateX(4px);
}



/* --- Animation Slide au Clic (Version Optimisée) --- */
.hero-content.slide-active {
    will-change: transform; /* Indique au navigateur d'optimiser les calculs pour la fluidité */
    animation: slideEffect 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes slideEffect {
    0% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-35px); /* Glisse vers la gauche */
    }
    65% {
        transform: translateX(12px);  /* Léger retour élastique */
    }
    100% {
        transform: translateX(0);     /* Retour parfait à sa place */
    }
}