/* HEADER / FLOATING HAMBURGER */

.site-header {
  position: fixed;
  top: clamp(36px, 4vw, 64px);
  right: clamp(34px, 5vw, 88px);
  z-index: 42;

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  transform: translateY(-16px);
  animation: headerReveal 1.1s var(--ease-premium) forwards;
  animation-delay: 0.4s;

  transition:
    opacity 0.45s var(--ease-premium),
    transform 0.45s var(--ease-premium),
    visibility 0.45s var(--ease-premium);
}

/* Quand le menu est ouvert, on cache le hamburger.
   L'utilisateur ferme avec l'ancre dans l'offcanvas. */

body.menu-open .site-header {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.94);
  pointer-events: none;
}

/* BURGER */

.menu-button {
  position: relative;
  isolation: isolate;

  width: clamp(68px, 5.4vw, 92px);
  height: clamp(62px, 5vw, 84px);
  padding: 0;

  border: 0;
  background: transparent;
  cursor: pointer;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 0.55vw, 9px);

  transform: rotate(-1deg);
  transition:
    transform 0.35s var(--ease-premium),
    filter 0.35s var(--ease-premium);
}

.menu-button::before {
  content: "";
  position: absolute;
  inset: -13px -15px;
  z-index: -1;

  background-image: url("../img/piece-icon.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;

  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.18));
  transform: rotate(1.5deg) scale(1);
  transition:
    transform 0.35s var(--ease-premium),
    filter 0.35s var(--ease-premium);
}

.menu-button span {
  position: relative;
  z-index: 2;

  display: block;
  width: clamp(28px, 2.3vw, 40px);
  height: 3px;

  background: #202846;
  border-radius: 999px;

  transform-origin: center;
  transition:
    transform 0.35s var(--ease-premium),
    opacity 0.3s ease,
    width 0.35s var(--ease-premium);
}

.menu-button:hover {
  transform: translateY(-2px) rotate(1deg);
}

.menu-button:hover::before {
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.22));
  transform: rotate(-1deg) scale(1.04);
}

.menu-button:hover span:nth-child(1) {
  width: clamp(22px, 1.8vw, 32px);
  transform: translateX(3px);
}

.menu-button:hover span:nth-child(2) {
  width: clamp(30px, 2.5vw, 42px);
}

.menu-button:hover span:nth-child(3) {
  width: clamp(24px, 1.9vw, 34px);
  transform: translateX(-3px);
}

/* Language switcher, utilisé dans le menu */

.language-switcher {
  display: flex;
  align-items: center;
  font-size: clamp(12px, 1vw, 24px);
}

.lang-item {
  position: relative;
  isolation: isolate;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  
  min-width: clamp(0.75rem, 0.4432rem + 1.3636vw, 1.5rem);
  min-height: clamp(0.75rem, 0.4432rem + 1.3636vw, 1.5rem);
  padding: 8px 24px;

  color: #171717;
  text-decoration: none;
  font-family: Helvetica, Arial, sans-serif;
  /*font size clamp into 12px */
  font-size: clamp(12px, 1vw, 24px);
  font-weight: 500;
  letter-spacing: -0.07em;
  line-height: 1;

  border: 0;
  background: transparent;

  transition:
    color 0.35s ease,
    transform 0.35s var(--ease-premium),
    opacity 0.35s ease;
}

.lang-item::before {
  content: "";
  position: absolute;
  inset: -20px -26px;
  z-index: -1;

  background-image: url("../img/piece-icon.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;

  opacity: 0;
  transform: rotate(-2deg) scale(0.88);

  transition:
    opacity 0.35s var(--ease-premium),
    transform 0.35s var(--ease-premium);
}

.lang-item:hover {
  color: #111;
  transform: translateY(-3px);
}

.lang-item:hover::before {
  opacity: 0.55;
  transform: rotate(1deg) scale(0.96);
}

.lang-item.is-active {
  color: #111;
  transform: rotate(-1deg);
}

.lang-item.is-active::before {
  opacity: 1;
  transform: rotate(-2deg) scale(1);
}

.lang-item.is-disabled {
  opacity: 1;
  cursor: not-allowed;
  pointer-events: none;
}

/* RESPONSIVE */

@media (max-width: 900px) {
  .site-header {
    top: 34px;
    right: 34px;
  }

  .menu-button {
    width: 64px;
    height: 58px;
  }

  .menu-button span {
    width: 28px;
    height: 2px;
  }
}

@media (max-width: 520px) {
  .site-header {
    top: 30px;
    right: 30px;
  }

  .menu-button {
    width: 58px;
    height: 52px;
  }

  .menu-button::before {
    inset: -11px -13px;
  }

  .lang-item {
    font-size: clamp(34px, 12vw, 56px);
    min-width: 58px;
    min-height: 56px;
  }

  .language-switcher {
    gap: 24px;
  }
}