/* Motion module "pin": the map pin drops once (about 520 ms) and settles with a small squash on landing. */
.motion-pin .map-pin[data-pin] {
  transform-origin: 50% 100%; /* the tip */
}

.motion-pin .map-pin[data-pin="wait"] {
  opacity: 0;
}

.motion-pin .map-pin[data-pin="drop"] {
  animation: motion-pin-drop 520ms linear both;
}

@keyframes motion-pin-drop {
  0% {
    opacity: 0;
    transform: translateY(-44px);
    animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.5);
  }

  12% {
    opacity: 1;
  }

  52% {
    opacity: 1;
    transform: translateY(0) scale(1, 1);
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.4, 1);
  }

  64% {
    transform: translateY(0) scale(1.14, 0.84);
    animation-timing-function: cubic-bezier(0.3, 0, 0.3, 1);
  }

  82% {
    transform: translateY(-5px) scale(0.97, 1.04);
    animation-timing-function: ease-in-out;
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1, 1);
  }
}

/* The address bubble grows out of the pin tip after the landing: scale from the anchor (42 px below the bubble's own tip =
   the pin tip, popupAnchor of the marker), about 250 ms, small overshoot. Only while the module runs (.motion-pin); the tip container is 20 px high, the pin is 42 px below it. */
.motion-pin .leaflet-popup[data-pin-grow] .leaflet-popup-content-wrapper {
  transform-origin: 50% calc(100% + 62px);
  animation: motion-pin-grow 250ms linear both;
}

.motion-pin .leaflet-popup[data-pin-grow] .leaflet-popup-tip-container {
  transform-origin: 50% calc(100% + 42px);
  animation: motion-pin-grow 250ms linear both;
}

@keyframes motion-pin-grow {
  0% {
    opacity: 0;
    transform: scale(0.25);
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.4, 1);
  }

  25% {
    opacity: 1;
  }

  70% {
    opacity: 1;
    transform: scale(1.04);
    animation-timing-function: ease-in-out;
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}
