/* Heat Meter — floating scroll bar with heater chamber.
   Hidden by default; the plugin adds the screen-size rules inline
   (compact size from "Smaller size from", full size from "Full size from"). */

.rthm {
  --rthm-heat: 0;                 /* 0..1, set by JS */
  --rthm-ball: #ff2198;           /* brand pink */
  --rthm-coil: #ff1f3d;           /* hot red */
  --rthm-glow: 255, 33, 152;
  --rthm-bar: linear-gradient(to top, #77777d 0%, #9c6f88 35%, #e04fa0 65%, #ff3aa6 85%, #ff2198 100%);

  display: none;
  position: fixed;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 99;                    /* stays under cookie banners, chat widgets, menus */
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;           /* never blocks clicks */
}

/* Compact size (between the two breakpoints) */
.rthm__icon {
  display: block;
  width: 44px;
  height: auto;
  overflow: visible;
  transition: filter .6s ease;
}
.rthm__track {
  position: relative;
  width: 6px;
  height: 32vh;
  margin-right: 7px;              /* line up under the chamber, not the side stem */
  border-radius: 99px;
  background: rgba(127, 127, 127, .18);
  overflow: hidden;
}
.rthm__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--rthm-bar);
  clip-path: inset(calc((1 - var(--rthm-heat)) * 100%) 0 0 0);
}

/* Cold */
.rthm__ball  { fill: #8e8e94; transition: fill .45s ease; }
.rthm__coil  { stroke: #a7a8ae; transition: stroke .5s ease; }
.rthm__steam { opacity: 0; transition: opacity .8s ease; }

/* Hot: reader has reached the end of the content */
.rthm.is-hot .rthm__ball  { fill: var(--rthm-ball); }
.rthm.is-hot .rthm__coil  { stroke: var(--rthm-coil); }
.rthm.is-hot .rthm__steam { opacity: .75; }
.rthm.is-hot .rthm__icon {
  filter: drop-shadow(0 0 5px rgba(var(--rthm-glow), .8)) drop-shadow(0 0 14px rgba(var(--rthm-glow), .4));
}
.rthm.is-hot .rthm__steam path { animation: rthm-rise 2.4s ease-in-out infinite; }
.rthm.is-hot .rthm__steam path:nth-child(2) { animation-delay: .5s; }
.rthm.is-hot .rthm__steam path:nth-child(3) { animation-delay: 1s; }

@keyframes rthm-rise {
  0%, 100% { transform: translateY(0);    opacity: .9; }
  50%      { transform: translateY(-3px); opacity: .5; }
}

@media (prefers-reduced-motion: reduce) {
  .rthm__ball, .rthm__coil, .rthm__steam, .rthm__icon { transition: none !important; }
  .rthm.is-hot .rthm__steam path { animation: none; }
}

@media print {
  .rthm { display: none !important; }
}
