/* ============================================================
   HEKLA — Navigation en flux (entre hero et manifeste)
   ============================================================ */

/* ── Conteneur section-menu — sticky, passe au-dessus du manifeste */
.section-menu {
  height: 150px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: calc(100vh - 150px);
  z-index: 30;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.section-menu.is-hidden {
  opacity: 0;
  /* Désactive les interactions sur la pill quand la nav est masquée
     (opacity:0 ne suffit pas — l'élément capture toujours les events) */
  pointer-events: none;
}
.section-menu.is-hidden .float-nav {
  pointer-events: none;
}

/* ── Pill en flux ────────────────────────────────────────────── */
.float-nav {
  position: relative;
  z-index: 10;
  pointer-events: auto;

  width: 720px;
  margin: 0;

  /* Glass pill */
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 100px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);

  /* Couleur par défaut : sombre (fond clair) */
  color: var(--c-black);

  /* Transition de thème */
  transition: color 0.4s ease, background 0.4s ease, border-color 0.4s ease,
              box-shadow 0.4s ease;
}

/* ── Thème clair (sur zones sombres) ─────────────────────────── */
.float-nav.is-light {
  color: var(--c-white);
  background: rgba(0, 0, 0, 0.18);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 4px 32px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* ── Embarqué ────────────────────────────────────────────────── */
.float-nav.is-embedded {
  box-shadow:
    0 2px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

/* ── Layout interne — space-between garantit des espaces égaux ── */
.float-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 36px;
  position: relative; /* ancre le burger absolu sur mobile */
}

/* ── Logo ────────────────────────────────────────────── */
.float-nav__logo {
  flex-shrink: 0;
  line-height: 0;
}

/* ── Swap de logos — cycle dynamique (injecté par float-nav.js) ── */
.logo-swap {
  position: relative;
  display: inline-block;
}

/* Tous les logos : noirs par défaut, transition opacity */
.logo-swap__item {
  display: block;
  width: auto;
  opacity: 0;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  filter: none;
}

/* Premier logo : in-flow (détermine la taille du wrapper) */
.logo-swap__item:first-child {
  pointer-events: auto;
}

/* Logos 2+ : superposés, centrés sur le premier */
.logo-swap__item:not(:first-child) {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Logo actif : visible */
.logo-swap__item.is-active {
  opacity: 1;
}

/* Sur fond sombre (nav is-light = texte blanc) : logos blancs */
.float-nav.is-light .logo-swap__item {
  filter: invert(1);
}

/* ── Logo projet (page détail) ───────────────────────────────── */
.pill-project-logo {
  display: block;
  height: 34px;      /* hauteur fixe indispensable pour les SVG sans dimensions */
  max-width: 120px;
  width: auto;
  object-fit: contain;
  transition: opacity 0.2s ease;
}

.float-nav.is-light .pill-project-logo {
  filter: invert(1);
}

/* ── Liens ───────────────────────────────────────────────────── */
.float-nav__links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.float-nav__link {
  font-family: var(--f-sans);
  font-size: 0.90rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: currentColor;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.2s ease;
  position: relative;
}

.float-nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.3s var(--ease-out);
}

.float-nav__link:hover { opacity: 1; }
.float-nav__link:hover::after { width: 100%; }

/* Page courante */
.float-nav__link.is-current {
  opacity: 1;
  font-weight: 500;
}
.float-nav__link.is-current::after {
  width: 100%;
}

/* ── Bloc droit ──────────────────────────────────────────────── */
.float-nav__right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* ── Icônes sociales ─────────────────────────────────────────── */
.float-nav__social {
  display: flex;
  align-items: center;
  gap: 12px;
}

.float-nav__social-link {
  color: currentColor;
  opacity: 1;
  transition: opacity 0.2s ease;
  line-height: 0;
}

.float-nav__social-link:hover { opacity: 1; }

/* ── Séparateur orange ───────────────────────────────────────── */
.float-nav__sep {
  width: 1px;
  height: 16px;
  background: var(--c-orange);
  margin: 0 14px;
  flex-shrink: 0;
}

/* ── Switcher de langue ──────────────────────────────────────── */
.float-nav__lang {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.float-nav__lang-dash {
  font-family: var(--f-sans);
  font-size: 0.8125rem;
  opacity: 1;
}

.float-nav__lang-btn {
  font-family: var(--f-sans);
  font-size: 0.8125rem;
  font-weight: 400;
  color: currentColor;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 1;
  padding: 0;
  position: relative;
  transition: opacity 0.2s ease;
}

.float-nav__lang-btn.is-active {
  opacity: 1;
  font-weight: 500;
}

.float-nav__lang-btn.is-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
}

.float-nav__lang-btn:not(.is-active):hover { opacity: 1; }

/* ── Entrée animée — glisse depuis le bas ────────────────────── */
@keyframes navFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.float-nav {
  animation: navFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

/* ══════════════════════════════════════════════════════════════
   ISL MODE TOGGLE — pill avec texte intégré dans le track
   Desktop : [social | sep | lang | sep | [○ ISL Mode] ]
   Mobile  : [sep | lang | sep | [○ ISL Mode] ]
══════════════════════════════════════════════════════════════ */

/* ── Wrapper ─────────────────────────────────────────────────── */
.float-nav__isk {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ── Label cliquable ──────────────────────────────────────────── */
.float-nav__isk-switch {
  position: relative;
  cursor: pointer;
  display: block;
  line-height: 0;
  flex-shrink: 0;
}

.float-nav__isk-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

/* ── Track étendu — contient thumb + texte ───────────────────── */
.float-nav__isk-track {
  position: relative;
  display: flex;
  align-items: center;
  width: 76px;
  height: 22px;
  /* OFF : thumb à gauche → texte à droite du padding-left */
  padding: 0 8px 0 23px;
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.13);
  /* transition padding : texte glisse de droite → gauche en synchro avec le thumb */
  transition: background 0.28s ease, padding-left 0.28s ease, padding-right 0.28s ease;
}

/* ── Thumb ────────────────────────────────────────────────────── */
.float-nav__isk-thumb {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
}

/* ── Texte intégré dans le track ──────────────────────────────── */
.float-nav__isk-text {
  font-family: var(--f-sans);
  font-size: 0.50rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: currentColor;
  opacity: 0.85;
  white-space: nowrap;
  line-height: 1;
}

/* ── État ON : thumb glisse à droite, texte "HKA Mode" ferrée à gauche ───────── */
.float-nav__isk-switch input:checked ~ .float-nav__isk-track {
  /* ON : thumb à droite → inverser le padding pour ferrer le texte à gauche */
  padding: 0 23px 0 8px;
}

.float-nav__isk-switch input:checked ~ .float-nav__isk-track .float-nav__isk-thumb {
  transform: translateX(54px);   /* 76 - 3 - 16 - 3 = 54px */
}

/* ══════════════════════════════════════════════════════════════
   BURGER BUTTON
══════════════════════════════════════════════════════════════ */

.float-nav__burger {
  display: none; /* visible uniquement sur mobile */
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: currentColor;
  flex-shrink: 0;
  position: relative;
  width: 26px;
  height: 20px;
}

/* Icône burger — visible par défaut */
.float-nav__burger .burger-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transition: opacity 0.25s ease, transform 0.3s ease;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Icône croix — cachée par défaut */
.float-nav__burger .close-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transition: opacity 0.25s ease, transform 0.3s ease;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6) rotate(-45deg);
}

