/* Christmas - Snow (Light). Snow falls across the page in three depths - fine
   and far, mid, and big slow crystals near - a Santa hat sits on the logo,
   and on a wide screen a wrapped present and two little firs with twinkling
   lights sit in snowdrifts in the bottom corners. Touches no colour tokens. */

/* The flakes are the overlay's first children (the nth-child rules at the
   foot count them); the drifts and the shared gradients come after.

   A flake falls on one clock and sways on another (translate and transform
   are separate properties), so no two paths match. */
html[data-gimmick="christmas-snow"] .cs-flake {
  position: absolute;
  top: -18px;
  border-radius: 50%;
  background: #ffffff;
  animation-name: cs-fall, cs-sway;
  animation-timing-function: linear, ease-in-out;
  animation-iteration-count: infinite, infinite;
  animation-direction: normal, alternate;
  will-change: translate, transform;
}
/* Far: a hint of an edge, so a speck still reads over a white page. */
html[data-gimmick="christmas-snow"] .cs-far { box-shadow: 0 0 2px rgb(30 60 100 / 0.5); }
html[data-gimmick="christmas-snow"] .cs-mid { box-shadow: 0 0 3px 0.5px rgb(30 60 100 / 0.4); }
/* Near: a crystal, big and slow. */
html[data-gimmick="christmas-snow"] .cs-near {
  border-radius: 0;
  background: url("flake.svg") center / contain no-repeat;
  filter: drop-shadow(0 0 1.5px rgb(40 80 130 / 0.7));
}
@keyframes cs-fall {
  from { translate: 0 0; }
  to   { translate: 0 112vh; }
}
@keyframes cs-sway {
  from { transform: translateX(calc(var(--sway) * -1)) rotate(0deg); }
  to   { transform: translateX(var(--sway)) rotate(var(--r)); }
}
@media (max-width: 640px) {
  html[data-gimmick="christmas-snow"] .cs-far:nth-child(even) { display: none; }
  html[data-gimmick="christmas-snow"] .cs-near { width: 10px !important; height: 10px !important; }
}

/* The still state: the flakes held where they are, spread down the page. */
@media (prefers-reduced-motion: reduce) {
  html[data-gimmick="christmas-snow"] .cs-flake { top: var(--y); }
}

/* The drifts: low, in the bottom corners, only where there is a margin to
   sit in. The left one clears the Hide decorations button. */
html[data-gimmick="christmas-snow"] .cs-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
html[data-gimmick="christmas-snow"] .cs-drift { position: absolute; bottom: 0; }
html[data-gimmick="christmas-snow"] .cs-dl { left: 50px; width: 150px; }
html[data-gimmick="christmas-snow"] .cs-dr { right: 0; width: 200px; }
html[data-gimmick="christmas-snow"] .cs-drift-svg { display: block; width: 100%; height: auto; overflow: visible; }
html[data-gimmick="christmas-snow"] .cs-bulb { animation: cs-twinkle 2.4s ease-in-out infinite; }
html[data-gimmick="christmas-snow"] .cs-bulb1 { animation-duration: 3.1s; animation-delay: -0.8s; }
html[data-gimmick="christmas-snow"] .cs-bulb2 { animation-duration: 1.9s; animation-delay: -1.5s; }
@keyframes cs-twinkle {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
@media (max-width: 1279px) {
  html[data-gimmick="christmas-snow"] .cs-drift { display: none; }
}

html[data-gimmick="christmas-snow"] [data-gimmick-anchor="logo"]::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: var(--gimmick-logo-x, -0.5em);
  top: var(--gimmick-logo-y, -0.4em);
  width: calc(1.8em * var(--gimmick-logo-size, 1));
  height: calc(1.56em * var(--gimmick-logo-size, 1));
  background: url("santa-hat.svg") center / contain no-repeat;
  transform: rotate(-14deg);
  filter: drop-shadow(0 1px 1.5px rgb(0 0 0 / 0.25));
  pointer-events: none;
}

