/*
  Small delights (see README, "Small delights"). delights.js adds .is-magnet / .is-tilt and
  sets --dx --dy / --rx --ry while a mouse is over the element. Nothing here applies on touch,
  with reduced motion, or without JS: the static look in base.css stays as it is.
  .is-delight (added on first hover, kept) carries the transitions, so the reveal-on-scroll is untouched.
*/
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  /* Magnetic buttons: the separate "translate" property never fights .btn:hover's "transform". */
  .btn--primary.is-delight {
    transition: translate 160ms var(--ease-out), transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
  }
  .btn--primary.is-magnet { translate: var(--dx, 0) var(--dy, 0); }

  /* Tilting cards. Perspective only works inside "transform", so the tilt is written there
     and the link-card lift from base.css is repeated next to it. */
  .card.is-delight,
  .flow__demo.is-delight {
    transition: transform 180ms var(--ease-out), border-color var(--dur), box-shadow var(--dur);
  }
  .js .card.is-tilt.is-delight,
  .js .flow__demo.is-tilt.is-delight {
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  }
  .js .card--link.is-tilt.is-delight:hover,
  .js .card--link.is-tilt.is-delight:focus-within {
    transform: perspective(900px) translateY(-4px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  }
}
