/* Pop from the avatar anchor; leave the map camera and marker transforms alone. */
.post-marker[data-map-post="post-book"]{--bubble-delay:0ms}
.post-marker[data-map-post="post-river"]{--bubble-delay:160ms}
.post-marker[data-map-post="post-park"]{--bubble-delay:320ms}

.post-marker .post-bubble,
.post-bubble.is-changing,
.post-marker.is-changing .post-bubble{
  transform-origin:50% calc(100% + 26px);
  animation:npc-bubble-pop 740ms cubic-bezier(.22,.75,.3,1) var(--bubble-delay,0ms) 1 backwards;
  box-shadow:0 7px 24px #48566f21,0 1px 3px #48566f10;
}

/* A single, quiet ripple accompanies each new avatar/content appearance. */
.post-avatar::before{
  content:"";
  position:absolute;
  inset:-5px;
  border:1px solid #b0a6ca99;
  border-radius:inherit;
  opacity:0;
  pointer-events:none;
  animation:npc-avatar-ripple 720ms ease-out var(--bubble-delay,0ms) 1 backwards;
}

@keyframes npc-bubble-pop{
  0%{opacity:0;transform:translateY(8px) scale(.28)}
  22%{opacity:1}
  58%{opacity:1;transform:translateY(-5px) scale(1.055)}
  80%{opacity:1;transform:translateY(1px) scale(.985)}
  100%{opacity:1;transform:none}
}

@keyframes npc-avatar-ripple{
  0%{opacity:0;transform:scale(.76)}
  22%{opacity:.75;transform:scale(.96)}
  100%{opacity:0;transform:scale(1.55)}
}

/* Reveal newly explored pins without replacing their geographic transform. */
.task-marker .task-marker-icon,
.task-marker .task-amount,
.circle-marker .circle-marker-icon,
.circle-marker .circle-marker-label{
  animation:npc-pin-reveal 540ms cubic-bezier(.2,.8,.25,1) var(--pin-delay,0ms) backwards;
}
@keyframes npc-pin-reveal{
  0%{opacity:0;transform:translateY(12px) scale(.55)}
  65%{opacity:1;transform:translateY(-4px) scale(1.08)}
  100%{opacity:1;transform:none}
}

/* Pause an in-flight entrance during direct manipulation, then continue it. */
.map-board.is-dragging .post-bubble,
.map-board.is-dragging .post-avatar::before,
.map-board.is-dragging .task-marker .task-marker-icon,
.map-board.is-dragging .task-marker .task-amount,
.map-board.is-dragging .circle-marker .circle-marker-icon,
.map-board.is-dragging .circle-marker .circle-marker-label{animation-play-state:paused}

@media(max-width:760px){
  .post-marker .post-bubble{transform-origin:50% calc(100% + 22px)}
}

@media(prefers-reduced-motion:reduce){
  .post-marker .post-bubble,
  .post-bubble.is-changing,
  .post-marker.is-changing .post-bubble,
  .post-avatar::before,
  .task-marker .task-marker-icon,
  .task-marker .task-amount,
  .circle-marker .circle-marker-icon,
  .circle-marker .circle-marker-label{animation:none!important}
}
