/* ===== hero (owner 2026-11-17): 16:9 monitor, slimmer chin and stand, Sleep button, peek mode on wake =====
   Desktop only (761px and up). The positions come from app.js (heroLayout) as CSS variables, so every move is a
   transition and nothing jumps. config.json peekMode:false keeps Sparky beside the monitor when awake. */
.chin .pwr{display:none}
@media (min-width:761px){
  .stage.jsl{display:block;position:relative;padding-top:var(--pT,40px);transition:padding-top .6s cubic-bezier(.22,1,.36,1)}
  .stage.jsl .monitor{position:relative;z-index:2;width:var(--mW);margin:0 0 0 var(--mL);
    transition:width .65s cubic-bezier(.22,1.08,.36,1),margin-left .65s cubic-bezier(.22,1.08,.36,1)}
  .stage.jsl .buddy{position:absolute;left:0;top:0;margin:0;width:var(--bW);z-index:3;
    transform:translate(var(--bX),var(--bY));
    transition:transform .62s cubic-bezier(.34,1.3,.64,1),width .62s cubic-bezier(.34,1.3,.64,1)}
  .stage.jsl.peek .buddy,.stage.jsl.moving .buddy{z-index:1}
  .stage.jsl .screen{aspect-ratio:16/9;height:auto}
  .stage.jsl .bezel{position:relative;padding:12px;border-radius:20px 20px 0 0}
  .stage.jsl .chin{height:30px;border-radius:0 0 18px 18px;display:flex;align-items:center;justify-content:center;gap:10px}
  .stage.jsl .neck{width:11%;height:30px}
  .stage.jsl .foot{width:26%;height:10px}
  /* a hop while Sparky moves */
  .stage.jsl.moving .dog{animation:hopmove .62s cubic-bezier(.3,.7,.4,1) 1}
  /* peek: the head over the top-left edge of the bezel, two paws on the edge */
  .stage.jsl.peek .floor{opacity:0}
  .stage.jsl.peek .zzz{right:4%;top:-2%}
  .paws{position:absolute;top:-7px;left:var(--pwX,60px);display:flex;gap:var(--pwG,16px);z-index:4;pointer-events:none;opacity:0;transform:translateY(8px);transition:opacity .25s,transform .35s cubic-bezier(.34,1.5,.64,1)}
  .paws i{display:block;width:var(--pwW,26px);height:calc(var(--pwW,26px) * .62);border-radius:50% 50% 42% 42%;background:#FFF4E2;border:2px solid #D9822B;box-shadow:0 2px 0 rgba(0,0,0,.25)}
  .stage.jsl.peek:not(.moving) .paws{opacity:1;transform:none;transition-delay:.12s}
  /* power button on the chin, next to the LED */
  .chin .pwr{display:grid;place-items:center;width:22px;height:22px;padding:0;border:0;border-radius:50%;background:transparent;color:#8A7563;opacity:0;pointer-events:none;transition:opacity .3s}
  .chin .pwr svg{width:14px;height:14px}
  .stage:not([data-state="asleep"]) .chin .pwr{opacity:1;pointer-events:auto}
  .chin .pwr:hover{color:#E07A1F;background:rgba(224,122,31,.12)}
}
@keyframes hopmove{0%{transform:translateY(0)}40%{transform:translateY(-22%) scale(1.02,.98)}100%{transform:translateY(0)}}
/* Sleep: the picture shrinks to a line and goes dark, like an old screen */
.app.off{animation:crtoff .42s cubic-bezier(.6,0,.9,.4) forwards}
@keyframes crtoff{0%{transform:none;filter:none;opacity:1}55%{transform:scale(1,.006);filter:brightness(2.4);opacity:1}100%{transform:scale(0,.006);filter:brightness(3);opacity:0}}
.ibtn.slp svg{width:17px;height:17px;display:block;margin:auto}
@media (prefers-reduced-motion:reduce){
  .stage.jsl,.stage.jsl .monitor,.stage.jsl .buddy,.paws{transition:none!important}
  .stage.jsl.moving .dog{animation:none}
  .app.off{animation:none;opacity:0}
}
.stage.noanim,.stage.noanim .monitor,.stage.noanim .buddy{transition:none!important}
@media (max-width:599px){.ibtn.slp{display:none}}
@media (max-width:360px){.nav nav a[href="/diary"]{display:none}.nav nav{gap:0}.nav .tbtn{min-width:38px}}
/* awake + tight height: a compact one-line title instead of scrolling; the bubble sits beside the peeking head */
@media (min-width:761px){
  :root.compact .intro{margin:0 0 4px;display:flex;align-items:baseline;justify-content:center;gap:12px}
  :root.compact .intro h1{font-size:32px}
  :root.compact .intro p{margin:0;font-size:16px}
  .stage.jsl.peek .say{bottom:auto;top:2%;left:100%;transform:translate(2px,0);border-radius:18px 18px 18px 4px}
  .stage.jsl .monitor .hint{margin-top:10px}
}
/* big screens: the hero may use up to 1280px (the rest of the page keeps its width) */
@media (min-width:1400px){.hero{max-width:calc(1280px + 2 * var(--gut))}}
/* a narrow chat (small monitor): the header keeps one line */
.chat{container-type:inline-size}
@container (max-width:560px){.head .who small span{display:none}}
/* awake: lists inside the monitor never hand their scroll to the page; touches on the monitor frame don't pan the page */
.msgs,.side,.chips{overscroll-behavior:contain}
@media (min-width:761px){.stage:not([data-state="asleep"]) .monitor{touch-action:none}.stage:not([data-state="asleep"]) .monitor .msgs,.stage:not([data-state="asleep"]) .monitor .side{touch-action:pan-y}.stage:not([data-state="asleep"]) .monitor .chips{touch-action:pan-x}.stage:not([data-state="asleep"]) .monitor input{touch-action:manipulation}}
