/* =====================================================================
   Patchwork page, v2 redesign (2026-10-16). Linked ONLY from the Patchwork page's shell, after build.css,
   and every rule is scoped to <body class="pw-page">, so nothing here can reach HHH, Shovl or the case pages.
   The page's older rules (the .dscard.patchwork card, the .pw-log build log) stay in build.css.
   ===================================================================== */

/* Screen captions carry meaning on this page (phone or desktop, light or dark, the Magic steps), so show them. */
.pw-page .device .cap{ display:block; text-align:center; }

/* ---------- One phone model and one laptop model, scaled (Asia, 2026-10-16) ----------
   build.css draws the frames in fixed pixels, so a smaller device got a relatively thicker bezel and rounder
   corners, i.e. a different model. Here every part of a frame is a share of the device's own width:
   - phone: the 228px phone (8px bezel, 30px outer corners, 26px screen corners). The phone is a size container
     and --u = 1/228 of its width. The bezel is drawn by ::before, because an element can't size its own padding
     from its own width, but its pseudo-element and children can.
   - laptop: the 460px laptop, exactly as the Shovl page (11px bezel, 13px base with a 22px overhang a side, 80px
     notch). With its base a laptop is 504u wide, so a laptop that fills a slot is 460/504 of it.
   Every place that sizes a device below gives it an explicit width, which size containment needs. */
.pw-page .phone{ container-type:inline-size; --u:calc(100cqw / 228); position:relative;
  padding:0; background:none; border-radius:0; box-shadow:none; }
.pw-page .phone::before{ content:""; position:absolute; inset:0; background:#241E18;
  border-radius:calc(30 * var(--u)); box-shadow:0 calc(8 * var(--u)) calc(22 * var(--u)) rgba(31,25,21,.07); }
.pw-page .phone .scr{ position:relative; width:calc(100% - 16 * var(--u)); height:auto; margin:calc(8 * var(--u));
  border-radius:calc(26 * var(--u)); }

.pw-page .laptop{ container-type:inline-size; --u:calc(100cqw / 460); }
.pw-page .laptop .lid{ padding:calc(11 * var(--u)) calc(11 * var(--u)) calc(12 * var(--u));
  border-radius:calc(16 * var(--u)) calc(16 * var(--u)) calc(4 * var(--u)) calc(4 * var(--u)); }
.pw-page .laptop .scr{ border-radius:calc(5 * var(--u)); }
.pw-page .laptop .base{ height:calc(13 * var(--u)); margin:0 calc(-22 * var(--u));
  border-radius:0 0 calc(12 * var(--u)) calc(12 * var(--u)); box-shadow:0 calc(10 * var(--u)) calc(20 * var(--u)) rgba(31,25,21,.07); }
.pw-page .laptop .base::before{ width:calc(80 * var(--u)); height:calc(5 * var(--u)); border-radius:0 0 calc(6 * var(--u)) calc(6 * var(--u)); }

/* Screens that belong to a text section sit inside its content column, under the text (Asia, 2026-10-16, same
   rule as the Shovl page). Only the gallery after the feature grid ("It kept growing") stays full width: it
   follows a plain .csec, not a .csec.split. The offset mirrors .csec.split's grid: 0.5fr / 1.5fr + its gap. */
@media(min-width:761px){
  .pw-page main.wrap > .csec.split + .devices{ --g:clamp(1.8rem,4vw,3.5rem); --gap:clamp(1.2rem,2.6vw,2.2rem);
    margin:clamp(1.8rem,4vw,2.6rem) 0 0 calc((100% - var(--g)) * .25 + var(--g));
    justify-content:flex-start; align-items:flex-end; flex-wrap:nowrap; column-gap:var(--gap); }
  /* phones share the row evenly, never wider than the 228px model */
  .pw-page main.wrap > .csec.split + .devices .device:has(.phone){ flex:0 1 228px; min-width:0; }
  .pw-page main.wrap > .csec.split + .devices .phone{ width:100%; }
  /* a laptop beside a phone (one thing on two surfaces), same height, bottoms aligned. Both scale with width
     (phone 474.8/228 tall per wide, laptop with its base 309.75/504), so the phone takes 0.2279 of the row. */
  .pw-page main.wrap > .csec.split + .devices:has(.laptop) .device:has(.phone){ flex:0 0 calc((100% - var(--gap)) * .2279); }
  .pw-page main.wrap > .csec.split + .devices .device:has(.laptop){ flex:1 1 0; min-width:0; }
  .pw-page main.wrap > .csec.split + .devices .laptop{ width:calc(100% * 460 / 504); margin:0 auto; }   /* base included, it fills the slot */
}

/* Phones (the viewport): two phones a row instead of build.css's three tiny ones; a laptop gets its own row. */
@media(max-width:760px){
  .pw-page .devices{ justify-content:center; column-gap:1rem; }
  .pw-page .devices .phone{ width:min(228px, 40vw); }
  .pw-page .devices .device:has(.laptop){ flex:0 0 100%; min-width:0; }
  .pw-page .devices .laptop{ width:min(460px, calc(100% * 460 / 504)); }
}

/* Outcome label: like the section headings, colour (and italics) only on the accent word, "The <em>point</em>"
   (Asia, 2026-10-16). build.css colours the whole label. */
.pw-page .bcase-eyebrow{ font-style:normal; color:var(--text-primary); }
.pw-page .bcase-eyebrow em{ font-style:italic; color:var(--text-accent); }

/* Design-system card: a row of the app's real stickers, on a stage the colour of the app's canvas (like the
   component tiles). Eight in a row on a wide card, four on a phone. */
.pw-page .dscard.patchwork .pw-stickers{ display:grid; grid-template-columns:repeat(8,minmax(0,1fr)); gap:.5rem;
  justify-items:center; align-items:center; padding:.9rem .75rem; border-radius:14px; background:#f5f4ef;
  box-shadow:inset 0 0 0 1px var(--ds-line); }   /* same stage as the component tiles (.pw-cmp__stage) */
.pw-page .dscard.patchwork .pw-stickers img{ display:block; width:100%; max-width:72px; height:auto; }
@media(max-width:600px){ .pw-page .dscard.patchwork .pw-stickers{ grid-template-columns:repeat(4,minmax(0,1fr)); } }
