/* Scrollbars. Case studies (Move.ai, Talkie): no system scrollbar, the section ruler in the
   header stands in for it. Every other page keeps the system's own scrollbar, asked to be
   thin: overlay as it is on macOS and phones; on Windows a thin bar without arrows (a page
   cannot turn on overlay scrollbars there, that is a browser setting). Where the system bar
   still takes room (classic Windows bars), scroll.js hides it and draws the overlay below. */
html { scrollbar-width: thin; }
html:has(#ruler-data), html:has(#ruler-data) body, html.ovs-page, html.ovs-page body { scrollbar-width: none; -ms-overflow-style: none; }
html:has(#ruler-data)::-webkit-scrollbar, html:has(#ruler-data) body::-webkit-scrollbar,
html.ovs-page::-webkit-scrollbar, html.ovs-page body::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* ---------- case study: section ruler = scrollbar ----------
   Full length of the line = the Full version. Solid segments = the version you read, one
   per main section; faint dots = what Skim leaves out; dark pill = what is on screen.
   Desktop: in the header, between the toggle and the close button. Phones: a vertical
   strip at the right edge of the window. Built by assets/js/scroll.js. */
@property --cr-t { syntax: "<length>"; inherits: true; initial-value: 3px; }
.case-headerrow.has-ruler { gap: 0; }
.cr {
  --cr-t: 3px; --cr-dur: 620ms; --cr-ease: cubic-bezier(0.32, 0.72, 0, 1);
  --cr-dot: color-mix(in srgb, var(--color-neutral-300) 55%, transparent);
  position: relative; flex: 1 1 auto; align-self: stretch; min-width: 24px; margin: 0 24px;
  cursor: pointer; touch-action: none; transition: --cr-t 160ms ease;
}
html.cr-grabbing, html.cr-grabbing * { cursor: grabbing !important; }   /* while the line is held */
.cr u, .cr i { position: absolute; pointer-events: none; border-radius: 999px; }
.cr u { background: repeating-linear-gradient(to right, var(--cr-dot) 0 2px, transparent 2px 6px); }
.cr i { background: var(--color-neutral-300); }
.cr-dk { position: absolute; inset: 0; pointer-events: none; }
.cr-dk i { background: var(--color-neutral-900); }
/* The dark window is clipped to the line's own thickness with the same pill radius. */
.cr.h:hover { --cr-t: 6px; }
.cr.h u, .cr.h i { top: 50%; height: var(--cr-t); margin-top: calc(var(--cr-t) / -2); }
.cr.h .cr-dk { clip-path: inset(calc(50% - var(--cr-t) / 2) var(--cr-b, 0px) calc(50% - var(--cr-t) / 2) var(--cr-a, 0px) round calc(var(--cr-t) / 2)); }
.cr.v { position: fixed; z-index: 70; top: 12px; bottom: 12px; right: 4px; width: 16px; margin: 0; min-width: 0; pointer-events: auto; }
.cr.v u, .cr.v i { left: 50%; width: var(--cr-t); margin-left: calc(var(--cr-t) / -2); }
.cr.v u { background: repeating-linear-gradient(to bottom, var(--cr-dot) 0 2px, transparent 2px 6px); }
.cr.v .cr-dk { clip-path: inset(var(--cr-a, 0px) calc(50% - var(--cr-t) / 2) var(--cr-b, 0px) calc(50% - var(--cr-t) / 2) round calc(var(--cr-t) / 2)); }
.cr.anim i, .cr.anim u {
  transition: left var(--cr-dur) var(--cr-ease), width var(--cr-dur) var(--cr-ease),
    top var(--cr-dur) var(--cr-ease), height var(--cr-dur) var(--cr-ease), opacity 240ms ease;
}
@media (prefers-reduced-motion: reduce) { .cr.anim i, .cr.anim u { transition: opacity 200ms ease; } }

/* ---------- other pages, classic system bars only: overlay thumb ----------
   Shows while scrolling or under the pointer; drag the thumb, or press the track to jump. */
.ovs {
  position: fixed; z-index: 80; top: 2px; bottom: 2px; right: 0; width: 14px;
  opacity: 0; transition: opacity 600ms ease;
}
.ovs.on { opacity: 1; transition-duration: 120ms; }
.ovs b {
  position: absolute; right: 3px; width: 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--color-neutral-900) 42%, transparent);
  transition: width 150ms ease, background 150ms ease;
}
.ovs:hover b, .ovs.drag b { width: 9px; background: color-mix(in srgb, var(--color-neutral-900) 55%, transparent); }
