.destination-handoff {
  --handoff-x: 50%;
  --handoff-y: 50%;
  position: fixed;
  inset: 0;
  z-index: 9998;
  overflow: hidden;
  pointer-events: none;
  background: #071c2b;
  clip-path: circle(0 at var(--handoff-x) var(--handoff-y));
  transition: clip-path 640ms cubic-bezier(.22, 1, .36, 1), opacity 380ms ease;
}

.destination-handoff::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--handoff-x) var(--handoff-y), rgba(37, 179, 164, .2), transparent 48%);
}

.destination-handoff__line {
  position: absolute;
  top: 50%;
  left: 10%;
  width: 80%;
  height: 2px;
  background: #54d7c7;
  opacity: .92;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 470ms cubic-bezier(.22, 1, .36, 1) 120ms;
}

.destination-handoff__dot {
  position: absolute;
  top: calc(50% - 8px);
  left: calc(10% - 8px);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 0 5px rgba(251, 191, 36, .16);
  opacity: 0;
}

.destination-handoff.is-entering {
  clip-path: circle(150vmax at var(--handoff-x) var(--handoff-y));
  pointer-events: auto;
}

.destination-handoff.is-entering .destination-handoff__line {
  transform: scaleX(1);
}

.destination-handoff.is-entering .destination-handoff__dot {
  animation: destination-handoff-dot 490ms cubic-bezier(.22, 1, .36, 1) 120ms both;
}

.destination-handoff.is-arriving {
  clip-path: none;
}

.destination-handoff.is-arriving .destination-handoff__line {
  transform: scaleX(1);
}

.destination-handoff.is-arriving .destination-handoff__dot {
  left: calc(90% - 8px);
  opacity: 1;
}

.destination-handoff.is-arriving.is-clearing {
  opacity: 0;
}

@keyframes destination-handoff-dot {
  0% { left: calc(10% - 8px); opacity: 0; transform: scale(.55); }
  18% { opacity: 1; transform: scale(1.12); }
  100% { left: calc(90% - 8px); opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .destination-handoff { display: none; }
}
