/* Icon motion: hover/focus/tap micro-animations for inline SVG icons.
   Shapes and motion follow lucide-animated (lucide-animated.com, MIT), ported from
   React + motion to plain CSS so no library loads. An icon opts in with data-la="<name>";
   it plays once when its parent link or button is hovered or keyboard-focused,
   and never for people who ask for reduced motion. */

[data-la] * { transform-box: view-box; }
[data-la] [pathLength] { stroke-dasharray: 1 1; }

/* Copy button: the check is hidden until the button reports success (.is-done). */
[data-la="copy"] .la-ok { opacity: 0; }
.is-done [data-la="copy"] .la-c { opacity: 0; }
.is-done [data-la="copy"] .la-ok { opacity: 1; }

@keyframes la-draw { from { stroke-dashoffset: 1; opacity: 0; } 10% { opacity: 1; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes la-redraw { 0%, 100% { stroke-dashoffset: 0; } 50% { stroke-dashoffset: 1; } }
@keyframes la-ring { 0%, 100% { rotate: 0deg; } 25% { rotate: -10deg; } 50% { rotate: 10deg; } 75% { rotate: -10deg; } }
@keyframes la-call { 0% { rotate: 0deg; scale: 1; } 20% { rotate: 12deg; scale: 1.05; } 45% { rotate: -8deg; scale: 1.1; } 70% { rotate: 6deg; scale: 1.05; } 100% { rotate: 0deg; scale: 1; } }
@keyframes la-wave { 0% { opacity: 1; } 30% { opacity: 0; } 100% { opacity: 1; } }
@keyframes la-spin { from { rotate: 0deg; } to { rotate: 360deg; } }
@keyframes la-lens { 0%, 100% { translate: 0 0; } 33% { translate: 0 -3px; } 66% { translate: -2.5px 0; } }
@keyframes la-slide { 0%, 100% { translate: 0 0; } 40% { translate: -4px 0; } 75% { translate: 1.5px 0; } }
@keyframes la-drop { from { translate: 0 -20px; opacity: 0; } 20% { opacity: 1; } to { translate: 0 0; opacity: 1; } }
@keyframes la-turn { from { rotate: 0deg; } to { rotate: 180deg; } }
@keyframes la-tear-l { 0%, 100% { translate: 0 0; } 45%, 60% { translate: -2.5px 0; } }
@keyframes la-tear-r { 0%, 100% { translate: 0 0; rotate: 0deg; } 45%, 60% { translate: 2.5px 0; rotate: 4deg; } }
@keyframes la-blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes la-nudge-r { 0%, 100% { translate: 0 0; } 40% { translate: 2px 0; } }
@keyframes la-nudge-l { 0%, 100% { translate: 0 0; } 40% { translate: -2px 0; } }
@keyframes la-nudge-d { 0%, 100% { translate: 0 0; } 40% { translate: 0 2px; } }
@keyframes la-shaft-x { 0%, 100% { scale: 1 1; } 50% { scale: .64 1; } }
@keyframes la-head-x { 0%, 100% { translate: 0 0; } 50% { translate: -3px 0; } }
@keyframes la-shaft-y { 0%, 100% { scale: 1 1; } 50% { scale: 1 .64; } }
@keyframes la-head-y { 0%, 100% { translate: 0 0; } 50% { translate: 0 3px; } }

@media (prefers-reduced-motion: no-preference) {
  :is(a, button):is(:hover, :focus-visible) [data-la="lines"] .la-l { animation: la-redraw .6s ease-in-out both; }
  :is(a, button):is(:hover, :focus-visible) [data-la="lines"] .la-l + .la-l { animation-delay: .12s; }
  :is(a, button):is(:hover, :focus-visible) [data-la="ring"] .la-g { transform-origin: 12px 4px; animation: la-ring .5s ease-in-out; }
  :is(a, button):is(:hover, :focus-visible) [data-la="call"] .la-g { transform-origin: 12px 12px; animation: la-call .8s ease-in-out; }
  :is(a, button):is(:hover, :focus-visible) [data-la="call"] .la-w1 { animation: la-wave .7s ease .05s both; }
  :is(a, button):is(:hover, :focus-visible) [data-la="call"] .la-w2 { animation: la-wave .7s ease .15s both; }
  :is(a, button):is(:hover, :focus-visible) [data-la="spin"] .la-n { transform-origin: 12px 12px; animation: la-spin .8s cubic-bezier(.34, 1.25, .64, 1); }
  :is(a, button):is(:hover, :focus-visible) [data-la="lens"] .la-g { animation: la-lens .6s ease-in-out; }
  :is(a, button):is(:hover, :focus-visible) [data-la="slide"] .la-g { animation: la-slide .7s ease-in-out; }
  :is(a, button):is(:hover, :focus-visible) [data-la="draw"] .la-d { animation: la-draw .55s ease-out both; }
  :is(a, button):is(:hover, :focus-visible) [data-la="draw"] .la-late { animation-delay: .35s; animation-duration: .4s; }
  :is(a, button):is(:hover, :focus-visible) [data-la="coins"] .la-coin { animation: la-drop .5s cubic-bezier(.34, 1.56, .64, 1) both; }
  :is(a, button):is(:hover, :focus-visible) [data-la="coins"] .la-coin + .la-coin { animation-delay: .15s; }
  :is(a, button):is(:hover, :focus-visible) [data-la="turn"] .la-b { transform-origin: 12px 12px; animation: la-turn .6s cubic-bezier(.34, 1.3, .64, 1) .05s; }
  :is(a, button):is(:hover, :focus-visible) [data-la="tear"] .la-tl { animation: la-tear-l .7s ease-in-out; }
  :is(a, button):is(:hover, :focus-visible) [data-la="tear"] .la-tr { transform-origin: 14px 12px; animation: la-tear-r .7s ease-in-out; }
  :is(a, button):is(:hover, :focus-visible) [data-la="dots"] .la-dot { animation: la-blink .4s ease both; }
  :is(a, button):is(:hover, :focus-visible) [data-la="dots"] .la-dot:nth-of-type(2) { animation-delay: .1s; }
  :is(a, button):is(:hover, :focus-visible) [data-la="dots"] .la-dot:nth-of-type(3) { animation-delay: .2s; }
  :is(a, button):is(:hover, :focus-visible) [data-la="dots"] .la-dot:nth-of-type(4) { animation-delay: .3s; }
  :is(a, button):is(:hover, :focus-visible) [data-la="dots"] .la-dot:nth-of-type(5) { animation-delay: .4s; }
  :is(a, button):is(:hover, :focus-visible) [data-la="dots"] .la-dot:nth-of-type(6) { animation-delay: .5s; }
  :is(a, button):is(:hover, :focus-visible) [data-la="next"] path { animation: la-nudge-r .5s ease; }
  :is(a, button):is(:hover, :focus-visible) [data-la="prev"] path { animation: la-nudge-l .5s ease; }
  :is(a, button):is(:hover, :focus-visible) [data-la="down"] path { animation: la-nudge-d .5s ease; }
  :is(a, button):is(:hover, :focus-visible) [data-la="arrow-r"] .la-s { transform-origin: 5px 12px; animation: la-shaft-x .4s ease; }
  :is(a, button):is(:hover, :focus-visible) [data-la="arrow-r"] .la-h { animation: la-head-x .4s ease; }
  :is(a, button):is(:hover, :focus-visible) [data-la="arrow-u"] .la-s { transform-origin: 12px 19px; animation: la-shaft-y .4s ease; }
  :is(a, button):is(:hover, :focus-visible) [data-la="arrow-u"] .la-h { animation: la-head-y .4s ease; }

  [data-la="copy"] .la-c > * { transition: translate .35s cubic-bezier(.34, 1.3, .64, 1); }
  button:is(:hover, :focus-visible):not(:disabled) [data-la="copy"] rect { translate: -2px -2px; }
  button:is(:hover, :focus-visible):not(:disabled) [data-la="copy"] .la-c path { translate: 2px 2px; }
  .is-done [data-la="copy"] .la-ok { animation: la-draw .4s ease-out both; }
}
