/* The resting frame is also the first paint when motion is unavailable. */
.mk-hero .mk-art img {
  animation: none;
  transform: none;
  transform-origin: 76% 62%;
}

.mk-hero .mk-orbit {
  display: none;
  animation: none;
}

.mk-title-word {
  display: inline-block;
  transform-origin: left bottom;
}

/* Reflected light follows the waterfront, behind the copy and the emblem. */
.mk-city-motion {
  --waterline: 76%;
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  mask-image: linear-gradient(90deg, transparent 16%, #0004 37%, #000 60%);
  -webkit-mask-image: linear-gradient(90deg, transparent 16%, #0004 37%, #000 60%);
}

.mk-city-motion::before {
  position: absolute;
  content: "";
  inset: 9% -8% 0 34%;
  opacity: 0;
  background: radial-gradient(ellipse at 61% 62%, #ffad9f45, #fb2e6a1c 35%, transparent 69%);
  transform-origin: 67% 65%;
}

.mk-city-motion > span {
  --trail-height: 3px;
  --trail-angle: -5deg;
  --trail-delay: 0.04s;
  --trail-color: #ff4e8d;
  position: absolute;
  top: var(--waterline);
  left: 0;
  width: 64%;
  height: var(--trail-height);
  opacity: 0;
  border-radius: 100%;
  background: linear-gradient(90deg, transparent, #ed1e6540 12%, var(--trail-color) 65%, #ffe7ed 94%, transparent);
  box-shadow: 0 2px 8px #ff397b80;
  transform-origin: right center;
}

.mk-city-motion > span::after {
  position: absolute;
  content: "";
  right: 4%;
  top: 50%;
  width: 21%;
  height: 1px;
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, #fff, transparent);
  box-shadow: 0 0 5px #ffdce4;
}

.mk-city-motion > span:nth-child(2) {
  --trail-height: 2px;
  --trail-angle: -3deg;
  --trail-delay: 0.18s;
  --trail-color: #ff929f;
  top: calc(var(--waterline) + 4%);
  width: 73%;
}

.mk-city-motion > span:nth-child(3) {
  --trail-height: 4px;
  --trail-angle: -7deg;
  --trail-delay: 0.31s;
  --trail-color: #ff377d;
  top: calc(var(--waterline) + 10%);
  width: 56%;
}

.mk-actions .mk-replay {
  display: inline-grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #ffdee999;
  border-radius: 50%;
  color: #fff;
  background: #392232;
  line-height: 1;
  transition: background-color 160ms, border-color 160ms;
}

.mk-replay img {
  display: block;
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.mk-actions .mk-replay[hidden],
.mk-replay img[hidden] {
  display: none;
}

.mk-actions .mk-replay:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

@media (hover: hover) {
  .mk-replay:hover {
    background-color: #6b2b4b;
    border-color: #ffe5ef;
  }
}

@media (max-width: 560px) {
  .mk-city-motion {
    --waterline: 69%;
    height: var(--mk-photo-height);
    bottom: auto;
    mask-image: linear-gradient(90deg, transparent 10%, #0004 31%, #000 59%);
    -webkit-mask-image: linear-gradient(90deg, transparent 10%, #0004 31%, #000 59%);
  }

  .mk-actions .mk-replay {
    margin-inline-start: auto;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .mk-hero.is-playing .mk-art img {
    animation: mk-camera-settle 2.48s cubic-bezier(.17,.77,.19,1) both;
  }

  .mk-hero.is-playing .mk-title-word {
    animation: mk-type-arrive .71s cubic-bezier(.16,.82,.24,1) backwards;
  }

  .mk-hero.is-playing .mk-title-word + .mk-title-word {
    animation-delay: .095s;
  }

  .mk-hero.is-playing .mk-city-motion::before {
    animation: mk-bay-glow 2.22s ease-out both;
  }

  .mk-hero.is-playing .mk-city-motion > span {
    animation: mk-water-streak 1.31s cubic-bezier(.36,.07,.32,1) var(--trail-delay) both;
  }
}

@keyframes mk-camera-settle {
  from { transform: scale(1.14) translate3d(-1%, 1%, 0); }
  to { transform: none; }
}

@keyframes mk-type-arrive {
  from {
    opacity: .66;
    transform: translate3d(-.12em, .16em, 0) skewX(-9deg);
    clip-path: inset(-.17em -.12em 22% -.12em);
  }
  to {
    opacity: 1;
    transform: none;
    clip-path: inset(-.17em -.12em -.24em -.12em);
  }
}

@keyframes mk-water-streak {
  0% { opacity: 0; transform: translate3d(-106%, 5px, 0) rotate(var(--trail-angle)); }
  24% { opacity: .94; }
  70% { opacity: .95; }
  100% { opacity: 0; transform: translate3d(188%, -3px, 0) rotate(var(--trail-angle)); }
}

@keyframes mk-bay-glow {
  0% { opacity: 0; transform: scale(.86); }
  41% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
  .mk-city-motion,
  .mk-actions .mk-replay {
    display: none;
  }
}

@media (forced-colors: active) {
  .mk-city-motion,
  .mk-hero .mk-light {
    display: none;
  }

  .mk-actions .mk-replay {
    color: ButtonText;
    border-color: ButtonText;
    background: ButtonFace;
  }

  .mk-replay img {
    forced-color-adjust: none;
    background-color: #392232;
    box-shadow: 0 0 0 3px #392232;
    border-radius: 50%;
  }
}
