@charset "UTF-8";
/*==========================================================================================

  Top page: the mug on the two ticket buttons shakes and throws snow
  (mouse enter / keyboard focus; once when the button scrolls into view on touch screens; see index.php).

  Each button is two layers cut from the old one-piece images (avenue__button*.png) by
  tools/build_ticket_mug_layers.py: the bar and the mug, both 800x196 (transparent around the mug), so both
  images get the same box and land on the same pixels: at rest the button looks exactly as before.

==========================================================================================*/
.avenue__ticket {
  position: relative;
  display: block;
}
.avenue__ticket .avenue__mug {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  /* Centre of the mug's base (x 74, y 189 of 800x196): it rocks on its foot. */
  transform-origin: 9.3% 96.4%;
}
.avenue__snow {
  position: absolute;
  top: 6%;
  left: 2%;
  width: 18%;
  height: 0;
  pointer-events: none;
}
.avenue__snow i {
  position: absolute;
  top: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 4px rgba(255, 255, 255, .9);
  opacity: 0;
}

/* is-shaking comes from index.php's script (mouse enter / focus, or scrolling into view on touch screens) and is
   removed when the last flake lands, so the shake always finishes even if the pointer leaves halfway. */
.avenue__ticket.is-shaking .avenue__mug {
  animation: avenue-mug-shake .9s ease-in-out;
}
.avenue__ticket.is-shaking .avenue__snow i {
  animation: avenue-mug-snow 1.4s ease-out both;
}

@keyframes avenue-mug-shake {
  0%   { transform: rotate(0); }
  15%  { transform: rotate(-9deg); }
  32%  { transform: rotate(7deg); }
  49%  { transform: rotate(-5deg); }
  66%  { transform: rotate(3deg); }
  83%  { transform: rotate(-1deg); }
  100% { transform: rotate(0); }
}
/* Out of the mug's mouth (up to --rise), then drifting down past it (to --fall) while fading. */
@keyframes avenue-mug-snow {
  0%   { opacity: 0; transform: translate(0, 0) scale(.4); }
  12%  { opacity: 1; }
  45%  { opacity: 1; transform: translate(calc(var(--drift) * .6), var(--rise)) scale(1); }
  100% { opacity: 0; transform: translate(var(--drift), var(--fall)) scale(.7); }
}
.avenue__snow i:nth-child(1)  { left: 10%;   --drift: -42px;  --rise: -23px;  --fall: 6px;   animation-delay: .05s; }
.avenue__snow i:nth-child(2)  { left: 22%;   --drift: -22px;  --rise: -31px;  --fall: -4px;  animation-delay: .18s; width: 4px; height: 4px; }
.avenue__snow i:nth-child(3)  { left: 34%;   --drift: -8px;   --rise: -26px;  --fall: 12px;  animation-delay: .1s; }
.avenue__snow i:nth-child(4)  { left: 46%;   --drift: 10px;   --rise: -35px;  --fall: 2px;   animation-delay: .26s; width: 5px; height: 5px; }
.avenue__snow i:nth-child(5)  { left: 58%;   --drift: 25px;   --rise: -24px;  --fall: 14px;  animation-delay: .02s; width: 7px; height: 7px; }
.avenue__snow i:nth-child(6)  { left: 70%;   --drift: 38px;   --rise: -30px;  --fall: 6px;   animation-delay: .22s; width: 4px; height: 4px; }
.avenue__snow i:nth-child(7)  { left: 82%;   --drift: 52px;   --rise: -20px;  --fall: 18px;  animation-delay: .12s; }
.avenue__snow i:nth-child(8)  { left: 16%;   --drift: -32px;  --rise: -17px;  --fall: 20px;  animation-delay: .34s; width: 3px; height: 3px; }
.avenue__snow i:nth-child(9)  { left: 40%;   --drift: -2px;   --rise: -40px;  --fall: -8px;  animation-delay: .3s;  width: 3px; height: 3px; }
.avenue__snow i:nth-child(10) { left: 64%;   --drift: 20px;   --rise: -37px;  --fall: -2px;  animation-delay: .38s; width: 5px; height: 5px; }
.avenue__snow i:nth-child(11) { left: 52%;   --drift: 5px;    --rise: -18px;  --fall: 22px;  animation-delay: .44s; width: 4px; height: 4px; }
.avenue__snow i:nth-child(12) { left: 28%;   --drift: -15px;  --rise: -36px;  --fall: 4px;   animation-delay: .48s; width: 5px; height: 5px; }

@media (prefers-reduced-motion: reduce) {
  .avenue__ticket .avenue__mug,
  .avenue__snow i {
    animation: none !important;
  }
}
