.carousel {
  position: relative;
  max-width: 1160px;
  margin: 0 auto;
  --carousel-gap: 16px;
}
.carousel-viewport {
  overflow: hidden;
  border-radius: 18px;
}
.carousel .example-grid {
  display: flex;
  gap: var(--carousel-gap);
  transition: transform 0.58s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}
.carousel .example-card {
  display: block;
  flex: 0 0 calc(33.333333% - 10.6667px);
  min-width: 0;
  max-width: none;
  border: 0;
  background: none;
  padding: 0;
  transform: none;
}
.carousel .sample-compare {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 14px;
  touch-action: pan-y;
}
.carousel .sample-compare img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1) !important;
  transition: transform 0.6s ease;
  filter: none;
  pointer-events: none;
  user-select: none;
}
.carousel .sample-compare:hover img {
  transform: scale(1.025) !important;
}
.carousel .sample-original {
  clip-path: inset(0 calc(100% - var(--split)) 0 0);
  z-index: 1;
}
.carousel .sample-label {
  position: absolute;
  top: 12px;
  z-index: 2;
  background: #fffffff0;
  color: #151515;
  border-radius: 100px;
  padding: 6px 9px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2px;
  pointer-events: none;
  white-space: nowrap;
}
.carousel .sample-compare > .sample-before {
  left: 10px;
  right: auto;
  width: auto;
  height: auto;
  display: inline-block;
}
.carousel .sample-compare > .sample-after {
  left: auto;
  right: 10px;
  width: auto;
  height: auto;
  display: inline-block;
}
.sample-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 2px;
  background: white;
  box-shadow: 0 0 3px #0005;
  z-index: 3;
  pointer-events: none;
}
.sample-divider span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: white;
  color: #111;
  font-size: 18px;
  box-shadow: 0 2px 12px #0002;
}
.sample-compare input {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 4;
  cursor: ew-resize;
  touch-action: none;
}
.sample-compare:focus-within {
  outline: 3px solid #315af8;
  outline-offset: -3px;
}
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}
.carousel-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}
.carousel-dots button {
  width: 32px;
  height: 36px;
  padding: 0;
  border: 0;
  background: none;
  position: relative;
}
.carousel-dots button:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 16px;
  height: 4px;
  border-radius: 9px;
  background: #d5d7d1;
}
.carousel-dots button.active:after {
  background: #315af8;
}
.carousel-arrows {
  display: flex;
  gap: 8px;
}
.carousel-arrows button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid #d8dad3;
  background: white;
  font-size: 21px;
}
.carousel-arrows button:hover {
  background: #111;
  color: white;
}
@media (max-width: 760px) {
  .carousel {
    --carousel-gap: 12px;
    width: 100%;
    max-width: none;
  }
  .carousel-viewport {
    width: 100%;
    border-radius: 16px;
  }
  .carousel .example-card {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
  }
  .carousel .example-card .sample-compare {
    will-change: transform, opacity;
  }
  .carousel .example-card:not(:first-child):not(.is-ready) .sample-compare img {
    visibility: hidden;
  }
  .carousel .example-card.is-current .sample-compare {
    animation: mobile-carousel-settle 0.52s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  .carousel .sample-compare {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 16px;
    touch-action: pan-y;
  }
  .carousel .sample-label {
    top: 10px;
    padding: 6px 8px;
    font-size: 9px;
  }
  .carousel .sample-compare > .sample-before {
    left: 10px;
  }
  .carousel .sample-compare > .sample-after {
    right: 10px;
  }
  .carousel .sample-compare input {
    pointer-events: none;
    touch-action: pan-y;
  }
  .carousel .sample-divider {
    width: 34px;
    margin-left: -16px;
    background: transparent;
    box-shadow: none;
    pointer-events: auto;
    touch-action: none;
    cursor: ew-resize;
  }
  .carousel .sample-divider::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background: white;
    box-shadow: 0 0 3px #0005;
  }
  .sample-divider span {
    width: 42px;
    height: 42px;
    font-size: 19px;
    touch-action: none;
  }
  .carousel-controls {
    margin-top: 14px;
  }
  .carousel-dots {
    gap: 5px;
    max-width: calc(100% - 112px);
    overflow: hidden;
  }
  .carousel-dots button {
    width: 20px;
    height: 36px;
    flex: 0 0 20px;
  }
  .carousel-arrows button {
    width: 44px;
    height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .carousel .example-grid,
  .carousel .sample-compare img {
    transition: none;
  }
  .carousel .sample-compare:hover img {
    transform: scale(1) !important;
  }
  .carousel .example-card.is-current .sample-compare {
    animation: none;
  }
}

@keyframes mobile-carousel-settle {
  from {
    opacity: 0.94;
    transform: scale(0.992);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
