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

.bg {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 100%;
}

.bg__scene {
  --px: 0.5;
  position: relative;
  overflow: hidden;
  width: 100%;
  height: clamp(110px, 32vh, 160px);
  border: 3px solid #17141a;
  border-radius: 16px;
  background: #ffd23f;
}

.bg__sky::before, .bg__sky::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: #ffffff;
  opacity: 0.9;
}

.bg__sky::before {
  width: 34px;
  height: 34px;
  left: 12%;
  top: 16%;
}

.bg__sky::after {
  width: 22px;
  height: 22px;
  left: 24%;
  top: 30%;
}

.bg__sun {
  position: absolute;
  right: 10%;
  top: 12%;
  display: flex;
  align-items: center;
  gap: 8px;
  width: clamp(44px, 12vw, 56px);
  height: clamp(44px, 12vw, 56px);
  box-sizing: border-box;
  background: #ffffff;
  border: 3px solid #17141a;
  border-radius: 50%;
}

.bg__eye {
  position: relative;
  overflow: hidden;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border: 2px solid #17141a;
  border-radius: 50%;
}

.bg__pupil {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  background: #17141a;
  border-radius: 50%;
}

.bg__mouth {
  position: absolute;
  left: 50%;
  bottom: 22%;
  width: 14px;
  height: 6px;
  margin-left: -7px;
  border-bottom: 3px solid #17141a;
  border-radius: 0 0 999px 999px;
}

.bg__hill {
  position: absolute;
  left: -8%;
  right: -8%;
  border-radius: 999px 999px 0 0;
}

.bg__hill--far {
  bottom: 26%;
  height: 34%;
  background: #fff7e6;
  opacity: 0.9;
}

.bg__hill--mid {
  bottom: 12%;
  height: 30%;
  background: #ff4d1f;
  border: 3px solid #17141a;
  border-bottom: 0;
}

.bg__grass {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-evenly;
  align-items: flex-end;
  height: 26%;
}

.bg__blade {
  width: 7px;
  border-radius: 999px 999px 0 0;
  background: #17141a;
  transform-origin: 50% 100%;
  transform: skewX(calc((0.5 - var(--px)) * 26deg));
}

.bg__blade:nth-child(odd) {
  height: 100%;
}

.bg__blade:nth-child(even) {
  height: 74%;
}

.bg__hint {
  margin: 0;
  color: #17141a;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 11px);
}

.bg.is-demo .bg__hill--far {
  animation: bgFar 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.bg.is-demo .bg__hill--mid {
  animation: bgMid 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.bg.is-demo .bg__grass {
  animation: bgNear 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.bg.is-demo .bg__blade {
  animation: bgLean 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.bg.is-demo .bg__pupil {
  animation: bgPeek 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

@keyframes bgFar {
  0%, 4% {
    transform: translate3d(5px, 0, 0);
  }
  34% {
    transform: translate3d(-5px, 0, 0);
  }
  44%, 50% {
    transform: translate3d(-5px, 0, 0);
  }
  80% {
    transform: translate3d(5px, 0, 0);
  }
  88%, 100% {
    transform: translate3d(5px, 0, 0);
  }
}
@keyframes bgMid {
  0%, 4% {
    transform: translate3d(11px, 0, 0);
  }
  34% {
    transform: translate3d(-11px, 0, 0);
  }
  44%, 50% {
    transform: translate3d(-11px, 0, 0);
  }
  80% {
    transform: translate3d(11px, 0, 0);
  }
  88%, 100% {
    transform: translate3d(11px, 0, 0);
  }
}
@keyframes bgNear {
  0%, 4% {
    transform: translate3d(17px, 0, 0);
  }
  34% {
    transform: translate3d(-17px, 0, 0);
  }
  44%, 50% {
    transform: translate3d(-17px, 0, 0);
  }
  80% {
    transform: translate3d(17px, 0, 0);
  }
  88%, 100% {
    transform: translate3d(17px, 0, 0);
  }
}
@keyframes bgLean {
  0%, 4% {
    transform: skewX(-13deg);
  }
  34% {
    transform: skewX(13deg);
  }
  44%, 50% {
    transform: skewX(13deg);
  }
  80% {
    transform: skewX(-13deg);
  }
  88%, 100% {
    transform: skewX(-13deg);
  }
}
@keyframes bgPeek {
  0%, 4% {
    transform: translate3d(-3.5px, 0, 0);
  }
  34% {
    transform: translate3d(3.5px, 0, 0);
  }
  44%, 50% {
    transform: translate3d(3.5px, 0, 0);
  }
  80% {
    transform: translate3d(-3.5px, 0, 0);
  }
  88%, 100% {
    transform: translate3d(-3.5px, 0, 0);
  }
}
@media (max-width: 340px) {
  .bg {
    gap: 8px;
  }
  .bg__scene {
    height: clamp(96px, 28vh, 130px);
  }
  .bg__sun {
    right: 6%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bg.is-demo .bg__hill--far,
  .bg.is-demo .bg__hill--mid,
  .bg.is-demo .bg__grass,
  .bg.is-demo .bg__blade,
  .bg.is-demo .bg__pupil {
    animation: none !important;
  }
  .bg.is-demo .bg__blade {
    transform: skewX(0deg) !important;
  }
}
