/* RoboProbe's Christmas dress (build/xmas.py). Shown only while <html> has the class "xmas". */
.xm-hat, .xm-sky, .xm-bells { display: none; }
.xmas .hero { position: relative; }

/* the hat sits on the face's canvas and makes the face's own moves, so it stays on */
.xmas .logo.live .xm-hat { display: block; position: absolute; left: 0; top: 0; width: calc(184 / 655 * 100%); height: 100%;
  overflow: visible; pointer-events: none; transform-box: view-box; }
.xmas .logo.live.shake .xm-hat { animation: lg-shake .42s ease-in-out; transform-origin: 92px 57px; }
.xmas .logo.live.wobble .xm-hat { animation: lg-wobble 1.1s ease-in-out; transform-origin: 92px 100px; }
.xmas .logo.live.hop .xm-hat { animation: lg-hop .5s cubic-bezier(.3, 0, .3, 1); transform-origin: 92px 114px; }
.xmas .xm-hat .xm-pom { transform-box: fill-box; transform-origin: 50% 0; }
.xmas .logo.live.hop .xm-pom { animation: xm-pom .7s ease-out; }
@keyframes xm-pom { 0%, 100% { translate: 0 0; } 40% { translate: 2px 5px; } 70% { translate: -1px -2px; } }

/* snow on the letters: each letter's cut-out also takes its cap of snow, painted over the letter's ink */
.xmas .logo.live .ch { background-size: 100% 100%; background-repeat: no-repeat; }
.xmas .logo.live .ch0 { background-image: url(brand/snow/0.png); -webkit-mask-image: url(brand/word/0.png), url(brand/snow/0.png); mask-image: url(brand/word/0.png), url(brand/snow/0.png); }
.xmas .logo.live .ch1 { background-image: url(brand/snow/1.png); -webkit-mask-image: url(brand/word/1.png), url(brand/snow/1.png); mask-image: url(brand/word/1.png), url(brand/snow/1.png); }
.xmas .logo.live .ch2 { background-image: url(brand/snow/2.png); -webkit-mask-image: url(brand/word/2.png), url(brand/snow/2.png); mask-image: url(brand/word/2.png), url(brand/snow/2.png); }
.xmas .logo.live .ch3 { background-image: url(brand/snow/3.png); -webkit-mask-image: url(brand/word/3.png), url(brand/snow/3.png); mask-image: url(brand/word/3.png), url(brand/snow/3.png); }
.xmas .logo.live .ch4 { background-image: url(brand/snow/4.png); -webkit-mask-image: url(brand/word/4.png), url(brand/snow/4.png); mask-image: url(brand/word/4.png), url(brand/snow/4.png); }
.xmas .logo.live .ch5 { background-image: url(brand/snow/5.png); -webkit-mask-image: url(brand/word/5.png), url(brand/snow/5.png); mask-image: url(brand/word/5.png), url(brand/snow/5.png); }
.xmas .logo.live .ch6 { background-image: url(brand/snow/6.png); -webkit-mask-image: url(brand/word/6.png), url(brand/snow/6.png); mask-image: url(brand/word/6.png), url(brand/snow/6.png); }
.xmas .logo.live .ch7 { background-image: url(brand/snow/7.png); -webkit-mask-image: url(brand/word/7.png), url(brand/snow/7.png); mask-image: url(brand/word/7.png), url(brand/snow/7.png); }
.xmas .logo.live .ch8 { background-image: url(brand/snow/8.png); -webkit-mask-image: url(brand/word/8.png), url(brand/snow/8.png); mask-image: url(brand/word/8.png), url(brand/snow/8.png); }

/* snowflakes drift down over the hero */
.xmas .xm-sky { display: block; position: absolute; inset: -40px 0 0; overflow: hidden; pointer-events: none; z-index: 0; }
.xmas .hero > :not(.xm-sky):not(.xm-bells) { position: relative; z-index: 1; }
.xm-flake { position: absolute; height: auto; fill: none; stroke: #9db3c8; stroke-width: 2.4; stroke-linecap: round; opacity: .9; }
@media (prefers-reduced-motion: no-preference) {
  .xmas .xm-flake { animation: xm-fall var(--t) linear var(--d) infinite; }
  @keyframes xm-fall {
    0% { translate: 0 -60px; rotate: 0deg; opacity: 0; }
    12% { opacity: .9; }
    50% { translate: var(--x) 110px; }
    85% { opacity: .9; }
    100% { translate: 0 280px; rotate: 180deg; opacity: 0; }
  }
}

/* a pair of bells with a red bow, hung at the hero's top right; they swing now and then */
.xmas .xm-bells { display: block; position: absolute; right: 0; top: clamp(70px, 11vh, 130px); width: clamp(72px, 8vw, 110px);
  height: auto; overflow: visible; z-index: 1; transform-origin: 50% 0; }
.xm-bell { transform-box: fill-box; transform-origin: 50% 0; }
@media (prefers-reduced-motion: no-preference) {
  .xmas .xm-bells { animation: xm-sway 6s ease-in-out infinite; }
  .xmas .xm-bell-l { animation: xm-ring-l 6s ease-in-out infinite; }
  .xmas .xm-bell-r { animation: xm-ring-r 6s ease-in-out infinite; }
  @keyframes xm-sway { 0%, 70%, 100% { rotate: 0deg; } 76% { rotate: 5deg; } 84% { rotate: -4deg; } 92% { rotate: 2deg; } }
  @keyframes xm-ring-l { 0%, 70%, 100% { rotate: 0deg; } 75% { rotate: 14deg; } 82% { rotate: -10deg; } 89% { rotate: 6deg; } 95% { rotate: -2deg; } }
  @keyframes xm-ring-r { 0%, 71%, 100% { rotate: 0deg; } 76% { rotate: -14deg; } 83% { rotate: 10deg; } 90% { rotate: -6deg; } 96% { rotate: 2deg; } }
}
@media (max-width: 860px) { .xmas .xm-bells { top: 70px; width: 56px; } .xmas .xm-sky { bottom: auto; height: 170px; } }
/* on a phone the logo spans the width: the bells hang smaller, in the space above it */
@media (max-width: 520px) { .xmas .xm-bells { top: 52px; width: 40px; } }

/* night: paler flakes, and the hat's white parts keep a light outline */
html[data-theme="dark"] .xm-flake { stroke: #d6e2ee; opacity: .7; }
html[data-theme="dark"] .xm-hat .xm-brim, html[data-theme="dark"] .xm-hat .xm-pom { stroke: #f3f1ea; }
