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

.pack {
  width: min(440px, 94vw);
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 12px;
  row-gap: 8px;
}

.file {
  position: relative;
  border-radius: 16px;
  background: #fff7e6;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  overflow: hidden;
}

.file__head {
  padding: 4px 8px;
  border-bottom: 2px solid rgba(23, 20, 26, 0.12);
}

.file__name {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: clamp(10px, 2.4vw, 13px);
  font-weight: 700;
  color: #17141a;
}

.file__rows {
  list-style: none;
  margin: 0;
  padding: 4px 8px 8px;
  display: grid;
  row-gap: 4px;
}

.row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  column-gap: 4px;
  border-radius: 4px;
  padding: 0 4px;
  min-height: clamp(18px, 6vw, 28px);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: clamp(8.5px, 2vw, 12px);
}

.row__key {
  color: #0a4fe8;
  font-weight: 700;
  white-space: nowrap;
}

.row__val {
  color: #17141a;
  white-space: nowrap;
}

.row__val::before {
  content: attr(data-t);
}

.row__val--empty {
  flex: 1;
  min-height: 14px;
  border: 2px dashed rgba(194, 54, 26, 0.55);
  border-radius: 4px;
}

.miss-badge {
  position: absolute;
  right: -4px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border-radius: 50%;
  background: #c2361a;
  color: #fff;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  font-weight: 800;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
}

.pack__note {
  grid-column: 1/-1;
  margin: 0;
  justify-self: center;
  border-radius: 999px;
  background: #ffe0d8;
  color: #17141a;
  font-size: clamp(10px, 2.4vw, 13px);
  font-weight: 700;
  padding: 4px 12px;
}

.scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent 0 calc(50% - 8px), rgba(47, 109, 246, 0.28) calc(50% - 8px) calc(50% + 8px), transparent calc(50% + 8px) 100%);
  background-size: 100% 220%;
  opacity: 0;
}

.stage.is-demo .scan {
  animation: scan-down 2s ease-out infinite;
}

.stage.is-demo .row {
  animation: row-flash 2s linear infinite;
  animation-delay: calc(var(--i) * 0.12s);
}

.stage.is-demo .row--miss .row__val--empty {
  animation: empty-alarm 2s ease-out infinite;
}

.stage.is-demo .miss-badge {
  animation: miss-pop 2s ease-out infinite;
}

.stage.is-demo .pack__note {
  animation: note-in 2s ease-out infinite;
}

@keyframes scan-down {
  0% {
    opacity: 1;
    background-position: 0 -130%;
  }
  55% {
    opacity: 1;
    background-position: 0 130%;
  }
  60%, 100% {
    opacity: 0;
    background-position: 0 130%;
  }
}
@keyframes row-flash {
  0%, 4% {
    background: transparent;
  }
  13% {
    background: rgba(47, 109, 246, 0.24);
  }
  27%, 100% {
    background: transparent;
  }
}
@keyframes empty-alarm {
  0%, 42% {
    background: transparent;
  }
  50% {
    background: rgba(194, 54, 26, 0.3);
  }
  60% {
    background: rgba(194, 54, 26, 0.1);
  }
  68% {
    background: rgba(194, 54, 26, 0.3);
  }
  76% {
    background: rgba(194, 54, 26, 0.1);
  }
  84%, 100% {
    background: rgba(194, 54, 26, 0.24);
  }
}
@keyframes miss-pop {
  0%, 42% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.3) rotate(0deg);
    opacity: 1;
  }
  56% {
    transform: scale(1) rotate(0deg);
  }
  66% {
    transform: scale(1) rotate(7deg);
  }
  72% {
    transform: scale(1) rotate(-7deg);
  }
  78% {
    transform: scale(1) rotate(4deg);
  }
  84%, 96% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: scale(0.5);
    opacity: 0;
  }
}
@keyframes note-in {
  0%, 48% {
    transform: translateY(6px);
    opacity: 0;
  }
  58%, 94% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(6px);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stage.is-demo .scan,
  .stage.is-demo .row,
  .stage.is-demo .row--miss .row__val--empty,
  .stage.is-demo .miss-badge,
  .stage.is-demo .pack__note {
    animation: none;
  }
  .scan {
    opacity: 0;
  }
}
