/* ── Matrimonio Daniele & Barbara — Bali 2027 ──────────────────────────
   Palette neutra calda: sabbia, avorio, greige, salvia, terracotta tenue.
   Mobile-first: base = telefono, media query solo per allargare. */

:root {
  --avorio: #faf7f1;
  --sabbia: #ede5d8;
  --greige: #b3a795;
  --testo: #4a443c;
  --testo-soft: #7d766b;
  --salvia: #8a9a88;
  --salvia-scuro: #6d7f6b;
  --terracotta: #c08464;
  --bianco: #fffdf9;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Jost', 'Helvetica Neue', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--avorio); }
body {
  font-family: var(--sans);
  font-weight: 300;
  color: var(--testo);
  background: transparent;
  line-height: 1.7;
  font-size: 1.05rem;
}

/* Filigrana: la foto della coppia in trasparenza dietro tutto il sito.
   PLACEHOLDER: sostituire img/filigrana.jpg con una vostra foto vera. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('../img/filigrana.jpg') center / cover no-repeat;
  opacity: 0.08;
  filter: grayscale(45%) sepia(20%);
  pointer-events: none;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; }
h2 {
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 0.6em;
  color: var(--testo);
}
h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 1px;
  background: var(--terracotta);
  margin: 0.5em auto 0;
  transform: scaleX(0);
  transition: transform 0.9s cubic-bezier(0.22, 0.8, 0.3, 1) 0.35s;
}
.reveal.visibile h2::after { transform: scaleX(1); }
a { color: var(--salvia-scuro); }

section { padding: 3.4rem 1.3rem; max-width: 1060px; margin: 0 auto; }
@media (min-width: 760px) { section { padding: 4.5rem 1.4rem; } h2 { font-size: 2.5rem; } }
.sezione-tinta { max-width: none; background: rgba(237, 229, 216, 0.88); }
.sezione-tinta > * { max-width: 1060px; margin-left: auto; margin-right: auto; }
.sezione-intro {
  text-align: center;
  color: var(--testo-soft);
  font-size: 1.05rem;
  max-width: 620px;
  margin: 0 auto 2.5rem;
}

/* ── Nav ── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
}
/* Sfondo+blur su un pseudo-elemento: backdrop-filter direttamente su #nav
   farebbe da containing block e romperebbe il menu overlay position:fixed */
#nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(250, 247, 241, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(179, 167, 149, 0.25);
}
#nav-toggle {
  display: block;
  margin-left: auto;
  padding: 0.8rem 1.3rem;
  background: none;
  border: none;
  font-size: 1.7rem;
  color: var(--testo);
  cursor: pointer;
}
#nav-toggle { position: relative; z-index: 60; }
#nav-menu {
  list-style: none;
  display: none;
}
/* Mobile: menu a schermo intero, voci grandi al centro */
#nav-menu.aperto {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(250, 247, 241, 0.97);
  backdrop-filter: blur(6px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}
#nav-menu.aperto a {
  font-family: var(--serif);
  font-size: 1.7rem;
  text-transform: none;
  letter-spacing: 0.04em;
  padding: 0.55rem 1.5rem;
}
#nav-menu a {
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--testo);
  display: block;
  padding: 0.45rem 0.8rem;
}
@media (min-width: 760px) { #nav-menu a { font-size: 0.85rem; padding: 0; } }
#nav-menu a:hover { color: var(--terracotta); }
.nav-cta { color: var(--terracotta) !important; font-weight: 400; }

@media (min-width: 760px) {
  #nav-toggle { display: none; }
  #nav-menu, #nav-menu.aperto {
    display: flex !important;
    position: static;
    background: none;
    flex-direction: row;
    justify-content: center;
    gap: 2.2rem;
    padding: 0.9rem 0;
  }
  #nav-menu.aperto a {
    font-family: var(--sans);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding: 0;
  }
}

