/* Mobile home (index.html only): the bio up top, and every project as a
   sticker scattered over the rest of the first screen. Stickers with a
   page link to it; the others show a "Coming soon" box when tapped
   (js/m-list.js). No info boxes or lines here: those are on desktop.
   The peel mechanics come from css/stickers.css (scoped to .m-stickers). */
@media (max-width: 767px) {
  /* overflow: clip — the stickers' folded-back flaps are laid out past the
     last row even when hidden, which would let the page scroll a bit */
  .mobile-hero { justify-content: flex-start; padding-top: 84px; box-sizing: border-box; overflow: clip; }
  .mobile-hero .bio-block { padding-top: 28px; }
  /* the name under the photo, in the top bar's type; it links to About */
  .mobile-hero .m-name {
    display: table; margin-top: 16px;
    font-family: 'B612 Mono', ui-monospace, monospace; font-size: 12px; color: var(--ink);
  }
  .mobile-hero .bio-block .bio { margin-bottom: 0; }

  .m-stickers {
    position: relative; flex: 1 0 380px;   /* fills what's left of the screen */
    margin: 24px 24px 20px;
  }
  /* drawn a little smaller than their real size (`scale` doesn't touch
     the peel maths, which works in the real size) so the scatter breathes */
  .m-stickers .sticker-peel { position: absolute; scale: .8; }
  /* the same sticker area at the end of the case pages (under MORE
     PROJECTS), where it isn't in the home hero's flex column */
  .mobile-projects .m-stickers { flex: none; height: 380px; margin: 0 0 32px; }
  /* a tap shouldn't leave the keyboard focus ring around the sticker */
  .m-stickers .sticker-peel:focus:not(:focus-visible) { outline: none; }
  .m-stickers button.sticker-peel {
    background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
    font: inherit; color: inherit; -webkit-tap-highlight-color: transparent;
  }
  .m-stickers .sticker-body, .m-stickers .sticker-flap { display: block; }

  /* each sticker at a fixed size (the peel maths depends on it); left in %
     of the area so the scatter widens with the phone, top in px */
  .m-stickers .sticker-molnia      { width: 80px;  left: 3%;  top: 0; }
  .m-stickers .sticker-easyquizy   { width: 88px;  left: 37%; top: 8px; }
  .m-stickers .sticker-random      { width: 64px;  left: 75%; top: 4px; }
  .m-stickers .sticker-livevoice   { width: 76px;  left: 1%;  top: 98px; }
  .m-stickers .sticker-ether       { width: 76px;  left: 37%; top: 106px; }
  .m-stickers .sticker-kathtreff   { width: 72px;  left: 73%; top: 96px; }
  .m-stickers .sticker-innovobot   { width: 110px; left: 2%;  top: 200px; }
  .m-stickers .sticker-hci         { width: 110px; left: 40%; top: 196px; }
  .m-stickers .sticker-pasamontana { width: 52px;  left: 82%; top: 186px; }
  .m-stickers .sticker-helpcenter  { width: 76px;  left: 9%;  top: 280px; }
  .m-stickers .sticker-hood        { width: 112px; left: 46%; top: 278px; }

  /* the four work projects only exist as stickers on mobile: their peel
     values (see the comment in css/stickers.css for what each one is) */
  .m-stickers .sticker-livevoice {          /* 400x400 SVG, rounded square */
    --w: 76px; --h: 76px; --nx: .70711; --ny: .70711;
    --d0: 104.02px; --q-hover: 14px; --ga: 135; --goff: 0px; --crease: 8px;
    --rot: -5deg; --rot-hover: -3deg;
    --peel-img: url(../assets/images/livevoice-sticker.svg);
  }
  .m-stickers .sticker-helpcenter {         /* 400x400 PNG, rounded square */
    --w: 76px; --h: 76px; --nx: -.70711; --ny: -.70711;
    --d0: -3.46px; --q-hover: 14px; --ga: -45; --goff: 107.48px; --crease: 8px;
    --rot: 4deg; --rot-hover: 2deg;
    --peel-img: url(../assets/images/helpcenter-sticker.png);
  }
  .m-stickers .sticker-kathtreff {          /* 400x400 SVG, rounded square */
    --w: 72px; --h: 72px; --nx: .70711; --ny: -.70711;
    --d0: 47.63px; --q-hover: 13px; --ga: 45; --goff: 50.91px; --crease: 8px;
    --rot: 6deg; --rot-hover: 4deg;
    --peel-img: url(../assets/images/kathtreff-sticker.svg);
  }
  .m-stickers .sticker-hci {                /* 440x250 PNG: the programme site's
                                               teal photo in a pebble shape */
    --w: 110px; --h: 62.5px; --nx: -.70711; --ny: .70711;
    --d0: 28.46px; --q-hover: 14px; --ga: 225; --goff: 77.78px; --crease: 8px;
    --rot: -4deg; --rot-hover: -2deg;
    --peel-img: url(../assets/images/hci-sticker.png);
  }

  /* "Coming soon" for stickers without a page: shown on tap, centred on
     the sticker, then hides again */
  .m-stickers .m-soon {
    position: absolute; left: 50%; top: 50%; z-index: 2;
    font-family: 'B612 Mono', ui-monospace, monospace;
    font-size: 12px; line-height: 1.35; letter-spacing: 0.3px; color: var(--ink);
    opacity: 0; transform: translate(-50%, -40%); pointer-events: none;
    scale: 1.25;                    /* undo the stickers' .8, so the box is full size */
    translate: var(--dx, 0px) 0;    /* nudged back inside the screen near an edge (js/m-list.js) */
    transition: opacity .2s ease, transform .25s cubic-bezier(.2, .8, .2, 1);
  }
  .m-stickers .show-soon { z-index: 8; }
  .m-stickers .show-soon .m-soon { opacity: 1; transform: translate(-50%, -50%); }
  /* a tap leaves the sticker "hovered", and the desktop callout's hover
     rule (css/stickers.css) would reset the box's centring and show it
     on its own: keep it centred, and shown only while .show-soon is on */
  .m-stickers .sticker-peel:is(:hover, :focus-visible) .m-soon { opacity: 0; transform: translate(-50%, -40%); }
  .m-stickers .sticker-peel.show-soon:is(:hover, :focus-visible) .m-soon { opacity: 1; transform: translate(-50%, -50%); }
}

/* wider screens that still get the mobile layout (a narrow laptop
   window, a tablet): stickers at full size and scattered loosely,
   rather than in the phone's rows */
@media (min-width: 500px) and (max-width: 767px) {
  .m-stickers { flex-basis: 430px; }
  .mobile-projects .m-stickers { height: 430px; }
  .m-stickers .sticker-peel { scale: 1; }
  .m-stickers .m-soon { scale: 1; }
  .m-stickers .sticker-molnia      { left: 6%;  top: 34px; }
  .m-stickers .sticker-easyquizy   { left: 27%; top: 0; }
  .m-stickers .sticker-random      { left: 50%; top: 70px; }
  .m-stickers .sticker-livevoice   { left: 79%; top: 22px; }
  .m-stickers .sticker-ether       { left: 12%; top: 168px; }
  .m-stickers .sticker-kathtreff   { left: 38%; top: 146px; }
  .m-stickers .sticker-innovobot   { left: 63%; top: 196px; }
  .m-stickers .sticker-hci         { left: 3%;  top: 316px; }
  .m-stickers .sticker-pasamontana { left: 31%; top: 268px; }
  .m-stickers .sticker-helpcenter  { left: 52%; top: 330px; }
  .m-stickers .sticker-hood        { left: 75%; top: 316px; }
}
