/* Seasonal bokeh lights in the homepage hero (see inc/holiday.php) */

.holiday-bokeh {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

/* .hero__overlay sits above .hero__bg; the lights go above both */
.hero .holiday-bokeh,
.x-hero .holiday-bokeh { z-index: 0; }
.hero__inner,
.x-hero .container { position: relative; z-index: 1; }

.holiday-bokeh__dot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    rgb(var(--c) / .95) 0%,
    rgb(var(--c) / .55) 45%,
    rgb(var(--c) / 0) 72%);
  filter: blur(var(--b));
  mix-blend-mode: screen;
  opacity: 0;
  will-change: transform, opacity;
  animation:
    holiday-twinkle var(--tw) ease-in-out var(--d) infinite,
    holiday-drift var(--dr) ease-in-out var(--d) infinite alternate;
}

/* sharper dots get a faint bright rim, like out-of-focus lights */
.holiday-bokeh__dot--ring {
  background: radial-gradient(circle at 50% 50%,
    rgb(var(--c) / .35) 0%,
    rgb(var(--c) / .5) 60%,
    rgb(var(--c) / .9) 68%,
    rgb(var(--c) / 0) 72%);
}

@keyframes holiday-twinkle {
  0%, 100% { opacity: calc(var(--o) * .45); }
  50%      { opacity: var(--o); }
}

@keyframes holiday-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(var(--mx), var(--my), 0) scale(1.15); }
}

/* the layer fades in so the hero does not flash */
.holiday-bokeh { animation: holiday-in 1.6s ease-out both; }
@keyframes holiday-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .holiday-bokeh,
  .holiday-bokeh__dot { animation: none; }
  .holiday-bokeh__dot { opacity: calc(var(--o) * .7); }
}
