/* Hotspoken gesture icons — animation stylesheet.
 *
 * One animation class per gesture. Put the class on the <svg> element
 * itself (when the SVG is inlined in the page) or on a wrapper element
 * around an inlined SVG, e.g.:
 *
 *   <svg class="gi-anim-pinch" ...> ... </svg>
 *
 * IMPORTANT: CSS in this file can only reach inside an SVG when the SVG
 * is INLINED in the page. A plain <img src="...svg"> is a separate
 * document and external CSS cannot touch its internals. Each SVG below
 * therefore also carries a verbatim copy of its own animation inside a
 * <style> element, so the <img> snippet in ICONS.md animates standalone.
 * This file is the canonical source; keep the two copies in sync.
 *
 * All animations are gentle (1.4–1.8s), infinite, and ease-in-out.
 * prefers-reduced-motion pauses every one of them (see the bottom).
 */

/* --- Pinch to zoom ---------------------------------------------------- */
.gi-anim-pinch .gi-finger-l { animation: gi-pinch-l 1.6s ease-in-out infinite alternate; }
.gi-anim-pinch .gi-finger-r { animation: gi-pinch-r 1.6s ease-in-out infinite alternate; }
.gi-anim-pinch .gi-arrow-l { animation: gi-pinch-al 1.6s ease-in-out infinite alternate; }
.gi-anim-pinch .gi-arrow-r { animation: gi-pinch-ar 1.6s ease-in-out infinite alternate; }
@keyframes gi-pinch-l { from { transform: translateX(0); } to { transform: translateX(-4px); } }
@keyframes gi-pinch-r { from { transform: translateX(0); } to { transform: translateX(4px); } }
@keyframes gi-pinch-al { from { transform: translateX(0); opacity: .55; } to { transform: translateX(-2px); opacity: 1; } }
@keyframes gi-pinch-ar { from { transform: translateX(0); opacity: .55; } to { transform: translateX(2px); opacity: 1; } }

/* --- Slide to explore ------------------------------------------------- */
.gi-anim-slide .gi-slide { animation: gi-slide 1.8s ease-in-out infinite alternate; }
.gi-anim-slide .gi-screen { animation: gi-slide-screen 1.8s ease-in-out infinite alternate; }
.gi-anim-slide .gi-slide-arrow { animation: gi-slide-arrow 1.8s ease-in-out infinite alternate; }
@keyframes gi-slide { from { transform: translateX(-5px); } to { transform: translateX(5px); } }
@keyframes gi-slide-screen { from { transform: translateX(2px); } to { transform: translateX(-2px); } }
@keyframes gi-slide-arrow { from { opacity: .55; } to { opacity: 1; } }

/* --- Double slide horizontally: speed --------------------------------- */
.gi-anim-speed .gi-speed-fingers { animation: gi-speed-fingers 1.4s ease-in-out infinite alternate; }
.gi-anim-speed .gi-chev-1 { animation: gi-chev 1.4s ease-in-out infinite alternate; }
.gi-anim-speed .gi-chev-2 { animation: gi-chev 1.4s ease-in-out .18s infinite alternate; }
@keyframes gi-speed-fingers { from { transform: translateX(0); } to { transform: translateX(3px); } }
@keyframes gi-chev { from { opacity: .3; } to { opacity: 1; } }

/* --- Double slide vertically: volume ---------------------------------- */
.gi-anim-volume .gi-vol-fingers { animation: gi-vol-fingers 1.6s ease-in-out infinite alternate; }
.gi-anim-volume .gi-vol-bar-1,
.gi-anim-volume .gi-vol-bar-2,
.gi-anim-volume .gi-vol-bar-3 { transform-box: fill-box; transform-origin: 50% 100%; animation: gi-vol-bar 1.6s ease-in-out infinite alternate; }
.gi-anim-volume .gi-vol-bar-2 { animation-delay: .15s; }
.gi-anim-volume .gi-vol-bar-3 { animation-delay: .3s; }
@keyframes gi-vol-fingers { from { transform: translateY(0); } to { transform: translateY(-4px); } }
@keyframes gi-vol-bar { from { transform: scaleY(.55); } to { transform: scaleY(1); } }

/* --- Triple slide sideways: next / previous ---------------------------- */
.gi-anim-triple-side .gi-side-fingers,
.gi-anim-triple-side .gi-side-arrow { animation: gi-side 1.6s ease-in-out infinite alternate; }
.gi-anim-triple-side .gi-next { transform-box: fill-box; transform-origin: center; animation: gi-next 1.6s ease-in-out infinite alternate; }
@keyframes gi-side { from { transform: translateX(0); } to { transform: translateX(4px); } }
@keyframes gi-next { from { transform: scale(1); opacity: .6; } to { transform: scale(1.15); opacity: 1; } }

