@media (prefers-reduced-motion: no-preference) {
  :is(nav a, #sidebar-import, .theme-switch) [data-icon] svg,
  :is(nav a, #sidebar-import, .theme-switch) [data-icon] svg * {
    transform-box: fill-box;
    transform-origin: center;
  }

  :is(nav a, #sidebar-import, .theme-switch) [data-icon] svg {
    overflow: visible;
  }

  :is(nav a, #sidebar-import, .theme-switch):hover [data-icon='grid'] rect {
    animation: icon-grid 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }
  :is(nav a, #sidebar-import, .theme-switch):hover [data-icon='grid'] rect:nth-child(2) {
    animation-delay: 0.06s;
  }
  :is(nav a, #sidebar-import, .theme-switch):hover [data-icon='grid'] rect:nth-child(3) {
    animation-delay: 0.12s;
  }
  :is(nav a, #sidebar-import, .theme-switch):hover [data-icon='grid'] rect:nth-child(4) {
    animation-delay: 0.18s;
  }

  :is(nav a, #sidebar-import, .theme-switch):hover [data-icon='check'] rect {
    animation: icon-squash 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  :is(nav a, #sidebar-import, .theme-switch):hover [data-icon='check'] path {
    stroke-dasharray: 15;
    animation: icon-draw-15 0.45s ease-out 0.08s both;
  }

  :is(nav a, #sidebar-import, .theme-switch):hover [data-icon='file'] svg {
    animation: icon-tilt 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  :is(nav a, #sidebar-import, .theme-switch):hover [data-icon='file'] path:nth-child(2) {
    stroke-dasharray: 24;
    animation: icon-draw-24 0.55s ease-out both;
  }

  :is(nav a, #sidebar-import, .theme-switch):hover [data-icon='book'] svg {
    animation: icon-flip 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  :is(nav a, #sidebar-import, .theme-switch):hover [data-icon='calendar'] svg {
    animation: icon-hop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  :is(nav a, #sidebar-import, .theme-switch):hover [data-icon='upload'] svg {
    animation: icon-lift 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  :is(nav a, #sidebar-import, .theme-switch):hover [data-icon='sun'] svg {
    animation: icon-spin 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  :is(nav a, #sidebar-import, .theme-switch):hover [data-icon='type'] svg {
    animation: icon-stretch 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  :is(nav a, #sidebar-import, .theme-switch):hover [data-icon='moon'] svg {
    animation: icon-rock 0.7s ease-in-out;
  }

  :is(nav a, #sidebar-import, .theme-switch):hover [data-icon='globe'] svg {
    animation: icon-globe 0.7s cubic-bezier(0.34, 1.3, 0.64, 1);
  }

  :is(nav a, #sidebar-import, .theme-switch) [data-icon].icon-pressed {
    animation: icon-press 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
}

@keyframes icon-grid {
  0% { transform: scale(1) rotate(0); }
  45% { transform: scale(0.55) rotate(45deg); }
  100% { transform: scale(1) rotate(90deg); }
}

@keyframes icon-squash {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.15, 0.85); }
  65% { transform: scale(0.92, 1.08); }
}

@keyframes icon-draw-15 {
  from { stroke-dashoffset: 15; }
  to { stroke-dashoffset: 0; }
}

@keyframes icon-draw-24 {
  from { stroke-dashoffset: 24; }
  to { stroke-dashoffset: 0; }
}

@keyframes icon-tilt {
  0%, 100% { transform: rotate(0); }
  35% { transform: rotate(-12deg) translateY(-2px); }
  70% { transform: rotate(5deg); }
}

@keyframes icon-flip {
  0%, 100% { transform: scaleX(1); }
  30% { transform: scaleX(0.15); }
  60% { transform: scaleX(1.12); }
}

@keyframes icon-hop {
  0%, 100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-5px) rotate(-10deg); }
  60% { transform: translateY(0) scale(1.1, 0.9); }
  80% { transform: translateY(-1px) rotate(3deg); }
}

@keyframes icon-lift {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-5px); }
  50% { transform: translateY(0) scale(1.08, 0.92); }
  75% { transform: translateY(-2px); }
}

@keyframes icon-spin {
  0% { transform: rotate(0) scale(1); }
  50% { transform: rotate(60deg) scale(1.18); }
  100% { transform: rotate(90deg) scale(1); }
}

@keyframes icon-stretch {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.25, 0.8); }
  60% { transform: scale(0.88, 1.15); }
}

@keyframes icon-rock {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-25deg); }
  55% { transform: rotate(12deg); }
  80% { transform: rotate(-5deg); }
}

@keyframes icon-globe {
  0% { transform: perspective(60px) rotateY(0); }
  100% { transform: perspective(60px) rotateY(360deg); }
}

@keyframes icon-press {
  0% { transform: scale(1); }
  30% { transform: scale(0.75); }
  65% { transform: scale(1.22); }
  100% { transform: scale(1); }
}
