.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #e42a31, #b90f16);
  color: #fff;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .38);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity .22s, transform .22s, visibility .22s, filter .2s;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  filter: brightness(1.14);
  transform: translateY(-3px);
}

.back-to-top:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

@media (max-width: 560px) {
  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
    font-size: 23px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: none; }
}
