.card {
  position: relative;
  inline-size: 12rem;
  margin: 1.5rem;
  padding: 2rem 1rem;
  font: 0.875rem system-ui, sans-serif;
  text-align: center;
  background-color: white;
  border: 1px solid gainsboro;
  border-radius: 0.75rem;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.25);
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover::after {
  opacity: 1;
}