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(260px, 70vw);
}

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

.tm__track {
  display: flex;
  width: max-content;
}

.tm__slide {
  flex: 0 0 min(260px, 70vw);
  aspect-ratio: 16/9;
  scroll-snap-align: start;
}

.tm__slide--1 {
  background: linear-gradient(135deg, #2f6df6, #d6ddeb);
}

.tm__slide--2 {
  background: linear-gradient(135deg, #ff4d1f, #ebdbd6);
}

.tm__slide--3 {
  background: linear-gradient(135deg, #c2ae82, #ffd23f);
}

.tm__thumbs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.tm__thumb {
  flex: 0 0 28px;
  aspect-ratio: 1/1;
  box-sizing: border-box;
  border-radius: 8px;
  border: 3px solid transparent;
  transition: border-color 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tm__thumb--1 {
  background: linear-gradient(135deg, #2f6df6, #d6ddeb);
}

.tm__thumb--2 {
  background: linear-gradient(135deg, #ff4d1f, #ebdbd6);
}

.tm__thumb--3 {
  background: linear-gradient(135deg, #c2ae82, #ffd23f);
}

.tm:has(#tm-s1:target) .tm__thumb--1,
.tm:has(#tm-s2:target) .tm__thumb--2,
.tm:has(#tm-s3:target) .tm__thumb--3 {
  border-color: #17141a;
}

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

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

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

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

@keyframes tm-track {
  0%, 8% {
    transform: translateX(0);
  }
  31%, 39% {
    transform: translateX(-25%);
  }
  62%, 70% {
    transform: translateX(-50%);
  }
  92%, 100% {
    transform: translateX(-75%);
  }
}
@keyframes tm-thumb-1 {
  0%, 4% {
    border-color: #17141a;
  }
  29%, 88% {
    border-color: transparent;
  }
  92%, 100% {
    border-color: #17141a;
  }
}
@keyframes tm-thumb-2 {
  0%, 29% {
    border-color: transparent;
  }
  33%, 62% {
    border-color: #17141a;
  }
  66%, 100% {
    border-color: transparent;
  }
}
@keyframes tm-thumb-3 {
  0%, 62% {
    border-color: transparent;
  }
  66%, 96% {
    border-color: #17141a;
  }
  100% {
    border-color: transparent;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tm.is-demo .tm__track,
  .tm.is-demo .tm__thumb--1,
  .tm.is-demo .tm__thumb--2,
  .tm.is-demo .tm__thumb--3 {
    animation: none !important;
  }
  .tm__viewport {
    scroll-behavior: auto;
  }
}
