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

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

@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
@property --mx {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 50%;
}
@property --my {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 50%;
}
@property --sp {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
@property --rx {
  syntax: "<angle>";
  inherits: true;
  initial-value: 0deg;
}
@property --ry {
  syntax: "<angle>";
  inherits: true;
  initial-value: 0deg;
}
.card {
  position: relative;
  width: min(190px, 58vw);
  padding: 2px;
  border-radius: 16px;
  outline: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(120px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.32), transparent 70%);
  opacity: var(--sp);
}

.card__ring {
  position: absolute;
  inset: -50%;
  background: conic-gradient(from var(--angle), transparent 0deg, #2f6df6 40deg, transparent 100deg);
  opacity: 0;
  transition: opacity 220ms ease-out;
  z-index: -1;
}

.card__inner {
  position: relative;
  z-index: 1;
  border-radius: 14px;
  background: #17141a;
  padding: 16px 14px;
}

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

.card__meta {
  margin: 0;
  font-weight: 500;
  font-size: clamp(11px, 3vw, 12px);
  line-height: 1.3;
  font-family: inherit;
  color: rgba(255, 247, 230, 0.7);
}

.card:hover .card__ring,
.card:focus-visible .card__ring,
.card:active .card__ring,
.card.is-demo .card__ring {
  opacity: 1;
  animation: spin 2s linear infinite;
}

.card.is-demo {
  animation: tilt-loop 2s linear infinite, spot-loop 2s linear infinite;
}

@keyframes spin {
  to {
    --angle: 360deg;
  }
}
@keyframes tilt-loop {
  0%, 15% {
    --rx: 0deg;
    --ry: 0deg;
  }
  35% {
    --rx: -4deg;
    --ry: 5deg;
  }
  65% {
    --rx: 3deg;
    --ry: -5deg;
  }
  85%, 100% {
    --rx: 0deg;
    --ry: 0deg;
  }
}
@keyframes spot-loop {
  0%, 15% {
    --sp: 0;
    --mx: 15%;
    --my: 20%;
  }
  30% {
    --sp: 1;
  }
  50% {
    --mx: 85%;
    --my: 30%;
  }
  70% {
    --mx: 50%;
    --my: 80%;
  }
  85%, 100% {
    --sp: 0;
  }
}
@media (hover: none) {
  .card:active .card__ring {
    opacity: 1;
    animation: spin 2s linear infinite;
  }
}
@media (prefers-reduced-motion: reduce) {
  .card__ring {
    transition: none;
    animation: none !important;
    opacity: 0.55;
  }
  .card {
    transition: none;
  }
  .card.is-demo {
    animation: none;
    --rx: 0deg;
    --ry: 0deg;
    --sp: 0;
  }
}
