/* Winter holiday decorations: falling snow, string lights under the header and a sleigh flyover.
   Purely decorative. Every layer ignores the pointer, and the fixed layers hang from zero-size
   anchors instead of covering the screen, so they never block clicks or add horizontal scroll. */

/* Falling snow: CSS animation only. The layer drifts with the wind, each flake falls on its own,
   and the flake's own ::before sways side to side. */
.holiday-snow { position: fixed; top: 0; left: 0; width: 0; height: 0; z-index: 51; pointer-events: none; }
.holiday-snow__layer { position: absolute; top: 0; left: -25vw; width: 150vw; height: 0; animation: holiday-wind 30s ease-in-out infinite; will-change: transform; }
.holiday-snow__layer--far { --gust: 1.6vw; }
.holiday-snow__layer--mid { --gust: 3.4vw; }
.holiday-snow__layer--near { --gust: 9vw; }
.holiday-snow i { position: absolute; top: 0; left: var(--x); width: var(--s); height: var(--s); animation: holiday-fall var(--d) linear var(--dl) infinite; will-change: transform; }
.holiday-snow i::before { content: ''; position: absolute; inset: 0; border-radius: 50%; opacity: var(--o); background: radial-gradient(circle, #fff 0 32%, #ffffffb3 48%, #fff0 70%); animation: holiday-sway var(--sd) ease-in-out var(--sl) infinite alternate; }
.holiday-snow__layer--far i::before { background: radial-gradient(circle, #f4f8ff 0 45%, #f4f8ff00 72%); }
/* Near flakes sit close to the lens, so they read as large, out-of-focus discs. */
.holiday-snow__layer--near i::before { background: radial-gradient(circle, #ffffffd9 0, #ffffff8c 28%, #ffffff2e 52%, #fff0 70%); }
.holiday-snow[data-scrolling] i, .holiday-snow[data-scrolling] i::before { animation-play-state: paused; }

@keyframes holiday-fall { from { transform: translate3d(0, -6vh, 0); } to { transform: translate3d(0, 106vh, 0); } }
@keyframes holiday-sway { from { transform: translate3d(calc(var(--sw) * -1), 0, 0); } to { transform: translate3d(var(--sw), 0, 0); } }
/* A slow 30-second weather cycle: calm, a light breeze, a gust, then calm again. */
@keyframes holiday-wind {
  0%, 100% { transform: translate3d(0, 0, 0); }
  22% { transform: translate3d(calc(var(--gust) * .25), 0, 0); }
  44% { transform: translate3d(var(--gust), 0, 0); }
  54% { transform: translate3d(calc(var(--gust) * .82), 0, 0); }
  76% { transform: translate3d(calc(var(--gust) * .18), 0, 0); }
}

@media (max-width: 760px) {
  .holiday-snow__layer--far i:nth-child(2n), .holiday-snow__layer--mid i:nth-child(2n) { display: none; }
}

/* String lights: C7 bulbs on a dark green wire that dips between hooks along the header's
   bottom edge. Each bulb twinkles on its own timing, animating opacity only. */
.holiday-lights { position: absolute; top: 100%; left: 0; right: 0; height: 34px; margin-top: -2px; overflow: hidden; pointer-events: none; }
.holiday-lights::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 0 0 3px 3px; background: radial-gradient(ellipse 14px 3px at 30% 0, #f3f7ff 60%, #f3f7ff00 61%) 0 1px / 37px 4px repeat-x, linear-gradient(#f6f9ffe6, #dfe8f7b3); box-shadow: 0 1px 2px #0005; opacity: .82; }
.holiday-lights__wire { position: absolute; top: 2px; left: 0; overflow: visible; }
.holiday-lights__wire path { fill: none; stroke: #183622; stroke-width: 1.6; stroke-linecap: round; }
.holiday-bulb { --glass: #8d2a22; --lit: #ff5a43; --halo: #ff3d2a; position: absolute; width: 8px; height: 13px; margin: 4px 0 0 -4px; border-radius: 50% 50% 50% 50% / 36% 36% 64% 64%; background: radial-gradient(ellipse at 40% 30%, color-mix(in srgb, var(--glass), #fff 22%), var(--glass) 70%); transform: rotate(var(--tilt)); transform-origin: 50% -3px; }
.holiday-bulb::before { content: ''; position: absolute; left: 1px; top: -4px; width: 6px; height: 5px; border-radius: 1.5px 1.5px 1px 1px; background: linear-gradient(90deg, #102a17, #2a4d30 45%, #0d2213); }
.holiday-bulb b { position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(ellipse at 42% 32%, #fffbe8 0 14%, var(--lit) 55%, color-mix(in srgb, var(--lit), #000 25%) 100%); box-shadow: 0 0 4px 1px color-mix(in srgb, var(--halo), transparent 25%), 0 2px 14px 5px color-mix(in srgb, var(--halo), transparent 72%); animation: holiday-twinkle var(--tw) ease-in-out var(--twd) infinite; }
.holiday-bulb--gold { --glass: #8a5a14; --lit: #ffbf3f; --halo: #ffb02e; }
.holiday-bulb--warm { --glass: #8f7a55; --lit: #fff1cf; --halo: #ffd892; }
@keyframes holiday-twinkle { 0%, 100% { opacity: 1; } 38% { opacity: .9; } 52% { opacity: .5; } 66% { opacity: .95; } }

/* Santa's sleigh: a dark silhouette with a soft moonlit edge, so it reads on dark and light
   sections. holiday.js flies it across with the Web Animations API. */
.holiday-sky { position: fixed; top: 0; left: 0; width: 0; height: 0; z-index: 49; pointer-events: none; }
.holiday-sleigh { position: absolute; top: 0; left: 0; width: clamp(170px, 19vw, 270px); will-change: transform; }
.holiday-sleigh__art { display: block; width: 100%; height: auto; filter: drop-shadow(0 8px 12px rgba(2, 8, 24, .45)) drop-shadow(0 0 10px rgba(169, 195, 255, .18)); }
.holiday-sleigh[data-direction="left"] .holiday-sleigh__art { transform: scaleX(-1); }
/* A gentle bob while it flies; the Blender render (design/blender/extras.py) carries the detail. */
.holiday-sleigh__art { animation: holiday-bob 1.8s ease-in-out infinite alternate; }
.holiday-sleigh[data-direction="left"] .holiday-sleigh__art { animation-name: holiday-bob-left; }
@keyframes holiday-bob { from { transform: translateY(-2px); } to { transform: translateY(2px); } }
@keyframes holiday-bob-left { from { transform: scaleX(-1) translateY(-2px); } to { transform: scaleX(-1) translateY(2px); } }
.holiday-spark { position: absolute; top: 0; left: 0; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: radial-gradient(circle, #fff8dc 0 25%, #ffcf5a 55%, #ffcf5a00 75%); box-shadow: 0 0 6px 1px #ffc94a99; }

@media (prefers-reduced-motion: reduce) {
  .holiday-snow, .holiday-lights, .holiday-sky { display: none !important; }
}
