/**
 * floating-nav.css — Menu flottant (pastille + panneau déplié).
 * Fond --blue-black (#090E15) : texte blanc à 19:1 de contraste. Il ressort sur le blanc
 * des sections claires et sur le bleu des sections animées ; sur le footer (même couleur)
 * le liseré clair et l'ombre le détachent.
 */

.float-nav {
  --fn-w: 218px;
  --fn-w-open: min(300px, calc(100vw - var(--pad) * 2));
  position: fixed;
  top: 14px;
  right: var(--pad);
  z-index: 50;
  width: var(--fn-w);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: var(--blue-black);
  color: var(--white);
  box-shadow: 0 10px 30px -8px rgba(2, 3, 15, 0.45);
  /* Caché : au-dessus de l'écran, légèrement réduit */
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, -140%, 0) scale(0.92);
  transform-origin: top right;
  transition:
    transform 0.7s var(--ease-out),
    opacity 0.35s ease,
    visibility 0s linear 0.7s,
    width 0.6s var(--ease-out);
}

.float-nav.is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.float-nav.is-open {
  width: var(--fn-w-open);
}

/* --- Pastille --- */
.float-nav__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  height: 52px;
  padding: 0 0.4rem 0 1.1rem;
}

.float-nav__logo img {
  width: 26px;
  height: auto;
}

.float-nav__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  height: 38px;
  padding: 0 1rem;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  will-change: transform;
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* Survol : c'est l'anneau du curseur qui réagit ; le remplissage orange reste pour l'état ouvert / le clic */
.float-nav__toggle:active,
.float-nav.is-open .float-nav__toggle {
  background: var(--orange);
}

/* Burger : deux traits qui se croisent en croix */
.burger {
  position: relative;
  width: 16px;
  height: 10px;
}

.burger i {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.55s var(--ease-out);
}

.burger i:first-child { top: 0; }
.burger i:last-child  { top: calc(100% - 1.5px); }

.is-open .burger i:first-child { transform: translateY(4.25px) rotate(45deg); }
.is-open .burger i:last-child  { transform: translateY(-4.25px) rotate(-45deg); }

/* --- Panneau : la hauteur se déplie sans JS de mesure --- */
.float-nav__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.6s var(--ease-out);
}

.is-open .float-nav__panel {
  grid-template-rows: 1fr;
}

.float-nav__clip {
  min-height: 0;
  overflow: hidden;
  padding-inline: 3.2rem 1.4rem; /* place pour la flèche des liens */
}

.float-nav__links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.1rem;
  padding-block: 0.9rem 1.2rem;
}

.float-nav .nav-link {
  font-size: 0.9rem;
}

.float-nav__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem 1.3rem;
  margin-inline: -3.2rem -1.4rem;
  padding-inline: 3.2rem 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.float-nav__foot .lang {
  padding-top: 0;
}

/* Les liens apparaissent en cascade à l'ouverture, disparaissent d'un bloc à la fermeture */
.float-nav__links li,
.float-nav__foot {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.is-open .float-nav__links li,
.is-open .float-nav__foot {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.6s ease calc(var(--i, 0) * 60ms + 160ms),
    transform 0.7s var(--ease-out) calc(var(--i, 0) * 60ms + 160ms);
}

@media (max-width: 420px) {
  .float-nav { --fn-w: 148px; }
  .float-nav__logo .logo__text,
  .float-nav__label { display: none; }
  .float-nav__toggle { padding: 0 0.85rem; }
}
