/* ═══════════════════════════
   BLOCCO MENU GLOBALE
   ═══════════════════════════ */
body.menu-open {
  position: fixed;
  width: 100%;
  overflow-y: scroll;
}

/* ═══════════════════════════
   FLOATING HAMBURGER
   ═══════════════════════════ */
.hamburger {
  position: fixed;
  top: clamp(0.8rem, 2vh, 1.2rem);
  right: clamp(0.8rem, 3vw, 1.5rem);
  z-index: 1001;
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer; padding: 10px;
  background: rgba(10,10,10,0.6);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(232,76,138,0.1);
  transition: background 0.3s;
  font: inherit; color: inherit; border-radius: 0;
  -webkit-appearance: none; appearance: none;
}
.hamburger:hover { background: rgba(10,10,10,0.85); }
.hamburger span {
  width: 26px; height: 2px; background: var(--pink);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center; display: block; pointer-events: none;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5.5px, 5.5px); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5.5px, -5.5px); }

/* ═══════════════════════════
   MENU OVERLAY E LINK
   ═══════════════════════════ */
.mobile-menu {
  position: fixed; inset: 0; z-index: 999;
  background: var(--dark-bg);
  display: flex; flex-direction: column;
  
  /* IL SALVAVITA: sostituisci "center" con "safe center" */
  justify-content: safe center; 
  
  align-items: center;
  opacity: 0; visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  overflow-y: auto; padding: 2rem 0;
}
.mobile-menu.open { 
  opacity: 1; visibility: visible; 
  pointer-events: auto;
}

/* 1. Link di base */
.mobile-menu a {
  font-family: var(--font-display); 
  font-weight: 600;
  font-size: var(--fs-elemento); /* <-- ECCO LA MAGIA! */
  color: var(--cream); 
  text-decoration: none;
  text-transform: uppercase; 
  letter-spacing: 5px;
  padding: 0.6em 0; 
  opacity: 0;
  transition: opacity 0.3s ease 0.1s, color 0.3s;
  position: relative; 
}

.mobile-menu.open a { opacity: 1; }

/* 2 E 3. PAGINA ATTIVA E HOVER PROTETTO */
/* Pagina attiva: Ora si illumina di rosa! */
.mobile-menu a.active { 
  color: var(--pink); 
  background: transparent; 
}

/* Hover intelligente: funziona solo col mouse, non si incastra sui telefoni */
@media (hover: hover) {
  .mobile-menu a:hover,
  .mobile-menu a.active:hover { 
    color: var(--pink); 
  }
}

/* 4. La Freccina Rosa a sinistra del link attivo */
.mobile-menu a.active::before {
  content: '►';
  color: var(--pink);
  font-family: var(--font-mono);
  font-size: 0.75em;
  position: absolute;
  left: -1.5em; /* Spinge la freccia fuori dal testo a sinistra */
  top: 50%;
  transform: translateY(-50%);
}

/* ═══════════════════════════
   DOPPIA FRECCIA E SFUMATURA SCROLL (SU E GIÙ)
   ═══════════════════════════ */
.indicator-top, .indicator-bottom {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  color: var(--pink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

/* Posizioni speculari */
.indicator-top { top: clamp(1rem, 4vh, 2rem); }
.indicator-bottom { bottom: clamp(1rem, 4vh, 2rem); }

.indicator-top svg, .indicator-bottom svg {
  width: 36px; height: 36px; fill: currentColor;
}

/* Animazioni separate */
.indicator-top svg { animation: bounceArrowUp 2s infinite; }
.indicator-bottom svg { animation: bounceArrowDown 2s infinite; }

/* Sfumature nere in alto e in basso */
.mobile-menu::before, .mobile-menu::after {
  content: ''; position: fixed; left: 0; width: 100%;
  height: clamp(60px, 15vh, 100px);
  pointer-events: none; opacity: 0; transition: opacity 0.3s ease;
  z-index: 990;
}
.mobile-menu::before { top: 0; background: linear-gradient(to top, #13111300 0%, #131113 85%); }
.mobile-menu::after { bottom: 0; background: linear-gradient(to bottom, #13111300 0%, #131113 85%); }

/* Accensioni separate gestite da JS */
.mobile-menu.can-scroll-up .indicator-top { opacity: 1; }
.mobile-menu.can-scroll-up::before { opacity: 1; }

.mobile-menu.can-scroll-down .indicator-bottom { opacity: 1; }
.mobile-menu.can-scroll-down::after { opacity: 1; }

@keyframes bounceArrowDown {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}
@keyframes bounceArrowUp {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(10px); }
  60% { transform: translateY(5px); }
}

/* ═══════════════════════════
   PAGE TRANSITION
   ═══════════════════════════ */
.page-transition {
  position: fixed; inset: 0;
  background: var(--dark-bg); z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.page-transition.active { opacity: 1; }