/* ============================================================
   ARLO — Custom branded scrollbar
   The native scrollbar is hidden and replaced by a drawn terracotta thumb
   (js/scrollbar.js). Hiding is scoped to html.js-scrollbar, so visitors
   without JavaScript keep the native scrollbar.
   ============================================================ */

:root {
  color-scheme: light;
}

/* Hide the native page scrollbar only when the custom one runs */
html.js-scrollbar {
  scrollbar-width: none; /* Firefox */
}

html.js-scrollbar::-webkit-scrollbar {
  display: none; /* Chromium / Safari */
}

/* ---- Custom scrollbar UI (fixed to the right edge of the viewport) ----
   js/scrollbar.js measures the track's real box, so changing these offsets
   is safe — the thumb math follows automatically. */
.arlo-scrollbar {
  position: fixed;
  top: 3px;
  bottom: 3px;
  right: 0;
  width: 10px;
  z-index: 9000; /* above modals (max 3000), like a native scrollbar */
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease-out);
}

.arlo-scrollbar.is-visible {
  opacity: 1;
}

.arlo-scrollbar__track {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  /* The tint hugs the page edge and fades inward, so the rail reads as
     attached to the right side rather than floating beside it. */
  background: linear-gradient(
    to inline-start,
    transparent,
    rgba(154, 91, 50, 0.06)
  );
}

.arlo-scrollbar__thumb {
  position: absolute;
  /* Physical, not logical: the rail is pinned to the right whatever the
     writing direction, so the thumb keeps a tighter 1px to the right
     edge while breathing 3px on the inner side. */
  right: 1px;
  left: 3px;
  top: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--color-accent), var(--color-accent-deep));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    0 2px 8px rgba(127, 74, 38, 0.35);
  touch-action: none;
  transition:
    box-shadow var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out);
}

.arlo-scrollbar__thumb:hover {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.4),
    0 2px 12px rgba(127, 74, 38, 0.45);
}

.arlo-scrollbar__thumb.is-dragging {
  background: var(--color-accent-deep);
}

@media (max-width: 39.99rem) {
  .arlo-scrollbar {
    width: 8px;
  }

  .arlo-scrollbar__thumb {
    right: 1px;
    left: 2px;
  }
}