/* Infinite · Bewegungs-Ebene. Opt-in per Attribut, damit sie auch mit CSS-Modulen funktioniert:
   data-fx="btn"    Knopf/Badge: heben, Glanz, Drücken
   data-fx="card"   Karte: heben, Rahmen-Leuchten, Bild-Zoom
   data-magnet      zusätzlich magnetischer Zug unter feinem Zeiger (JS)
   data-reveal      weiches Einblenden beim Scrollen (JS setzt html.fx-motion)
   Alte Safari: nur transform/opacity/box-shadow, keine neuen Syntaxen. */

[data-fx] {
  -webkit-tap-highlight-color: transparent;
  -webkit-transition: -webkit-transform .38s cubic-bezier(.2, .8, .2, 1), box-shadow .38s cubic-bezier(.2, .8, .2, 1), border-color .25s, background-color .25s, filter .25s;
  transition: transform .38s cubic-bezier(.2, .8, .2, 1), box-shadow .38s cubic-bezier(.2, .8, .2, 1), border-color .25s, background-color .25s, filter .25s;
  will-change: transform;
}
[data-fx="btn"] { position: relative; overflow: hidden; }
[data-fx="btn"]::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: -60%; width: 45%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, .28) 50%, transparent 100%);
  -webkit-transform: translateX(0) skewX(-18deg); transform: translateX(0) skewX(-18deg);
  opacity: 0; pointer-events: none;
}
[data-fx="card"] img { -webkit-transition: -webkit-transform .6s cubic-bezier(.2, .8, .2, 1); transition: transform .6s cubic-bezier(.2, .8, .2, 1); }

/* Drücken: auch auf Touch spürbar */
[data-fx="btn"]:active { -webkit-transform: scale(.965); transform: scale(.965); -webkit-transition-duration: .08s; transition-duration: .08s; }
[data-fx="card"]:active { -webkit-transform: scale(.985); transform: scale(.985); -webkit-transition-duration: .1s; transition-duration: .1s; }

@media (hover: hover) and (pointer: fine) {
  [data-fx="btn"]:hover {
    -webkit-transform: translate3d(var(--fx-x, 0px), calc(var(--fx-y, 0px) - 3px), 0) scale(1.035);
    transform: translate3d(var(--fx-x, 0px), calc(var(--fx-y, 0px) - 3px), 0) scale(1.035);
    box-shadow: 0 16px 34px -14px rgba(139, 92, 255, .75), 0 0 0 1px rgba(255, 255, 255, .06);
    filter: brightness(1.06);
  }
  [data-fx="btn"]:hover::after {
    opacity: 1;
    -webkit-transform: translateX(420%) skewX(-18deg); transform: translateX(420%) skewX(-18deg);
    -webkit-transition: -webkit-transform .75s cubic-bezier(.2, .8, .2, 1), opacity .2s; transition: transform .75s cubic-bezier(.2, .8, .2, 1), opacity .2s;
  }
  [data-fx="card"]:hover {
    -webkit-transform: translateY(-5px); transform: translateY(-5px);
    border-color: rgba(139, 92, 255, .55) !important;
    box-shadow: 0 26px 50px -24px rgba(0, 0, 0, .9), 0 0 0 1px rgba(139, 92, 255, .25), 0 0 40px -18px rgba(139, 92, 255, .55);
  }
  [data-fx="card"]:hover img { -webkit-transform: scale(1.045); transform: scale(1.045); }
  [data-fx]:focus-visible { outline: 2px solid #8B5CFF; outline-offset: 3px; }
}

/* Einblenden beim Scrollen (nur wenn JS läuft und Bewegung erlaubt ist) */
html.fx-motion [data-reveal] {
  opacity: 0; -webkit-transform: translateY(22px); transform: translateY(22px);
  -webkit-transition: opacity .8s cubic-bezier(.2, .8, .2, 1), -webkit-transform .8s cubic-bezier(.2, .8, .2, 1);
  transition: opacity .8s cubic-bezier(.2, .8, .2, 1), transform .8s cubic-bezier(.2, .8, .2, 1);
  -webkit-transition-delay: var(--fx-d, 0s); transition-delay: var(--fx-d, 0s);
}
html.fx-motion [data-reveal].fx-in { opacity: 1; -webkit-transform: none; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-fx], [data-fx]::after, [data-fx] img { -webkit-transition: none !important; transition: none !important; }
  [data-fx]:hover, [data-fx]:active, [data-fx]:hover img { -webkit-transform: none !important; transform: none !important; }
  html.fx-motion [data-reveal] { opacity: 1 !important; -webkit-transform: none !important; transform: none !important; }
}
