/* =============================================
   1. VARIABLES & FONDAMENTAUX
   ============================================= */
:root {
  --color-background: #0D0D1A;
  --color-card: rgba(26, 26, 46, 0.6);
  --color-primary: #8A4FFF;
  --color-primary-light: #A577FF;
  --color-text: #E0E0FF;
  --color-text-secondary: #A0A0C0;
  
  --font-family: 'Inter', sans-serif;
  --border-radius: 12px;
  --transition-speed: 0.3s;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-family);
  background-color: var(--color-background);
  color: var(--color-text);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

.background-animation {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
  background: radial-gradient(circle at 20% 30%, var(--color-primary), transparent 30%), radial-gradient(circle at 80% 70%, var(--color-primary-light), transparent 30%);
  background-size: 200% 200%; opacity: 0.1; animation: moveGradient 20s ease-in-out infinite;
}
@keyframes moveGradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* =============================================
   2. CLASSES UTILITAIRES & GLOBALES
   ============================================= */
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }
.section__title { font-size: clamp(2rem, 5vw, 2.5rem); font-weight: 900; text-align: center; margin-bottom: 3rem; background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; text-fill-color: transparent; }
.btn { display: inline-block; padding: 0.8rem 2rem; background-color: var(--color-primary); color: #fff; border-radius: var(--border-radius); text-decoration: none; font-weight: 700; transition: transform var(--transition-speed) ease, background-color var(--transition-speed) ease; }
.btn:hover { transform: translateY(-3px); background-color: var(--color-primary-light); }
section { padding: 6rem 0; }

/* =============================================
   3. HEADER & NAVIGATION
   ============================================= */
.header { position: sticky; top: 0; width: 100%; z-index: 10; padding: 1.5rem 0; background-color: rgba(13, 13, 26, 0.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.nav { display: flex; justify-content: space-between; align-items: center; }
.nav__logo { font-size: 1.5rem; font-weight: 900; color: var(--color-text); text-decoration: none; }
.nav__list { display: flex; gap: 2rem; list-style: none; }
.nav__link { color: var(--color-text-secondary); text-decoration: none; font-weight: 700; transition: color var(--transition-speed) ease; }
.nav__link:hover { color: var(--color-primary); }
/* STYLE SPECIAL POUR LE LIEN DU LABO */
.nav__link--special { color: var(--color-primary-light); }
.nav__link--special:hover { text-shadow: 0 0 8px var(--color-primary); }

/* =============================================
   4. SECTIONS
   ============================================= */
.hero { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 0 2rem; }
.hero__title { font-size: clamp(3rem, 10vw, 5rem); font-weight: 900; line-height: 1.1; margin-bottom: 1rem; }
.hero__subtitle { display: block; font-size: clamp(1.2rem, 4vw, 1.8rem); font-weight: 300; color: var(--color-text-secondary); }
.hero__description { max-width: 600px; margin-bottom: 2rem; font-size: 1.1rem; color: var(--color-text-secondary); }

/* =============================================
   SECTION PROJETS (MODIFIÉE)
   ============================================= */
.projects {
  padding-top: 6rem;
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.project-card {
  background-color: var(--color-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  display: flex; /* Ajout important pour la mise en page interne */
  flex-direction: column; /* Ajout important */
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* LA CORRECTION PRINCIPALE EST ICI */
.project-card__image {
  height: 250px; /* On donne une hauteur fixe à la zone de l'image */
  overflow: hidden; /* S'assure que rien ne dépasse */
  display: flex; /* Permet de centrer l'image à l'intérieur */
  justify-content: center;
  align-items: center;
  background-color: #e0e0e0; /* Couleur de fond claire, comme dans votre image */
  padding: 1rem; /* Ajoute un peu d'espace autour de l'image */
}

.project-card__image img {
  width: auto; /* L'image prendra sa largeur naturelle */
  max-width: 100%; /* Mais ne dépassera jamais le conteneur */
  height: 100%; /* L'image prendra toute la hauteur disponible */
  object-fit: contain; /* S'assure que l'image entière est visible, sans être coupée ni déformée */
  display: block;
}
/* FIN DE LA CORRECTION */


.project-card__content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Permet à cette section de prendre le reste de l'espace */
}

.project-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.project-card__description {
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
  flex-grow: 1; /* Pousse les tags et les liens vers le bas */
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin-bottom: 1.5rem;
}

.project-card__tags li {
  background-color: rgba(138, 79, 255, 0.1);
  color: var(--color-primary-light);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}

.project-card__links {
  display: flex;
  gap: 1rem;
}



.skills__list { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; max-width: 800px; margin: 0 auto; }
.skills__list li { background-color: var(--color-card); padding: 0.8rem 1.5rem; border-radius: var(--border-radius); border: 1px solid rgba(255, 255, 255, 0.1); font-weight: 700; }

/* STYLE POUR LA NOUVELLE SECTION CTA */
.lab-cta { text-align: center; background-color: var(--color-card); border-radius: var(--border-radius); border: 1px solid rgba(255, 255, 255, 0.1); }
.lab-cta__description { max-width: 600px; margin: 0 auto 2rem; color: var(--color-text-secondary); }

.contact { text-align: center; }
.contact__text { max-width: 600px; margin: 0 auto 2rem; font-size: 1.1rem; color: var(--color-text-secondary); }
.footer { padding: 2rem 0; text-align: center; color: var(--color-text-secondary); border-top: 1px solid rgba(255, 255, 255, 0.1); margin-top: 6rem; }