html { scroll-behavior: smooth; }

.back-to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 20;
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  background-color: #087ea4;
  box-shadow: 0 6px 18px rgba(7, 23, 44, .28);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  text-decoration: none;
  transform: translateY(.75rem);
  visibility: hidden;
  transition: background-color .2s ease, box-shadow .2s ease, opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}

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

.back-to-top svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.back-to-top:hover {
  background-color: #066783;
  box-shadow: 0 8px 22px rgba(7, 23, 44, .36);
  text-decoration: none;
  transform: translateY(-2px);
}

.back-to-top:focus-visible { border-radius: 50%; }

@media print {
  .back-to-top { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .back-to-top { transition: none; transform: none; }
}
