/* ink-thread 1.0.0 | the JPRAXC scrollbar (C-29 UPDATE 5, design 1 "Ink thread"). Standalone: no kit dependency.
   The native bar is hidden ONLY after ink-thread.js has started (html.ink-thread-ready), so a page without the script
   keeps its native scrollbar. forced-colors keeps the native bar (the script does not start there either).
   Accent: --ink-thread (default #620D2D; a school sets its resolved dark colour). Dark pages get an ivory-tinted
   handle so it stays visible on black. */
:root { --ink-thread: #620D2D; --ink-thread-ivory: #F4EEE3; }

/* the native bar, hidden once the overlay is running */
html.ink-thread-ready.ink-thread-doc { scrollbar-width: none; }
html.ink-thread-ready.ink-thread-doc::-webkit-scrollbar { width: 0; height: 0; }
html.ink-thread-ready .ink-thread-on { scrollbar-width: none; }
html.ink-thread-ready .ink-thread-on::-webkit-scrollbar { width: 0; height: 0; }

/* the handle: a hairline at rest, a capsule on hover or drag */
.ink-thread-handle {
  position: fixed;
  z-index: 2147483000;
  top: 0;
  left: 0;
  width: 9px;
  height: 28px;
  margin-left: -9px;
  border-radius: 999px;
  background: transparent;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.ink-thread-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 2px;
  border-radius: 999px;
  background: var(--ink-thread);
  opacity: 0.55;
  transition: width 0.25s cubic-bezier(0.3, 1.4, 0.5, 1), opacity 0.2s ease;
}
.ink-thread-handle.is-wide::before,
.ink-thread-handle.is-drag::before { width: 9px; opacity: 1; }
.ink-thread-handle.is-drag { cursor: grabbing; }
.ink-thread-handle[data-state="off"] { display: none; }

/* dark pages: maroon on black falls below 3:1, so the handle is tinted toward ivory */
:is(html[data-theme="dark"], html[data-color-scheme="dark"]) .ink-thread-handle::before {
  background: color-mix(in srgb, var(--ink-thread) 35%, var(--ink-thread-ivory));
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]):not([data-color-scheme]) .ink-thread-handle::before {
    background: color-mix(in srgb, var(--ink-thread) 35%, var(--ink-thread-ivory));
  }
}

@media (prefers-reduced-motion: reduce) {
  .ink-thread-handle::before { transition: none; }
}
@media (forced-colors: active) {
  .ink-thread-handle { display: none; }
  html.ink-thread-ready.ink-thread-doc, html.ink-thread-ready .ink-thread-on { scrollbar-width: auto; }
}
@media print {
  .ink-thread-handle { display: none !important; }
}
