/* Original paper courier: the reading position is also a draggable control. */
#flight-progress {
  --flight-y: 0px;
  --flight-progress: 0;
  --flight-ink: #53615c;
  position: fixed;
  z-index: 80;
  right: 14px;
  top: 140px;
  bottom: 60px;
  width: 44px;
  min-height: 100px;
  padding: 0;
  border: 0;
  outline: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#flight-progress[hidden] { display: none !important; }
#flight-progress:focus-visible {
  outline: 1px solid #7a8c80;
  outline-offset: 3px;
  border-radius: 22px;
}
.flight-track {
  position: absolute;
  inset: 29px 21px;
  background: #d7dcd8;
  pointer-events: none;
}
.flight-travelled {
  position: absolute;
  inset: 0;
  background: var(--flight-ink);
  transform-origin: center top;
  transform: scaleY(var(--flight-progress));
  transition: transform 110ms linear, background 240ms ease;
}
.flight-track::before,
.flight-track::after {
  content: '';
  position: absolute;
  left: -2px;
  width: 6px;
  height: 1px;
  background: #a6b1a9;
}
.flight-track::before { top: 0; }
.flight-track::after { bottom: 0; }
.flight-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 58px;
  display: grid;
  place-items: center;
  pointer-events: none;
  transform: translate3d(0, var(--flight-y), 0);
  transition: transform 110ms linear;
  will-change: transform;
}
.flight-courier {
  width: 34px;
  height: 54px;
  overflow: visible;
  filter: grayscale(1);
  opacity: .78;
  transition: filter 360ms ease, opacity 240ms ease;
  /* Integer geometry keeps the small figure legible without an image asset. */
  shape-rendering: geometricPrecision;
}
.flight-flying {
  transform-origin: 20px 32px;
  transform: rotate(180deg);
  transition: transform 300ms cubic-bezier(.2,.75,.25,1), opacity 170ms ease;
}
.is-rising .flight-flying { transform: rotate(0deg); }
.flight-standing { opacity: 0; transition: opacity 170ms ease; }
.flight-pages { transform-origin: 20px 29px; }
.flight-ray {
  stroke: #b0a575;
  stroke-width: 1;
  fill: none;
  opacity: 0;
  transform-origin: 20px 32px;
}
.flight-ground {
  position: absolute;
  bottom: 5px;
  left: 13px;
  width: 18px;
  height: 2px;
  background: #a8b3a9;
  opacity: 0;
  transform: scaleX(.4);
  transition: opacity 200ms ease, transform 280ms ease;
  pointer-events: none;
}
#flight-progress.is-landed { --flight-ink: #657c6b; }
.is-landed .flight-flying { opacity: 0; }
.is-landed .flight-standing { opacity: 1; }
.is-landed .flight-courier { filter: grayscale(0); opacity: 1; }
.is-landed .flight-ground { opacity: 1; transform: scaleX(1); }
.just-landed .flight-ray { animation: flight-arrival 850ms ease-out both; }
#flight-progress.is-dragging { cursor: grabbing; }
.is-dragging .flight-thumb,
.is-dragging .flight-travelled { transition: none; }
#flight-progress:hover .flight-courier,
#flight-progress:focus-visible .flight-courier { opacity: 1; }
.flight-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
@keyframes flight-arrival {
  0% { opacity: 0; transform: scale(.6); }
  22% { opacity: .85; }
  100% { opacity: 0; transform: scale(1.3); }
}
@media (min-width: 1600px) {
  #flight-progress { right: 26px; }
}
@media (max-width: 800px) {
  #flight-progress {
    right: 0;
    top: 130px;
    bottom: 36px;
    width: 40px;
    min-height: 80px;
  }
  .flight-track { inset: 22px 19px; }
  .flight-thumb { width: 40px; height: 44px; }
  .flight-courier { width: 24px; height: 40px; }
  .flight-ground { left: 13px; width: 14px; bottom: 3px; }
}
@media (max-height: 430px) {
  #flight-progress { top: 100px; bottom: 24px; min-height: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  #flight-progress *, #flight-progress *::before, #flight-progress *::after {
    transition: none !important;
    animation: none !important;
  }
}
