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

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

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

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

.pt__bar {
  display: grid;
  gap: 8px;
  background: #17141a;
  padding: 8px 12px;
}

.pt__tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.pt__tool {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  cursor: pointer;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.56);
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 10px);
  line-height: 1.3;
  padding: 4px 8px;
}

.pt__tool[aria-pressed=true] {
  color: #ffffff;
}

.pt__tool:focus-visible {
  outline: 3px solid #2f6df6;
  outline-offset: 2px;
}

.pt__ico {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.pt__mark {
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 2px;
  height: 3px;
  border-radius: 999px;
  background: #ffd23f;
  opacity: 0;
}

.pt__tool[aria-pressed=true] .pt__mark {
  opacity: 1;
}

.pt__opts {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pt__swatches, .pt__widths {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pt__widths {
  margin-left: auto;
}

.pt__swatch {
  width: 16px;
  height: 16px;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
}

.pt__swatch--ink {
  background: #17141a;
}

.pt__swatch--blue {
  background: #2f6df6;
}

.pt__swatch--red {
  background: #c2361a;
}

.pt__swatch[aria-pressed=true] {
  border-color: #ffffff;
}

.pt__width {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  cursor: pointer;
  border: 0;
  background: transparent;
  border-radius: 50%;
}

.pt__width[aria-pressed=true] {
  background: rgba(255, 255, 255, 0.2);
}

.pt__dot {
  display: block;
  border-radius: 50%;
  background: #ffffff;
}

.pt__dot--s {
  width: 3px;
  height: 3px;
}

.pt__dot--m {
  width: 6px;
  height: 6px;
}

.pt__dot--l {
  width: 9px;
  height: 9px;
}

.pt__wipe {
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: transparent;
  color: #ffffff;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 10px);
  line-height: 1.3;
  padding: 4px 8px;
}

.pt__swatch:focus-visible, .pt__width:focus-visible, .pt__wipe:focus-visible {
  outline: 3px solid #2f6df6;
  outline-offset: 2px;
}

.pt__pad {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  aspect-ratio: 300/104;
  touch-action: none;
}

.pt__sample {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 12%;
  margin: 0;
  white-space: nowrap;
  font-weight: 700;
  font-size: clamp(10px, 2.6vw, 12px);
  line-height: 1.4;
  color: rgba(23, 20, 26, 0.82);
}

.pt__ink, .pt__ghost {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pt__ghost {
  display: none;
  fill: none;
}

.pt__band {
  display: none;
  position: absolute;
  left: 6%;
  top: 11%;
  width: 58%;
  height: 17%;
  background: #ffd23f;
  mix-blend-mode: multiply;
  clip-path: inset(0 100% 0 0);
}

.pt__stroke {
  stroke: #17141a;
  stroke-width: 14;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

.pt__rub {
  fill: rgba(23, 20, 26, 0.12);
  stroke: rgba(23, 20, 26, 0.55);
  stroke-width: 2;
  opacity: 0;
}

.pt.is-demo .pt__ink {
  visibility: hidden;
}

.pt.is-demo .pt__ghost {
  display: block;
}

.pt.is-demo .pt__band {
  display: block;
}

.pt.is-demo .pt__band,
.pt.is-demo .pt__stroke,
.pt.is-demo .pt__rub,
.pt.is-demo .pt__mark {
  animation-duration: 2s;
  animation-iteration-count: infinite;
}

.pt.is-demo .pt__band {
  animation-name: ptBand;
  animation-timing-function: ease-out;
}

.pt.is-demo .pt__stroke {
  animation-name: ptStroke;
  animation-timing-function: ease-out;
}

.pt.is-demo .pt__rub {
  animation-name: ptRub;
  animation-timing-function: linear;
}

.pt.is-demo .pt__mark {
  animation-timing-function: steps(1, end);
}

.pt.is-demo .pt__tool--pen .pt__mark {
  animation-name: ptPickPen;
}

.pt.is-demo .pt__tool--hl .pt__mark {
  animation-name: ptPickHl;
}

.pt.is-demo .pt__tool--er .pt__mark {
  animation-name: ptPickEr;
}

@keyframes ptBand {
  0%, 4% {
    clip-path: inset(0 100% 0 0);
  }
  30%, 80% {
    clip-path: inset(0 0 0 0);
  }
  94%, 100% {
    clip-path: inset(0 100% 0 0);
  }
}
@keyframes ptStroke {
  0%, 44% {
    stroke-dashoffset: 100;
  }
  50%, 62% {
    stroke-dashoffset: 0;
  }
  78%, 100% {
    stroke-dashoffset: -100;
  }
}
@keyframes ptRub {
  0%, 56% {
    opacity: 0;
    transform: translate(16px, 80px);
  }
  58%, 62% {
    opacity: 1;
    transform: translate(16px, 80px);
  }
  78% {
    opacity: 1;
    transform: translate(284px, 80px);
  }
  82% {
    opacity: 1;
    transform: translate(284px, 24px);
  }
  93% {
    opacity: 1;
    transform: translate(20px, 24px);
  }
  94%, 100% {
    opacity: 0;
    transform: translate(16px, 80px);
  }
}
@keyframes ptPickHl {
  0%, 33% {
    opacity: 1;
  }
  34%, 93% {
    opacity: 0;
  }
  94%, 100% {
    opacity: 1;
  }
}
@keyframes ptPickPen {
  0%, 33% {
    opacity: 0;
  }
  34%, 55% {
    opacity: 1;
  }
  56%, 100% {
    opacity: 0;
  }
}
@keyframes ptPickEr {
  0%, 55% {
    opacity: 0;
  }
  56%, 93% {
    opacity: 1;
  }
  94%, 100% {
    opacity: 0;
  }
}
.pt.is-demo .pt__tool--pen,
.pt.is-demo .pt__tool--er {
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

.pt.is-demo .pt__tool--pen {
  animation-name: ptPressPen;
}

.pt.is-demo .pt__tool--er {
  animation-name: ptPressEr;
}

@keyframes ptPressPen {
  0%, 32% {
    transform: scale(1);
  }
  35% {
    transform: scale(0.9);
  }
  40%, 100% {
    transform: scale(1);
  }
}
@keyframes ptPressEr {
  0%, 54% {
    transform: scale(1);
  }
  57% {
    transform: scale(0.9);
  }
  62%, 100% {
    transform: scale(1);
  }
}
@media (max-width: 340px) {
  .pt__bar {
    gap: 4px;
    padding: 4px 8px;
  }
  .pt__opts {
    gap: 4px;
  }
  .pt__sample {
    left: 6%;
    right: 6%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pt.is-demo .pt__band,
  .pt.is-demo .pt__stroke,
  .pt.is-demo .pt__rub,
  .pt.is-demo .pt__mark,
  .pt.is-demo .pt__tool--pen,
  .pt.is-demo .pt__tool--er {
    animation: none !important;
  }
  .pt.is-demo .pt__band {
    clip-path: inset(0 0 0 0) !important;
  }
  .pt.is-demo .pt__stroke {
    stroke-dashoffset: 0 !important;
  }
  .pt.is-demo .pt__rub {
    opacity: 0 !important;
  }
  .pt.is-demo .pt__tool--hl .pt__mark,
  .pt.is-demo .pt__tool--er .pt__mark {
    opacity: 0 !important;
  }
  .pt.is-demo .pt__tool--pen .pt__mark {
    opacity: 1 !important;
  }
}
