.totop a {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease, border-radius .3s ease;
}
.totop a::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(145deg, #198ba7, #12668e);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.totop a::after {
  content: '';
  position: absolute;
  inset: -45%;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.35) 50%, transparent 60%);
  transform: translateX(-110%);
  pointer-events: none;
}
.totop a i { display: inline-block; }
.totop a:focus-visible {
  outline: 2px solid #a2edff;
  outline-offset: 5px;
  box-shadow: 0 0 8px rgba(34,181,211,.15);
}
@media (hover: hover) and (pointer: fine) {
  .totop a:hover {
    transform: translateY(-3px);
    border-radius: 13px;
    box-shadow: 0 5px 12px rgba(0,0,0,.22);
  }
  .totop a:hover::before { opacity: 1; }
  .totop a:hover::after { animation: none; opacity: 0; }
  .totop a:hover i { animation: totop-arrow .65s ease-out both; }
  .totop a:active { transform: translateY(-2px) scale(.96); }
}
@keyframes totop-sheen {
  to { transform: translateX(110%); }
}
@keyframes totop-arrow {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-7px); }
  70% { transform: translateY(2px); }
}
@media (prefers-reduced-motion: reduce) {
  .totop a, .totop a::before { transition: none; }
  .totop a:hover, .totop a:active { transform: none; }
  .totop a:hover i, .totop a:hover::after { animation: none; }
}
