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

.sa {
  box-sizing: border-box;
  display: grid;
  gap: 4px;
  width: min(280px, 92vw);
  padding: 8px;
  border-radius: 16px;
  background: #fff7e6;
  color: #17141a;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.sa * {
  box-sizing: border-box;
}

.sa__title {
  margin: 0;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.sa__skywrap {
  position: relative;
  height: 92px;
  border-radius: 12px;
  overflow: hidden;
}

.sa__band {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sa__band--morning {
  background: linear-gradient(180deg, #ffd9a3 0%, #ffeccc 100%);
  opacity: 0;
}

.sa__band--noon {
  background: linear-gradient(180deg, #bfe3ff 0%, #e8f4ff 100%);
  opacity: 0;
}

.sa__band--evening {
  background: linear-gradient(180deg, #ddc9b9 0%, #ffd9b8 100%);
  opacity: 0;
}

.sa.is-morning .sa__band--morning {
  opacity: 1;
}

.sa.is-noon .sa__band--noon {
  opacity: 1;
}

.sa.is-evening .sa__band--evening {
  opacity: 1;
}

.sa__arc {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 240px;
  height: 90px;
  margin-left: -120px;
}

.sa__sun {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 240px;
  height: 90px;
  margin-left: -120px;
  pointer-events: none;
  color: #ba9f72;
  offset-path: path("M 20 71 A 120 60 0 0 1 220 71");
  offset-distance: 57%;
  offset-rotate: 0deg;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 2px 2px rgba(23, 20, 26, 0.25));
}

.sa__rise, .sa__set {
  position: absolute;
  bottom: 4px;
  color: rgba(23, 20, 26, 0.72);
}

.sa__rise {
  left: 8px;
}

.sa__set {
  right: 8px;
}

.sa__ctrl {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}

.sa__lab {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  color: rgba(23, 20, 26, 0.72);
}

.sa__range {
  width: 100%;
  margin: 0;
  accent-color: #2f6df6;
}
.sa__range:focus-visible {
  outline: 2px solid #2f6df6;
  outline-offset: 2px;
}

.sa__time {
  min-width: 32px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@keyframes sa-travel {
  from {
    offset-distance: 0%;
  }
  to {
    offset-distance: 100%;
  }
}
@keyframes sa-morning {
  0%, 27% {
    opacity: 1;
  }
  28%, 100% {
    opacity: 0;
  }
}
@keyframes sa-noon {
  0%, 27% {
    opacity: 0;
  }
  28%, 65% {
    opacity: 1;
  }
  66%, 100% {
    opacity: 0;
  }
}
@keyframes sa-evening {
  0%, 65% {
    opacity: 0;
  }
  66%, 100% {
    opacity: 1;
  }
}
.sa.is-demo .sa__sun {
  animation-name: sa-travel;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}
.sa.is-demo .sa__band--morning {
  animation-name: sa-morning;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}
.sa.is-demo .sa__band--noon {
  animation-name: sa-noon;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}
.sa.is-demo .sa__band--evening {
  animation-name: sa-evening;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@media (max-width: 340px) {
  .sa {
    padding: 4px;
  }
  .sa__skywrap {
    height: 84px;
  }
  .sa__arc, .sa__sun {
    width: 216px;
    height: 81px;
    margin-left: -108px;
  }
  .sa__sun {
    offset-path: path("M 16 64 A 108 54 0 0 1 200 64");
  }
}
@media (prefers-reduced-motion: reduce) {
  .sa.is-demo .sa__sun,
  .sa.is-demo .sa__band {
    animation: none !important;
  }
  .sa.is-demo .sa__band--noon {
    opacity: 1 !important;
  }
}
