.portal { position:relative; }

/* The walking strip runs across the bottom of the portal. */
.mascot-lane {
  position:absolute;
  left:38%;
  right:7%;
  top:0;
  height:112px;
  visibility:hidden;
  pointer-events:none;
  z-index:2;
}

.mascot-lane.is-ready { visibility:visible; }

.mascot-speech {
  position:absolute;
  bottom:calc(100% + 6px);
  left:0;
  width:280px;
  max-width:100%;
  padding:16px 19px;
  border:1px solid #c9c0aa;
  border-radius:17px 17px 17px 5px;
  background:#f4efdf;
  color:#203a49;
  box-shadow:0 8px 24px #0617213d;
  font:15px/1.55 Georgia,serif;
  text-align:left;
  opacity:0;
  visibility:hidden;
  transform:translateY(5px) scale(.97);
  transform-origin:var(--speech-tail,50%) bottom;
  transition:opacity .18s,transform .22s,visibility 0s .22s;
  pointer-events:none;
  z-index:1;
}

.mascot-speech::after {
  content:'';
  position:absolute;
  bottom:-7px;
  left:var(--speech-tail,50%);
  width:12px;
  height:12px;
  background:#f4efdf;
  border-right:1px solid #c9c0aa;
  border-bottom:1px solid #c9c0aa;
  transform:translateX(-50%) rotate(45deg);
}

.mascot-speech.is-visible {
  opacity:1;
  visibility:visible;
  transform:translateY(0) scale(1);
  transition-delay:0s;
}

.book-mascot {
  position:absolute;
  bottom:0;
  left:0;
  width:86px;
  height:112px;
  padding:0;
  border:0;
  background:none;
  cursor:grab;
  pointer-events:auto;
  touch-action:pan-y;
  user-select:none;
  -webkit-user-select:none;
  transform:translateX(var(--mascot-x,0px));
  will-change:transform;
  border-radius:18px;
}

.book-mascot.is-dragging { cursor:grabbing; }
.book-mascot svg { display:block; width:100%; height:100%; overflow:visible; pointer-events:none; }
.book-mascot svg {
  transform:scaleX(var(--mascot-facing,-1));
  transform-origin:center;
  transition:transform .24s cubic-bezier(.4,0,.2,1);
}
.book-mascot:focus-visible { outline:1px dashed #a9cdbb; outline-offset:3px; }
.mascot-limbs {
  fill:none;
  stroke:#080d12;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
  filter:drop-shadow(0 0 .7px #d8e8d0);
}

.mascot-help {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip-path:inset(50%);
  white-space:nowrap;
}

@media(max-width:1000px) {
  .book-mascot { width:78px; height:102px; }
  .mascot-lane { height:102px; }
}

@media(max-width:700px) {
  .mascot-lane { display:none; }
  .book-mascot { width:74px; height:97px; }
  .mascot-lane { height:100px; left:26px; right:26px; }
}

@media(prefers-reduced-motion:reduce) {
  .book-mascot { will-change:auto; }
  .book-mascot svg { transition:none; }
  .mascot-speech { transition:none; }
}
