/* ==========================================================
   Tema Halloween – attivo solo con la classe .halloween su <html>
   (la mette js/season.js nei giorni giusti). Sobrio: notte, luna,
   tre pipistrelli e una ragnatela. Tutto il resto resta com'è.
   ========================================================== */

/* Colori notturni, indipendenti dal tema chiaro/scuro del sistema */
html.halloween {
  --green:       #8FAE7E;
  --green-dark:  #A9C499;
  --green-soft:  #1B1A22;
  --orange:      #F28A2E;
  --orange-dark: #F7A35C;
  --orange-soft: #221A16;

  --bg:          #131118;
  --surface:     #1D1A23;
  --text:        #ECE7F1;
  --text-muted:  #A7A0B2;
  --border:      #2D2935;
  --shadow:      0 6px 24px rgba(0, 0, 0, .45);

  color-scheme: dark;
}

html.halloween .section--green { background: #1A1620; }
html.halloween .section--green .socials a,
html.halloween .contact { color: var(--text); }

/* ===== Hero: luna, pipistrelli, ragnatela ===== */
html.halloween .hero { position: relative; overflow: hidden; }
html.halloween .hero__inner { position: relative; }

/* La luna dietro la foto */
html.halloween .hero__photo { position: relative; isolation: isolate; }
html.halloween .hero__photo::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(560px, 110vw);
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -52%);
  border-radius: 50%;
  /* Alone di luce lunare che sfuma nel buio */
  background: radial-gradient(circle, rgba(251, 240, 205, .20) 0%, rgba(251, 240, 205, .09) 38%, rgba(251, 240, 205, 0) 68%);
}

/* Tre pipistrelli, piccoli e lenti */
html.halloween .hero::before,
html.halloween .hero::after,
html.halloween .hero__inner::before {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  background: url(../img/halloween/bat.svg) center / contain no-repeat;
  aspect-ratio: 64 / 28;
  opacity: .75;
  animation: hw-flutter 7s ease-in-out infinite alternate;
}
html.halloween .hero::before        { width: 46px; top: 18%; right: 9%; }
html.halloween .hero::after         { width: 30px; top: 30%; right: 22%; animation-duration: 9s; animation-delay: -3s; opacity: .55; }
html.halloween .hero__inner::before { width: 22px; top: -4%; left: 46%;  animation-duration: 11s; animation-delay: -6s; opacity: .45; }

@keyframes hw-flutter {
  0%   { transform: translate(0, 0) rotate(-4deg); }
  50%  { transform: translate(-14px, -10px) rotate(3deg); }
  100% { transform: translate(8px, 6px) rotate(-2deg); }
}

/* Ragnatela nell'angolo in alto a destra */
html.halloween .hero__inner::after {
  content: "";
  position: absolute;
  pointer-events: none;
  top: calc(-1 * var(--header-h) - 40px);
  right: -20px;
  width: 170px;
  aspect-ratio: 1;
  background: url(../img/halloween/cobweb.svg) center / contain no-repeat;
  transform: scaleX(-1);
  opacity: .22;
}

/* Footer */
html.halloween .footer .container::after { content: " · Happy Halloween 🎃"; }
html.halloween:lang(it) .footer .container::after { content: " · Buon Halloween 🎃"; }

@media (max-width: 960px) {
  /* Foto in alto: alone più piccolo, così non finisce sotto il menu */
  html.halloween .hero__photo::before { width: min(360px, 92vw); transform: translate(-50%, -50%); }
  html.halloween .hero__inner::after { width: 110px; right: -10px; }
  html.halloween .hero::before { top: 10%; right: 6%; }
  html.halloween .hero::after  { top: 16%; right: 26%; }
}

@media (prefers-reduced-motion: reduce) {
  html.halloween .hero::before,
  html.halloween .hero::after,
  html.halloween .hero__inner::before { animation: none; }
}
