:root {
    --primary: #6366f1;
    --secondary: #22c55e;
    --dark: #0f172a;
    --light: #f1f5f9;
    --gray: #64748b;
    --card: #ffffff;
    --bg: rgb(237, 245, 252);
    --shadow: #0000003b;
  }
  
  /* Dark mode */
  body.dark {
    --bg: hwb(228 2% 90%);
    --card: #000000;
    --dark: #e5e7eb;
    --gray: #94a3b8;
    --shadow: #f7f7f73b;
  }
  
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', sans-serif;
  }
  
  body {
    background: var(--bg);
    color: var(--dark);
    line-height: 1.6;
    transition: background 0.4s ease, color 0.4s ease;
  }
  
  /* ================= HEADER ================= */
  
  header.hero {
    position: relative;
    max-width: 1100px;
    margin: 4rem auto 2rem;
    border-radius: 2.5rem;
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.8s ease forwards;
  }
  
  .hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, #6366f1, #312e81);
    transition: filter 0.3s ease;
  }
  
  .hero-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 2.5rem;
    padding: 3.5rem;
    background: linear-gradient(
      to right,
      rgba(15,23,42,0.85),
      rgba(15,23,42,0.4)
    );
  }
  
  .hero-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg);

    transition: all 0.5s ease;
  }

  .hero-avatar:hover {
    transform: scale(1.15);
    box-shadow: 0 0 40px 15px var(--primary);
    border-color: var(--primary);
  }
  
  .hero-text h1 {
    font-size: 2.6rem;
    color: white;
  }
  
  .hero-role {
    font-size: 1.2rem;
    color: #c7d2fe;
  }
  
  .hero-tagline {
    margin-top: 0.8rem;
    font-size: 1rem;
    color: #e5e7eb;
    max-width: 500px;
  }
  
  .hero-socials {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
  }
  
  .hero-socials a {
    color: #e5e7eb;
    opacity: 0.8;
    text-decoration: none;
    
    transition: all 0.3s ease;
  }
  
  .hero-socials a:hover {
    transform: scale(1.05);
    opacity: 1;
  }
  
  .theme-toggle {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255,255,255,0.15);
    border: none;
    color: var(--bg);
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    cursor: pointer;
    backdrop-filter: blur(8px);
  }

  .back_return {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    background: rgba(255,255,255,0.15);
    border: none;
    color: var(--bg);
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    cursor: pointer;
    backdrop-filter: blur(8px);
  }
  
  /* ================= SECTIONS ================= */
  
  section {
    max-width: 1100px;
    margin: 3rem auto;
    padding: 0 2rem;
  }
  
  h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
  }
  
  h2::before {
    content: '';
    width: 14px;
    height: 14px;
    background: var(--primary);
    border-radius: 50%;
  }
  
  /* ================= CV ================= */
  
  .title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 10px 20px;
  }

  .title-downloadCV {
    font-size: 1.2rem;
    background: var(--card);
    color: var(--primary);
    
    border: none;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;

    cursor: pointer;
    backdrop-filter: blur(8px);

    box-shadow: 0px 0px 20px var(--primary);
  }

  .cv {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 2rem;
    background: var(--card);
    padding: 2.5rem;
    border-radius: 1.5rem;
    box-shadow: 0px 0px 50px var(--shadow);
  }
  
  .cv-main h3 {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    color: var(--primary);
  }
  
  .cv-main ul {
    margin-left: 1.2rem;
  }
  
  .cv-main li {
    margin-bottom: 0.4rem;
  }
  
  /* Colonne droite */
  .cv-side {
    background: linear-gradient(180deg, #0f172a, #020617);
    color: #e5e7eb;
    padding: 2rem;
    border-radius: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }
  
  .cv-side h3 {
    font-size: 1.1rem;
    color: #a5b4fc;
  }
  
  .cv-side p {
    font-size: 0.95rem;
    color: #cbd5f5;
  }
  
  /* ================= PROJETS ================= */
  
  .projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
  }
  
  .project-card {
    background: var(--card);
    border-radius: 1rem;
    box-shadow: 0 10px 20px var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease;
  }
  
  .project-card:hover {
    transform: translateY(-8px);
  }
  
  .project-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
  }
  
  .project-content {
    padding: 1.5rem;
  }
  
  .project-content p {
    color: var(--gray);
  }
  
  .legende {
    padding: 1.5rem;
  }
  /* ================= FOOTER ================= */
  
  footer {
    text-align: center;
    padding: 2rem;
    color: var(--gray);
  }
  
  /* ================= ANIMATIONS ================= */
  
  @keyframes fadeIn {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* ================= RESPONSIVE ================= */
  
  @media (max-width: 900px) {
    .cv {
      grid-template-columns: 1fr;
    }
  }
  
  @media (max-width: 768px) {
    .hero-content {
      flex-direction: column;
      text-align: center;
    }
  }
  
/* ================= PAGE PROJET ================= */
.project-page {
  max-width: 1100px;
  margin: 0 auto 4rem;
  padding: 0 2rem;
}

.project-intro {
  max-width: 1000px;
  margin-bottom: 2.5rem;
  color: var(--gray);
}

/* ================= Galerie images projet ================= */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
  align-items: center;
}

.project-gallery img {
  width: 100%;
  border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.project-gallery img:hover {
  transform: scale(1.03);
  cursor: zoom-in;
}

/* ================= LIEN PROJET ================= */
.project-link {
  color: #c7d2fe;
  text-decoration: none;
  font-weight: bold;
}

.project-link:hover {
  text-decoration: underline;
}

/* ================= Fond de la modale ================= */
.modal {
  display: none; /* Caché par défaut */
  position: fixed;
  z-index: 1000;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.9);
  padding-top: 50px;
}

/* ================= L'image agrandie ================= */
.modal-content {
  margin: auto;
  display: block;
  max-width: 85%;
  max-height: 85vh;
  border-radius: 0.5rem;
  animation: zoom 0.3s; /* Animation fluide */
  cursor: zoom-out;
}

@keyframes zoom {
  from {transform: scale(0.7); opacity: 0;}
  to {transform: scale(1); opacity: 1;}
}

/* ================= Bouton fermer ================= */
.close {
  position: absolute;
  top: 20px; right: 35px;
  color: white;
  font-size: 40px;
  cursor: pointer;
}

/* Container pour l'image et ses textes */
.modal-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#caption {
  color: #f1f1f1;
  font-size: 1.5rem;
  font-weight: bold;
  margin-top: 15px;
}

#description {
  color: #ccc;
  font-size: 1rem;
  margin-top: 10px;
  max-width: 600px;
  text-align: center;
  line-height: 1.5;
}

/* On s'assure que l'image ne prend pas toute la place pour laisser le texte visible */
.modal-content {
  max-height: 70vh !important; 
}