/* Optional falling snow. Loaded only if the page includes this file.
   Active when <html> has class "snow". Off: drop the class, or omit this file
   and the .snow-layer markup. */
.snow-layer {
  display: none;
}

html.snow .snow-layer {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  overflow: hidden;
}

html.snow .snow-layer span {
  position: absolute;
  top: -12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 4px 1px rgba(255, 255, 255, 0.55);
  animation-name: schmidt-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

html.snow .snow-layer span:nth-child(1)  { left:  2%; width: 4px; height: 4px; opacity: .7; animation-duration: 11s; animation-delay: -1s; }
html.snow .snow-layer span:nth-child(2)  { left:  7%; width: 6px; height: 6px; opacity: .85; animation-duration: 15s; animation-delay: -6s; }
html.snow .snow-layer span:nth-child(3)  { left: 11%; width: 3px; height: 3px; opacity: .55; animation-duration: 9s;  animation-delay: -3s; }
html.snow .snow-layer span:nth-child(4)  { left: 16%; width: 5px; height: 5px; opacity: .8;  animation-duration: 13s; animation-delay: -10s; }
html.snow .snow-layer span:nth-child(5)  { left: 21%; width: 4px; height: 4px; opacity: .65; animation-duration: 17s; animation-delay: -2s; }
html.snow .snow-layer span:nth-child(6)  { left: 25%; width: 7px; height: 7px; opacity: .9;  animation-duration: 12s; animation-delay: -8s; }
html.snow .snow-layer span:nth-child(7)  { left: 30%; width: 3px; height: 3px; opacity: .5;  animation-duration: 10s; animation-delay: -4s; }
html.snow .snow-layer span:nth-child(8)  { left: 34%; width: 5px; height: 5px; opacity: .75; animation-duration: 14s; animation-delay: -11s; }
html.snow .snow-layer span:nth-child(9)  { left: 39%; width: 4px; height: 4px; opacity: .7;  animation-duration: 16s; animation-delay: -7s; }
html.snow .snow-layer span:nth-child(10) { left: 43%; width: 6px; height: 6px; opacity: .85; animation-duration: 11s; animation-delay: -1s; }
html.snow .snow-layer span:nth-child(11) { left: 48%; width: 3px; height: 3px; opacity: .55; animation-duration: 9s;  animation-delay: -5s; }
html.snow .snow-layer span:nth-child(12) { left: 52%; width: 5px; height: 5px; opacity: .8;  animation-duration: 18s; animation-delay: -12s; }
html.snow .snow-layer span:nth-child(13) { left: 57%; width: 4px; height: 4px; opacity: .65; animation-duration: 13s; animation-delay: -3s; }
html.snow .snow-layer span:nth-child(14) { left: 61%; width: 7px; height: 7px; opacity: .9;  animation-duration: 15s; animation-delay: -9s; }
html.snow .snow-layer span:nth-child(15) { left: 66%; width: 3px; height: 3px; opacity: .5;  animation-duration: 10s; animation-delay: -2s; }
html.snow .snow-layer span:nth-child(16) { left: 70%; width: 5px; height: 5px; opacity: .75; animation-duration: 12s; animation-delay: -6s; }
html.snow .snow-layer span:nth-child(17) { left: 74%; width: 4px; height: 4px; opacity: .7;  animation-duration: 16s; animation-delay: -14s; }
html.snow .snow-layer span:nth-child(18) { left: 79%; width: 6px; height: 6px; opacity: .85; animation-duration: 11s; animation-delay: -4s; }
html.snow .snow-layer span:nth-child(19) { left: 83%; width: 3px; height: 3px; opacity: .55; animation-duration: 9s;  animation-delay: -7s; }
html.snow .snow-layer span:nth-child(20) { left: 88%; width: 5px; height: 5px; opacity: .8;  animation-duration: 14s; animation-delay: -1s; }
html.snow .snow-layer span:nth-child(21) { left: 92%; width: 4px; height: 4px; opacity: .65; animation-duration: 17s; animation-delay: -8s; }
html.snow .snow-layer span:nth-child(22) { left: 96%; width: 6px; height: 6px; opacity: .9;  animation-duration: 13s; animation-delay: -5s; }
html.snow .snow-layer span:nth-child(23) { left:  5%; width: 3px; height: 3px; opacity: .5;  animation-duration: 19s; animation-delay: -13s; }
html.snow .snow-layer span:nth-child(24) { left: 46%; width: 4px; height: 4px; opacity: .6;  animation-duration: 12s; animation-delay: -15s; }
html.snow .snow-layer span:nth-child(25) { left: 58%; width: 6px; height: 6px; opacity: .8;  animation-duration: 10s; animation-delay: -16s; }
html.snow .snow-layer span:nth-child(26) { left: 19%; width: 5px; height: 5px; opacity: .7;  animation-duration: 18s; animation-delay: -9s; }
html.snow .snow-layer span:nth-child(27) { left: 85%; width: 3px; height: 3px; opacity: .55; animation-duration: 15s; animation-delay: -11s; }
html.snow .snow-layer span:nth-child(28) { left: 37%; width: 7px; height: 7px; opacity: .85; animation-duration: 14s; animation-delay: -17s; }

@keyframes schmidt-fall {
  from { transform: translate3d(0, -10px, 0); }
  to   { transform: translate3d(8vw, 110vh, 0); }
}

html.snow .snow-layer span:nth-child(odd) {
  /* slight drift the other way on odd flakes */
}

html.snow .snow-layer span:nth-child(3n) {
  animation-name: schmidt-fall-left;
}

@keyframes schmidt-fall-left {
  from { transform: translate3d(0, -10px, 0); }
  to   { transform: translate3d(-6vw, 110vh, 0); }
}

@media (prefers-reduced-motion: reduce) {
  html.snow .snow-layer { display: none; }
}
