/* Public navigation stack: page headers 50, back-to-top 100, menu trigger 110,
   photo lightbox 300. The menu dialog uses the browser's modal top layer.
   The existing grain overlay is decorative and ignores pointer events. */
.back-to-top {
  position: fixed;
  right: calc(clamp(16px, 2vw, 28px) + env(safe-area-inset-right, 0px));
  bottom: calc(clamp(16px, 2vw, 28px) + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  box-sizing: border-box;
  padding: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 180ms ease, color 160ms ease,
    visibility 0s linear 180ms;
  -webkit-tap-highlight-color: transparent;
}

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

.back-to-top:hover,
.back-to-top:focus-visible {
  color: var(--color-accent, #e8fb06);
}

.back-to-top:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: -4px;
}

/* Over a lime / off-white surface (html.chrome-bottom-on-light, set by js/site-navigation.js from the same declared
   layers as the RO / EN switch and the menu trigger) the arrow turns near-black, like them. Lime would disappear
   there, so hover/focus keep it dark; the focus outline follows the text colour. */
.chrome-bottom-on-light .back-to-top,
.chrome-bottom-on-light .back-to-top:hover,
.chrome-bottom-on-light .back-to-top:focus-visible { color: var(--color-bg, #0a0a0b); }

.back-to-top svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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