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

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

.btn {
  box-sizing: border-box;
  position: relative;
  width: 240px;
  height: 64px;
  border: none;
  border-radius: 999px;
  background: #fff7e6;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.btn__wash {
  position: absolute;
  inset: 0;
  background: #e2cec4;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn__labels {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.btn__t-on-dark,
.btn__t-on-light {
  grid-area: 1/1;
  transition: opacity 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn__t-on-dark {
  color: #fff7e6;
  opacity: 0;
}

.btn__t-on-light {
  color: #17141a;
}

.btn:hover .btn__wash {
  transform: scaleX(1);
}

.btn:hover .btn__t-on-dark {
  opacity: 1;
}

.btn:hover .btn__t-on-light {
  opacity: 0;
}

.btn:focus-visible {
  outline: 3px solid #17141a;
  outline-offset: 4px;
}

.stage.is-demo .btn__wash {
  animation: wash 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.stage.is-demo .btn__t-on-dark {
  animation: swap-in 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.stage.is-demo .btn__t-on-light {
  animation: swap-out 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

@keyframes wash {
  0%, 12% {
    transform: scaleX(0);
  }
  48%, 70% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(0);
  }
}
@keyframes swap-in {
  0%, 18% {
    opacity: 0;
  }
  48%, 70% {
    opacity: 1;
  }
  88%, 100% {
    opacity: 0;
  }
}
@keyframes swap-out {
  0%, 18% {
    opacity: 1;
  }
  48%, 70% {
    opacity: 0;
  }
  88%, 100% {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stage.is-demo .btn__wash {
    animation: none;
    transform: scaleX(1);
  }
  .stage.is-demo .btn__t-on-dark {
    animation: none;
    opacity: 1;
  }
  .stage.is-demo .btn__t-on-light {
    animation: none;
    opacity: 0;
  }
}
