/* SVG motion for every icon on the site.
   Line icons draw themselves in as they scroll into view, solid icons pop in, and icons
   react when their button, link or card is hovered. Everything starts from the finished
   picture unless JavaScript has switched the effect on (html.svg-anim), and reduced-motion
   visitors never get it. Wired by svg-motion.js. */
@keyframes svDraw { from { stroke-dashoffset: 100 } to { stroke-dashoffset: 0 } }
@keyframes svPop { from { opacity: 0; transform: scale(.55) rotate(-10deg) } to { opacity: 1; transform: none } }
@keyframes svWiggle { 0%, 100% { rotate: 0deg; scale: 1 } 25% { rotate: -9deg; scale: 1.12 } 60% { rotate: 7deg; scale: 1.12 } }

html.svg-anim svg.svgfx-stroke :is(path, line, polyline, polygon, circle, ellipse, rect) { stroke-dasharray: 100; stroke-dashoffset: 100 }
html.svg-anim svg.svgfx-stroke.is-drawn :is(path, line, polyline, polygon, circle, ellipse, rect) {
  animation: svDraw .95s cubic-bezier(.22, 1, .36, 1) forwards; animation-delay: calc(var(--sv-i, 0) * 70ms)
}
/* once drawn, return to plain strokes so joins and caps stay crisp */
html.svg-anim svg.svg-done :is(path, line, polyline, polygon, circle, ellipse, rect) { stroke-dasharray: none; stroke-dashoffset: 0; animation: none }

html.svg-anim svg.svgfx-fill:not(.is-drawn) { opacity: 0 }
html.svg-anim svg.svgfx-fill.is-drawn { animation: svPop .6s cubic-bezier(.34, 1.56, .64, 1) backwards }

/* hover: the icon inside a hovered control or card wiggles once */
@media (hover: hover) {
  html.svg-anim :where(a, button, summary, .glass-panel, .j-card, .tech-tile, .price-card, .proc-step, .stat-tile, .local-card):hover svg.svg-done:not(.svc-chev svg) {
    animation: svWiggle .6s ease
  }
}
@media (prefers-reduced-motion: reduce) {
  html.svg-anim svg.svgfx-stroke :is(path, line, polyline, polygon, circle, ellipse, rect) { stroke-dasharray: none; stroke-dashoffset: 0; animation: none }
  html.svg-anim svg.svgfx-fill:not(.is-drawn) { opacity: 1 }
}
