/* =====================================================================
   Parmae City Lab — custom layer (oltre a Tailwind)
   ===================================================================== */

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { overflow-x: hidden; }

/* --- Anti-sovrapposizione nav fissa: quando si salta a un'ancora, il titolo
       non finisce sotto la barra in alto (76px + margine) --- */
:target { scroll-margin-top: 96px; }
section[id], footer[id], [data-anchor] { scroll-margin-top: 96px; }

/* --- Barra avanzamento scroll (in cima) --- */
#scroll-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; z-index: 60;
  background: linear-gradient(90deg, #0088CC, #4E81BD);
  transform: scaleX(0); transform-origin: 0 50%;
  will-change: transform;
}

/* --- Reveal: fade-in + slide-up (stato iniziale) --- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  will-change: opacity, transform;
}
.no-js [data-reveal] { opacity: 1; transform: none; }

/* --- Scroll cue --- */
@keyframes cue-pulse {
  0%, 100% { transform: scaleY(1);   opacity: 0.85; transform-origin: top; }
  50%      { transform: scaleY(0.35); opacity: 0.3; transform-origin: top; }
}
.scroll-cue { animation: cue-pulse 2.4s ease-in-out infinite; }

/* --- Nav: trasparente sull'hero, navy-glass dopo lo scroll --- */
#nav.is-scrolled {
  background: rgba(10, 14, 20, 0.72);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- Desktop: nav SEMPRE col colore "scrollato" (su mobile resta trasparente
       sull'hero e si colora allo scroll, come da richiesta) --- */
@media (min-width: 1024px) {
  #nav {
    background: rgba(10, 14, 20, 0.72);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
}

/* --- Hamburger → X --- */
.hb-line {
  display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px;
  transition: transform .3s ease, opacity .2s ease;
}
#menu-btn.is-active .hb-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#menu-btn.is-active .hb-line:nth-child(2) { opacity: 0; }
#menu-btn.is-active .hb-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Mobile menu overlay --- */
.mobile-menu {
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease;
}
.mobile-menu.is-open { opacity: 1; pointer-events: auto; }
.mm-link {
  font-size: clamp(1.9rem, 8vw, 2.6rem); font-weight: 500; letter-spacing: -0.02em;
  padding: .35rem 0; color: #fff;
  opacity: 0; transform: translateY(14px);
  transition: opacity .4s ease, transform .4s ease;
}
.mobile-menu.is-open .mm-link { opacity: 1; transform: translateY(0); }
.mobile-menu.is-open .mm-link:nth-child(1) { transition-delay: .08s; }
.mobile-menu.is-open .mm-link:nth-child(2) { transition-delay: .14s; }
.mobile-menu.is-open .mm-link:nth-child(3) { transition-delay: .20s; }
.mobile-menu.is-open .mm-link:nth-child(4) { transition-delay: .26s; }
.mobile-menu.is-open .mm-link:nth-child(5) { transition-delay: .32s; }
.mobile-menu.is-open .mm-link:nth-child(6) { transition-delay: .38s; }
.mobile-menu.is-open .mm-link:nth-child(7) { transition-delay: .44s; }
.mm-link:active { color: #0088CC; }

/* --- Card progetto: zoom morbido in hover --- */
.project-card .project-img { transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1); }
.project-card:hover .project-img { transform: scale(1.05); }

/* --- Accessibilità: rispetta reduce-motion --- */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .scroll-cue { animation: none; }
  .project-card .project-img { transition: none; }
}