/* ── Hero ── */
#hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 1.4rem 3rem;
  overflow: hidden;
  background: linear-gradient(160deg, #d9cbb4 0%, #9aa892 100%);
  color: var(--bianco);
}
/* Foto su layer separato: così può respirare (ken burns) senza toccare il layout.
   PLACEHOLDER: img/hero.jpg è una foto demo — sostituire con la vostra */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url('../img/hero.jpg') center / cover no-repeat;
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(60, 55, 47, 0.38), rgba(60, 55, 47, 0.52));
}
/* Orizzonte animato: il tramonto scivola piano verso sera e ritorna (~75s) */
.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg,
    rgba(25, 32, 66, 0.7) 0%,
    rgba(84, 54, 84, 0.35) 55%,
    rgba(16, 22, 48, 0.6) 100%);
  mix-blend-mode: multiply;
  opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .hero-bg::before { animation: seraArriva 75s ease-in-out infinite; }
}
@keyframes seraArriva {
  0%, 10% { opacity: 0; }
  45%, 58% { opacity: 0.85; }
  92%, 100% { opacity: 0; }
}
.hero-inner, #hero-scroll { position: relative; z-index: 2; }
@media (prefers-reduced-motion: no-preference) {
  .hero-bg { animation: kenburns 26s ease-in-out infinite alternate; }
}
@keyframes kenburns {
  from { transform: scale(1); }
  to { transform: scale(1.09) translateY(-1.5%); }
}

/* Ingresso hero: ogni riga arriva sfocata dal basso, in sequenza */
@media (prefers-reduced-motion: no-preference) {
  .hero-inner > * {
    opacity: 0;
    animation: heroIn 1s cubic-bezier(0.22, 0.8, 0.3, 1) both;
  }
  .hero-inner > *:nth-child(1) { animation-delay: 0.2s; }
  .hero-inner > *:nth-child(2) { animation-delay: 0.45s; animation-duration: 1.3s; }
  .hero-inner > *:nth-child(3) { animation-delay: 0.9s; }
  .hero-inner > *:nth-child(4) { animation-delay: 1.1s; }
  .hero-inner > *:nth-child(5) { animation-delay: 1.35s; }
  .hero-inner > *:nth-child(6) { animation-delay: 1.6s; }
  /* Il titolo non entra in blocco: si "scrive" lettera per lettera (JS
     avvolge ogni lettera in .lettera con indice --l) */
  #hero h1 { opacity: 1; animation: none; }
  /* Solo opacity: transform/filter sulle lettere romperebbero il
     background-clip:text dello shimmer */
  #hero h1 .lettera {
    opacity: 0;
    animation: scritturaLettera 0.55s ease-out both;
    animation-delay: calc(0.55s + var(--l, 0) * 65ms);
  }
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(22px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes scritturaLettera {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Parallasse hero: scorrendo via, il contenuto scivola più lento e sfuma
   (solo browser con scroll-driven animations; altrove non succede nulla) */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .hero-inner {
      animation: heroParallax linear both;
      animation-timeline: scroll();
      animation-range: 0 100vh;
    }
  }
}
@keyframes heroParallax {
  to { transform: translateY(16vh); opacity: 0; }
}

/* Lucciole dorate nel hero (create da JS, solo senza reduced-motion):
   puntini di luce calda che vagano lenti e pulsano — sera tropicale */
.hero-lucciole {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.hero-lucciole span {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: calc(5px * var(--sc, 1));
  height: calc(5px * var(--sc, 1));
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 232, 184, 0.95) 0%, rgba(255, 210, 140, 0.45) 45%, transparent 75%);
  box-shadow: 0 0 14px 4px rgba(255, 214, 150, 0.3);
  opacity: 0;
  animation:
    lucciolaVaga var(--dur, 12s) ease-in-out var(--del, 0s) infinite alternate,
    lucciolaPulsa calc(var(--dur, 12s) / 3.2) ease-in-out var(--del, 0s) infinite;
}
@keyframes lucciolaVaga {
  from { transform: translate(0, 0); }
  to { transform: translate(var(--dx, 50px), var(--dy, -35px)); }
}
@keyframes lucciolaPulsa {
  0%, 100% { opacity: 0.08; }
  50% { opacity: var(--op, 0.7); }
}

/* Shimmer sui nomi: ogni tanto una banda di luce dorata attraversa il
   titolo (overlay in blend screen — background-clip:text non convive con
   l'opacity delle singole lettere) */
