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

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

.physkey {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.physkey__well {
  position: relative;
  box-sizing: border-box;
  width: clamp(180px, 56vw, 236px);
  padding: 8px;
  border-radius: 12px;
  background: linear-gradient(180deg, #c3c8d4, #d7dbe4 30%, #e3e6ec);
  box-shadow: inset 0 2px 5px rgba(23, 20, 26, 0.3);
}

.physkey__wall {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  height: 8px;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(180deg, #5067a2, #475b90);
  transform-origin: 50% 0;
  animation: wallPress 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.physkey__cap {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #b5c0da 0%, #2f6df6 28%, #5d74af 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: clamp(13px, 3.2vw, 16px);
  line-height: 1;
  font-family: inherit;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.25);
  cursor: pointer;
  animation: capPress 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.physkey__cap:focus-visible {
  outline: 3px solid #5d74af;
  outline-offset: 3px;
}

.physkey__label {
  font-family: inherit;
}

.physkey__cap svg {
  width: 1.1em;
  height: 1.1em;
}

.physkey__caption {
  margin: 0;
  color: #5c5048;
  font-weight: 700;
  font-size: clamp(11px, 2.8vw, 13px);
  line-height: 1;
  font-family: inherit;
}

@keyframes capPress {
  0%, 12% {
    transform: translateY(0);
  }
  32%, 46% {
    transform: translateY(8px);
  }
  62% {
    transform: translateY(-3px);
  }
  76%, 100% {
    transform: translateY(0);
  }
}
@keyframes wallPress {
  0%, 12% {
    transform: scaleY(1);
  }
  32%, 46% {
    transform: scaleY(0.25);
  }
  62% {
    transform: scaleY(1.1);
  }
  76%, 100% {
    transform: scaleY(1);
  }
}
@media (max-width: 340px), (max-height: 220px) {
  .physkey__well {
    padding: 4px;
    width: 188px;
  }
  .physkey__wall {
    left: 4px;
    right: 4px;
    top: 4px;
    height: 8px;
  }
  .physkey__caption {
    display: none;
  }
  .physkey {
    gap: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .physkey__cap {
    animation: none !important;
  }
  .physkey__wall {
    animation: none !important;
  }
}
