.back-to-top {
  position: fixed;
  right: clamp(12px, 1.4vw, 22px);
  bottom: clamp(12px, 1.4vw, 22px);
  z-index: 25;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #c4b8a9;
  border-radius: 3px;
  background: #fffaf2e8;
  color: var(--muted);
  box-shadow: 3px 3px 0 #342b271c;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity .18s ease, transform .22s ease, visibility 0s linear .22s, background .16s ease;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition-delay: 0s;
}
@media (hover: hover) and (pointer: fine) {
  .back-to-top:hover { border-color: var(--ink); background: var(--ink); color: var(--yellow); transform: translateY(-2px); }
}
.back-to-top:active { transform: translateY(1px); }
.back-to-top:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.back-to-top svg { width: 17px; height: 17px; image-rendering: pixelated; }
@media (max-width: 767px) {
  .back-to-top { right: 10px; bottom: 10px; width: 36px; height: 36px; background: #fffaf2f2; color: var(--muted); }
  .back-to-top svg { width: 16px; height: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: none; }
}