@media (prefers-reduced-motion: no-preference) {
  #hero h1 { position: relative; overflow: hidden; }
  #hero h1::after {
    content: "";
    position: absolute;
    inset: -12% 0;
    background: linear-gradient(105deg, transparent 43%, rgba(255, 226, 166, 0.38) 50%, transparent 57%);
    transform: translateX(-130%);
    animation: lucePassa 9s ease-in-out 3.5s infinite;
    mix-blend-mode: screen;
    pointer-events: none;
  }
}
@keyframes lucePassa {
  0%, 42% { transform: translateX(-130%); }
  72%, 100% { transform: translateX(130%); }
}
.hero-eyebrow {
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
#hero h1 { font-size: clamp(2.7rem, 10vw, 5.2rem); font-weight: 500; text-shadow: 0 1px 12px rgba(0,0,0,0.25); }
.amp { font-style: italic; color: var(--sabbia); }
.hero-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.4rem;
  margin-top: 0.6rem;
}
.hero-date {
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-size: 1rem;
  margin-top: 0.8rem;
}
#countdown {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  margin: 2.4rem 0;
  perspective: 600px;
}
/* Card in vetro smerigliato, cifre che ribaltano in 3D quando cambiano */
#countdown div {
  display: flex;
  flex-direction: column;
  min-width: 88px;
  padding: 0.7rem 0.8rem 0.55rem;
  background: rgba(255, 253, 249, 0.13);
  border: 1px solid rgba(255, 253, 249, 0.28);
  border-radius: 10px;
  backdrop-filter: blur(5px);
}
#countdown span { font-family: var(--serif); font-size: 2.4rem; line-height: 1.15; }
#countdown small {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.9;
}

/* ── Bottoni ── */
.btn {
  display: inline-block;
  position: relative;
  overflow: hidden;
  padding: 1rem 2.4rem;
  border: 1px solid var(--salvia-scuro);
  background: transparent;
  color: var(--salvia-scuro);
  font-family: var(--sans);
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, transform 0.2s, box-shadow 0.25s;
}
.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 45%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s ease;
  pointer-events: none;
}
.btn:hover::after, .btn:focus-visible::after { left: 130%; }
.btn:hover {
  background: var(--salvia-scuro);
  color: var(--bianco);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px -12px rgba(74, 68, 60, 0.55);
}
.btn:active { transform: translateY(0) scale(0.97); }
.btn-primary {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: var(--bianco);
}
.btn-primary:hover { background: #a96e51; border-color: #a96e51; }

/* ── Storia ── */
.storia-grid { display: grid; gap: 2rem; align-items: center; }
.storia-testo p + p { margin-top: 1em; }
@media (min-width: 760px) { .storia-grid { grid-template-columns: 5fr 6fr; } }

/* ── Foto placeholder (sostituire con background-image reali) ── */
.photo {
  border: none;
  border-radius: 4px;
  min-height: 260px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
}
.photo-storia { background-image: url('../img/storia.jpg'); min-height: 340px; }
.g1 { background-image: url('../img/g1.jpg'); }
.g2 { background-image: url('../img/g2.jpg'); }
.g3 { background-image: url('../img/g3.jpg'); }
.g4 { background-image: url('../img/g4.jpg'); }
.g5 { background-image: url('../img/g5.jpg'); }

/* ── Timeline ── */
.timeline {
  list-style: none;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
  padding-left: 1.6rem;
}
/* La linea si disegna dall'alto quando la sezione entra in vista */
.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--greige);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.6s cubic-bezier(0.22, 0.8, 0.3, 1) 0.25s;
}
.reveal.visibile .timeline::before { transform: scaleY(1); }
.timeline li { position: relative; padding-bottom: 2rem; }
.timeline li::before {
  content: "";
  position: absolute;
  left: calc(-1.6rem - 5px);
  top: 0.5em;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--terracotta);
}
.timeline time {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--salvia-scuro);
}
.timeline h3 { font-size: 1.3rem; margin-top: 0.1em; }
.timeline p { color: var(--testo-soft); font-size: 1rem; }

/* ── Cards viaggio ── */
.cards { display: grid; gap: 1.4rem; margin-bottom: 2.5rem; }
.card {
  background: var(--bianco);
  border: 1px solid rgba(179, 167, 149, 0.3);
  border-radius: 6px;
  padding: 1.6rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -22px rgba(74, 68, 60, 0.4);
  border-color: rgba(192, 132, 100, 0.45);
}
.card h3 { font-size: 1.35rem; margin-bottom: 0.6em; }
.card p + p, .card ul + p { margin-top: 0.8em; }
.card p, .card li { font-size: 1rem; }
.lista-hotel { list-style: none; }
.lista-hotel li { padding: 0.3em 0; }
@media (min-width: 760px) { .cards { grid-template-columns: 1fr 1fr; } }

.mappa iframe {
  width: 100%;
  height: 340px;
  border: 0;
  border-radius: 6px;
  filter: saturate(0.75);
}

