/* ============================================================
   24 — SCROLL TO TOP BUTTON
   Matches nav-desktop button aesthetic — circle variant
   Mirrors: border, glow, box-shadow, lift from header nav
============================================================ */

#byr-scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9000;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill, 999px);

  background: var(--clr-nav-btn-bg, rgba(255,255,255,0.12));
  color: var(--clr-nav-btn-text, #ffffff) !important;
  border: 1px solid var(--clr-nav-btn-border, rgba(255,255,255,0.25));

  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;

  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  transition: all var(--anim-fast, 0.2s ease);

  /* Hidden by default */
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

/* Visible state — toggled by JS */
#byr-scroll-top.byr-stt-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ── Light mode ─────────────────────────────────────────── */
html:not(.mode-dark) #byr-scroll-top {
  background: #ffffff;
  color: var(--color-accent, #0066cc) !important;
  border-color: var(--color-accent, #0066cc);
  box-shadow: 0 0 6px rgba(0,102,204,0.35);
}

html:not(.mode-dark) #byr-scroll-top:hover {
  background: #f0f6ff;
  box-shadow: 0 0 12px rgba(0,102,204,0.55);
  transform: translateY(-2px);
}

/* ── Dark mode ──────────────────────────────────────────── */
html.mode-dark #byr-scroll-top {
  background: var(--color-accent, #0066cc);
  color: #ffffff !important;
  border-color: rgba(255,255,255,0.65);
  box-shadow:
    0 0 10px rgba(0,102,204,0.7),
    inset 0 0 4px rgba(255,255,255,0.25);
}

html.mode-dark #byr-scroll-top:hover {
  box-shadow:
    0 0 16px rgba(0,102,204,0.9),
    0 0 28px rgba(100,180,255,0.45),
    inset 0 0 6px rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

/* ── Focus ring (accessibility) ─────────────────────────── */
#byr-scroll-top:focus-visible {
  outline: 3px solid var(--color-accent-gold, #f5c842);
  outline-offset: 3px;
}

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #byr-scroll-top {
    transition: opacity 0.1s ease;
    transform: none !important;
  }
  #byr-scroll-top.byr-stt-visible {
    transform: none;
  }
}

/* ── Mobile: nudge inward slightly ──────────────────────── */
@media (max-width: 768px) {
  #byr-scroll-top {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }
}