/* Each one's place, size and timing: here rather than inline, so a
   strict style-src doesn't refuse them. */
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(1){left:56%;width:3px;height:3px;opacity:0.55;animation-duration:26s,5.1s;animation-delay:-21.4s,-0.2s;--sway:12px;--r:0deg;--y:35%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(2){left:29%;width:7px;height:7px;opacity:0.8;animation-duration:18s,3.6s;animation-delay:-1.1s,-1.7s;--sway:36px;--r:0deg;--y:22%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(3){left:71%;width:13px;height:13px;opacity:0.95;animation-duration:15s,4.8s;animation-delay:-1.6s,-1.8s;--sway:64px;--r:-120deg;--y:12%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(4){left:11%;width:4px;height:4px;opacity:0.55;animation-duration:34s,6.1s;animation-delay:-29.4s,-0.9s;--sway:16px;--r:0deg;--y:72%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(5){left:6%;width:6px;height:6px;opacity:0.9;animation-duration:18s,4.5s;animation-delay:-17.1s,-0.2s;--sway:30px;--r:0deg;--y:76%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(6){left:94%;width:4px;height:4px;opacity:0.55;animation-duration:31s,8.0s;animation-delay:-15.8s,-2.0s;--sway:16px;--r:0deg;--y:78%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(7){left:37%;width:4px;height:4px;opacity:0.55;animation-duration:32s,6.9s;animation-delay:-6.6s,-2.3s;--sway:16px;--r:0deg;--y:36%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(8){left:46%;width:6px;height:6px;opacity:0.9;animation-duration:19s,3.9s;animation-delay:-17.4s,-2.8s;--sway:36px;--r:0deg;--y:53%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(9){left:19%;width:12px;height:12px;opacity:0.95;animation-duration:12s,3.5s;animation-delay:-5.3s,-1.7s;--sway:40px;--r:-120deg;--y:52%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(10){left:82%;width:4px;height:4px;opacity:0.55;animation-duration:28s,6.2s;animation-delay:-20.5s,-0.1s;--sway:20px;--r:0deg;--y:29%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(11){left:79%;width:2px;height:2px;opacity:0.55;animation-duration:28s,5.0s;animation-delay:-1.3s,-0.2s;--sway:20px;--r:0deg;--y:31%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(12){left:11%;width:13px;height:13px;opacity:0.95;animation-duration:15s,4.4s;animation-delay:-3.6s,-0.3s;--sway:40px;--r:150deg;--y:48%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(13){left:90%;width:4px;height:4px;opacity:0.7;animation-duration:28s,7.2s;animation-delay:-13.3s,-1.6s;--sway:20px;--r:0deg;--y:51%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(14){left:46%;width:6px;height:6px;opacity:0.9;animation-duration:22s,4.7s;animation-delay:-18.7s,-0.0s;--sway:24px;--r:0deg;--y:8%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(15){left:44%;width:14px;height:14px;opacity:0.95;animation-duration:14s,3.3s;animation-delay:-5.2s,-1.5s;--sway:52px;--r:90deg;--y:84%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(16){left:93%;width:4px;height:4px;opacity:0.7;animation-duration:31s,6.5s;animation-delay:-20.2s,-1.4s;--sway:16px;--r:0deg;--y:56%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(17){left:20%;width:5px;height:5px;opacity:0.9;animation-duration:19s,5.5s;animation-delay:-14.0s,-1.7s;--sway:36px;--r:0deg;--y:21%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(18){left:70%;width:12px;height:12px;opacity:0.95;animation-duration:14s,3.9s;animation-delay:-10.7s,-2.6s;--sway:40px;--r:150deg;--y:21%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(19){left:78%;width:2px;height:2px;opacity:0.7;animation-duration:33s,6.6s;animation-delay:-0.2s,-2.4s;--sway:12px;--r:0deg;--y:24%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(20){left:25%;width:5px;height:5px;opacity:0.8;animation-duration:17s,5.0s;animation-delay:-7.0s,-0.1s;--sway:36px;--r:0deg;--y:17%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(21){left:66%;width:4px;height:4px;opacity:0.7;animation-duration:26s,6.9s;animation-delay:-24.4s,-1.6s;--sway:16px;--r:0deg;--y:36%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(22){left:55%;width:4px;height:4px;opacity:0.55;animation-duration:34s,6.2s;animation-delay:-3.7s,-0.6s;--sway:12px;--r:0deg;--y:90%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(23){left:86%;width:5px;height:5px;opacity:0.8;animation-duration:19s,3.8s;animation-delay:-5.7s,-0.5s;--sway:30px;--r:0deg;--y:60%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(24){left:50%;width:14px;height:14px;opacity:0.95;animation-duration:13s,4.0s;animation-delay:-8.4s,-1.6s;--sway:64px;--r:-120deg;--y:84%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(25){left:87%;width:3px;height:3px;opacity:0.55;animation-duration:27s,5.1s;animation-delay:-13.2s,-1.2s;--sway:12px;--r:0deg;--y:24%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(26){left:82%;width:4px;height:4px;opacity:0.7;animation-duration:33s,5.5s;animation-delay:-4.5s,-2.5s;--sway:16px;--r:0deg;--y:38%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(27){left:15%;width:13px;height:13px;opacity:0.95;animation-duration:11s,3.8s;animation-delay:-2.0s,-0.8s;--sway:52px;--r:90deg;--y:11%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(28){left:5%;width:2px;height:2px;opacity:0.55;animation-duration:30s,5.5s;animation-delay:-0.7s,-0.0s;--sway:16px;--r:0deg;--y:69%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(29){left:89%;width:5px;height:5px;opacity:0.9;animation-duration:20s,5.0s;animation-delay:-5.5s,-0.7s;--sway:36px;--r:0deg;--y:48%}
html[data-gimmick="christmas-snow"] .cs-flake:nth-child(30){left:86%;width:13px;height:13px;opacity:0.95;animation-duration:11s,4.3s;animation-delay:-10.7s,-1.2s;--sway:40px;--r:-120deg;--y:69%}
