/* Christmas snowfall: decorative, page-wide, never clickable.
   Built by snow.js (stable particle values, no per-frame JavaScript). Pure CSS transform animations run on the GPU.
   Tune here:
     --snow-speed    1 = default. 1.3 = 30% slower, 0.8 = faster. Multiplies every fall and sway duration.
     --snow-opacity  1 = default. 0.6 = fainter, 1.2 = brighter. Multiplies every flake's opacity.
   Density (number of flakes) is set in snow.js (COUNTS). */
:root { --snow-speed: 1; --snow-opacity: 1; }
@media (max-width: 600px) { :root { --snow-speed: 1.2; --snow-opacity: 0.85; } } /* phones: slower and softer */

.snow {
  position: fixed; inset: 0; z-index: 40; overflow: hidden; contain: strict;
  pointer-events: none; /* never blocks taps, clicks, scrolling or forms */
}
.snow-layer { position: absolute; inset: 0; animation: snow-wind calc(41s * var(--snow-speed)) ease-in-out infinite; }
.snow-fg { animation-duration: calc(53s * var(--snow-speed)); animation-delay: -17s; }

/* Each flake is a full-height column that slides down by its own height, so the fall always spans the visible
   screen (no vh jumps when a phone's address bar hides). The dot itself is the ::before, which sways. */
.snow i {
  position: absolute; top: 0; left: var(--x); width: var(--size); height: 100%;
  transform: translate3d(0, -4%, 0);
  animation: snow-fall calc(var(--d) * var(--snow-speed)) linear var(--delay) infinite;
}
.snow i::before {
  content: ""; display: block; width: var(--size); height: var(--size); border-radius: 50%;
  opacity: calc(var(--o) * var(--snow-opacity));
  background: radial-gradient(circle, #fff 0 42%, rgba(255, 255, 255, 0) 72%);
  animation: snow-sway-1 calc(var(--sd) * var(--snow-speed)) ease-in-out var(--delay) infinite alternate;
}
/* Three fixed sway widths (fixed keyframes keep every animation on the GPU compositor) */
.snow i.s2::before { animation-name: snow-sway-2; }
.snow i.s3::before { animation-name: snow-sway-3; }
/* Foreground: a few larger, softer flakes. The soft edge comes from the gradient, not a blur filter (cheap on phones). */
.snow-fg i::before { background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 22%, rgba(255, 255, 255, 0.45) 46%, rgba(255, 255, 255, 0) 72%); }

@keyframes snow-fall { from { transform: translate3d(0, -4%, 0); } to { transform: translate3d(0, 100%, 0); } }
@keyframes snow-sway-1 { from { transform: translate3d(-9px, 0, 0); } to { transform: translate3d(9px, 0, 0); } }
@keyframes snow-sway-2 { from { transform: translate3d(-16px, 0, 0); } to { transform: translate3d(16px, 0, 0); } }
@keyframes snow-sway-3 { from { transform: translate3d(-26px, 0, 0); } to { transform: translate3d(26px, 0, 0); } }
/* An occasional gentle gust moves the whole layer sideways, slowly */
@keyframes snow-wind { 0%, 100% { transform: translate3d(0, 0, 0); } 35% { transform: translate3d(16px, 0, 0); } 70% { transform: translate3d(-7px, 0, 0); } }

/* Stop/show switch: a small snowflake at the right of the top bar, 44 px to tap */
.snow-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 44px; height: 44px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: #fff7df; cursor: pointer; opacity: 0.85;
}
.snow-toggle::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; border: 1px solid rgba(255, 247, 223, 0.45); }
.snow-toggle[aria-pressed="false"] { opacity: 0.55; }
.snow-toggle[aria-pressed="false"]::after { content: ""; position: absolute; width: 22px; height: 1.8px; background: currentColor; transform: rotate(-45deg); border-radius: 1px; }
.snow-toggle:hover { opacity: 1; }
.snow-toggle:focus-visible { outline: 2px solid #f3cf7a; outline-offset: -2px; }
.topbar:has(.snow-toggle) { padding-left: 52px; padding-right: 52px; } /* keeps the offer text centred and clear of the switch */
.snow-toggle-float { position: fixed; top: auto; bottom: 12px; left: 12px; right: auto; transform: none; z-index: 41; background: rgba(12, 62, 41, 0.85); }
.snow[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) { .snow, .snow-toggle { display: none; } }
@media print { .snow { display: none; } }