/* ── Galleria: swipe orizzontale su mobile, griglia su desktop ── */
.galleria-grid {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 0.9rem;
  padding-bottom: 0.8rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.galleria-grid::-webkit-scrollbar { display: none; }
.galleria-grid .photo {
  flex: 0 0 80%;
  min-height: 320px;
  scroll-snap-align: center;
  border-radius: 8px;
  transition: opacity 0.25s;
}
.galleria-grid .photo:hover { opacity: 0.85; }
.galleria-hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--testo-soft);
  letter-spacing: 0.1em;
}
@media (min-width: 760px) {
  .galleria-grid { display: grid; grid-template-columns: repeat(3, 1fr); overflow: visible; }
  .galleria-grid .photo { min-height: 240px; }
  .galleria-hint { display: none; }
}

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(40, 36, 30, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
#lightbox[hidden] { display: none; }
#lb-foto {
  width: min(90vw, 820px);
  height: min(65vh, 560px);
  background-size: cover;
  background-position: center;
  border-radius: 4px;
}
#lb-caption { color: var(--sabbia); font-family: var(--serif); font-size: 1.2rem; margin-top: 1rem; }
#lb-chiudi {
  position: absolute;
  top: 1rem; right: 1.4rem;
  background: none; border: none;
  color: var(--bianco);
  font-size: 2.4rem;
  cursor: pointer;
}

/* ── FAQ ── */
.faq-list { max-width: 680px; margin: 0 auto; }
.faq-list details {
  border-bottom: 1px solid rgba(179, 167, 149, 0.35);
  padding: 1rem 0;
}
.faq-list summary {
  font-family: var(--serif);
  font-size: 1.3rem;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding: 0.3rem 2rem 0.3rem 0;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  position: absolute;
  right: 0.2rem;
  color: var(--terracotta);
  transition: transform 0.2s;
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { padding-top: 0.6rem; color: var(--testo-soft); font-size: 1rem; }

/* ── Lista nozze ── */
.iban-box {
  max-width: 560px;
  margin: 0 auto;
  background: var(--bianco);
  border: 1px solid rgba(179, 167, 149, 0.3);
  border-radius: 6px;
  padding: 1.8rem;
  text-align: center;
}
.iban-box p { margin-bottom: 0.5em; }
.iban-box code {
  font-size: 1rem;
  background: var(--avorio);
  padding: 0.2em 0.5em;
  border-radius: 3px;
  word-break: break-all;
}
#btn-copia-iban { margin-top: 0.8rem; }
#iban-copiato { display: block; color: var(--salvia-scuro); font-size: 0.85rem; min-height: 1.4em; }

/* ── RSVP ── */
#rsvp-form { max-width: 560px; margin: 0 auto; }
.campo { margin-bottom: 1.3rem; }
.campo label, .campo legend {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--testo-soft);
  margin-bottom: 0.4rem;
}
.campo input[type="text"], .campo input[type="number"], .campo input[type="date"],
.campo textarea {
  width: 100%;
  padding: 0.95rem 1rem;
  border: 1px solid var(--greige);
  border-radius: 4px;
  background: var(--bianco);
  font-family: var(--sans);
  font-size: 1.05rem; /* ≥16px: evita lo zoom automatico di iOS sul focus */
  color: var(--testo);
}
#rsvp-form button[type="submit"] { width: 100%; }
@media (min-width: 760px) { #rsvp-form button[type="submit"] { width: auto; } }
.campo input:focus, .campo textarea:focus {
  outline: none;
  border-color: var(--salvia-scuro);
}
.campo fieldset, fieldset.campo { border: none; }
/* Scelte Sì/No come bottoni grandi tappabili */
.scelte { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.radio {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex: 1 1 40%;
  padding: 0.95rem 1rem;
  border: 1px solid var(--greige);
  border-radius: 8px;
  background: var(--bianco);
  font-size: 1.05rem !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: var(--testo) !important;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.radio input { accent-color: var(--terracotta); }
.radio:has(input:checked) {
  border-color: var(--terracotta);
  background: rgba(192, 132, 100, 0.12);
}
.campo-doppio { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
#dettagli-si.nascosto { display: none; }
#rsvp-esito { margin-top: 1rem; font-size: 0.95rem; min-height: 1.5em; }
#rsvp-esito.ok { color: var(--salvia-scuro); }
#rsvp-esito.errore { color: #b3573f; }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 3rem 1.4rem;
  background: var(--testo);
  color: var(--sabbia);
  font-family: var(--serif);
  font-size: 1.05rem;
}
.footer-piccolo {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-top: 0.5rem;
}

/* ── Barra RSVP fissa (solo mobile) ── */
#rsvp-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 40;
  padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom));
  background: rgba(250, 247, 241, 0.94);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(179, 167, 149, 0.3);
  transition: transform 0.3s ease;
}
#rsvp-bar .btn { display: block; width: 100%; text-align: center; }
#rsvp-bar.nascosto { transform: translateY(110%); }
body { padding-bottom: 76px; }
@media (min-width: 760px) {
  #rsvp-bar { display: none; }
  body { padding-bottom: 0; }
}

