html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ffffff;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.tm {
  width: min(340px, 82vw);
  overflow: hidden;
}

.tm__viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border-radius: 16px;
  scrollbar-width: none;
}
.tm__viewport::-webkit-scrollbar {
  display: none;
}

.tm__viewport::scroll-marker-group {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.tm__track {
  display: flex;
  width: 400%;
}

.tm__slide {
  flex: 0 0 25%;
  scroll-snap-align: start;
  aspect-ratio: 16/10;
  margin-right: 12px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: end start;
  box-sizing: border-box;
  background: linear-gradient(135deg, var(--thumb), color-mix(in srgb, var(--thumb) 55%, white));
}
.tm__slide::scroll-marker {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--thumb);
  border: 2px solid transparent;
  box-sizing: border-box;
  transition: border-color 300ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tm__slide::scroll-marker:target-current {
  border-color: #fff7e6;
  transform: scale(1.12);
}

.tm__slide--clone::scroll-marker {
  display: none;
}

.tm__slide:last-child {
  margin-right: 0;
}

.tm__slide::before {
  content: "";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
}

.tm__slide::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -6%;
  height: 48%;
  background: rgba(23, 20, 26, 0.22);
  clip-path: polygon(0% 100%, 20% 40%, 40% 66%, 58% 26%, 76% 60%, 100% 34%, 100% 100%);
}

.tm__cap {
  position: relative;
  z-index: 1;
  margin: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.38);
  color: #fff7e6;
  font-weight: 600;
  font-size: clamp(12px, 3.2vw, 13px);
  line-height: 1;
  font-family: inherit;
}

.tm.is-demo .tm__track {
  animation: tm-loop 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

@keyframes tm-loop {
  0%, 8% {
    transform: translateX(0%);
  }
  31%, 39% {
    transform: translateX(calc(-25% - 12px));
  }
  62%, 70% {
    transform: translateX(calc(-50% - 24px));
  }
  92%, 100% {
    transform: translateX(calc(-75% - 36px));
  }
}
@media (prefers-reduced-motion: reduce) {
  .tm.is-demo .tm__track {
    animation: none !important;
  }
  .tm__slide::scroll-marker {
    transition: none;
  }
}
