body { isolation: isolate; }

.winter-stars, .winter-snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}
.winter-stars { z-index: -2; }
.winter-snow { z-index: -1; }

.winter-lights {
  --swag-width: 156px;
  position: relative;
  display: flex;
  width: 100%;
  height: 35px;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  background: linear-gradient(180deg, #0b1219, transparent);
}
.winter-swag {
  position: relative;
  display: flex;
  justify-content: space-around;
  flex: 0 0 var(--swag-width);
}
.winter-swag::before {
  content: "";
  position: absolute;
  inset: -11px -1px auto;
  height: 23px;
  border-bottom: 2px solid #506259;
  border-radius: 0 0 50% 50%;
  box-shadow: 0 1px 0 #101c18;
}
.winter-bulb {
  position: relative;
  display: block;
  top: 9px;
  width: 7px;
  height: 5px;
  border-radius: 2px 2px 1px 1px;
  background: repeating-linear-gradient(to bottom, #58645b 0 1px, #24332f 1px 3px);
  transform: rotate(-9deg);
  transform-origin: center top;
}
.winter-bulb:nth-child(2) { top: 12px; transform: rotate(3deg); }
.winter-bulb:nth-child(3) { transform: rotate(9deg); }
.winter-bulb::before, .winter-bulb::after {
  content: "";
  position: absolute;
  top: 4px;
  left: -1px;
  width: 9px;
  height: 14px;
  border-radius: 46% 46% 50% 50% / 30% 30% 72% 72%;
}
.winter-bulb::before {
  background: radial-gradient(ellipse at 30% 30%, var(--glass) 0, var(--unlit) 48%, #192020 100%);
}
.winter-bulb::after {
  background: radial-gradient(ellipse at 36% 36%, #fff8e9 0 12%, var(--core) 34%, var(--glass) 75%);
  box-shadow: 0 0 4px var(--glass), 0 0 10px var(--halo), 0 0 17px var(--halo);
  animation: winter-lamp var(--cycle) ease-in-out var(--delay) infinite paused;
}
.winter-bulb.berry { --glass: #fa636e; --unlit: #663038; --core: #ffc1bd; --halo: #f9516149; }
.winter-bulb.amber { --glass: #ffb54d; --unlit: #704b26; --core: #ffe4a8; --halo: #ffb33b50; }
.winter-bulb.ice { --glass: #63bffc; --unlit: #294f67; --core: #c5eeff; --halo: #54b7fd54; }
.winter-bulb.fir { --glass: #5cc695; --unlit: #295841; --core: #c0fada; --halo: #49c3834d; }
.winter-lights[data-state="playing"] .winter-bulb::after { animation-play-state: running; }
@keyframes winter-lamp {
  0%, 25%, 100% { opacity: 1; }
  48%, 67% { opacity: .06; }
  87% { opacity: .9; }
}

html:has(.winter-lights) { scroll-padding-top: 117px; }
@media (max-width: 610px) {
  html:has(.winter-lights) { scroll-padding-top: 129px; }
  .winter-lights { --swag-width: 126px; height: 31px; }
  .winter-bulb::before, .winter-bulb::after { height: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .winter-snow { display: none; }
  .winter-bulb::after { animation: none; opacity: .82; }
}
