/* Ryan's dot scroller (scripts/dots.js): the rail sits on the scrolling element's parent,
   over its right edge, and the scrollbar it replaces is hidden. The spring and the pop are
   Petal OS's own: cubic-bezier(.34, 1.56, .64, 1), 360ms and 260ms. */

.dots-host {
  position: relative;
}
.dots-scroll {
  scrollbar-width: none;
}
.dots-scroll::-webkit-scrollbar {
  display: none;
}
.dots-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 6px;
  width: 16px;
  cursor: pointer;
  touch-action: none;
}
.dots-rail[hidden] {
  display: none;
}
.dots-dot {
  position: absolute;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--dots-color, var(--accent));
  transition: top 360ms cubic-bezier(0.34, 1.56, 0.64, 1), scale 200ms ease;
  animation: dots-pop 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dots-rail:hover .dots-dot,
.dots-rail.dragging .dots-dot {
  scale: 1.5;
}
.dots-rail.dragging .dots-dot {
  transition: scale 200ms ease; /* it follows the pointer, no spring */
}
@keyframes dots-pop {
  0% {
    opacity: 0;
    transform: scale(0.2);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .dots-dot {
    transition: none;
    animation: none;
  }
}
