nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 220px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 100;
  border-right: 1px solid var(--border);
}

/* ---------- Profil (cellule du haut) ---------- */
.profile {
  padding: 28px 16px;
  text-align: center;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.profile img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: 2px solid var(--accent);
  border-radius: 50%;
}

.profile h2 {
  margin: 14px 0 4px;
  font: 600 18px/1.2 system-ui, sans-serif;
}

.profile h3 {
  margin: 0;
  font: 400 14px/1.2 system-ui, sans-serif;
  color: var(--muted);
}

/* ---------- Menu (centré au milieu) ---------- */
.menu {
  flex: 1;                      
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.menu button {
  all: unset;
  box-sizing: border-box;
  display: flex;
  height: 64px;
  cursor: pointer;
  border-top: 1px solid var(--border);
  transition: background 0.2s;
}

.menu button:last-child {
  border-bottom: 1px solid var(--border);
}

.menu button:hover,
.menu button:focus-within {
  background: var(--bg-hover);
}

.menu a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  color: var(--text);
  font: 500 15px/1 system-ui, sans-serif;
  text-decoration: none;
}

.menu svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.menu button:hover svg {
  stroke: #fff;
}

/* ---------- Footer ---------- */
nav footer {
  padding: 16px;
  text-align: center;
  border-top: 1px solid var(--border);
}

nav footer p {
  margin: 0;
  font: 400 12px/1.5 system-ui, sans-serif;
  color: var(--muted);
}

/* ---------- Bouton hamburger (caché sur desktop) ---------- */
#menu-toggle,
#nav-overlay {
  display: none;
}

@media (max-width: 900px) {
  #menu-toggle {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 110;
    width: 44px;
    height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    cursor: pointer;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.2s;
  }

  #menu-toggle:hover,
  #menu-toggle:focus-visible {
    border-color: var(--accent);
  }

  #menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.2s;
  }

  /* hamburger -> croix */
  .nav-open #menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-open #menu-toggle span:nth-child(2) { opacity: 0; }
  .nav-open #menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* navbar cachée hors écran, glisse à l'ouverture */
  nav {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .nav-open nav {
    transform: translateX(0);
  }

  /* fond sombre derrière la navbar */
  #nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }

  .nav-open #nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  body.nav-open {
    overflow: hidden;
  }

  /* laisse la place au bouton hamburger en haut des sections */
  .navigate_section.navigate_section {
    padding-top: 80px;
  }
}