/* ==========================================================================
   motion.css — Carta Viva v6.6: Performance-First Signature Animations + Bottom Sheet
   No library, no build. --ease in tokens.css. Reduced-motion FIRST.
   - A: Hero Load "La carta si apre" (transform-only, no clip-path)
   - B: Scroll Reveal Editoriale (transform + opacity only, batched)
   - C: Micro-interazioni Tattili (transform-only, no layout thrash)
   - Bottom Sheet Mobile Menu (Material 3, performant, no backdrop-filter on mobile)
   ========================================================================== */

/* ===== CSS CUSTOM PROPERTIES FOR MOTION =================================== */
:root {
  --reveal-duration: 650ms;
}

/* ===== KEYFRAMES ========================================================== */

/* A: Hero Load — "La carta si apre" (transform-only, no clip-path) */
@keyframes heroRevealText {
  0%   { opacity: 0; transform: translateY(1.25rem); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes heroRevealCTA {
  0%   { opacity: 0; transform: translateY(1rem) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes heroCue {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50%      { transform: translateY(0.4rem); opacity: 1; }
}

/* B: Scroll Reveal Editoriale — transform + opacity solo */
/* C: Micro-interazioni Tattili */
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231,193,140,0); }
  50%      { box-shadow: 0 0 0 6px rgba(231,193,140,0.12); }
}

/* Bottom Sheet Menu */
@keyframes bottomSheetSlideUp {
  0%   { opacity: 0; transform: translateY(100%); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ===== A: HERO LOAD — "La carta si apre" (transform-only) ================== */
.hero__title, .hero__intro, .hero__actions { will-change: transform, opacity; }

@media (prefers-reduced-motion: no-preference) {
  .hero__title   { animation: heroRevealText 0.8s var(--ease) both; }
  .hero__intro   { animation: heroRevealText 0.8s var(--ease) both 120ms; }
  .hero__actions { animation: heroRevealCTA 0.8s var(--ease) both 220ms; }
  .hero__cue     { animation: heroCue 2s var(--ease) infinite 1s; }
}

/* ===== B: SCROLL REVEAL EDITORIALE — transform + opacity solo =============== */
/* Default: visible (no-JS / reduced-motion safe) */
.reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(1.5rem);
    will-change: opacity, transform;
    transition: opacity var(--reveal-duration) var(--ease),
                transform var(--reveal-duration) var(--ease);
    transition-delay: var(--reveal-delay, 0ms);
  }
  .js .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== C: MICRO-INTERAZIONI TATTILI (transform-only) ======================== */

/* Price pill — magnetic (hover/tap) */
.menu-moment__price {
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease);
  will-change: transform, box-shadow;
}
@media (prefers-reduced-motion: no-preference) {
  .menu-moment__price:hover,
  .menu-moment__price:active {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(231,193,140,0.35);
  }
}

/* Nav pill — ink fill (active/hover) — transform-based */
.site-nav a {
  position: relative;
  overflow: hidden;
  background: transparent;
  transition: color 180ms var(--ease);
}

.site-nav a[aria-current="true"],
.site-nav a:hover {
  color: var(--cream);
}
.site-nav a[aria-current="true"]::before,
.site-nav a:hover::before {
  transform: scaleX(1);
}

/* CTA pulse gentile */
@media (prefers-reduced-motion: no-preference) {
  .cta-reservation:not(:hover):not(:focus-visible) {
    animation: ctaPulse 4s var(--ease) infinite;
  }
  .cta-reservation:hover,
  .cta-reservation:focus-visible {
    animation: none;
  }
}

/* Hamburger morph (stroke-dashoffset) */
.menu-toggle svg path {
  stroke-dasharray: 30;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 250ms var(--ease), transform 250ms var(--ease);
}
.menu-toggle[aria-expanded="true"] svg path {
  stroke-dashoffset: 60;
  transform: rotate(45deg);
}

/* ===== REDUCED MOTION ===================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important; scroll-behavior: auto !important;
  }
  .hero__title, .hero__intro, .hero__actions, .hero__cue { animation: none !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .mobile-menu { transition: none !important; animation: none !important; }
  .mobile-menu-overlay { transition: none !important; }
  .cta-reservation { animation: none !important; }
  .menu-moment__price:hover { transform: none !important; }
  .site-nav a::before { transition: none !important; }
}

/* ===== SMOOTH SCROLL & VIEW TRANSITIONS =================================== */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--dur); }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}