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

.ex {
  display: flex;
  justify-content: center;
  width: 100%;
}

.ex__card {
  width: min(100%, 340px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  overflow: hidden;
}

.ex__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #17141a;
  padding: 8px 12px;
}

.ex__label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-weight: 800;
  font-size: clamp(9px, 2.4vw, 11px);
  line-height: 1.3;
  color: #ffffff;
}

.ex__ico {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.ex__btn {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: 1px solid #2f6df6;
  background: #2f6df6;
  color: #ffffff;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 10px);
  padding: 4px 8px;
  line-height: 1.3;
}

.ex__btn:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

.ex__body {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 8px;
  padding: 8px;
}

.ex__pad {
  position: relative;
  background: #fff7e6;
  border-radius: 8px;
  aspect-ratio: 200/100;
  touch-action: none;
  overflow: hidden;
}

.ex__ink, .ex__ghost {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ex__ghost {
  display: none;
}

.ex__stroke {
  fill: none;
  stroke: #17141a;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ex__crop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px dashed #2f6df6;
  border-radius: 4px;
  transition: inset 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ex__out {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ex__outLabel {
  font-weight: 800;
  font-size: 9px;
  line-height: 1.3;
  color: rgba(23, 20, 26, 0.72);
}

.ex__frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(23, 20, 26, 0.16);
  border-radius: 8px;
  overflow: hidden;
  background-color: #ffffff;
  background-image: repeating-conic-gradient(rgba(23, 20, 26, 0.1) 0% 25%, transparent 0% 50%);
  background-size: 12px 12px;
}

.ex__hint {
  padding: 0 4px;
  text-align: center;
  font-weight: 700;
  font-size: clamp(8px, 2.2vw, 9px);
  line-height: 1.3;
  color: rgba(23, 20, 26, 0.72);
}

.ex__img {
  display: none;
  max-width: 100%;
  max-height: 100%;
}

.ex.has-out .ex__img {
  display: block;
}

.ex.has-out .ex__hint {
  display: none;
}

.ex__thumb {
  display: none;
  position: absolute;
  inset: 4px;
}

.ex__thumb .ex__stroke {
  stroke-width: 6;
}

.ex__live {
  position: relative;
  margin: 0;
  padding: 0 12px 8px;
  font-weight: 700;
  font-size: clamp(8px, 2.2vw, 10px);
  line-height: 1.3;
  color: rgba(23, 20, 26, 0.72);
}

.ex__liveDemo {
  display: none;
  position: absolute;
  left: 12px;
  top: 0;
}

.ex.is-demo .ex__ink {
  visibility: hidden;
}

.ex.is-demo .ex__ghost {
  display: block;
}

.ex.is-demo .ex__thumb {
  display: block;
}

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

@keyframes exPress {
  0% {
    transform: scale(1);
  }
  4% {
    transform: scale(0.9);
  }
  10%, 100% {
    transform: scale(1);
  }
}
.ex.is-demo .ex__crop {
  animation-name: exCrop;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes exCrop {
  0%, 12% {
    inset: 0;
  }
  44%, 84% {
    inset: 19% 15% 16% 11%;
  }
  92%, 100% {
    inset: 0;
  }
}
.ex.is-demo .ex__thumb {
  animation-name: exShow, exPop, exWipe;
  animation-duration: 2s, 2s, 2s;
  animation-timing-function: steps(1, end), cubic-bezier(0.2, 1.4, 0.4, 1), ease-out;
  animation-iteration-count: infinite, infinite, infinite;
  animation-fill-mode: backwards, backwards, backwards;
}

@keyframes exShow {
  0%, 45% {
    opacity: 0;
  }
  46%, 100% {
    opacity: 1;
  }
}
@keyframes exPop {
  0%, 45% {
    transform: scale(0.86);
  }
  62%, 100% {
    transform: scale(1);
  }
}
@keyframes exWipe {
  0%, 70% {
    clip-path: inset(0 0 0 0);
  }
  84%, 100% {
    clip-path: inset(0 100% 0 0);
  }
}
.ex.is-demo .ex__hint {
  animation-name: exHint;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes exHint {
  0%, 45% {
    opacity: 1;
  }
  46%, 85% {
    opacity: 0;
  }
  86%, 100% {
    opacity: 1;
  }
}
.ex.is-demo .ex__liveReal {
  color: transparent;
}

.ex.is-demo .ex__liveDemo {
  display: block;
}

.ex.is-demo .ex__liveDemo--before {
  animation-name: exSayBefore;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.ex.is-demo .ex__liveDemo--after {
  animation-name: exSayAfter;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes exSayBefore {
  0%, 63% {
    opacity: 1;
  }
  64%, 93% {
    opacity: 0;
  }
  94%, 100% {
    opacity: 1;
  }
}
@keyframes exSayAfter {
  0%, 63% {
    opacity: 0;
  }
  64%, 93% {
    opacity: 1;
  }
  94%, 100% {
    opacity: 0;
  }
}
@media (max-width: 340px) {
  .ex__bar {
    padding: 4px 8px;
  }
  .ex__body {
    gap: 4px;
    padding: 4px;
  }
  .ex__live {
    padding: 0 8px 4px;
  }
  .ex__liveDemo {
    left: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ex.is-demo .ex__btn,
  .ex.is-demo .ex__crop,
  .ex.is-demo .ex__thumb,
  .ex.is-demo .ex__hint,
  .ex.is-demo .ex__liveDemo {
    animation: none !important;
  }
  .ex.is-demo .ex__crop {
    inset: 19% 15% 16% 11% !important;
  }
  .ex.is-demo .ex__thumb {
    opacity: 1 !important;
    transform: scale(1) !important;
    clip-path: inset(0 0 0 0) !important;
  }
  .ex.is-demo .ex__hint {
    opacity: 0 !important;
  }
  .ex.is-demo .ex__liveDemo--before {
    opacity: 0 !important;
  }
  .ex.is-demo .ex__liveDemo--after {
    opacity: 1 !important;
  }
}
