#button-gotop {
  position: fixed;
  bottom: 50%;
  right: 20px;
  width: 34px;
  height: 34px;
  background: rgba(120, 120, 120, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  visibility: hidden;
  opacity: 0;
  transform: translateY(20px);
  z-index: 1000;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0.3s ease,
    background 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  mix-blend-mode: difference;

  display: block;
  box-sizing: border-box;
  position: fixed;
}

/* анимация плавного мигания */
@keyframes fade {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

#button-gotop::before,
#button-gotop::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%) rotate(-45deg);
  width: 10px;
  height: 10px;
  border-top: 2px solid white;
  border-right: 2px solid white;
  opacity: 0;
}

#button-gotop::before {
  top: 12px;
  animation: fade 3s infinite;
  animation-delay: 0s;
}

#button-gotop::after {
  top: 18px;
  animation: fade 3s infinite;
  animation-delay: 1.5s; /* плавное смещение по времени */
}

#button-gotop.show {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

#button-gotop:hover,
#button-gotop:focus {
  background: rgba(120, 120, 120, 0.4);
  outline: none;
}

@media (max-width: 991px) {
  #button-gotop {
    right: 12px;
    width: 28px;
    height: 28px;
  }

  #button-gotop::before,
  #button-gotop::after {
    width: 10px;
    height: 10px;
    border-top-width: 2px;
    border-right-width: 2px;
  }

  #button-gotop::before { top: 9px; }
  #button-gotop::after { top: 15px; }
}