.back-to-top {
  position: fixed;
  right: calc(20px + env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 9;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  padding: 0;
  color: var(--white, #ffffff);
  background: var(--dark, #1f2933);
  border: 2px solid var(--orange, #f47721);
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(31, 41, 51, 0.24);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    visibility 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

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

.back-to-top:hover {
  background: var(--dark, #1f2933);
  border-color: var(--turquoise, #3dbfb8);
  transform: translateY(-2px);
}

.back-to-top:active {
  transform: translateY(2px);
}

.back-to-top:focus-visible {
  outline: 3px solid var(--turquoise, #3dbfb8);
  outline-offset: 4px;
}

.back-to-top svg {
  width: 24px;
  height: 24px;
  pointer-events: none;
}

@media (max-width: 600px) {
  .back-to-top {
    right: calc(14px + env(safe-area-inset-right));
    bottom: calc(14px + env(safe-area-inset-bottom));
    width: 48px;
    height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .back-to-top {
    transition: none;
  }
}