/* Su mobile il CTA del hero è ridondante: c'è la barra fissa in basso */
.hero-inner .btn { display: none; }
@media (min-width: 760px) { .hero-inner .btn { display: inline-block; } }

/* ── Chevron scroll nel hero ── */
#hero { position: relative; }
#hero-scroll {
  position: absolute;
  bottom: calc(1rem + env(safe-area-inset-bottom) + 64px);
  left: 50%;
  transform: translateX(-50%);
  color: var(--bianco);
  font-size: 2rem;
  text-decoration: none;
  opacity: 0.85;
  animation: rimbalzo 2.2s infinite;
}
@keyframes rimbalzo {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}
@media (min-width: 760px) { #hero-scroll { bottom: 1.5rem; } }

/* ── Micro-animazioni reveal ── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visibile { opacity: 1; transform: none; }

/* Figli scaglionati: card, tappe timeline, FAQ arrivano una alla volta
   (--i assegnato da JS per ordine) */
.reveal .stagger-item {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.22, 0.8, 0.3, 1);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.reveal.visibile .stagger-item { opacity: 1; transform: none; }

/* ── Nav: ombra quando si scorre, voci del menu overlay a cascata ── */
#nav { transition: box-shadow 0.3s ease; }
#nav.scrolled { box-shadow: 0 2px 20px rgba(74, 68, 60, 0.1); }
@media (prefers-reduced-motion: no-preference) {
  #nav-menu.aperto li { animation: vociMenu 0.5s cubic-bezier(0.22, 0.8, 0.3, 1) both; }
  #nav-menu.aperto li:nth-child(1) { animation-delay: 0.05s; }
  #nav-menu.aperto li:nth-child(2) { animation-delay: 0.1s; }
  #nav-menu.aperto li:nth-child(3) { animation-delay: 0.15s; }
  #nav-menu.aperto li:nth-child(4) { animation-delay: 0.2s; }
  #nav-menu.aperto li:nth-child(5) { animation-delay: 0.25s; }
  #nav-menu.aperto li:nth-child(6) { animation-delay: 0.3s; }
  #nav-menu.aperto li:nth-child(7) { animation-delay: 0.35s; }
}
@keyframes vociMenu {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@media (min-width: 760px) {
  #nav-menu.aperto li { animation: none; }
}

/* ── Galleria mobile: la foto al centro dello swipe è a fuoco, le altre
   si ritirano (scroll-driven animations, solo browser moderni) ── */
@media (max-width: 759px) and (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .galleria-grid .photo {
      animation: fotoFocus linear both;
      animation-timeline: view(inline);
    }
  }
}
@keyframes fotoFocus {
  0% { transform: scale(0.92); opacity: 0.55; }
  38%, 62% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.92); opacity: 0.55; }
}
@media (min-width: 760px) {
  .galleria-grid .photo { transition: transform 0.35s ease, opacity 0.25s, box-shadow 0.35s ease; }
  .galleria-grid .photo:hover {
    transform: scale(1.025);
    box-shadow: 0 16px 38px -20px rgba(74, 68, 60, 0.55);
  }
}

/* ── FAQ: apertura fluida (interpolate-size, solo browser recenti) ── */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .faq-list details::details-content {
    opacity: 0;
    block-size: 0;
    overflow: hidden;
    transition: content-visibility 0.4s allow-discrete, opacity 0.4s ease, block-size 0.4s ease;
  }
  .faq-list details[open]::details-content { opacity: 1; block-size: auto; }
}

/* ── Countdown: la cifra ribalta come una paletta d'aeroporto ── */
#countdown span.tick { animation: flipCifra 0.65s cubic-bezier(0.3, 1.2, 0.4, 1); }
@keyframes flipCifra {
  0% { transform: rotateX(-90deg); opacity: 0.15; }
  100% { transform: rotateX(0); opacity: 1; }
}

/* ── Grana fotografica sottile su tutto il sito (feel editoriale) ── */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal .stagger-item { opacity: 1; transform: none; transition: none; }
  h2::after, .reveal.visibile h2::after { transform: scaleX(1); transition: none; }
  .timeline::before, .reveal.visibile .timeline::before { transform: scaleY(1); transition: none; }
  .hero-inner > * { opacity: 1; animation: none; }
  .hero-lucciole { display: none; }
  #countdown span.tick { animation: none; }
  html { scroll-behavior: auto; }
}
