/* ========================================================================
   AudioJoy · festive layer  (seasonal — safe to delete with festive.js)
   Nothing here changes the site's own layout or styles. Everything is
   fixed-position, pointer-events:none, and sits behind interactive UI.
   ===================================================================== */

/* ---- snow ------------------------------------------------------------ */
#festive-snow {
  position: fixed;
  inset: 0;
  z-index: 30;              /* under header (40) and player bar (50) */
  pointer-events: none;
  overflow: hidden;
}

.flake {
  position: absolute;
  top: -6vh;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  will-change: transform, opacity;
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes fall {
  0%   { transform: translate3d(0, -6vh, 0);              opacity: 0; }
  8%   {                                                   opacity: var(--peak); }
  92%  {                                                   opacity: var(--peak); }
  100% { transform: translate3d(var(--drift), 106vh, 0);   opacity: 0; }
}

/* ---- tree ------------------------------------------------------------ */
#festive-tree {
  position: fixed;
  right: clamp(0.75rem, 2.5vw, 2rem);
  bottom: calc(4rem + clamp(0.75rem, 2vw, 1.25rem)); /* clears the player bar */
  z-index: 35;
  width: clamp(76px, 8vw, 104px);
  pointer-events: none;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .55));
}

#festive-tree svg { display: block; width: 100%; height: auto; }

/* gentle, staggered twinkle — a glow coming up and down, not a strobe */
.bauble {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: twinkle 3.4s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: .35; transform: scale(.82); }
  to   { opacity: 1;   transform: scale(1.12); }
}

.star-glow { animation: starpulse 4.6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 50%; }
@keyframes starpulse {
  from { opacity: .55; transform: scale(.94); }
  to   { opacity: 1;   transform: scale(1.06); }
}

/* ---- respect the viewer --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .flake { animation: none; opacity: var(--peak); }
  .bauble, .star-glow { animation: none; opacity: .9; }
}

/* keep it out of the way on very small screens */
@media (max-width: 420px) {
  #festive-tree { width: 68px; bottom: calc(4rem + 0.6rem); right: 0.6rem; }
}

@media print {
  #festive-snow, #festive-tree { display: none; }
}
