@property --reveal {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 50%;
}
html, body {
  margin: 0;
  overflow: hidden;
}

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

.track {
  display: flex;
  gap: 12px;
  width: 260px;
  max-width: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border-radius: 16px;
}

.ba {
  position: relative;
  flex: 0 0 200px;
  aspect-ratio: 4/3;
  scroll-snap-align: center;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  touch-action: pan-x;
  --reveal: 50%;
}

.ba.is-active {
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32), 0 0 0 4px #fff7e6;
  cursor: ew-resize;
}

.ba__after,
.ba__before {
  position: absolute;
  inset: 0;
}

.ba__after {
  background: linear-gradient(155deg, #2f6df6 0%, #fff7e6 100%);
}

.ba__before {
  background: linear-gradient(155deg, #17141a 0%, #2f6df6 70%);
  clip-path: inset(0 calc(100% - var(--reveal)) 0 0);
}

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

.ba.is-demo[data-i="2"] {
  animation-delay: -0.6s;
}

.ba.is-demo[data-i="3"] {
  animation-delay: -1.2s;
}

@keyframes reveal-loop {
  0%, 8% {
    --reveal: 20%;
  }
  50% {
    --reveal: 80%;
  }
  92%, 100% {
    --reveal: 20%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ba.is-demo {
    animation: none;
    --reveal: 50%;
  }
}
