.scroll-to-top {
  position: fixed;
  z-index: 1000;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  color: var(--cream, #f8f5ee);
  background: var(--orange, #bd6038);
  box-shadow: 0 5px 18px rgba(36, 38, 36, .22);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, background-color .2s ease, visibility .2s;
}

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

.scroll-to-top:hover {
  background: var(--plum, #4a2835);
}

.scroll-to-top:focus-visible {
  outline: 3px solid var(--cream, #f8f5ee);
  outline-offset: 3px;
}

.scroll-to-top svg {
  width: 21px;
  height: 21px;
  max-width: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

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

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