/* ============================================================
   BACK TO TOP BUTTON — site-wide, single source of truth.
   The button markup is injected by assets/js/back-to-top.js;
   pages only reference these two files (main pages get them
   automatically via includes/head.php + includes/footer.php).

   Color tokens fall back to literal values because the
   self-contained pages (project-*.php, p2/p3, stories,
   privacy) do not load main.css.

   z-index 900 keeps it BELOW the fixed header (1000) and every
   modal/lightbox overlay (1000–99998), so an open popup always
   covers the button.
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: var(--cyan, #00a8ea);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  box-shadow: var(--shadow-md, 0 10px 25px rgba(0,0,0,.08));

  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.35s ease, transform 0.35s ease, background 0.3s ease, visibility 0.35s;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--dark-blue, #00468b);
  transform: translateY(-4px);
}
.back-to-top:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.back-to-top svg {
  width: 18px;
  height: 18px;
}
@media (max-width: 600px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
  }
  .back-to-top svg { width: 16px; height: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: none; }
}
