/* Seasonal decorations, variant 2: swinging baubles + windy snow (admin + public site).
   Self-contained: remove the <link> / UNFOLD["STYLES"] entry to disable. */

/* Cluster of Christmas baubles hanging from the top center of the viewport.
   Box starts above the viewport so string tops stay hidden while swinging. */
html::before {
  content: "";
  position: fixed;
  top: -12px;
  left: 50%;
  width: 220px;
  height: 100px;
  z-index: 2147483001;
  pointer-events: none;
  transform-origin: 50% 0;
  background-repeat: no-repeat;
  background-image:
    /* red */
    radial-gradient(circle 3px at 35% 32%, rgba(255, 255, 255, 0.9) 50%, transparent 100%),
    linear-gradient(#d4a017, #d4a017),
    radial-gradient(circle closest-side at 45% 40%, #f87171 0%, #dc2626 55%, #7f1d1d 96%, transparent 100%),
    linear-gradient(#cbd5e1, #cbd5e1),
    /* gold */
    radial-gradient(circle 4px at 35% 32%, rgba(255, 255, 255, 0.9) 50%, transparent 100%),
    linear-gradient(#d4a017, #d4a017),
    radial-gradient(circle closest-side at 45% 40%, #fde68a 0%, #eab308 55%, #854d0e 96%, transparent 100%),
    linear-gradient(#cbd5e1, #cbd5e1),
    /* silver */
    radial-gradient(circle 3px at 35% 32%, rgba(255, 255, 255, 0.9) 50%, transparent 100%),
    linear-gradient(#d4a017, #d4a017),
    radial-gradient(circle closest-side at 45% 40%, #f1f5f9 0%, #94a3b8 55%, #475569 96%, transparent 100%),
    linear-gradient(#cbd5e1, #cbd5e1),
    /* green */
    radial-gradient(circle 4px at 35% 32%, rgba(255, 255, 255, 0.9) 50%, transparent 100%),
    linear-gradient(#d4a017, #d4a017),
    radial-gradient(circle closest-side at 45% 40%, #86efac 0%, #16a34a 55%, #14532d 96%, transparent 100%),
    linear-gradient(#cbd5e1, #cbd5e1),
    /* blue */
    radial-gradient(circle 3px at 35% 32%, rgba(255, 255, 255, 0.9) 50%, transparent 100%),
    linear-gradient(#d4a017, #d4a017),
    radial-gradient(circle closest-side at 45% 40%, #93c5fd 0%, #2563eb 55%, #1e3a8a 96%, transparent 100%),
    linear-gradient(#cbd5e1, #cbd5e1);
  background-size:
    22px 22px, 6px 4px, 22px 22px, 1px 44px,
    28px 28px, 6px 4px, 28px 28px, 1px 64px,
    18px 18px, 6px 4px, 18px 18px, 1px 34px,
    26px 26px, 6px 4px, 26px 26px, 1px 56px,
    20px 20px, 6px 4px, 20px 20px, 1px 40px;
  background-position:
    11px 45px, 19px 42px, 11px 45px, 22px 0,
    52px 65px, 63px 62px, 52px 65px, 66px 0,
    101px 35px, 107px 32px, 101px 35px, 110px 0,
    141px 57px, 151px 54px, 141px 57px, 154px 0,
    188px 41px, 195px 38px, 188px 41px, 198px 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
  animation: holiday-v2-swing 3.2s ease-in-out infinite alternate;
}

/* Windy snow: tile widths divide 400px and heights divide 100vh so the diagonal loop is seamless */
html::after {
  content: "";
  position: fixed;
  top: -100vh;
  left: -400px;
  width: calc(100% + 400px);
  height: 200vh;
  z-index: 2147483000;
  pointer-events: none;
  background-image:
    radial-gradient(4px 4px at 50px 20%, rgba(255, 255, 255, 0.95), rgba(191, 219, 254, 0.6) 50%, transparent 100%),
    radial-gradient(6px 6px at 150px 60%, rgba(255, 255, 255, 0.9), rgba(191, 219, 254, 0.5) 50%, transparent 100%),
    radial-gradient(3px 3px at 30px 40%, rgba(255, 255, 255, 0.95), rgba(191, 219, 254, 0.6) 50%, transparent 100%),
    radial-gradient(7px 7px at 300px 30%, rgba(255, 255, 255, 0.8), rgba(191, 219, 254, 0.35) 50%, transparent 100%),
    radial-gradient(3.5px 3.5px at 120px 80%, rgba(255, 255, 255, 0.95), rgba(191, 219, 254, 0.6) 50%, transparent 100%);
  background-size: 200px 25vh, 400px 50vh, 100px 20vh, 400px 50vh, 200px 50vh;
  opacity: 0.9;
  will-change: transform;
  animation: holiday-v2-snow 30s linear infinite;
}

@keyframes holiday-v2-swing {
  from {
    transform: translateX(-50%) rotate(-2deg);
  }
  to {
    transform: translateX(-50%) rotate(2deg);
  }
}

@keyframes holiday-v2-snow {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(400px, 100vh, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html::before {
    animation: none;
    transform: translateX(-50%);
  }

  html::after {
    animation: none;
  }
}

@media print {
  html::before,
  html::after {
    display: none;
  }
}