/* À l'ouverture : swap burger → croix */
.float-nav__burger.is-open .burger-icon {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6) rotate(45deg);
}
.float-nav__burger.is-open .close-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

/* ══════════════════════════════════════════════════════════════
   OVERLAY MENU MOBILE — orange, tombe du haut
══════════════════════════════════════════════════════════════ */

.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* S'arrête au-dessus de la pill — la pill fait ~150px sticky depuis le bas */
  bottom: 0;
  z-index: 25; /* sous le section-menu (z-index: 30) → pill reste visible */
  background: var(--c-orange, #F26322);
  color: #fff;

  /* Animation : tombe du haut */
  transform: translateY(-100%);
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.mobile-nav.is-open {
  transform: translateY(0);
  pointer-events: auto;
  z-index: 95; /* passe au-dessus des pills projet-infos / projet-detail-btn (z:90) */
}

/* ── Contenu interne ────────────────────────────────────────── */
.mobile-nav__inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  /* Padding bottom : laisse de l'espace au-dessus de la pill */
  padding: clamp(48px, 12vh, 100px) 40px clamp(120px, 22vh, 180px);
}

/* ── Liens : Projets + Expertises ───────────────────────────── */
.mobile-nav__links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
  flex: 1;
  justify-content: center;
}

.mobile-nav__link {
  font-family: var(--f-serif);
  font-size: clamp(3rem, 13vw, 5rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: #fff;
  text-decoration: none;
  text-align: center;

  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s cubic-bezier(0.16,1,0.3,1),
              transform 0.5s cubic-bezier(0.16,1,0.3,1);
}

.mobile-nav.is-open .mobile-nav__link:nth-child(1) {
  opacity: 1; transform: none; transition-delay: 0.15s;
}
.mobile-nav.is-open .mobile-nav__link:nth-child(2) {
  opacity: 1; transform: none; transition-delay: 0.24s;
}

.mobile-nav__link.is-current {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
}

/* ── CTA Contactez-nous ─────────────────────────────────────── */
.mobile-nav__cta {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  text-align: center;

  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.45s 0.32s ease,
              transform 0.45s 0.32s ease;
}

.mobile-nav.is-open .mobile-nav__cta {
  opacity: 1;
  transform: none;
}

.mobile-nav__cta-title {
  font-family: var(--f-serif);
  font-size: 3rem;
  font-weight: 400;
  color: #fff;
  margin: 0;
  line-height: 1.15;
}

.mobile-nav__cta-btn {
  display: inline-block;
  align-self: center;
  font-family: var(--f-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  background: #111110;
  text-decoration: none;
  padding: 16px 28px;
  border-radius: 20px;
  transition: color 0.2s, background 0.2s;
}

.mobile-nav__cta-btn:hover {
  background: #fff;
  color: #111110;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Sur mobile : fixed au lieu de sticky — le sticky ne fonctionne pas
     car .above-fold a une hauteur auto bien supérieure à 100vh,
     donc .section-menu ne sort jamais du flux pendant l'édito.       */
  .section-menu {
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    height: auto;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.35s ease;
  }
  /* is-hidden (footer) reste prioritaire */
  .section-menu.is-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .float-nav {
    width: calc(100% - 32px);
    /* safe-area-inset-bottom : home indicator iPhone (≈34px Face ID, 0px sinon)
       + 16px de marge visuelle au-dessus de la barre navigateur Safari       */
    margin: 0 auto calc(16px + env(safe-area-inset-bottom, 0px));
  }

  /* 3 zones : logo (fixe) | burger (flex:1, centré) | right (fixe) */
  .float-nav__inner {
    display: flex;
    height: 60px;
    padding: 0 20px;
    align-items: center;
    position: relative;
  }

  .float-nav__logo { flex-shrink: 0; }

  .float-nav__burger {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    /* position: relative conservé depuis le CSS de base —
       les icônes absolues s'ancrent dans le bouton, pas dans l'inner */
    transform: none;
    width: auto;
    height: auto;
  }

  .float-nav__right { flex-shrink: 0; }

  /* Compensation optique : le premier .float-nav__sep a margin-left:14px,
     ce qui décale le contenu visible de 14px dans la zone right.
     On avance les icônes burger de la moitié (7px) pour les centrer optiquement. */
  .float-nav__burger .burger-icon,
  .float-nav__burger .close-icon {
    left: calc(50% + 7px);
  }

  /* Icônes sociales masquées sur mobile — layout simplifié */
  .float-nav__social { display: none; }

  /* Éléments du bloc droit à pleine opacité sur mobile */
  .float-nav__right .float-nav__social-link,
  .float-nav__right .float-nav__lang-btn,
  .float-nav__right .float-nav__lang-dash {
    opacity: 1;
  }

  /* Liens desktop cachés */
  .float-nav__links { display: none; }
}
