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

.pk {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 340px;
}

.pk__hint {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-weight: 700;
  font-size: clamp(10px, 2.8vw, 12px);
  color: #17141a;
}

.pk__ico {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #17141a;
}

.pk__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  border-radius: 16px;
  padding: 12px 16px 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 26%), #fff7e6;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -3px 0 rgba(23, 20, 26, 0.14);
}

.pk__lidWrap {
  position: relative;
  perspective: 520px;
  width: 100%;
}

.pk__mouth {
  height: clamp(44px, 12vw, 60px);
  border-radius: 8px;
  background: rgba(23, 20, 26, 0.92);
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.6), inset 0 -1px 0 rgba(255, 247, 230, 0.18);
}

.pk__lid {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  transform-origin: 50% 0;
  transform: rotateX(0deg);
  transition: transform 300ms cubic-bezier(0.2, 1.4, 0.4, 1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0) 40%), linear-gradient(180deg, #2f6df6, rgba(23, 20, 26, 0.35));
  box-shadow: 0 4px 8px rgba(23, 20, 26, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -4px 0 rgba(23, 20, 26, 0.4);
}

.pk__lidFace {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44%;
  height: 4px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(255, 247, 230, 0.6);
  box-shadow: 0 2px 0 rgba(23, 20, 26, 0.3);
}

.pk.is-open .pk__lid {
  transform: rotateX(-76deg);
}

.pk__neck {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-top: -4px;
  padding: 0 12px 8px;
}

.pk__stem {
  width: 12px;
  height: clamp(14px, 4vw, 18px);
  background: linear-gradient(90deg, rgba(23, 20, 26, 0.8), rgba(23, 20, 26, 0.45) 50%, rgba(23, 20, 26, 0.8));
  box-shadow: inset 0 1px 0 rgba(255, 247, 230, 0.25);
}

.pk__knob {
  position: relative;
  width: clamp(56px, 15vw, 68px);
  height: clamp(36px, 10vw, 44px);
  border: 0;
  border-radius: 12px;
  padding: 0;
  cursor: grab;
  touch-action: none;
  transform-origin: 50% 0;
  transform: translateY(calc(var(--pull, 0) * 1px)) scale(1, calc(1 + var(--pull, 0) / 220));
  background: radial-gradient(120% 140% at 30% 0%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 50%), #17141a;
  box-shadow: 0 6px 10px rgba(23, 20, 26, 0.4), inset 0 1px 0 rgba(255, 247, 230, 0.3), inset 0 -3px 0 rgba(0, 0, 0, 0.5);
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.pk.is-drag .pk__knob {
  transition: none;
  cursor: grabbing;
}

.pk__grip {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 8px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, rgba(255, 247, 230, 0.8) 0 4px, rgba(255, 247, 230, 0.25) 4px 8px);
}

.pk__state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 8px 0 4px;
}

.pk__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #17141a;
  background: transparent;
  transition: background 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pk.is-open .pk__dot {
  background: #17141a;
}

.pk__stateLock, .pk__stateOpen {
  font-weight: 800;
  font-size: clamp(10px, 2.6vw, 12px);
  line-height: 1.6;
  color: #17141a;
}

.pk:not(.is-open) .pk__stateOpen {
  display: none;
}

.pk.is-open .pk__stateLock {
  display: none;
}

.pk.is-demo .pk__knob {
  animation-name: pkKnob;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

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

.pk.is-demo .pk__stateLock, .pk.is-demo .pk__stateOpen {
  display: inline;
}

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

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

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

@keyframes pkKnob {
  0%, 5% {
    transform: translateY(0) scale(1, 1);
  }
  14% {
    transform: translateY(44px) scale(0.93, 1.26);
  }
  19% {
    transform: translateY(44px) scale(0.93, 1.26);
  }
  23% {
    transform: translateY(44px) scale(1, 1);
  }
  43%, 100% {
    transform: translateY(0) scale(1, 1);
  }
}
@keyframes pkLid {
  0%, 26% {
    transform: rotateX(0deg);
  }
  38%, 76% {
    transform: rotateX(-76deg);
  }
  88%, 100% {
    transform: rotateX(0deg);
  }
}
@keyframes pkLockCut {
  0%, 25% {
    opacity: 1;
  }
  26%, 87% {
    opacity: 0;
  }
  88%, 100% {
    opacity: 1;
  }
}
@keyframes pkOpenCut {
  0%, 25% {
    opacity: 0;
  }
  26%, 87% {
    opacity: 1;
  }
  88%, 100% {
    opacity: 0;
  }
}
@keyframes pkDotCut {
  0%, 25% {
    background: transparent;
  }
  26%, 87% {
    background: #17141a;
  }
  88%, 100% {
    background: transparent;
  }
}
@media (max-width: 340px) {
  .pk {
    gap: 0;
  }
  .pk__body {
    padding: 4px 12px 4px;
  }
  .pk__mouth {
    height: 36px;
  }
  .pk__state {
    margin: 4px 0 0;
  }
  .pk__stem {
    height: 8px;
  }
  .pk__knob {
    height: 32px;
  }
  .pk__neck {
    padding: 0 12px 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pk.is-demo .pk__knob {
    animation: none !important;
  }
  .pk.is-demo .pk__lid {
    animation: none !important;
  }
  .pk.is-demo .pk__stateLock {
    animation: none !important;
  }
  .pk.is-demo .pk__stateOpen {
    animation: none !important;
  }
  .pk.is-demo .pk__dot {
    animation: none !important;
  }
  .pk__knob {
    transition: none !important;
  }
  .pk__lid {
    transition: none !important;
  }
  .pk__dot {
    transition: none !important;
  }
}
