/* LLL — Selected works on a laptop or a tablet held sideways (client,
   2026-11-19: "on a laptop the room becomes horizontal"; 2026-11-20: her
   own wide room, "pokoj_wymiar website 2.png", the four frames painted in
   it, one row: Rebecca · Phia · MS Moda · Old Garden). It covers the screen
   (at most zoomed a little; on a 4:3 screen its side walls run off the
   edges, the frames all stay in view). Each frame button carries the same
   frame cut from her room (assets/selected-works-tablet/ramy.py; tablets:
   her 4:3 and 3:4 rooms, below),
   laid exactly over itself, as on the phone — so it lifts off the wall.
   Nothing is blurred.

   .niche itself stays the phone-shaped box (100dvh tall, centred, --drop
   lower): the case window is measured in its cqw and must not change. The
   room, the dim and the frames are laid round it in screen units. */

picture { display: contents; }   /* the phone picture's box exactly as before */

/* Her rooms by screen shape (client, 2026-11-20): 16:9 on a laptop, 4:3 on a
   tablet held sideways (and 3:2 screens, ~5 % cropped top and bottom), 3:4
   on a tablet held upright (and 10:16 ones, ~8 % cropped at the sides). The
   <picture> sources in selected-works use the same bands. */
@media (min-aspect-ratio: 4/3) and (min-height: 600px),
       (min-aspect-ratio: 3/5) and (max-aspect-ratio: 1/1) and (min-width: 600px) {
  .works .niche {
    --ar: 1.7917;                                   /* her laptop room, 5504 × 3072 */
    --rw: max(100vw, 100dvh * var(--ar));           /* the room, cover-fitted */
    --rh: max(100dvh, 100vw / var(--ar));
    --rx: calc(50% - var(--rw) / 2);                /* its corner, from the niche box */
    --ry: calc(50% - var(--rh) / 2 - var(--drop));
  }
  .works .niche::before { display: none; }         /* the mirrored strip: the room is tall enough */
  .works .niche-base,
  .works .niche-dim {
    inset: auto;
    left: var(--rx);
    top: var(--ry);
    width: var(--rw);
    height: var(--rh);
    max-width: none;
  }
  .works .niche-base { position: absolute; }

  .works .frame {
    left: calc(var(--rx) + var(--rw) * var(--gx) / 100);
    top: calc(var(--ry) + var(--rh) * var(--gy) / 100);
    width: calc(var(--rw) * var(--gw) / 100);
    height: calc(var(--rh) * var(--gh) / 100);
  }
  /* Her frames' shadows are painted in her wall, as on the phone (works.css). */

  /* The frames in % of the room (x, y, width, height), measured off it
     (assets/selected-works-tablet/ramy-*.json). */
  .works .frame[data-case="rebecca"]    { --gx: 17.805; --gy: 32.129; --gw: 14.807; --gh: 38.509; }
  .works .frame[data-case="phia"]       { --gx: 34.339; --gy: 35.514; --gw: 15.389; --gh: 36.556; }
  .works .frame[data-case="ms-moda"]    { --gx: 52.98; --gy: 32.454; --gw: 12.754; --gh: 38.379; }
  .works .frame[data-case="old-garden"] { --gx: 70.167; --gy: 34.049; --gw: 13.209; --gh: 32.78; }
}
@media (min-aspect-ratio: 4/3) and (max-aspect-ratio: 1549/1000) and (min-height: 600px) {
  .works .niche { --ar: 1.3333; }                  /* her 4:3 room, 4096 × 3072 */
  .works .frame[data-case="rebecca"]    { --gx: 16.699; --gy: 32.227; --gw: 16.211; --gh: 31.38; }
  .works .frame[data-case="phia"]       { --gx: 33.105; --gy: 33.984; --gw: 17.31; --gh: 30.664; }
  .works .frame[data-case="ms-moda"]    { --gx: 52.002; --gy: 37.63; --gw: 14.648; --gh: 32.943; }
  .works .frame[data-case="old-garden"] { --gx: 68.433; --gy: 32.454; --gw: 14.795; --gh: 27.441; }
}
@media (min-aspect-ratio: 3/5) and (max-aspect-ratio: 1/1) and (min-width: 600px) {
  .works .niche { --ar: .75; }                     /* her 3:4 room, 4096 × 5462 */
  .works .head { left: 0; translate: none; width: 100%; }   /* the room fills the screen: so does the bar (the footer: foot.js) */
  .works .frame[data-case="rebecca"]    { --gx: 24.219; --gy: 25.32; --gw: 23.193; --gh: 25.247; }
  .works .frame[data-case="phia"]       { --gx: 53.931; --gy: 25.339; --gw: 23.169; --gh: 23.288; }
  .works .frame[data-case="ms-moda"]    { --gx: 55.762; --gy: 50.201; --gw: 20.312; --gh: 25.577; }
  .works .frame[data-case="old-garden"] { --gx: 27.588; --gy: 52.472; --gw: 20.557; --gh: 21.476; }
}

/* A client's story on a laptop (client, 2026-11-20): the same Mac window,
   laid sideways — the words on the left (back link, title, the story's
   parts, previous / next project), the monitor with her pictures on the
   right. Her marked screenshot: a little taller (the monitor larger); the
   words start level with the monitor's top and "previous / next project"
   end level with its bottom; a label ("What changed") never runs into its
   text. Same pieces, same order, same behaviour (works.js, case.js); sized
   in cqw of the niche (166 cqw wide, ~135 cqw tall). */
@media (min-aspect-ratio: 4/3) and (min-height: 600px) {
  .is-screen .case {
    left: calc(50cqw - 83cqw);
    right: calc(50cqw - 83cqw);
    padding: calc(var(--bar) + 8cqw) 5cqw 9cqw;
    font-size: max(3cqw, 12px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 86cqw;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    column-gap: 5cqw;
    align-items: start;
  }
  .is-screen .case .story { display: contents; }
  .is-screen .case-nav { grid-column: 1; grid-row: 1; margin: 0; }
  .is-screen .case-title { grid-column: 1; grid-row: 2; margin: 3cqw 0 3.4cqw; font-size: 8.2cqw; }
  .is-screen .story-texts { grid-column: 1; grid-row: 3; align-self: stretch; height: auto; min-height: 0; }
  .is-screen .story-text { grid-template-columns: max-content minmax(0, 1fr); column-gap: 3.2cqw; }
  .is-screen .case-pn { grid-column: 1; grid-row: 4; align-self: end; margin: 2cqw 0 0; }
  .is-screen .pn-btn { font-size: max(2.8cqw, 11px); }
  .is-screen .crt {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: start;
    width: 86cqw;
    margin: 0;
    padding: 5.1cqw 4.5cqw 10cqw;
  }
}
