.seasonal-theme {
  --seasonal-figure-size: clamp(3.25rem, 8.6vw, 8.25rem);
  position: absolute;
  z-index: 51;
  inset: 0 0 auto;
  height: 100svh;
  pointer-events: none;
}

.seasonal-theme[data-seasonal-theme="christmas"] {
  --seasonal-figure: var(--christmas-figure);
  --seasonal-ribbon: #173a32;
  --seasonal-primary: #ffcc67;
  --seasonal-secondary: #e84343;
  --seasonal-highlight: #fff4d5;
}

.seasonal-theme[data-seasonal-theme="halloween"] {
  --seasonal-figure: var(--halloween-figure);
  --seasonal-ribbon: #211331;
  --seasonal-primary: #ff9a37;
  --seasonal-secondary: #a06ef0;
  --seasonal-highlight: #ffdf9c;
}

.seasonal-lights {
  position: fixed;
  inset: 0 0 auto;
  height: .325rem;
  background: radial-gradient(circle at 6px 0, var(--seasonal-primary) 2px, transparent 3px) 0 1px / 40px 6px repeat-x,
    radial-gradient(circle at 26px 0, var(--seasonal-secondary) 2px, transparent 3px) 0 1px / 40px 6px repeat-x,
    var(--seasonal-ribbon);
}

.seasonal-figure {
  display: none;
  position: absolute;
  bottom: .75rem;
  width: var(--seasonal-figure-size);
  aspect-ratio: 1;
  background: var(--seasonal-figure) center bottom / contain no-repeat;
  filter: drop-shadow(0 .3rem .45rem #0d14254d);
}

.seasonal-figure-left { right: var(--seasonal-figure-size); transform: scale(-.7, .7); transform-origin: bottom center; }
.seasonal-figure-right { right: .375rem; }
[data-route="home"] .seasonal-figure, [data-route="paw_patrol"] .seasonal-figure { display: block; }

.seasonal-confetti { position: fixed; inset: 0; overflow: hidden; }

.seasonal-confetti i {
  position: absolute;
  top: -1rem;
  left: var(--left);
  width: .375rem;
  height: .6rem;
  border-radius: .125rem;
  background: var(--seasonal-primary);
  animation: seasonal-fall var(--duration) linear var(--delay) both;
}

.seasonal-confetti i:nth-child(3n + 1) { background: var(--seasonal-secondary); }
.seasonal-confetti i:nth-child(3n + 2) { border-radius: 50%; height: .375rem; background: var(--seasonal-highlight); }
.seasonal-confetti i:nth-child(5n) { width: .625rem; height: .625rem; border-radius: 50%; }

@keyframes seasonal-fall {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0); }
  12%, 83% { opacity: .8; }
  100% { opacity: 0; transform: translate3d(var(--drift), 105vh, 0) rotate(325deg); }
}

/* Christmas: lit garland, light snowfall, snowy header edge */
.seasonal-theme[data-seasonal-theme="christmas"] .seasonal-lights {
  height: 1.375rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='22'%3E%3Cpath d='M0 3Q40 15 80 3T160 3' fill='none' stroke='%230f2f26' stroke-width='1.6'/%3E%3Cg stroke='%230f2f26' stroke-width='.8'%3E%3Crect x='17' y='7' width='4' height='3' rx='1' fill='%23284b3f'/%3E%3Crect x='57' y='7' width='4' height='3' rx='1' fill='%23284b3f'/%3E%3Crect x='97' y='7' width='4' height='3' rx='1' fill='%23284b3f'/%3E%3Crect x='137' y='7' width='4' height='3' rx='1' fill='%23284b3f'/%3E%3C/g%3E%3Cellipse cx='19' cy='14.5' rx='3.6' ry='5' fill='%23ffcc67'/%3E%3Cellipse cx='59' cy='14.5' rx='3.6' ry='5' fill='%23e84343'/%3E%3Cellipse cx='99' cy='14.5' rx='3.6' ry='5' fill='%23fff4d5'/%3E%3Cellipse cx='139' cy='14.5' rx='3.6' ry='5' fill='%2342b883'/%3E%3C/svg%3E") 0 0 / 160px 22px repeat-x;
  filter: drop-shadow(0 1px 1px #00000040);
}
.seasonal-theme[data-seasonal-theme="christmas"] .seasonal-lights::before,
.seasonal-theme[data-seasonal-theme="christmas"] .seasonal-lights::after {
  content: "";
  position: absolute;
  inset: 0;
  animation: seasonal-twinkle 2.4s ease-in-out 8 alternate both;
}
.seasonal-theme[data-seasonal-theme="christmas"] .seasonal-lights::before {
  background: radial-gradient(circle at 19px 14px, #ffcc67b3, transparent 11px) 0 0 / 80px 22px repeat-x;
}
.seasonal-theme[data-seasonal-theme="christmas"] .seasonal-lights::after {
  background: radial-gradient(circle at 59px 14px, #e84343a6, transparent 11px) 0 0 / 80px 22px repeat-x;
  animation-delay: 1.2s;
}

.seasonal-theme[data-seasonal-theme="christmas"] .seasonal-figure {
  filter: drop-shadow(0 0 1.1rem #ffcc6766) drop-shadow(0 .3rem .45rem #0d14254d);
}

.seasonal-theme[data-seasonal-theme="christmas"] .seasonal-confetti i {
  top: -.75rem;
  width: .3125rem;
  height: .3125rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 .25rem #8fb2d6b3;
  animation: seasonal-snow calc(var(--duration) * 2.6) linear calc(var(--delay) * 10) 3 both;
}
.seasonal-theme[data-seasonal-theme="christmas"] .seasonal-confetti i:nth-child(3n + 1) { width: .4375rem; height: .4375rem; opacity: .9; }
.seasonal-theme[data-seasonal-theme="christmas"] .seasonal-confetti i:nth-child(3n + 2) { width: .1875rem; height: .1875rem; }
.seasonal-theme[data-seasonal-theme="christmas"] .seasonal-confetti i:nth-child(5n) { width: .5625rem; height: .5625rem; filter: blur(1px); }

html[data-seasonal-theme="christmas"] .site-header::before {
  content: "";
  position: absolute;
  inset: auto 0 -.5rem;
  height: .5625rem;
  background:
    radial-gradient(ellipse 18px 8px at 18px 0, #fff 96%, transparent) 0 0 / 46px 9px repeat-x,
    radial-gradient(ellipse 11px 6px at 9px 0, #f2f7ff 96%, transparent) 23px 0 / 31px 7px repeat-x;
  filter: drop-shadow(0 2px 2px #0d142533);
  opacity: .92;
  pointer-events: none;
}

@keyframes seasonal-twinkle {
  from { opacity: .25; }
  to { opacity: 1; }
}

@keyframes seasonal-snow {
  0% { opacity: 0; transform: translate3d(0, 0, 0); }
  10%, 85% { opacity: .85; }
  50% { transform: translate3d(var(--drift), 52vh, 0); }
  100% { opacity: 0; transform: translate3d(calc(var(--drift) * -.5), 104vh, 0); }
}

@media (max-width: 700px) {
  [data-route="home"] .seasonal-figure-left, [data-route="paw_patrol"] .seasonal-figure-left { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .seasonal-confetti { display: none; }
  .seasonal-lights::before, .seasonal-lights::after { animation: none; }
}
