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

.stage {
  padding: clamp(8px, 2.4vw, 16px);
}

.card {
  position: relative;
  width: min(160px, 50vw);
  aspect-ratio: 8/5;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  padding: 12px;
  box-sizing: border-box;
  outline: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ring__rect {
  fill: none;
  stroke: #2f6df6;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
  transition: stroke-dashoffset 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card__title {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: clamp(12px, 3.4vw, 14px);
  line-height: 1.3;
  font-family: inherit;
  color: #17141a;
}

.card__meta {
  margin: 0;
  font-weight: 500;
  font-size: clamp(11px, 3vw, 12px);
  line-height: 1.3;
  font-family: inherit;
  color: rgba(23, 20, 26, 0.6);
}

.card:hover .ring__rect,
.card:focus-visible .ring__rect,
.card:active .ring__rect {
  stroke-dashoffset: 0;
}

.card.is-demo .ring__rect {
  animation: ring-loop 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

@keyframes ring-loop {
  0%, 10% {
    stroke-dashoffset: 500;
  }
  55%, 80% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: 500;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ring__rect {
    transition: none;
  }
  .card.is-demo .ring__rect {
    animation: none;
    stroke-dashoffset: 0;
  }
}
