/* Back to top (header-matched + ring + avoid footer overlap) */
.back-to-top{
  --btn-bg: rgba(24,26,28,0.85);       /* same with the header */
  --btn-border: rgba(255,255,255,0.14);
  --btn-hover: rgba(24,26,28,0.95);

  --ring-bg: rgba(255,255,255,0.10);
  --ring-fg: rgba(255,255,255,0.70);
  --ring-fg-hover: rgba(255,255,255,0.92); /* hover glow */

  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;

  width: 46px;
  height: 46px;
  border-radius: 999px;

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

  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: rgba(255,255,255,0.92);

  box-shadow: 0 16px 45px rgba(0,0,0,0.35);
  backdrop-filter: blur(10px);

  cursor: pointer;
  user-select: none;

  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;

  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.back-to-top.show{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover{
  background: var(--btn-hover);
  border-color: rgba(255,255,255,0.22);
  box-shadow: 0 18px 55px rgba(0,0,0,0.42);
}

/* Chevron */
.back-to-top-chevron{
  position: relative;
  z-index: 2;
  width: 18px;
  height: 18px;
  transform: translateY(-1px);
  opacity: 0.92;
}

/* Ring */
.back-to-top-ring{
  position: absolute;
  inset: 0;
  width: 46px;
  height: 46px;
  transform: rotate(-90deg);
  z-index: 1;
}

.back-to-top-ring-bg,
.back-to-top-ring-fg{
  fill: none;
  stroke-width: 2.6;
}

.back-to-top-ring-bg{
  stroke: var(--ring-bg);
}

.back-to-top-ring-fg{
  stroke: var(--ring-fg);
  stroke-linecap: round;
  stroke-dasharray: 113.097;
  stroke-dashoffset: 113.097;
  transition: stroke-dashoffset 0.05s linear, stroke 0.15s ease, filter 0.15s ease;
}

/* hover glow */
.back-to-top:hover .back-to-top-ring-fg{
  stroke: var(--ring-fg-hover);
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.35));
}

/* mobile */
@media (max-width: 700px){
  .back-to-top{
    right: 16px;
    bottom: 16px;
  }
}
