/* =====================================================
   Mido Hasan — GO TO TOP (scoped)
   /assets/css/12__go-to-top.css
   Floating glass button, bottom-right. Independent of the
   global .cbm-u-btn system. Premium, lavender glow on hover.
   ===================================================== */
.cbm-totop {
  position: fixed;
  right: clamp(18px, 2.4vw, 34px);
  bottom: clamp(18px, 2.4vw, 34px);
  z-index: 400;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-secondary);

  /* glass */
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  background-color: rgba(20, 16, 23, 0.45);
  border: 1px solid rgba(44, 37, 50, 0.9);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, .18),
    0 10px 28px rgba(0, 0, 0, .16);

  /* hidden state near the top */
  opacity: 0;
  transform: translateY(14px) scale(.94);
  pointer-events: none;
  transition:
    opacity 420ms var(--ease-out),
    transform 420ms var(--ease-out),
    border-color 360ms var(--ease-out),
    box-shadow 360ms var(--ease-out);
}

.cbm-totop.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.cbm-totop__arrow {
  position: relative;
  z-index: 2;
  font-size: 18px;
  line-height: 1;
  transition: transform 360ms var(--ease-out), color 360ms var(--ease-out);
}

/* soft lavender glow ring on hover */
.cbm-totop__ring {
  position: absolute;
  inset: -1px;
  z-index: 1;
  border-radius: inherit;
  opacity: 0;
  box-shadow: 0 0 0 1px rgba(183, 140, 255, .5), 0 0 22px rgba(183, 140, 255, .28);
  transition: opacity 360ms var(--ease-out);
  pointer-events: none;
}

.cbm-totop:hover {
  color: var(--text-primary);
  border-color: rgba(142, 99, 163, .55);
}
.cbm-totop:hover .cbm-totop__ring { opacity: 1; }
.cbm-totop:hover .cbm-totop__arrow { transform: translateY(-2px); color: #E6D8FF; }

.cbm-totop:focus-visible {
  outline: none;
  border-color: rgba(183, 140, 255, .7);
}
.cbm-totop:focus-visible .cbm-totop__ring { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .cbm-totop {
    transition: opacity 200ms linear;
    transform: none;
  }
  .cbm-totop.is-visible { transform: none; }
  .cbm-totop__arrow { transition: none; }
}
