/* ============================================================
   SCROLL-TO-TOP BUTTON  (shared across all pages)
   Premium floating control with a live gold scroll-progress ring.
   Injected by js/scroll-top.js. Brand-matched, responsive,
   keyboard-accessible, and reduced-motion aware.
============================================================ */
.scroll-top-btn {
  position: fixed;
  right: calc(28px + env(safe-area-inset-right, 0px));
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(201, 168, 76, 0.32);
  background:
    radial-gradient(120% 120% at 30% 22%, rgba(201, 168, 76, 0.18), transparent 60%),
    rgba(18, 18, 20, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #e8c96d;
  cursor: pointer;
  z-index: 9000;
  box-shadow: 0 12px 32px -10px rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.82);
  transition:
    opacity 0.55s cubic-bezier(0.19, 1, 0.22, 1),
    transform 0.55s cubic-bezier(0.19, 1, 0.22, 1),
    box-shadow 0.4s ease,
    border-color 0.4s ease;
}

.scroll-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.scroll-top-btn:hover {
  border-color: rgba(201, 168, 76, 0.7);
  box-shadow:
    0 18px 40px -10px rgba(0, 0, 0, 0.85),
    0 0 24px -2px rgba(201, 168, 76, 0.5);
  transform: translateY(-3px) scale(1.05);
}

.scroll-top-btn:active {
  transform: translateY(-1px) scale(0.97);
}

.scroll-top-btn:focus-visible {
  outline: none;
  border-color: #e8c96d;
  box-shadow:
    0 0 0 3px rgba(201, 168, 76, 0.35),
    0 18px 40px -10px rgba(0, 0, 0, 0.85);
}

/* Live scroll-progress ring */
.scroll-top-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}
.scroll-top-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.09);
  stroke-width: 2;
}
.scroll-top-ring-progress {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.12s linear;
}

/* Upward arrow */
.scroll-top-arrow {
  position: relative;
  width: 21px;
  height: 21px;
  transition: transform 0.35s cubic-bezier(0.19, 1, 0.22, 1);
}
.scroll-top-btn:hover .scroll-top-arrow {
  transform: translateY(-2px);
}

/* Compact sizing + tighter safe-area margins on phones */
@media (max-width: 600px) {
  .scroll-top-btn {
    width: 48px;
    height: 48px;
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .scroll-top-arrow {
    width: 18px;
    height: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-top-btn,
  .scroll-top-arrow,
  .scroll-top-ring-progress {
    transition: none;
  }
}
