/* Seasonal decorations. Loaded only while a theme is active. Nothing here blocks taps (pointer-events: none). */

/* Greeting banner above the header */
.season-banner { display: block; margin: 0; padding: 9px 16px; text-align: center; font: 500 .9rem/1.35 var(--sans); letter-spacing: .01em; text-decoration: none; background: var(--sage); color: #fff; }
@media (max-width: 639px) { .season-banner { padding: 7px 14px; font-size: .8rem; line-height: 1.3; } }
.season-banner span { text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.season-banner.tone-night { background: #232220; color: #f3c27a; }
.season-banner.tone-rose { background: #a8435a; color: #fff; }
.season-banner.tone-navy { background: #2f4a7a; color: #fff; }
.season-banner.tone-green { background: #2f6b3a; color: #fff; }
.season-banner.tone-pastel { background: #e9dff2; color: #4a3f5c; }
.season-banner.tone-rust { background: #8a4a2a; color: #fff4e6; }
.season-banner.tone-pine { background: #24402f; color: #f6e7c1; }

/* Garland hanging under the sticky header */
.season-garland { position: absolute; left: 0; right: 0; top: 100%; height: 40px; pointer-events: none; overflow: visible; }
.season-garland .g-wire { display: block; width: 100%; height: 40px; overflow: visible; }
.site-header:has(.site-nav.open) .season-garland { display: none; }
.g-glow { animation: g-twinkle 2.6s ease-in-out infinite; }
.g-bulb.dim .g-glow { animation-duration: 3.4s; }
@keyframes g-twinkle { 0%, 100% { opacity: .9; } 45% { opacity: .15; } 60% { opacity: .75; } }
.g-sway { transform-box: fill-box; transform-origin: 50% 0; animation: g-sway 4s ease-in-out infinite alternate; }
@keyframes g-sway { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }

/* Falling particles + fireworks canvases */
.season-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 45; }
.season-fireworks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.hero { position: relative; }

/* ---------- Halloween ---------- */
.season-fog { position: fixed; left: 0; right: 0; bottom: 0; height: 34vh; pointer-events: none; z-index: 44; overflow: hidden;
  -webkit-mask-image: linear-gradient(to top, #000 30%, transparent); mask-image: linear-gradient(to top, #000 30%, transparent); }
.season-fog i { position: absolute; left: 0; bottom: -10%; width: 200%; height: 100%;
  background:
    radial-gradient(38% 55% at 12% 70%, rgba(92, 84, 104, .22), transparent 70%),
    radial-gradient(30% 45% at 34% 85%, rgba(92, 84, 104, .18), transparent 70%),
    radial-gradient(40% 60% at 58% 75%, rgba(92, 84, 104, .2), transparent 70%),
    radial-gradient(28% 40% at 80% 88%, rgba(92, 84, 104, .17), transparent 70%);
  animation: fog-drift 46s linear infinite; }
.season-fog i:nth-child(2) { bottom: -22%; opacity: .8; animation-duration: 70s; animation-direction: reverse; }
.season-fog i:nth-child(3) { bottom: 4%; opacity: .55; animation-duration: 95s; }
@keyframes fog-drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.season-bat { position: fixed; top: 0; left: 0; width: 46px; height: 24px; pointer-events: none; z-index: 46; color: #2a2a27;
  animation: bat-fly var(--dur, 9s) linear forwards; }
.season-bat svg { width: 100%; height: 100%; overflow: visible; }
.season-bat .wing { transform-box: fill-box; animation: bat-flap .16s ease-in-out infinite alternate; }
.season-bat .wing.l { transform-origin: 100% 40%; }
.season-bat .wing.r { transform-origin: 0 40%; }
@keyframes bat-flap { from { transform: scaleY(1); } to { transform: scaleY(-.35); } }
@keyframes bat-fly {
  0% { transform: translate(var(--x0), var(--y0)) scale(var(--s, 1)); }
  25% { transform: translate(calc(var(--x0) + (var(--x1) - var(--x0)) * .25), calc(var(--y0) - 30px)) scale(var(--s, 1)); }
  50% { transform: translate(calc(var(--x0) + (var(--x1) - var(--x0)) * .5), calc(var(--y0) + 18px)) scale(var(--s, 1)); }
  75% { transform: translate(calc(var(--x0) + (var(--x1) - var(--x0)) * .75), calc(var(--y0) - 22px)) scale(var(--s, 1)); }
  100% { transform: translate(var(--x1), var(--y1)) scale(var(--s, 1)); }
}

.season-spider { position: absolute; top: 0; right: 14%; width: 26px; pointer-events: none; }
.season-spider .thread { width: 1px; margin: 0 auto; height: 8px; background: rgba(42, 42, 39, .45); animation: spider-drop 9s ease-in-out infinite; }
.season-spider svg { display: block; width: 26px; height: 26px; color: #2a2a27; margin-top: -2px; animation: spider-wiggle 9s ease-in-out infinite; }
@keyframes spider-drop { 0%, 12% { height: 8px; } 30%, 58% { height: 92px; } 80%, 100% { height: 8px; } }
@keyframes spider-wiggle { 0%, 30%, 58%, 100% { transform: rotate(0); } 40% { transform: rotate(8deg); } 50% { transform: rotate(-8deg); } }

.season-web { position: absolute; top: -2px; left: 0; width: 110px; height: 110px; pointer-events: none; color: rgba(42, 42, 39, .32); }

/* Preview chip for the admin */
.season-preview { position: fixed; left: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 70; display: flex; gap: 10px; align-items: center;
  background: #2a2a27; color: #fff; font: 500 .82rem/1 var(--sans); padding: 9px 12px; border-radius: 99px; box-shadow: 0 8px 24px -10px rgba(0,0,0,.5); }
.season-preview a { color: #f3c27a; }
@media (min-width: 900px) { .season-preview { bottom: 16px; } }

@media (prefers-reduced-motion: reduce) {
  .g-glow, .g-sway, .season-fog i, .season-spider .thread, .season-spider svg { animation: none !important; }
  .season-bat, .season-canvas, .season-fireworks { display: none !important; }
}
