.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: clamp(76px, 6vw, 100px);
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur-m) ease, border-color var(--dur-m) ease, backdrop-filter var(--dur-m) ease;
}
.nav.is-scrolled {
  background: rgba(6,6,8,.66);
  border-bottom-color: var(--line);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.nav-inner {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 100%; width: var(--wide); margin: 0 auto;
}
.nav-logo { justify-self: start; display: flex; align-items: center; }
.nav-logo img { height: clamp(30px, 2.4vw, 42px); width: auto; }

.nav-links {
  justify-self: center; display: flex; align-items: center; gap: clamp(4px, .6vw, 10px);
  padding: 6px; border-radius: 999px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line-hair);
  backdrop-filter: blur(14px);
}
.nav-links a {
  padding: 10px clamp(16px, 1.3vw, 24px); border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--grey-2);
  transition: background-color var(--dur-s) ease, color var(--dur-s) ease;
}
.nav-links a:hover { color: #fff; }

.nav-actions { justify-self: end; display: flex; align-items: center; gap: clamp(14px, 1.4vw, 26px); }
.nav-login { font-size: 14px; font-weight: 600; color: var(--grey-2); transition: color var(--dur-s) ease; }
.nav-login:hover { color: #fff; }
.nav-cta {
  display: inline-flex; align-items: center; height: clamp(38px, 2.6vw, 46px); padding: 0 clamp(16px, 1.3vw, 24px);
  border-radius: 999px; background: #fff; color: #060608;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; white-space: nowrap;
  transition: transform var(--dur-s) var(--ease-out), box-shadow var(--dur-s) ease;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -10px rgba(255,255,255,.4); }

/* Tablette / petit portable (761–1100px) : la pilule centrale et le bloc
   « Connexion · Commencer » se touchaient (à 820px, « Premium » collait à
   « Connexion »). On resserre les liens et on garantit un écart minimal. */
.nav-inner { column-gap: 16px; }
@media (max-width: 1100px) {
  .nav-links { gap: 0; }
  .nav-links a { padding: 10px 12px; }
}

@media (max-width: 760px) {
  .nav { height: 64px; }
  .nav-links, .nav-login { display: none; }
  .nav-inner { width: 90vw; }
}


/* ============================================================
   Menu mobile
   ============================================================
   Le bouton n'apparait qu'en dessous de 760px, la ou .nav-links est masque.
   Avant, ce point de rupture supprimait la navigation sans rien mettre a la
   place : le site n'avait plus de menu du tout sur telephone. */
.nav-burger { display: none; }

@media (max-width: 760px) {
  .nav-burger {
    display: inline-flex; flex-direction: column; justify-content: center;
    /* 44px : plancher de zone tactile confortable au pouce */
    gap: 5px; width: 44px; height: 44px; padding: 0 11px;
    background: var(--glass-fill); border: 1px solid var(--line);
    border-radius: 12px; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-burger span {
    display: block; height: 2px; width: 100%; border-radius: 2px;
    background: var(--grey-1);
    transition: transform .28s var(--ease-out), opacity .2s ease;
  }
  /* Les deux barres se croisent pour former une croix — l'etat du menu se lit
     sur le bouton lui-meme, sans texte a traduire. */
  .nav-burger[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .nav-burger[aria-expanded="true"] span:last-child  { transform: translateY(-3.5px) rotate(-45deg); }

  .nav-mobile {
    /* aligné sur .nav-inner, qui fait 90vw centré */
    position: absolute; left: 5vw; right: 5vw; top: 100%;
    margin-top: 8px;
    padding: 10px;
    border-radius: var(--radius-m);
    background: rgba(10, 10, 13, .92);
    border: 1px solid var(--line);
    backdrop-filter: blur(18px);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8);
    transform-origin: top center;
    animation: navMobileIn .26s var(--ease-out) both;
  }
  .nav-mobile[hidden] { display: none; }
  .nav-mobile nav { display: flex; flex-direction: column; }
  .nav-mobile a {
    display: block; padding: 13px 14px; border-radius: 12px;
    font-family: var(--font-body); font-size: 15px; font-weight: 600;
    color: var(--grey-1); text-decoration: none;
  }
  .nav-mobile a:active { background: var(--glass-fill); }
  .nav-mobile-login {
    margin-top: 6px; border-top: 1px solid var(--line-hair);
    border-radius: 0 0 12px 12px; color: var(--pink-light) !important;
  }
}

@keyframes navMobileIn {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-mobile { animation: none; }
  .nav-burger span { transition: none; }
}

/* Sur téléphone .nav-links est masqué : avec la grille 1fr auto 1fr, le bloc
   d'actions tombait dans la colonne centrale au lieu de coller au bord droit. */
@media (max-width: 760px) {
  .nav-inner { grid-template-columns: 1fr auto; }
}
