/* Fixed back-to-top — icon only, sits after the first fold. */
.back-to-top {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 9000;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid var(--_main-style---white);
  border-radius: 50%;
  background-color: var(--_main-style---bacground);
  color: var(--_main-style---white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(0.95);
  transition:
    opacity 200ms cubic-bezier(0.23, 1, 0.32, 1),
    transform 200ms cubic-bezier(0.23, 1, 0.32, 1),
    visibility 200ms cubic-bezier(0.23, 1, 0.32, 1),
    border-color 200ms ease;
}

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

.back-to-top img {
  width: 22px;
  height: 22px;
  display: block;
}

.back-to-top:focus-visible {
  outline: 2px solid var(--_main-style---dark-accent);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .back-to-top:hover {
    border-color: var(--_main-style---dark-accent);
  }

  .back-to-top:active {
    transform: scale(0.97);
    transition-duration: 100ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transform: none;
    transition: opacity 200ms ease, visibility 200ms ease, border-color 200ms ease;
  }

  .back-to-top.is-visible,
  .back-to-top:active {
    transform: none;
  }
}

@media screen and (max-width: 767px) {
  .back-to-top {
    width: 44px;
    height: 44px;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  .back-to-top img {
    width: 18px;
    height: 18px;
  }
}
