/* ==========================================================================
   Scrollbar fuse — substitui a barra nativa no desktop.
   Trilho curto (não ocupa a altura toda), flutuando à direita no meio da
   viewport, com cross-marks nas pontas (assinatura da casa) e thumb
   hairline. mix-blend-mode: difference faz a barra se adaptar sozinha a
   seções claras e escuras. Aparece ao rolar, respira fora pra ~zero quando
   ocioso; hover engorda o thumb (300ms in / 500ms out, expo).
   A barra nativa só é escondida quando o JS assume (html.has-fuse-scrollbar)
   — sem JS, o site continua com a barra do browser.
   ========================================================================== */

html.has-fuse-scrollbar {
  scrollbar-width: none;            /* Firefox */
}

html.has-fuse-scrollbar::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;                    /* Chromium/WebKit */
}

.fuse-scrollbar {
  position: fixed;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  height: min(38vh, 360px);
  padding: 0 10px;                  /* área de toque generosa pro hairline */
  display: flex;
  align-items: stretch;
  z-index: 200;                     /* acima do conteúdo, abaixo do menu */
  color: #fff;
  mix-blend-mode: difference;       /* contraste automático em qualquer seção */
  opacity: 0;
  transition: opacity 500ms var(--ease-expo-out, cubic-bezier(0.19, 1, 0.22, 1));
  cursor: pointer;
}

.fuse-scrollbar.is-active,
.fuse-scrollbar:hover {
  opacity: 0.9;
  transition-duration: 300ms;
}

.fuse-scrollbar.is-dragging {
  opacity: 1;
}

/* cross-marks nas pontas do trilho */
.fuse-scrollbar::before,
.fuse-scrollbar::after {
  content: '+';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 400;
  line-height: 1;
  opacity: 0.55;
}

.fuse-scrollbar::before { top: -16px; }
.fuse-scrollbar::after  { bottom: -16px; }

.fuse-scrollbar__track {
  position: relative;
  width: 2px;
  height: 100%;
  background: rgba(255, 255, 255, 0.16);
}

.fuse-scrollbar__thumb {
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  min-height: 28px;
  transform: translateX(-50%);
  background: #fff;
  transition: width 500ms var(--ease-expo-out, cubic-bezier(0.19, 1, 0.22, 1));
  will-change: top;
}

.fuse-scrollbar:hover .fuse-scrollbar__thumb,
.fuse-scrollbar.is-dragging .fuse-scrollbar__thumb {
  width: 4px;
  transition-duration: 300ms;
}

/* touch / telas estreitas ficam com a barra nativa do sistema */
@media (pointer: coarse), (max-width: 1023px) {
  .fuse-scrollbar { display: none; }
}