/* --- Triple slide sideways and hold: top level comment ----------------- */
.gi-anim-triple-hold .gi-hold-fingers { animation: gi-hold-fingers 1.8s ease-in-out infinite; }
.gi-anim-triple-hold .gi-hold-ring,
.gi-anim-triple-hold .gi-hold-mark { animation: gi-hold-ring 1.8s ease-in-out infinite; }
@keyframes gi-hold-fingers { 0% { transform: translateX(0); } 40% { transform: translateX(3px); } 100% { transform: translateX(3px); } }
@keyframes gi-hold-ring { 0% { opacity: 0; transform: scale(.92); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: 1; transform: scale(1); } }

/* --- Triple slide up: parent ------------------------------------------ */
.gi-anim-triple-up .gi-rise { animation: gi-rise 1.6s ease-in-out infinite alternate; }
.gi-anim-triple-up .gi-up-arrow { animation: gi-up-arrow 1.6s ease-in-out infinite alternate; }
.gi-anim-triple-up .gi-sun { transform-box: fill-box; transform-origin: center; animation: gi-sun 1.6s ease-in-out infinite alternate; }
@keyframes gi-rise { from { transform: translateY(0); } to { transform: translateY(-6px); } }
@keyframes gi-up-arrow { from { transform: translateY(0); opacity: .6; } to { transform: translateY(-2px); opacity: 1; } }
@keyframes gi-sun { from { transform: scale(1); } to { transform: scale(1.08); } }

/* --- Triple slide down: next element in thread ------------------------ */
.gi-anim-triple-down .gi-down-fingers,
.gi-anim-triple-down .gi-down-arrow { animation: gi-down 1.6s ease-in-out infinite alternate; }
.gi-anim-triple-down .gi-drop-1 { animation: gi-drop 1.6s ease-in-out infinite alternate; }
.gi-anim-triple-down .gi-drop-2 { animation: gi-drop 1.6s ease-in-out .2s infinite alternate; }
@keyframes gi-down { from { transform: translateY(0); } to { transform: translateY(3px); } }
@keyframes gi-drop { from { opacity: .35; } to { opacity: 1; } }

/* --- Triple slide down and hold: autoplay ------------------------------ */
.gi-anim-autoplay .gi-auto-fingers { animation: gi-auto-fingers 1.5s ease-in-out infinite alternate; }
.gi-anim-autoplay .gi-play { transform-box: fill-box; transform-origin: center; animation: gi-play 1.5s ease-in-out infinite alternate; }
.gi-anim-autoplay .gi-chain-1 { animation: gi-chain 1.5s ease-in-out infinite alternate; }
.gi-anim-autoplay .gi-chain-2 { animation: gi-chain 1.5s ease-in-out .18s infinite alternate; }
.gi-anim-autoplay .gi-chain-3 { animation: gi-chain 1.5s ease-in-out .36s infinite alternate; }
@keyframes gi-auto-fingers { from { transform: translateY(0); } to { transform: translateY(2px); } }
@keyframes gi-play { from { transform: scale(1); } to { transform: scale(1.12); } }
@keyframes gi-chain { from { opacity: .3; } to { opacity: 1; } }

/* --- Reduced motion: pause every gesture animation --------------------- */
@media (prefers-reduced-motion: reduce) {
  .gi-anim-pinch .gi-finger-l,
  .gi-anim-pinch .gi-finger-r,
  .gi-anim-pinch .gi-arrow-l,
  .gi-anim-pinch .gi-arrow-r,
  .gi-anim-slide .gi-slide,
  .gi-anim-slide .gi-screen,
  .gi-anim-slide .gi-slide-arrow,
  .gi-anim-speed .gi-speed-fingers,
  .gi-anim-speed .gi-chev-1,
  .gi-anim-speed .gi-chev-2,
  .gi-anim-volume .gi-vol-fingers,
  .gi-anim-volume .gi-vol-bar-1,
  .gi-anim-volume .gi-vol-bar-2,
  .gi-anim-volume .gi-vol-bar-3,
  .gi-anim-triple-side .gi-side-fingers,
  .gi-anim-triple-side .gi-side-arrow,
  .gi-anim-triple-side .gi-next,
  .gi-anim-triple-hold .gi-hold-fingers,
  .gi-anim-triple-hold .gi-hold-ring,
  .gi-anim-triple-hold .gi-hold-mark,
  .gi-anim-triple-up .gi-rise,
  .gi-anim-triple-up .gi-up-arrow,
  .gi-anim-triple-up .gi-sun,
  .gi-anim-triple-down .gi-down-fingers,
  .gi-anim-triple-down .gi-down-arrow,
  .gi-anim-triple-down .gi-drop-1,
  .gi-anim-triple-down .gi-drop-2,
  .gi-anim-autoplay .gi-auto-fingers,
  .gi-anim-autoplay .gi-play,
  .gi-anim-autoplay .gi-chain-1,
  .gi-anim-autoplay .gi-chain-2,
  .gi-anim-autoplay .gi-chain-3 {
    animation: none;
  }
}
