.back-to-top {
  position: fixed;
  right: max(0px, calc(32px - (100vw - 100%)));
  bottom: 32px;
  z-index: 90;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 48, .45);
  cursor: pointer;
}

.back-to-top[hidden] { display: none; }

.back-to-top__icon {
  display: block;
  width: 100%;
  height: 100%;
  background-color: #fff;
  -webkit-mask: url("../images/arrow-up.svg") center / contain no-repeat;
  mask: url("../images/arrow-up.svg") center / contain no-repeat;
  transition: background-color 220ms ease;
}

.back-to-top:is(:hover, :focus-visible) .back-to-top__icon { background-color: #00ffff; }
.back-to-top:focus-visible { outline: 2px solid #00ffff; outline-offset: 4px; }

.footer__back-to-top { display: none; }

@media (max-width: 767px) {
  .back-to-top { display: none; }
  .footer__back-to-top {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-self: flex-end;
    align-items: center;
    gap: 4px;
    padding-inline: 8px;
    color: var(--color-white);
    text-decoration: none;
  }
}

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