/* Rail companion (phones): a full-length front drawing standing still above the Home icon while
   the notebook pages are pinned. Hidden state sits up and larger, toward the big drawing. */
.nb-companion{display:none}
@media(max-width:960px){
  .nb-companion{display:block;position:fixed;left:0;bottom:var(--bottom,96px);z-index:120;width:min(150px,38vw);height:calc(min(150px,38vw) * 1.5);pointer-events:none;opacity:0;transform:translate3d(var(--x,12px),-40vh,0) scale(1.6);transform-origin:50% 100%;transition:transform .7s cubic-bezier(.5,0,.2,1),opacity .45s ease;filter:drop-shadow(0 3px 3px #20372d33)}
  .nb-companion.is-shown{opacity:1;transform:translate3d(var(--x,12px),0,0) scale(1);transition:transform .7s cubic-bezier(.2,.75,.25,1),opacity .35s ease}
  .nb-companion>canvas{display:block;width:100%;height:100%}
}
/* Thanos's walk-on uses the same corner: the figure steps away until the snap scene closes. */
@media(max-width:960px){
  body:is(.snap-scene-open,.snap-dusting) .nb-companion.is-shown{opacity:0;transform:translate3d(calc(var(--x,12px) - 60vw),0,0) scale(.9);transition:transform .5s cubic-bezier(.5,0,.2,1),opacity .3s ease}
}

/* Peek (résumé): a round avatar in the slide controls row, fully above the bottom menu (never
   touching it), with an accent ring. It rises in, slides away when hidden or during the Thanos scene. */
@media(max-width:960px){
  html[data-companion-style="peek"] .nb-companion{width:72px;height:72px;z-index:90;padding:0;border-radius:50%;background:#fbfaf6;box-shadow:0 0 0 2px var(--site-surface,#fff),0 0 0 4px var(--site-accent,#335d65),0 6px 14px #00000033;filter:none;overflow:hidden;opacity:0;transform:translate3d(var(--x,20px),24px,0) scale(.8);transition:transform .5s cubic-bezier(.3,1.3,.5,1),opacity .3s ease}
  html[data-companion-style="peek"] .nb-companion::before,html[data-companion-style="peek"] .nb-companion::after{content:none}
  html[data-companion-style="peek"] .nb-companion>canvas{position:absolute;inset:0;width:100%;height:100%;border-radius:50%}
  html[data-companion-style="peek"] .nb-companion.is-shown{opacity:1;transform:translate3d(var(--x,20px),0,0) scale(1)}
  html[data-companion-style="peek"] body:is(.snap-scene-open,.snap-dusting) .nb-companion.is-shown{opacity:0;transform:translate3d(var(--x,20px),24px,0) scale(.8)}
}
