.back-to-top {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 25;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 2px solid var(--ink, #173b43);
  border-radius: 50%;
  background: var(--yellow, #ffd840);
  color: var(--ink, #173b43);
  box-shadow: 4px 4px 0 var(--ink, #173b43);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}

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

@media (hover: hover) {
  .back-to-top:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--ink, #173b43);
  }
}

.back-to-top:focus-visible {
  outline: 3px solid var(--coral, #ef6b58);
  outline-offset: 5px;
}

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

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