/* Transparent decorations stay outside the homepage layout and its hit targets. */
.jh-weather, .jh-helmet-beat {
  pointer-events: none;
  user-select: none;
}
.jh-weather {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 2147483600;
}
.jh-weather--blizzard {
  background: linear-gradient(112deg, rgb(36 60 87 / 22%), rgb(85 117 147 / 14%) 58%, rgb(36 60 87 / 23%));
  animation: jh-storm-envelope 7.3s linear both;
}
@keyframes jh-storm-envelope {
  0%, 100% { opacity: 0; }
  11% { opacity: .79; }
  24%, 61%, 72% { opacity: 1; }
  41% { opacity: .45; }
  89% { opacity: .33; }
}
.jh-weather-snow {
  position: absolute;
  inset: calc(0px - var(--tile-y)) 0 0 calc(0px - var(--tile-x));
  background-repeat: repeat;
  background-size: var(--tile-x) var(--tile-y);
  animation: jh-snow-travel var(--speed) linear var(--phase) infinite;
}
.jh-weather-far {
  --tile-x: 146px; --tile-y: 139px; --speed: 2.7s; --phase: -.8s;
  background-image: url("snow-0.png");
}
.jh-weather-mid {
  --tile-x: 208px; --tile-y: 140px; --speed: 1.2s; --phase: -.9s;
  background-image: url("snow-1.png");
}
.jh-weather-near {
  --tile-x: 324px; --tile-y: 172px; --speed: .72s; --phase: -.2s;
  background-image: url("snow-2.png");
}
@keyframes jh-snow-travel {
  from { transform: translate3d(0,0,0); }
  to { transform: translate3d(var(--tile-x),var(--tile-y),0); }
}
.jh-helmet-beat {
  position: absolute;
  z-index: 6;
  left: 58%;
  top: 0%;
  width: 30%;
  height: 16%;
  overflow: visible;
}
.jh-helmet-beat > span { position: absolute; display: block; }
.jh-helmet-bulb {
  width: 15%; height: 33%; left: 12%; bottom: 146%;
  border-radius: 42% 42% 55% 55%;
  background: #ffda69;
  border-top: 3px solid #41614a;
  box-shadow: 0 0 7px 2px #ffe4a3;
  animation: jh-tip-light 1.25s linear both;
}
@keyframes jh-tip-light {
  0%, 30%, 100% { opacity: 0; }
  44%, 72% { opacity: 1; }
  55% { opacity: .38; }
}
.jh-helmet-snowcap {
  left: -21%; top: 0; width: 88%; height: 40%;
  background: radial-gradient(ellipse at 29% 82%, #fffeff 0 37%, transparent 40%),
              radial-gradient(ellipse at 52% 64%, #fff 0 41%, transparent 44%),
              radial-gradient(ellipse at 76% 78%, #dcf0fc 0 32%, transparent 35%);

  transform-origin: center bottom;
  animation: jh-cap-drop 1.38s linear both;
}
@keyframes jh-cap-drop {
  0%, 43% { opacity: 0; transform: translateY(-400%) rotate(-9deg); }
  52% { opacity: 1; transform: translateY(-370%) rotate(-8deg); }
  66% { transform: translateY(-240%) rotate(-4deg); }
  77% { opacity: 1; transform: translateY(0) scale(1.16,.62); }
  87% { opacity: 1; transform: translateY(-8%) scale(.98,1.02); }
  100% { opacity: 0; transform: translateY(10%) scale(1.3,.55); }
}
.jh-helmet-burst {
  inset: -30% -45% -30% -70%;
  background: url("snow-2.png") center / 72px 52px, radial-gradient(ellipse, #e1f6ff 0, transparent 67%);
  border-radius: 50%;
  animation: jh-cap-impact .6s 1.06s ease-out both;
}
@keyframes jh-cap-impact {
  0% { opacity: 0; transform: scale(.25); }
  16% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-24%) scale(1.5); }
}
.jh-weather-squall {
  --tile-x: 520px; --tile-y: 280px; --speed: .9s; --phase: -.31s;
  background-image: url("snow-1.png"), radial-gradient(ellipse 60% 16% at 48% 55%, #f4fbffab, transparent 96%);
  animation: jh-snow-travel var(--speed) linear var(--phase) infinite, jh-squalls 7.3s ease-in-out both;
}
.jh-weather-foreground {
  --tile-x: 490px; --tile-y: 380px; --speed: .66s; --phase: -.52s;
  background-image: url("snow-2.png");
  animation: jh-snow-travel var(--speed) linear var(--phase) infinite, jh-squalls 7.3s .08s ease-in-out both;
}
.jh-weather-drift {
  --tile-x: 157px; --tile-y: 242px; --speed: 5.4s; --phase: -2.1s;
  background-image: url("snow-0.png");
}
@keyframes jh-squalls {
  0%, 37%, 100% { opacity: 0; }
  17% { opacity: .82; }
  54%, 67% { opacity: 1; }
  89% { opacity: .08; }
}
.jh-sleigh-flight {
  position: absolute; left: 0; top: 0;
  width: clamp(220px, 50vw, 640px);
  transform-origin: 60% 48%;
  animation: jh-sleigh-bank 6.7s linear both;
}
.jh-weather-sleigh { display: block; width: 100%; height: auto; }
.jh-sleigh-nose {
  position: absolute; left: 86.5%; top: 23%; width: 2.4%; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #fff8df 0 9%, #ea4832 26%, transparent 70%);
  animation: jh-beacon 6.7s ease-out both;
}
@keyframes jh-beacon {
  0%, 25% { opacity: 1; transform: scale(7); }
  62% { opacity: .8; transform: scale(1.2); }
  80%, 100% { opacity: 0; transform: scale(.65); }
}
@keyframes jh-sleigh-bank {
  0% { opacity: 0; transform: translate(20vw,16vh) translate(-50%,-50%) perspective(720px) rotateY(-64deg) rotate(-9deg) scale(.045); }
  12% { opacity: 1; transform: translate(24vw,14vh) translate(-50%,-50%) perspective(720px) rotateY(-61deg) rotate(-12deg) scale(.095); }
  36% { transform: translate(36vw,18vh) translate(-50%,-50%) perspective(720px) rotateY(-40deg) rotate(11deg) scale(.30); }
  60% { transform: translate(var(--bank-x),var(--bank-y)) translate(-50%,-50%) perspective(720px) rotateY(-14deg) rotate(13deg) scale(.76); }
  73% { transform: translate(calc(var(--bank-x) + 9vw),calc(var(--bank-y) - 2vh)) translate(-50%,-50%) perspective(720px) rotateY(8deg) rotate(-12deg) scale(1.16); }
  88%, 100% { opacity: 1; transform: translate(calc(110vw + 720px),-27vh) translate(-50%,-50%) perspective(720px) rotateY(21deg) rotate(-25deg) scale(1.52); }
}
@media (prefers-reduced-motion: reduce) {
  .jh-weather, .jh-helmet-beat { display: none; }
}
