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

.save {
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, 2.6vw, 12px);
  border: 0;
  border-radius: 12px;
  padding: clamp(12px, 4vw, 16px) clamp(18px, 5.6vw, 24px);
  font-weight: 700;
  font-size: clamp(14px, 4vw, 17px);
  line-height: 1;
  font-family: inherit;
  color: #17141a;
  background: #fff7e6;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.save__icon {
  position: relative;
  width: 24px;
  height: 24px;
  flex: none;
}
.save__ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: #2f6df6;
  opacity: 0;
  transform: scale(0.4);
}
.save__disk {
  position: absolute;
  inset: 0;
  border: 2.4px solid currentColor;
  border-radius: 4px;
  opacity: 1;
  transform: scale(1);
}
.save__disk::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 7px;
  height: 6px;
  background: currentColor;
}
.save__check {
  position: absolute;
  inset: 0;
  color: #fff7e6;
}
.save__check-bar {
  position: absolute;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
}
.save__check-bar--short {
  width: 6px;
  left: 8px;
  top: 14px;
  transform: rotate(225deg) scaleX(0);
}
.save__check-bar--long {
  width: 13px;
  left: 8px;
  top: 14px;
  transform: rotate(-52deg) scaleX(0);
}
.save.is-saved .save__ring {
  animation: ring-pop 300ms cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}
.save.is-saved .save__disk {
  animation: disk-out 300ms cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}
.save.is-saved .save__check-bar--short {
  animation: check-short 300ms cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
  animation-delay: 105ms;
}
.save.is-saved .save__check-bar--long {
  animation: check-long 300ms cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
  animation-delay: 150ms;
}
.save.is-demo .save__ring {
  animation: ring-pop-loop 2s cubic-bezier(0.2, 1.4, 0.4, 1) infinite;
}
.save.is-demo .save__disk {
  animation: disk-out-loop 2s cubic-bezier(0.2, 1.4, 0.4, 1) infinite;
}
.save.is-demo .save__check-bar--short {
  animation: check-short-loop 2s cubic-bezier(0.2, 1.4, 0.4, 1) infinite;
}
.save.is-demo .save__check-bar--long {
  animation: check-long-loop 2s cubic-bezier(0.2, 1.4, 0.4, 1) infinite;
}

@keyframes ring-pop {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes disk-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.5);
  }
}
@keyframes check-short {
  to {
    transform: rotate(225deg) scaleX(1);
  }
}
@keyframes check-long {
  to {
    transform: rotate(-52deg) scaleX(1);
  }
}
@keyframes ring-pop-loop {
  0%, 20% {
    opacity: 0;
    transform: scale(0.4);
  }
  40%, 85% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.4);
  }
}
@keyframes disk-out-loop {
  0%, 20% {
    opacity: 1;
    transform: scale(1);
  }
  40%, 85% {
    opacity: 0;
    transform: scale(0.5);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes check-short-loop {
  0%, 27% {
    transform: rotate(225deg) scaleX(0);
  }
  45%, 85% {
    transform: rotate(225deg) scaleX(1);
  }
  100% {
    transform: rotate(225deg) scaleX(0);
  }
}
@keyframes check-long-loop {
  0%, 32% {
    transform: rotate(-52deg) scaleX(0);
  }
  50%, 85% {
    transform: rotate(-52deg) scaleX(1);
  }
  100% {
    transform: rotate(-52deg) scaleX(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .save__ring, .save__disk, .save__check-bar {
    animation: none !important;
  }
  .save.is-saved .save__ring {
    opacity: 1;
    transform: scale(1);
  }
  .save.is-saved .save__disk {
    opacity: 0;
  }
  .save.is-saved .save__check-bar--short {
    transform: rotate(225deg) scaleX(1);
  }
  .save.is-saved .save__check-bar--long {
    transform: rotate(-52deg) scaleX(1);
  }
}
