/* Belt-and-pulley scrollbar (js/belt-scroll.js). Only present with a
   mouse/trackpad on screens 720px and wider; everywhere else the native
   scrollbar stays. Colours come from the site tokens, so it follows the theme. */

/* It replaces the page scrollbar completely (drag + click), so hide the native one. */
html.belt-on { scrollbar-width: none; }
html.belt-on::-webkit-scrollbar { display: none; }
html.belt-dragging, html.belt-dragging * { user-select: none; -webkit-user-select: none; }

.belt-bar {
  position: fixed; right: 2px; top: 80px; bottom: 14px; width: 40px; z-index: 45;
  pointer-events: none; opacity: 0; translate: 10px 0;
  transition: opacity .6s var(--ease), translate .7s var(--ease);
}
.belt-bar[hidden] { display: none; }
.belt-bar.is-ready { opacity: 1; translate: 0 0; }
.belt-bar.is-ready.is-idle { opacity: 0; translate: 10px 0; }
.belt-bar.is-idle * { pointer-events: none !important; }

.belt-svg { display: block; overflow: visible; }

/* Hit area over the belt itself (keeps clicks off the page content beside it). */
.belt-hit { position: absolute; top: 0; right: 0; bottom: 0; width: 26px; pointer-events: auto; cursor: grab; }
.belt-bot { pointer-events: auto; cursor: grab; }
.belt-dragging .belt-hit, .belt-dragging .belt-bot { cursor: grabbing; }

/* Frame */
.belt-rail { stroke: var(--line); stroke-width: 2; stroke-linecap: round; }
.belt-housing { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1; transition: fill .6s, stroke .6s; }
.belt-vent { stroke: var(--line-2); stroke-width: 1.5; stroke-linecap: round; }
.belt-bolt { fill: var(--line-2); }
.belt-led { fill: var(--line-2); transition: fill .3s, filter .3s; }
.is-running .belt-led { fill: var(--sage); filter: drop-shadow(0 0 2.5px var(--sage)); }

/* Pulleys */
.belt-wheel { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.2; }
.belt-groove { fill: none; stroke: var(--line-2); stroke-width: 1; }
.belt-spoke { stroke: var(--muted); stroke-width: 1.2; stroke-linecap: round; }
.belt-mark { fill: var(--accent); }
.belt-hub { fill: var(--ink-2); }

/* Belt: dark band with wooden teeth that slide as it runs */
.belt-base { fill: none; stroke: var(--ink-2); stroke-width: 2.6; }
.belt-teeth { fill: none; stroke: var(--wood); stroke-width: 2.6; stroke-dasharray: 1.6 3.4; }

/* Extruder */
.belt-bot { filter: drop-shadow(0 2px 2px rgb(40 30 20 / .18)); }
.ext-clamp { fill: var(--wood); stroke: var(--ink-2); stroke-width: .9; }
.ext-plate { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.1; transition: fill .3s; }
.ext-sink { fill: var(--muted); }
.ext-fin { fill: var(--surface-2); stroke: var(--ink-2); stroke-width: .9; }
.ext-heater { fill: var(--wood); stroke: var(--ink-2); stroke-width: 1; }
.ext-nozzle { fill: var(--accent); stroke: var(--ink-2); stroke-width: .8; stroke-linejoin: round; }
.ext-hot { fill: var(--accent); opacity: 0; transition: opacity .3s; }
.is-running .ext-hot { opacity: 1; filter: drop-shadow(0 0 2.5px var(--accent)); }
.ext-grab { fill: transparent; }
.belt-bot:hover .ext-plate, .belt-dragging .ext-plate { fill: var(--accent-soft); }
[data-theme-active="dark"] .belt-bot { filter: drop-shadow(0 2px 3px rgb(0 0 0 / .45)); }

/* Percentage tag beside the extruder, shown on hover or while dragging */
.belt-tag {
  position: absolute; top: 0; right: 48px; padding: 1px 8px; border-radius: 999px;
  font: 500 .72rem/1.6 var(--sans); letter-spacing: .08em; font-variant-numeric: tabular-nums;
  color: var(--ink-2); background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); white-space: nowrap; pointer-events: none;
  opacity: 0; translate: 6px 0; transition: opacity .3s var(--ease), translate .4s var(--ease);
}
.belt-bar:has(.belt-hit:hover, .belt-bot:hover) .belt-tag, .belt-dragging .belt-tag { opacity: 1; translate: 0 0; }

@media (prefers-reduced-motion: reduce) {
  .belt-bar, .belt-tag, .belt-led, .ext-hot { transition: none; }
  .belt-bar, .belt-bar.is-ready.is-idle { translate: 0 0; }
}
