{
  "id": "3d-tilt-card",
  "name": "3D Tilt Card",
  "category": "cards",
  "tags": [
    "tilt",
    "3d",
    "perspective",
    "hover",
    "parallax",
    "no javascript"
  ],
  "description": "A card that tilts toward the cursor in 3D using nine invisible hover zones instead of JavaScript.",
  "url": "https://copy-css.com/snippets/3d-tilt-card",
  "markdown": "https://copy-css.com/snippets/3d-tilt-card.md",
  "html": "<div class=\"tilt\">\n  <span></span><span></span><span></span>\n  <span></span><span></span><span></span>\n  <span></span><span></span><span></span>\n  <div class=\"tilt-card\">\n    <h3>Tilt me</h3>\n    <p>Move your cursor around the card.</p>\n  </div>\n</div>",
  "css": ".tilt {\n  --tilt: 10deg;\n  position: relative;\n  display: grid;\n  grid-template: repeat(3, 1fr) / repeat(3, 1fr);\n  width: 230px;\n  height: 150px;\n  perspective: 700px;\n  font-family: system-ui, sans-serif;\n}\n\n.tilt > span {\n  position: relative;\n  z-index: 2;\n}\n\n.tilt-card {\n  position: absolute;\n  inset: 0;\n  display: grid;\n  align-content: end;\n  padding: 18px;\n  border-radius: 18px;\n  background: linear-gradient(135deg, #f472b6, #8b5cf6 55%, #3b82f6);\n  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.6);\n  color: #fff;\n  transition: transform 0.35s ease;\n}\n\n.tilt-card h3 {\n  margin: 0 0 4px;\n  font-size: 20px;\n}\n\n.tilt-card p {\n  margin: 0;\n  font-size: 13px;\n  opacity: 0.9;\n}\n\n.tilt > span:nth-child(1):hover ~ .tilt-card {\n  transform: rotateX(var(--tilt)) rotateY(calc(var(--tilt) * -1));\n}\n\n.tilt > span:nth-child(2):hover ~ .tilt-card {\n  transform: rotateX(var(--tilt));\n}\n\n.tilt > span:nth-child(3):hover ~ .tilt-card {\n  transform: rotateX(var(--tilt)) rotateY(var(--tilt));\n}\n\n.tilt > span:nth-child(4):hover ~ .tilt-card {\n  transform: rotateY(calc(var(--tilt) * -1));\n}\n\n.tilt > span:nth-child(5):hover ~ .tilt-card {\n  transform: scale(1.03);\n}\n\n.tilt > span:nth-child(6):hover ~ .tilt-card {\n  transform: rotateY(var(--tilt));\n}\n\n.tilt > span:nth-child(7):hover ~ .tilt-card {\n  transform: rotateX(calc(var(--tilt) * -1)) rotateY(calc(var(--tilt) * -1));\n}\n\n.tilt > span:nth-child(8):hover ~ .tilt-card {\n  transform: rotateX(calc(var(--tilt) * -1));\n}\n\n.tilt > span:nth-child(9):hover ~ .tilt-card {\n  transform: rotateX(calc(var(--tilt) * -1)) rotateY(var(--tilt));\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .tilt-card {\n    transition: none;\n  }\n\n  .tilt > span:hover ~ .tilt-card {\n    transform: none;\n  }\n}",
  "features": [
    "transitions",
    "3D transforms",
    "transforms",
    "linear gradients",
    "box shadows",
    "CSS Grid",
    "custom properties",
    "reduced-motion support"
  ],
  "customProperties": [
    {
      "name": "--tilt",
      "value": "10deg"
    }
  ]
}
