/* ========== SCROLL TO TOP BUTTON ========== */
.scroll-to-top {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 12px;
  gap: 4px;
  isolation: isolate;
  position: fixed;
  width: 48px;
  height: 48px;
  right: 40px;
  bottom: 40px; /* Back to corner position */
  background: rgba(38, 38, 38, 0.9);
  background: color(display-p3 0.149 0.149 0.149 / 0.9);
  backdrop-filter: blur(4px);
  border-radius: 32px;
  border: none;
  cursor: pointer;
  z-index: 1002;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

/* Mobile positioning: center bottom */
@media (max-width: 600px) {
  .scroll-to-top {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 24px;
    width: 44px;
    height: 44px;
    padding: 10px;
  }
  
  .scroll-to-top:hover {
    transform: translateX(-50%) translateY(-2px);
  }
  
  .scroll-to-top img {
    width: 20px;
    height: 20px;
  }
}

/* Restore desktop positioning for larger screens */
@media (min-width: 601px) {
  .scroll-to-top {
    left: auto;
    right: 40px;
    transform: none;
  }
  
  .scroll-to-top:hover {
    transform: translateY(-2px);
  }
}

.scroll-to-top:hover {
  transform: translateY(-2px);
  background: rgba(38, 38, 38, 1);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top img {
  width: 24px;
  height: 24px;
  flex: none;
  order: 0;
  flex-grow: 0;
  z-index: 0;
  filter: brightness(0) invert(1);
} 