The carousel is just a horizontal scroller with scroll-snap-type: x mandatory, so swiping on a phone, trackpad scrolling and momentum all behave exactly like the platform expects. No drag code, no transform math.
The script adds dots and arrows on top, and an IntersectionObserver (with the track as its root) marks a slide as current once 60% of it is visible. That keeps the dots in sync no matter how the slide got there: a swipe, an arrow, a dot or the keyboard.
aria-roledescription tells screen readers this is a carousel of slides, and each slide is labelled "2 of 4". With reduced motion on, arrow and dot jumps happen instantly instead of smooth-scrolling.
Use real images: put an <img> inside each .slide with object-fit: cover.