/* The weather sits between the garden veils and the page content. */
main > :is(.hero, .section) { isolation: auto; }
main > :is(.hero, .section)::before { z-index: 0; }
main > :is(.hero, .section) > .wrap,
.site-footer > .wrap { position: relative; z-index: 3; }

#holiday-snow {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  visibility: hidden;
}

body:has(#garden[data-motion="running"]) #holiday-snow { visibility: visible; }
body:has(#garden[data-motion="running"]) #holiday-snow .flurry { animation-play-state: running; }

#holiday-snow .flurry {
  background: radial-gradient(circle at 42% 38%, #fcfeff 0 25%, #c0e3ffce 39%, #96bed847 65%, transparent 76%);
}

#holiday-snow .flurry--near {
  width: calc(var(--size) * 4.9);
  height: calc(var(--size) * 4.9);
  top: -2.55rem;
  --alpha: .96;
  background: url("./img/copo-cristal-cielo.png") center / contain no-repeat;
  filter: drop-shadow(0 1px 3px #8bc9f090);
}

#holiday-snow .flurry--near.flurry--reverse {
  background-image: url("./img/copo-cristal-ramificado.png");
}

#holiday-snow .flurry--crystal {
  width: calc(var(--size) * 4.25);
  height: calc(var(--size) * 4.25);
  --alpha: .78;
  background: url("./img/copo-cristal-ramificado.png") center / contain no-repeat;
}

.holiday-flight {
  position: fixed;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.holiday-sleigh {
  --sleigh-width: clamp(17rem, 29vw, 24rem);
  position: absolute;
  top: max(6rem, 15svh);
  left: 0;
  width: var(--sleigh-width);
  height: auto;
  max-width: none;
  transform: translate3d(calc(0px - var(--sleigh-width) - 1.5rem), 0, 0);
  filter: drop-shadow(0 4px 6px #200c2255);
}
.holiday-sleigh[data-route="lower"] { top: 56svh; }
.holiday-sleigh[data-flying] { animation: sleigh-cross 5.1s linear both; }
.holiday-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: .5rem;
  min-width: 3rem;
  min-height: 3rem;
  padding: 0 .68rem;
  background: #291b40df;
  color: #fff4fb;
  border: 1px solid #f6d5ea91;
  border-radius: 999px;
  font: 700 .88rem var(--sans);
}
.holiday-switch:hover { background: #533260; }
.holiday-switch svg { width: 1.18rem; height: 1.18rem; }
.holiday-switch[aria-pressed="true"] .holiday-switch-slash { display: none; }
.holiday-switch[aria-pressed="false"] { opacity: .83; }

@keyframes sleigh-cross {
  0% { transform: translate3d(calc(0px - var(--sleigh-width) - 1.5rem), 1rem, 0) rotate(-2deg); }
  34% { transform: translate3d(calc(34vw - var(--sleigh-width) * .64), -.28rem, 0) rotate(-1deg); }
  70% { transform: translate3d(calc(70vw - var(--sleigh-width) * .27), -.9rem, 0) rotate(2deg); }
  100% { transform: translate3d(calc(100vw + 1.5rem), .18rem, 0) rotate(3deg); }
}

@media (max-width: 46rem) {
  .masthead .masthead-inner { gap: .4rem; }
  .masthead .brand { margin-inline-end: auto; gap: .4rem; }
  .holiday-switch { padding: 0; }
  .holiday-switch span { display: none; }
  .holiday-sleigh {
    --sleigh-width: min(76vw, 21rem);
    top: max(7rem, 25svh);
  }
  .holiday-sleigh[data-route="lower"] { top: 61svh; }
  .holiday-sleigh[data-flying] { animation-duration: 4.35s; }
}

@media (prefers-reduced-motion: reduce), (prefers-reduced-data: reduce) {
  #holiday-snow, .holiday-flight, .holiday-switch { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .holiday-switch { transition: transform var(--fast), background-color var(--fast); }
  .holiday-switch:active { transform: scale(.96); }
}
