/* Standalone back-to-top control. */
.back-to-top {
  --back-to-top-progress: 0deg;
  position: fixed;
  z-index: 45;
  right: clamp(16px, 2vw, 32px);
  bottom: clamp(16px, 2vw, 32px);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: conic-gradient(
    var(--be-coral) var(--back-to-top-progress),
    rgba(80, 31, 58, 0.14) var(--back-to-top-progress)
  );
  box-shadow: 0 10px 24px rgba(80, 31, 58, 0.2);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  isolation: isolate;
  transform: translateY(12px);
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease,
    transform 180ms ease,
    visibility 180ms ease;
}

.back-to-top::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 3px;
  border-radius: inherit;
  background: var(--be-white);
  transition: background-color 180ms ease;
}

.back-to-top img {
  position: relative;
  z-index: 1;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  transform: rotate(-90deg);
  transition: transform 180ms ease;
}

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

.back-to-top.is-visible:hover {
  box-shadow: 0 14px 28px rgba(80, 31, 58, 0.24);
  transform: translateY(-3px);
}

.back-to-top.is-visible:hover::before {
  background: var(--be-blush);
}

.back-to-top.is-visible:hover img {
  transform: rotate(-90deg) scale(1.06);
}

.back-to-top:focus-visible {
  outline: 3px solid var(--be-orange);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .back-to-top {
    width: 44px;
    height: 44px;
  }
}

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

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