* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* --- Corps de la page --- */
body {
  font-family: 'Inter', sans-serif;
  color: white;
  overflow-x: hidden;
  background-color: #0b0b12;
}

/* --- Footer --- */
footer {
  font-family: 'Inter', sans-serif;
  color: white;
  opacity: 70%;
  display: flex;
  justify-content: center;
  align-items: center;
}

footer p {
  margin: 12px;        
  padding: 10px 16px;  
  border-radius: 8px;  
}

/* --- Fond animé sombre --- */
.background-animation {
  position: fixed;
  width: 120%;
  height: 120%;
  top: -10%;
  left: -10%;
  background: radial-gradient(circle at 20% 30%, #2b2b52, transparent 40%),
              radial-gradient(circle at 80% 70%, #4b206e, transparent 40%),
              radial-gradient(circle at 50% 50%, #16213e, transparent 40%);
  filter: blur(100px);
  animation: moveBg 20s infinite alternate ease-in-out;
  z-index: -1;
}

@keyframes moveBg {
  0% { transform: translate(0, 0); }
  50% { transform: translate(60px, -100px); }
  100% { transform: translate(-40px, 80px); }
}

/* --- Effet Glass --- */
.glass {
  background: rgba(25, 25, 40, 0.3);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.logo {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.6px;
  color: #f8f8ff;
  line-height: 1;
  transform: translateY(-1px);
}

@media (min-width: 768px) {
  .logo { font-size: 1.5rem; }
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 30px;
  align-items: center;
}

.nav-links a {
  color: #f0f0ff;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: color 0.3s, transform 0.2s;
}

.nav-links a:hover {
  color: #a084f3;
  transform: translateY(-2px);
}

/* Hamburger (mobile) - hidden on desktop */
.hamburger {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
}

/* Mobile panel + overlay */
.mobile-panel {
  position: fixed;
  top: 0;
  left: -320px; /* hidden by default */
  width: 320px;
  height: 100%;
  z-index: 60;
  transition: left 0.32s cubic-bezier(.2,.8,.2,1);
}

.mobile-panel.open { left: 0; }

.mobile-panel .mobile-panel-inner {
  height: 100%;
  padding: 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-close {
  background: transparent;
  color: #fff;
  font-size: 2rem;
  border: none;
  align-self: flex-end;
  cursor: pointer;
}

.mobile-nav ul { list-style: none; padding: 0; margin: 10px 0 0 0; display:flex; flex-direction: column; gap: 14px; }
.mobile-nav a { color: #fff; text-decoration: none; font-size: 1.05rem; }

.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 50;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.mobile-overlay.show { opacity: 1; }


/* --- Dropdown --- */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 45px;
  left: 0;
  padding: 10px 0;
  width: 220px;
  flex-direction: column;
  border-radius: 15px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-15px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(25, 25, 40, 0.75);
  backdrop-filter: blur(20px);
  list-style: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.dropdown-menu li {
  padding: 12px 25px;
  list-style: none;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.dropdown-menu li a {
  color: #ffffff;
  display: block;
  width: 100%;
  text-decoration: none;
}

.dropdown-menu li a:hover {
  color: #a084f3;
}

.dropdown:hover .dropdown-menu {
  display: flex;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown:hover .dropdown-menu li {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.1s;
}

/* --- Sections --- */
.section {
  min-height: 100vh;
  padding: 150px 10%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  color: #ffffff;
  gap: 60px;
}

/* --- Hero Section --- */
.hero {
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 60px;
  padding: 100px 10%;
  background: none;
  border-radius: 25px;
  box-shadow: none;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffffff;
}

.cards-container {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 40px;
  flex-wrap: wrap;
}

/* --- Carte accueil --- */
.card {
  flex: 1 1 350px;
  max-width: 400px;
  padding: 40px 30px;
  border-radius: 20px;
  background: rgba(80, 80, 90, 0.25);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #f0f0f0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.profile-card img.profile-pic {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}

.card h2 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  margin-bottom: 15px;
}

.card p {
  font-size: 1rem;
  line-height: 1.5;
  opacity: 0.9;
}

/* --- Section Projets --- */
.projects-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 60px;
  padding: 100px 5%;
}

/* --- Section Compétences --- */
.section-title {
  font-size: 2.5rem;
  margin: 0 auto 30px; /* center the block and keep text left-aligned */
  font-weight: 700;
  color: #fff;
  text-align: left;
  width: 100%;
  max-width: 1200px;
}

/* Ensure containers for sections align titles with card content */
.projects-container,
.competences-container,
.passions-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.skills-grid {
  width: 100%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  /* Ensure rows are uniform height so cards align without holes */
  grid-auto-rows: 1fr;
  align-items: stretch;
}

.skill-card {
  padding: 20px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  /* Make each card stretch to fill the grid row height */
  height: 100%;
}

.skill-card-header {
  display: flex;
  justify-content: center; /* center the title horizontally */
  align-items: center;
  padding: 6px 0;
}
.skill-card-header h3 {
  font-size: 1.45rem; /* slightly larger title */
  font-weight: 700;
  margin: 0;
  text-align: center;
}

/* Make the programming card span two rows so CAO and Simulation stack at right */
.skill-card.tall {
  grid-row: span 2;
}

.tools-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Always visible — no collapse */
  overflow: visible;
  max-height: none;
}

.skill-card .tool-item {
  display: flex;
  gap: 14px;
  align-items: center;
}

.tool-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(0,0,0,0.15);
  padding: 6px;
}

.printer-logo { width: 96px; height: auto; }

.tool-text h4 {
  margin: 0 0 6px 0;
  font-size: 1rem;
  font-weight: 600;
}

.tool-text p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.9;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .hamburger { display: block; }
  .nav-links { display: none; }

  .skills-grid { grid-template-columns: 1fr; }
  .tool-logo { width: 48px; height:48px; }

  /* Stack major card groups vertically for mobile */
  .cards-container, .sub-cards-container, .cards-container .card, .sub-cards-container .sub-card, .projects-card, .competences-section .skills-grid, .skills-grid .skill-card {
    width: 100%;
    display: block;
  }

  /* Make all cards full-width and stacked */
  .card, .sub-card, .projects-card, .skill-card { flex: none; max-width: 100%; margin: 0 auto; }

  /* Reduce section padding on mobile */
  .section { padding: 80px 6% !important; }
}

/* Make more room under the fixed navbar for the hero on mobile */
@media (max-width: 900px) {
  .hero { padding-top: 140px !important; }
}

/* Additional mobile fixes for spacing, slideshow order and contact card */
@media (max-width: 900px) {
  /* ensure containers are centered */
  .projects-container, .competences-container, .passions-container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 6px;
  }

  /* restore consistent vertical gaps */
  .projects-container { display: flex; flex-direction: column; gap: 28px; }
  .skills-grid { row-gap: 20px; }
  .sub-cards-container { display: flex; flex-direction: column; gap: 18px; }
  .sub-card { max-width: 100%; }

  /* Passions: stack text above slideshow */
  .passions-container { display: flex; flex-direction: column; gap: 18px; align-items: center; }
  .passions-card { width: 100%; max-width: 720px; }
  .slideshow-container { width: 100%; max-width: 720px; order: 2; height: auto; }
  .slides { display: block; }
  .slide-img { width: 100%; height: auto; margin: 12px 0; }

  /* Contact card responsive sizing so it never overflows */
  .contact-card { max-width: 720px; width: calc(100% - 24px); padding: 28px 18px; box-sizing: border-box; }

  /* ensure mobile panel overlay sits above everything */
  .mobile-panel { z-index: 9999; }
  .mobile-overlay { z-index: 9998; }
}

/* Small gap under each card on mobile to avoid touching */
@media (max-width: 900px) {
  .card, .sub-card, .skill-card, .projects-card { margin-bottom: 16px; }

  /* Make sure contact details wrap and don't overflow */
  .contact-card { overflow: hidden; }
  .contact-details, .contact-item { max-width: 100%; overflow-wrap: anywhere; }
  .contact-item a { display: inline-block; overflow-wrap: anywhere; word-break: break-word; }
  .contact-item { font-size: 1rem; }
  .icon { width: 28px; height: 28px; }
}

/* Projects container alignment and spacing to match Competences */
.projects-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 40px; /* restore vertical spacing between Projects Personal and Projects University cards */
}

.projects-container .projects-card {
  /* reduce top padding so the space under the section title matches Competences */
  padding: 20px 40px 50px 40px; /* top right bottom left */
}

/* Reduce top padding for the passions card to align spacing under the title */
.passions-card {
  padding-top: 20px;
}


/* Cartes projets */
.projects-card {
  width: 100%;
  max-width: 1200px;
  padding: 50px 40px;
  border-radius: 25px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.projects-title {
  font-size: 2.5rem;
  text-align: center;
  font-weight: 700;
  margin-bottom: 20px;
  color: #fff;
}

.sub-cards-container {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.sub-card {
  flex: 1 1 30%;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  /* allow content to grow and wrap; avoid cutting long titles */
  overflow: visible;
  background: rgba(80, 80, 90, 0.25);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sub-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.sub-card-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 20px 20px 0 0;
}

.sub-card-content {
  padding: 15px;
  text-align: center;
  color: #f0f0f0;
}

.sub-card-content h3 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  margin-bottom: 10px;
  /* ensure long titles wrap and don't get truncated */
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sub-card-content p {
  font-size: 0.95rem;
  line-height: 1.4;
  opacity: 0.9;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .sub-card {
    flex: 1 1 45%;
  }
}

@media (max-width: 768px) {
  .sub-card {
    flex: 1 1 100%;
  }
  .projects-card {
    padding: 40px 20px;
  }
  .projects-section {
    padding: 80px 5%;
  }
}

/* --- Section Passions --- */
.passions-container {
  display: flex;
  justify-content: space-between;
  align-items: center;  /* Centrer verticalement */
  gap: 30px;
  width: 100%;
  max-width: 1200px;
}

/* Carte Passions */
.passions-card {
  flex: 1;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.passions-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 20px 20px 0 0;
}

.passions-card h2 {
  font-size: 1.5rem;
  text-align: center;
  font-weight: 600;
}

.passions-card p {
  font-size: 1rem;
  line-height: 1.5;
  text-align: center;
  opacity: 0.9;
}

/* --- Diaporama --- */
.slideshow-container {
  flex: 1;
  position: relative;
  width: 100%;
  max-width: 750px;  /* Agrandir le carrousel */
  height: 350px;  /* Ajouter une hauteur fixe pour le carrousel */
  border-radius: 20px;
}

.slides {
  display: flex;
  overflow: hidden;
  height: 100%;  /* Prendre toute la hauteur du conteneur */
  border-radius: 20px;
}

.slide-img {
  width: 100%;
  height: 100%;  /* Assurer que l'image prend toute la hauteur du carrousel */
  object-fit: cover;
  border-radius: 10px;
  margin-right: 10px;
  transition: transform 0.5s ease;
}

/* Flèches */
.prev, .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 2rem;
  padding: 15px;  /* Augmenter la taille pour rendre les boutons plus visibles */
  border-radius: 50%;  /* Rendre les boutons ronds */
  cursor: pointer;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.prev {
  left: 10px;
}

.next {
  right: 10px;
}

.prev:hover, .next:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

.info-card h2 {
  background: linear-gradient(90deg, #a084f3, #8ec5fc);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.info-card p {
  margin-top: 10px;
}

.info-card h4 {
  font-weight: 500;
  opacity: 0.9;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 8px;
  margin-bottom: 15px;
}

/* --- Section Contact --- */
.contact-card {
  max-width: 600px;
  text-align: center;
  gap: 20px;
  padding: 50px 40px;
}

.contact-card h2 {
  font-size: 2rem;
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(90deg, #a084f3, #8ec5fc);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 15px;
}

.contact-card p {
  font-size: 1.1rem;
  opacity: 0.9;
}


.contact-info a {
  color: #cfcfff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-info a:hover {
  color: #a084f3;
}

/* Lien LinkedIn stylisé */
.contact-links {
  margin-top: 20px;
}

.linkedin-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #cfcfff;
  font-weight: 500;
  transition: transform 0.3s ease, color 0.3s ease;
}

.linkedin-link:hover {
  transform: translateY(-3px);
  color: #a084f3;
}

.linkedin-logo {
  width: 28px;
  height: 28px;
  filter: brightness(1.2);
}

/* --- Footer separator --- */
.footer-separator {
  width: 80%;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.3);
  border: none;
  margin: 20px auto;
}

/* --- Section Contact (modernisée) --- */
.contact-card {
  position: relative;
  max-width: 650px;
  text-align: center;
  padding: 60px 50px;
  border-radius: 25px;
  background: rgba(40, 40, 60, 0.35);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.contact-card h2 {
  font-size: 2.3rem;
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(90deg, #a084f3, #8ec5fc);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}

.contact-subtitle {
  font-size: 1.1rem;
  opacity: 0.85;
  margin-bottom: 30px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  margin: 0 auto;
  width: fit-content;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 1.05rem;
  transition: transform 0.3s ease;
}

.contact-item:hover {
  transform: translateX(6px);
}

.contact-item a {
  color: #e0e0ff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-item a:hover {
  color: #a084f3;
}

.icon {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 0 5px rgba(160, 132, 243, 0.6));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.contact-item:hover .icon {
  transform: scale(1.1);
  filter: drop-shadow(0 0 8px rgba(160, 132, 243, 0.8));
}

/* Glow animé dans la carte */
.contact-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 20% 20%, rgba(160, 132, 243, 0.15), transparent 40%),
              radial-gradient(circle at 80% 80%, rgba(142, 197, 252, 0.15), transparent 40%);
  filter: blur(50px);
  animation: glowMove 12s infinite alternate ease-in-out;
  z-index: -1;
}

@keyframes glowMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(30px, -30px); }
}

/* --- Footer separator --- */
.footer-separator {
  width: 85%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  border: none;
  margin: 40px auto 10px auto;
  opacity: 0.6;
}

/* --- Section Contact (améliorée et élargie) --- */
.contact-card {
  position: relative;
  max-width: 900px; /* 🔹 élargie */
  text-align: center;
  padding: 80px 70px; /* 🔹 plus de respiration */
  border-radius: 30px;
  background: rgba(45, 45, 65, 0.4);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.contact-card h2 {
  font-size: 2.8rem; /* 🔹 titre plus fort */
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(90deg, #a084f3, #8ec5fc);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
}

/* --- Phrase d'accroche modernisée --- */
.contact-subtitle {
  font-family: 'Poppins', 'Inter', sans-serif;  font-size: 1.4rem; /* 🔹 plus grande */
  letter-spacing: 0.5px;
  opacity: 0.9;
  color: #d7d7f7;
  margin-bottom: 40px;
}

/* --- Liens (emails, LinkedIn) --- */
.contact-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 25px; /* 🔹 plus d’espace entre les lignes */
  margin: 0 auto;
  width: fit-content;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 1.25rem; /* 🔹 plus gros texte */
  transition: transform 0.3s ease;
}

.contact-item:hover {
  transform: translateX(8px);
}

.contact-item a {
  color: #e5e5ff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.contact-item a:hover {
  color: #a084f3;
}

/* --- Icônes --- */
.icon {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 0 6px rgba(160, 132, 243, 0.6));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.contact-item:hover .icon {
  transform: scale(1.15);
  filter: drop-shadow(0 0 10px rgba(160, 132, 243, 0.9));
}

/* --- Glow animé (inchangé mais adouci) --- */
.contact-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 25% 25%, rgba(160, 132, 243, 0.18), transparent 40%),
              radial-gradient(circle at 80% 75%, rgba(142, 197, 252, 0.18), transparent 40%);
  filter: blur(60px);
  animation: glowMove 14s infinite alternate ease-in-out;
  z-index: -1;
}
