/* Floating "back to top" button — visible from anywhere on the page once
   the visitor has scrolled down a bit (toggled via JS, see the script at
   the end of index.html), fixed to the bottom-right corner. */
.back-to-top {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(122, 0, 255, 0.55);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-standard),
    transform var(--duration-base) var(--ease-standard);
}

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

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

.back-to-top svg {
  width: 20px;
  height: 20px;
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top,
  .back-to-top:hover {
    transition: opacity var(--duration-fast) linear;
    transform: none;
  }
}

@media (max-width: 640px) {
  .back-to-top {
    right: var(--space-4);
    bottom: var(--space-4);
    width: 44px;
    height: 44px;
  }
}
