/* Navigation (desktop) */
nav {
  position: fixed;
  bottom: 1rem; /* Collée en bas */
  left: 50%; /* Point de référence */
  transform: translateX(-50%); /* Centre horizontalement */
  z-index: 1000;
  display: flex;
  flex-wrap: wrap; /* Pour s'adapter aux petits écrans */
  justify-content: center;
  gap: 0.8rem;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(10px);
  padding: 0.8rem 1rem;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-color: rgba(100, 255, 218, 0.3);
  max-width: 90%; /* Évite de dépasser sur petits écrans */
}

nav a {
  color: #fff;
  text-decoration: none;
  padding: 0.9rem 0.4rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-family: 'Roboto mono';
  font-size: 16px;
  background: rgba(6, 40, 32, 0.518);
}

nav a:hover {
  background: rgba(100, 255, 218, 0.2);
  color: #64ffda;
}

/* ✅ Menu burger (initialement caché) */
#navMobile {
  display: none;
}

.menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 35px;
  height: 25px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1100;
}

.menu-toggle .bar {
  width: 100%;
  height: 3px;
  background: #fff;
  border-radius: 5px;
  transition: 0.3s ease;
}

/* ✅ Responsive */
@media (max-width:  1210px) {
  nav {
    display: none; /* Cache le menu du bas */
  }

  #navMobile {
    display: flex;
  }

  .menu-toggle {
    display: flex; /* Affiche le burger */
  }

  /* ✅ Menu latéral caché par défaut */
  #mobile-menu {
    position: fixed;
    top: 0;
    left: -100%; /* Hors écran */
    height: 100vh;
    width: 220px;
    background: rgba(10, 10, 10, 0.95);
    padding: 4rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    transition: left 0.4s ease;
    z-index: 1000;
    overflow: hidden;
  }

  #mobile-menu.show {
    left: 0; /* Slide in */
  }

  #mobile-menu a {
    color: #fff;
    font-size: 18px;
    text-decoration: none;
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  #mobile-menu.show a {
    opacity: 1;
    transform: translateX(0);
  }

  /* ✅ Animation croix */
  .menu-toggle.active .bar:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
  }
  .menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.active .bar:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
  }
}
