.mit-scroll-rail {
  display: none;
  position: absolute;
  width: var(--mit-rail-size);
  pointer-events: none;
  mask-image: linear-gradient(to bottom, transparent, #000 16px, #000 calc(100% - 16px), transparent);
}

@media (prefers-reduced-motion: no-preference) {
  #mascot-game[data-scroll-ride] {
    --mit-figure: var(--mit-rail-size);
  }
  #mascot-game[data-scroll-ride] .mit-scroll-rail {
    display: block;
  }
  #mascot-game[data-scroll-ride] .mit-object {
    z-index: 1;
  }
  #mascot-game[data-scroll-ride] .mit-actor {
    width: var(--mit-rail-size);
    height: var(--mit-rail-size);
  }
  #mascot-game[data-scroll-ride] :is(.mit-caption, .mit-ground, .mit-board) {
    display: none;
  }
  #mascot-game[data-scroll-ride] .mit-figure {
    filter: drop-shadow(1px 2px 1px #15212e36);
  }
  #mascot-game[data-scroll-ride][data-rail-pass] :is(.mit-target, .mit-figure) {
    pointer-events: none;
  }
  #mascot-game[data-scroll-ride][data-rail-side="left"] :is(.mit-figure, .mit-scroll-rail) {
    scale: -1 1;
  }

  /* The pipe baked into the 320px pose occupies columns 238–261. */
  #mascot-game[data-scroll-ride="down"] .mit-scroll-rail::before {
    content: "";
    position: absolute;
    inset-block: 0;
    left: 74.375%;
    width: 7.5%;
    border-radius: 2px;
    background:
      repeating-linear-gradient(to bottom, transparent 0 78px, #364754 78px 79px, #dce2e7 79px 81px, #465563 81px 82px),
      linear-gradient(to right, #484951, #80808d 25%, #ecebf0 47%, #a2a8b5 58%, #738097 80%, #697379);
    background-size: 100% 82px, 100% 100%;
    background-position: 0 var(--mit-rung-offset, 0px), 0 0;
    box-shadow: 1px 0 2px #15232e48;
  }
  #mascot-game[data-scroll-ride="down"] .mit-sprite {
    background: url("/assets/mitya-window-slide.webp") center / contain no-repeat;
  }

  #mascot-game[data-scroll-ride="up"] .mit-scroll-rail {
    --rail-width: max(3px, calc(var(--mit-rail-size) * .047));
    --rung-spacing: calc(var(--mit-rail-size) * .23);
  }
  #mascot-game[data-scroll-ride="up"] .mit-scroll-rail::before,
  #mascot-game[data-scroll-ride="up"] .mit-scroll-rail::after {
    content: "";
    position: absolute;
    inset-block: 0;
    left: 35%;
    width: 44%;
  }
  #mascot-game[data-scroll-ride="up"] .mit-scroll-rail::before {
    background: repeating-linear-gradient(to bottom,
      #b5c1c9 0 1px, #8b99a2 1px 2.5px, #51616c 2.5px 3.5px, transparent 3.5px var(--rung-spacing));
    background-size: 100% var(--rung-spacing);
    background-position-y: var(--mit-rung-offset, 0px);
    filter: drop-shadow(0 1px 1px #23384a2b);
  }
  #mascot-game[data-scroll-ride="up"] .mit-scroll-rail::after {
    --stile: linear-gradient(to right, #485a65, #d1d9dd 34%, #9caeb9 65%, #52636e);
    background: var(--stile) left center / var(--rail-width) 100% no-repeat,
      var(--stile) right center / var(--rail-width) 100% no-repeat;
    filter: drop-shadow(1px 0 1px #23384a30);
  }
  #mascot-game[data-scroll-ride="up"] .mit-sprite {
    background: url("/assets/mitya-climb.webp") 0 0 / 200% 100% no-repeat;
  }
  #mascot-game[data-scroll-ride="up"][data-step="1"] .mit-sprite {
    background-position-x: 100%;
  }
}
