.to-top {
  position: fixed;
  top: 47.35vh;
  right: clamp(24px, 4.95vw, 95px);
  z-index: 100;
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f68804;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

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

.to-top img {
  display: block;
  width: 20px;
  height: 20px;
}

@media (hover: hover) {
  .to-top--visible:hover {
    background: #fa990f;
  }
}

.to-top--visible:active {
  transform: scale(0.96);
}

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

@media (max-width: 768px) {
  .to-top {
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    top: auto;
  }
}

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