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

.px {
  position: relative;
  box-sizing: border-box;
  width: min(320px, 92vw);
  border-radius: 16px;
  background: #fff7e6;
  color: #17141a;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  overflow: hidden;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.px__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
}

.px__title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.px__attr {
  margin: 0;
  font-size: 10px;
  line-height: 1.3;
  color: rgba(23, 20, 26, 0.72);
}
.px__attr code {
  font-family: "Consolas", "Menlo", monospace;
}

.px__view {
  position: relative;
  height: 168px;
  overflow-y: auto;
  background: #231f28;
  outline: none;
}

.px__scene {
  position: sticky;
  top: 0;
  height: 100%;
}

.px__spacer {
  height: 120px;
}

.px__layer {
  position: absolute;
  will-change: transform;
}

.px__layer--stars {
  inset: -24px 0;
  background-image: radial-gradient(circle 1.5px at 12px 12px, rgba(255, 247, 230, 0.9) 99%, transparent 100%), radial-gradient(circle 1px at 30px 26px, rgba(255, 247, 230, 0.5) 99%, transparent 100%), radial-gradient(circle 2px at 36px 8px, rgba(255, 247, 230, 0.75) 99%, transparent 100%);
  background-size: 44px 44px;
}
.px__layer--stars::after {
  content: "";
  position: absolute;
  top: 44px;
  right: 32px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 247, 230, 0.92);
  box-shadow: 0 0 12px rgba(255, 247, 230, 0.4);
}

.px__layer--hills {
  inset: -44px 0;
}
.px__layer--hills .px__hills {
  position: absolute;
  bottom: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 132px;
}
.px__layer--hills .px__hill--back {
  fill: #2f6df6;
}
.px__layer--hills .px__hill--front {
  fill: #0a4fe8;
}

.px__layer--type {
  inset: -72px 0;
  display: grid;
  place-items: center;
}

.px__word {
  margin: 32px 0 0;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.14em;
  color: #fff7e6;
}

.px__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid rgba(23, 20, 26, 0.12);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}
.px__foot b {
  color: #c93000;
}

.px__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #2f6df6;
}

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

.px.is-demo .px__layer--stars {
  animation-name: px-far;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}
.px.is-demo .px__layer--hills {
  animation-name: px-mid;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}
.px.is-demo .px__layer--type {
  animation-name: px-near;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}
.px.is-demo .px__dot {
  animation-name: px-blink;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes px-far {
  0%, 8% {
    transform: translate3d(0, 0, 0);
  }
  36%, 56% {
    transform: translate3d(0, -14.4px, 0);
  }
  82%, 100% {
    transform: translate3d(0, 0, 0);
  }
}
@keyframes px-mid {
  0%, 8% {
    transform: translate3d(0, 0, 0);
  }
  36%, 56% {
    transform: translate3d(0, -36px, 0);
  }
  82%, 100% {
    transform: translate3d(0, 0, 0);
  }
}
@keyframes px-near {
  0%, 8% {
    transform: translate3d(0, 0, 0);
  }
  36%, 56% {
    transform: translate3d(0, -66px, 0);
  }
  82%, 100% {
    transform: translate3d(0, 0, 0);
  }
}
@keyframes px-blink {
  0% {
    background: rgba(23, 20, 26, 0.2);
  }
  36% {
    background: #2f6df6;
  }
  86% {
    background: rgba(23, 20, 26, 0.2);
  }
}
@media (max-width: 340px) {
  .px {
    width: 100%;
  }
  .px__head,
  .px__foot {
    padding: 4px 8px;
  }
  .px__view {
    height: 112px;
  }
  .px__word {
    margin-top: 28px;
    font-size: 24px;
  }
  .px__layer--hills .px__hills {
    height: 100px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .px__layer {
    transition: none !important;
  }
  .px.is-demo .px__layer,
  .px.is-demo .px__dot {
    animation: none !important;
  }
  .px.is-demo .px__layer {
    transform: none !important;
  }
  .px.is-demo .px__dot {
    background: #2f6df6 !important;
  }
}
