.hero__fila > :nth-child(2) { top: -20px; }
.hero__fila > :nth-child(3) { top: 6px; }
.hero__fila > :nth-child(4) { top: -34px; }
@media (min-width: 768px) {
  .hero__fila > :nth-child(1) { top: -100px; }
  .hero__fila > :nth-child(2) { top: -30px; }
  .hero__fila > :nth-child(3) { top: -8px; }
  .hero__fila > :nth-child(4) { top: -48px; }
  .hero__fila > :nth-child(5) { top: -130px; }
}

.hero__corpo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero__casetta .ombra {
  position: absolute;
  left: -16%;
  right: -16%;
  bottom: -7%;
  height: 8%;
  border-radius: 50%;
  background: color-mix(in srgb, var(--crema) 72%, var(--bruno));
  opacity: 0.55;
  z-index: -1;
}

.neve {
  position: absolute;
  left: -15%;
  width: 130%;
  bottom: -6%;
  height: 38%;
  z-index: 4;
  display: block;
  overflow: hidden;
  pointer-events: none;
}
.n-c { fill: var(--crema); }
.n-b { fill: color-mix(in srgb, var(--crema) 85%, var(--bruno)); }
.hero__fila > :nth-child(2)::before,
.hero__fila > :nth-child(4)::before { content: none; }

.luci {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  --p: 7px;
}
.luci i {
  position: absolute;
  box-sizing: border-box;
  width: var(--p);
  height: var(--p);
  margin: calc(var(--p) / -2) 0 0 calc(var(--p) / -2);
  border-radius: 50%;
  background: var(--lucina);
  border: 1px solid color-mix(in srgb, var(--crema) 45%, var(--bruno));
  left: calc(50% * var(--t));
  top: calc(var(--casetta-tetto) * (1 - var(--t)) + 1px);
}
.luci i:nth-child(n + 7) { left: calc(100% - 50% * var(--t)); }
.luci i:nth-child(even) {
  --p: 6px;
  background: color-mix(in srgb, var(--lucina) 50%, var(--crema));
}
.luci i:nth-child(5n) { background: var(--lucina-arancio); }
.luci i:nth-child(6n + 1) { --t: 0.07; }
.luci i:nth-child(6n + 2) { --t: 0.24; }
.luci i:nth-child(6n + 3) { --t: 0.41; }
.luci i:nth-child(6n + 4) { --t: 0.58; }
.luci i:nth-child(6n + 5) { --t: 0.75; }
.luci i:nth-child(6n) { --t: 0.92; }
.luci--vivo i:nth-child(odd) {
  animation: tremola 3.6s ease-in-out infinite alternate;
  animation-delay: calc(var(--t) * -5s);
}
@keyframes tremola {
  from { opacity: 1; }
  to { opacity: 0.3; }
}

.ghirl {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 5;
  width: clamp(34px, 22%, 46px);
  height: auto;
  transform: translate(-50%, -56%);
  pointer-events: none;
}
.gh-a { fill: none; stroke: var(--abete); stroke-width: 6; }
.gh-f { fill: color-mix(in srgb, var(--abete) 70%, var(--crema)); }
.gh-b { fill: var(--lucina); }
.gh-n { fill: var(--rosso); }

.fiocchi {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: clip;
  pointer-events: none;
}
.fiocchi .sprite {
  position: absolute;
  width: 0;
  height: 0;
}
.fiocchi > :not(.sprite) {
  position: absolute;
  left: var(--xm);
  top: var(--ym);
  width: var(--sm);
  height: var(--sm);
  opacity: var(--o);
  --f: var(--fm);
  --dx: var(--dxm);
  animation: cade var(--d) linear var(--dl) infinite;
}
.fiocchi i {
  border-radius: 50%;
  background: var(--crema);
}
.fiocchi .fi {
  color: var(--crema);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: var(--wm);
  overflow: visible;
}
.fiocchi .so-desk { display: none; }
@media (min-width: 768px) {
  .fiocchi > :not(.sprite) {
    left: var(--x);
    top: var(--y);
    width: var(--s);
    height: var(--s);
    --f: var(--fd);
    --dx: var(--dxd);
  }
  .fiocchi .fi { stroke-width: var(--wd); }
  .fiocchi .so-desk { display: block; }
}
@media (prefers-reduced-motion: no-preference) {
  .hero .fiocchi .fi {
    filter: drop-shadow(0 0 1.5px rgb(40 66 54 / 0.6));
  }
  .hero .fiocchi i {
    box-shadow: 0 0 2px rgb(40 66 54 / 0.55);
  }
}
@media (prefers-reduced-motion: reduce) {
  .fiocchi .fx { display: none; }
}
@keyframes cade {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  8% { opacity: var(--o); }
  92% { opacity: var(--o); }
  100% { transform: translate3d(var(--dx), var(--f), 0) rotate(var(--r, 0deg)); opacity: 0; }
}
.hero.is-fuori .fiocchi > :not(.sprite),
.hero.is-fuori .luci i,
.hero.is-fuori .luci--vivo i:nth-child(odd) {
  animation-play-state: paused;
}
@media (prefers-reduced-motion: reduce) {
  .fiocchi > :not(.sprite),
  .luci i,
  .luci--vivo i:nth-child(odd) {
    animation: none;
  }
}

@media (max-width: 767.98px) {
  .hero {
    --hm: min(var(--c-reg), var(--h-max));
    --he: calc(var(--hm) * 1);
    --fila-min: calc(var(--hm) + 6px + var(--he) * 0.75);
    --m-fila: clamp(24px, calc(100svh - 790px), 46px);
    grid-template-rows: auto minmax(calc(var(--fila-min) + var(--m-fila)), 1fr);
  }
  .hero__fila {
    align-items: flex-start;
    min-height: var(--fila-min);
  }
  .hero__fila > .hero__casetta { height: var(--hm); }
  .hero__fila > .hero__casetta--interna {
    height: calc(var(--hm) * var(--f-int));
    margin-top: calc(var(--hm) * (1 - var(--f-int)));
  }
  .hero__fila > .hero__casetta--esterna {
    display: block;
    position: absolute;
    z-index: 6;
    height: var(--he);
    width: calc(var(--he) * var(--rapp));
  }
  .hero__fila > :nth-child(1) {
    left: calc(50% - var(--hm) * 0.4 - var(--gap-c) / 2 - var(--he) * 0.4);
    bottom: 36px;
  }
  .hero__fila > :nth-child(5) {
    left: calc(50% + var(--hm) * 0.4 + var(--gap-c) / 2 - var(--he) * 0.4);
    bottom: 42px;
  }
}
