/* --- Variables et Styles de base --- */
:root {
  --primary-color: #007bff;
  --dark-color: #333;
  --light-color: #f4f4f4;
  --text-color: #555;
  --container-width: 960px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  /* Pour un défilement fluide lors du clic sur les ancres */
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial,
    sans-serif;
  line-height: 1.6;
  background-color: #fff;
  color: var(--text-color);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: var(--primary-color);
}

h1,
h2,
h3 {
  color: var(--dark-color);
  margin-bottom: 1rem;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* --- Header & Navigation --- */
header {
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--dark-color);
}

.nav-links {
  display: flex;
}

.nav-links li {
  margin-left: 1.5rem;
}

.nav-links a {
  font-weight: 500;
  color: var(--text-color);
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--primary-color);
}

/* Icône du menu mobile (hamburger) */
.mobile-menu-icon {
  display: none;
  cursor: pointer;
}

.mobile-menu-icon span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--dark-color);
  margin: 5px;
  transition: all 0.3s ease-in-out;
}

/* --- Sections --- */
section {
  padding: 4rem 0;
}

hr.container {
  border: 0;
  height: 1px;
  background: #eee;
}

/* --- Section home (Accueil) --- */
#home {
  text-align: center;
  padding-top: 6rem;
  padding-bottom: 6rem;
}

#home h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

#home .subtitle {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.cta-button {
  display: inline-block;
  background: var(--primary-color);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  margin-top: 1.5rem;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.cta-button:hover {
  background: #0056b3;
}

/* --- Section À Propos --- */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.skills-list li {
  background: var(--light-color);
  color: var(--dark-color);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
}

/* --- Section Projets --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.project-card img {
  width: 100%;
  height: 200px; /* Hauteur fixe */
  object-fit: cover; /* Recadre l'image pour l'adapter */
}

.project-card h3,
.project-card p {
  padding: 0 1.5rem;
}

.project-card h3 {
  margin-top: 1.5rem;
}

.project-card p {
  padding-bottom: 1.5rem;
}

.project-links {
  display: flex;
  justify-content: space-around;
  background: var(--light-color);
  padding: 1rem 1.5rem;
  border-top: 1px solid #ddd;
}

.project-links a {
  font-weight: bold;
}

/* --- Section Contact --- */
#contact {
  text-align: center;
}

.social-links {
  margin-top: 2rem;
}

.social-links a {
  margin: 0 1rem;
  font-size: 1.1rem;
  font-weight: bold;
}

/* --- Footer --- */
footer {
  text-align: center;
  padding: 2rem;
  background: var(--dark-color);
  color: #fff;
  margin-top: 2rem;
}

/* --- Responsive (Mobile) --- */
@media (max-width: 768px) {
  .nav-links {
    display: none; /* Caché par défaut */
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 60px; /* Hauteur du header */
    left: 0;
    background: white;
    border-bottom: 1px solid #ddd;
  }

  .nav-links.active {
    display: flex; /* Affiché quand la classe 'active' est ajoutée */
  }

  .nav-links li {
    margin: 0;
    text-align: center;
  }

  .nav-links a {
    padding: 1rem;
    display: block;
    border-bottom: 1px solid #f4f4f4;
  }

  .mobile-menu-icon {
    display: block; /* Afficher l'icône hamburger */
  }

  /* Animation de l'icône hamburger en "X" */
  .mobile-menu-icon.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .mobile-menu-icon.active span:nth-child(2) {
    opacity: 0;
  }
  .mobile-menu-icon.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }

  #home h1 {
    font-size: 2.5rem;
  }

  #home .subtitle {
    font-size: 1.2rem;
  }
}
