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

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

.ta {
  box-sizing: border-box;
  width: min(300px, 92vw);
  padding: 12px;
  border-radius: 16px;
  background: #fff7e6;
  color: #17141a;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}

.ta * {
  box-sizing: border-box;
}

.ta__all {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(23, 20, 26, 0.12);
}

.ta__ic {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #17141a;
}

.ta__ic svg {
  width: 100%;
  height: 100%;
}

.ta__allText {
  margin-right: auto;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
}

.ta__switch {
  position: relative;
  flex: 0 0 auto;
  width: 30px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background-color: rgba(23, 20, 26, 0.2);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background-color 220ms ease-out;
}
.ta__switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff7e6;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ta__switch:checked {
  background-color: #17141a;
}
.ta__switch:checked::after {
  transform: translateX(14px);
}
.ta__switch:indeterminate {
  background-color: rgba(23, 20, 26, 0.45);
}
.ta__switch:focus-visible {
  outline: 2px solid #17141a;
  outline-offset: 2px;
}

.ta__list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.ta__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ta__row:nth-child(1) {
  --i: 0;
}

.ta__row:nth-child(2) {
  --i: 1;
}

.ta__row:nth-child(3) {
  --i: 2;
}

.ta__row:nth-child(4) {
  --i: 3;
}

.ta__box {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.ta__mark {
  position: relative;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(23, 20, 26, 0.26);
  border-radius: 4px;
  color: #fff7e6;
  cursor: pointer;
}
.ta__mark::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background-color: #17141a;
  transform: scale(0);
  transition: transform 220ms ease-out;
  transition-delay: calc(var(--i, 0) * 60ms);
}

.ta__mark svg {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
}

.ta__tick {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 300ms ease-out;
  transition-delay: calc(var(--i, 0) * 60ms);
}

.ta__box:checked ~ .ta__mark::before {
  transform: scale(1);
}

.ta__box:checked ~ .ta__mark .ta__tick {
  stroke-dashoffset: 0;
}

.ta__box:focus-visible ~ .ta__mark {
  outline: 2px solid #17141a;
  outline-offset: 2px;
}

.ta__text {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
}

@keyframes taFill {
  0% {
    transform: scale(0);
    animation-timing-function: steps(1, end);
  }
  6% {
    transform: scale(0);
    animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  }
  10% {
    transform: scale(1);
    animation-timing-function: steps(1, end);
  }
  46% {
    transform: scale(1);
    animation-timing-function: linear;
  }
  80%, 100% {
    transform: scale(0);
  }
}
@keyframes taDraw {
  0%, 10% {
    stroke-dashoffset: 1;
  }
  24%, 46% {
    stroke-dashoffset: 0;
  }
  66%, 100% {
    stroke-dashoffset: 1;
  }
}
@keyframes taSwitchOn {
  0% {
    background-color: rgba(23, 20, 26, 0.2);
  }
  2%, 70% {
    background-color: #17141a;
  }
  84%, 100% {
    background-color: rgba(23, 20, 26, 0.2);
  }
}
@keyframes taThumb {
  0%, 2% {
    transform: translateX(0);
  }
  10%, 70% {
    transform: translateX(14px);
  }
  80%, 100% {
    transform: translateX(0);
  }
}
.ta.is-demo .ta__switch {
  animation-name: taSwitchOn;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}
.ta.is-demo .ta__switch::after {
  animation-name: taThumb;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}
.ta.is-demo .ta__mark::before {
  animation-name: taFill;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.ta.is-demo .ta__tick {
  animation-name: taDraw;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
  animation-delay: calc(var(--i, 0) * 60ms);
}

@media (max-width: 340px) {
  .ta {
    padding: 8px;
  }
  .ta__all {
    padding-bottom: 8px;
  }
  .ta__list {
    gap: 4px;
    margin-top: 8px;
  }
  .ta__allText {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ta__switch,
  .ta__switch::after,
  .ta__tick,
  .ta__mark::before {
    transition: none !important;
  }
  .ta.is-demo .ta__switch,
  .ta.is-demo .ta__switch::after,
  .ta.is-demo .ta__mark::before,
  .ta.is-demo .ta__tick {
    animation: none !important;
  }
}
