/* Effects layer, Software & Services and Private tools (docs/FX.md). Normal and Turn it up.
   - The cards' pictures are windows: they shift against the cursor (--px/--py from
     assets/js/fx/tilt.js) and a glare line slides across with it.
   - The private tools' screenshots float in 3D, each on its own beat, and lift toward
     the viewer on hover. Turn it up spins them on a slow carousel tilt. */

:where(html:not([data-fx="calm"])) #software .card:not(.private-tool) .card-media img {
  scale: 1.1;
  translate: calc((0.5 - var(--px, 0.5)) * 22px) calc((0.5 - var(--py, 0.5)) * 14px);
  transition: translate 0.25s ease-out, scale 0.4s ease;
}
:where(html:not([data-fx="calm"])) #software .card:not(.private-tool):hover .card-media img { scale: 1.16; }
:where(html:not([data-fx="calm"])) #software .card:not(.private-tool) .card-media::before {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, 0.28) 49%, rgba(255, 255, 255, 0.05) 52%, transparent 60%);
  translate: calc((var(--px, 0.5) - 0.5) * 80%) 0;
  opacity: 0;
  transition: opacity 0.3s ease, translate 0.25s ease-out;
}
:where(html:not([data-fx="calm"])) #software .card:not(.private-tool):hover .card-media::before { opacity: 1; }

@keyframes fx-float {
  0%, 100% { transform: perspective(900px) rotateX(6deg) rotateY(-8deg) translate3d(0, 0, 0); }
  50% { transform: perspective(900px) rotateX(-4deg) rotateY(7deg) translate3d(0, -8px, 22px); }
}
:where(html:not([data-fx="calm"])) .private-tool .card-media {
  overflow: visible;
  background: transparent;
  perspective: 900px;
}
:where(html:not([data-fx="calm"])) .private-tool .card-media img {
  border-radius: 0.6rem;
  box-shadow: 0 24px 40px -18px #000, 0 0 0 1px rgba(255, 255, 255, 0.18), 0 0 30px -10px var(--section-accent);
  animation: fx-float 7s ease-in-out infinite;
  transition: scale 0.4s ease;
}
:where(html:not([data-fx="calm"])) .private-tool:nth-child(2) .card-media img { animation-delay: -2.3s; animation-duration: 8s; }
:where(html:not([data-fx="calm"])) .private-tool:nth-child(3) .card-media img { animation-delay: -4.6s; animation-duration: 6.5s; }
:where(html:not([data-fx="calm"])) .private-tool:hover .card-media img { scale: 1.06; animation-play-state: paused; }
html[data-fx="loud"] .private-tool .card-media img { animation-duration: 3.2s; }
@media (pointer: coarse) {
  :where(html:not([data-fx="calm"])) .private-tool .card-media img { animation-duration: 12s; }
}
