html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ffffff;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

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

@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);
  border-radius: 16px;
  background: #17141a;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  padding: 16px 14px;
  outline: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 220ms ease-out;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(140px circle at var(--mx) var(--my), rgba(47, 109, 246, 0.5), transparent 70%);
  opacity: var(--sp);
  transition: opacity 220ms ease-out;
  pointer-events: none;
}

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

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

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

@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;
  }
}
@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;
  }
}
.card:focus-visible::before,
.card:active::before {
  --mx: 50%;
  --my: 50%;
  opacity: 1;
}

@media (hover: none) {
  .card:active::before {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .card::before {
    transition: none;
  }
  .card.is-demo {
    animation: none;
  }
  .card {
    transition: none;
  }
}
