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);
}

.ct {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: clamp(280px, 86vw, 384px);
  padding: 16px;
  padding-bottom: 48px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.ct__label {
  margin: 0;
  color: #5b5566;
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  font-family: inherit;
}

.ct__field {
  display: flex;
  gap: 8px;
}

.ct__url {
  flex: 1 1 auto;
  box-sizing: border-box;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #ddd6ca;
  border-radius: 12px;
  background: #fdf8f0;
  color: #15131a;
  font-weight: 500;
  font-size: 12px;
  line-height: 1;
  font-family: inherit;
}

.ct__url:focus-visible {
  outline: 2px solid #477690;
  outline-offset: 1px;
}

.ct__btn {
  flex: 0 0 auto;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: #15131a;
  color: #ffffff;
  cursor: pointer;
  transition: transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1), background-color 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.ct__btn:focus-visible {
  outline: 2px solid #15131a;
  outline-offset: 2px;
}

.ct__ics {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
}

.ct__ic {
  grid-area: 1/1;
  display: grid;
  place-items: center;
  opacity: 0;
}

.ct__ic svg {
  display: block;
}

.ct__ic--copy {
  opacity: 1;
}

.ct__btnLabel {
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  font-family: inherit;
}

.ct.is-done .ct__btn {
  background: #479074;
}

.ct.is-done .ct__ic--copy {
  opacity: 0;
}

.ct.is-done .ct__ic--done {
  opacity: 1;
}

.ct__toast {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: #15131a;
  color: #ffffff;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.2;
  font-family: inherit;
  transform: translateY(120%);
  transition: transform 300ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.ct.is-done .ct__toast {
  transform: translateY(0);
}

.ct__toastIc {
  grid-area: 1/1;
  display: grid;
  place-items: center;
  color: #b5dbcb;
}

.ct__toastIcs {
  flex: 0 0 auto;
  display: grid;
  width: 16px;
  height: 16px;
}

.ct__toastIc--bad {
  color: #ffb3a0;
  opacity: 0;
}

.ct.is-bad .ct__toastIc--ok {
  opacity: 0;
}

.ct.is-bad .ct__toastIc--bad {
  opacity: 1;
}

.ct__toastIc svg {
  display: block;
}

.ct__toast::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: #b5dbcb;
  transform: scaleX(0);
  transform-origin: left center;
}

.is-demo .ct__btn {
  animation-name: ctPress;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

.is-demo .ct__ic {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.is-demo .ct__ic--copy {
  animation-name: ctIcCopy;
}

.is-demo .ct__ic--done {
  animation-name: ctIcDone;
}

.is-demo .ct__toast {
  animation-name: ctRise;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

.is-demo .ct__toast::after {
  animation-name: ctDrain;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes ctPress {
  0%, 6% {
    transform: scale(1);
    background-color: #15131a;
  }
  10% {
    transform: scale(0.94);
    background-color: #15131a;
  }
  16%, 100% {
    transform: scale(1);
    background-color: #479074;
  }
}
@keyframes ctIcCopy {
  0%, 13.9% {
    opacity: 1;
  }
  14%, 100% {
    opacity: 0;
  }
}
@keyframes ctIcDone {
  0%, 13.9% {
    opacity: 0;
  }
  14%, 100% {
    opacity: 1;
  }
}
@keyframes ctRise {
  0%, 14% {
    transform: translateY(120%);
  }
  30%, 100% {
    transform: translateY(0);
  }
}
@keyframes ctDrain {
  0%, 30% {
    transform: scaleX(1);
  }
  96%, 100% {
    transform: scaleX(0.04);
  }
}
@media (max-width: 340px), (max-height: 220px) {
  .ct {
    gap: 4px;
    padding: 12px;
    padding-bottom: 40px;
  }
  .ct__url {
    height: 36px;
    padding: 0 8px;
    font-size: 11px;
  }
  .ct__btn {
    height: 36px;
    padding: 0 8px;
  }
  .ct__toast {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 8px;
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .is-demo .ct__btn, .is-demo .ct__ic, .is-demo .ct__toast, .is-demo .ct__toast::after {
    animation: none !important;
  }
  .ct__btn, .ct__toast {
    transition: none !important;
  }
  .ct.is-done .ct__toast {
    transform: translateY(0);
  }
  .ct__toast::after {
    transform: scaleX(1);
  }
}
