/* Shared device mockups for The Library (home cover + project page) */

/* iPhone with a status-bar strip so the Dynamic Island never covers the app's nav.
   Strip color matches the top of The Library's mobile screenshots (#f8f3e4). */
.iphone--inset .iphone__screen { padding-top: 13%; background: var(--inset, #f8f3e4); }
.iphone--inset .iphone__screen img { height: 100%; object-fit: cover; object-position: top; }

/* Project page: laptop + iPhone side by side, no overlap */
.stage--setup { aspect-ratio: auto !important; display: flex; align-items: center; justify-content: center; gap: 4%; padding: 7% 6% 6%; }
.stage--setup::after { display: none; }
.stage--setup .laptop { flex: 0 0 70%; display: flex; flex-direction: column; align-items: center; }
.stage--setup .laptop__lid { width: 86%; padding: 2.2% 2.2% 2.6%; background: #161618; border-radius: 12px 12px 3px 3px; box-shadow: 0 0 0 1px rgba(255,255,255,.16), 0 30px 60px -24px rgba(0,0,0,.55); }
.stage--setup .laptop__screen { border-radius: 3px; overflow: hidden; background: #fff; }
.stage--setup .laptop__screen img { display: block; width: 100%; height: auto; }
.stage--setup .laptop__base { position: relative; width: 100%; height: clamp(8px, 1.4vw, 16px); background: linear-gradient(#e3e3e6, #a9a9ae 70%, #7d7d82); border-radius: 2px 2px 12px 12px; box-shadow: 0 18px 30px -12px rgba(0,0,0,.5); }
.stage--setup .laptop__base span { position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 16%; height: 40%; background: #9a9a9f; border-radius: 0 0 6px 6px; }
.stage--setup .setup__phone { flex: 0 0 19%; }
.stage--setup .iphone { position: relative; inset: auto; width: 100%; transform: none !important; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.12); }
@media (max-width: 640px) {
  .stage--setup { gap: 3%; padding: 8% 4% 6%; }
  .stage--setup .laptop { flex-basis: 72%; }
  .stage--setup .setup__phone { flex-basis: 22%; }
}

/* one large phone (case-study openers) */
.stage--hero-phone { aspect-ratio: auto !important; display: grid; place-items: center; padding: clamp(36px, 5vw, 64px) 0 clamp(28px, 4vw, 48px); }
.stage--hero-phone::after { display: none; }
.stage--hero-phone .iphone, .stage--hero-phone .vphone { position: relative; inset: auto; width: min(320px, 64%); transform: none !important; }
.stage--hero-phone .vphone { height: auto; border-radius: 14% / 6.8%; box-shadow: 0 40px 70px -24px rgba(0,0,0,.6); }

/* Pastella: Figma screen recordings placed inside the site iPhone.
   The recordings include Figma's own phone frame; the screen sits at x=21, y=17, 398x867 of a 442px-wide video.
   Scaling and offsetting the video crops that frame so only the app screen shows. */
.iphone__screen.vcrop { position: relative; }
.iphone__screen.vcrop video { position: absolute; width: 111.06%; max-width: none; height: auto; left: -5.28%; top: -1.96%; object-fit: initial; }
.stage--pair { aspect-ratio: auto !important; display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); justify-content: center; gap: clamp(20px, 5vw, 64px); padding: clamp(32px, 4vw, 56px) 0 clamp(24px, 3vw, 40px); }
.stage--pair::after { display: none; }
.stage--pair .iphone { position: relative; inset: auto; width: 100%; transform: none !important; }
.stage--pair figcaption, .stage--pair .label { display: block; text-align: center; margin-top: 12px; }

/* sizing wrapper: percentages inside .iphone resolve against the phone, not the stage */
.stage--hero-phone .phone-box { width: min(320px, 64%); }
.stage--hero-phone .phone-box .iphone { width: 100%; }
.stage--hero-phone > .iphone { width: min(320px, 64%); }

/* Pastella recordings: crop Figma's frame and status bar, add a status strip for the Dynamic Island */
.iphone__screen.vcrop.inset-white { background: #fff; }
.iphone__screen.vcrop.inset-white video { top: 3.4%; }
.iphone__screen.vcrop.inset-white::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6.6%; background: #fff; z-index: 1; }
/* hide the Dynamic Island baked into the Figma recordings (x 160–283, y 31–66 of the 442px video) */
.iphone__screen.vcrop.inset-white::after { content: ""; position: absolute; left: 34.6%; width: 31.6%; top: 6.7%; height: 4.6%; background: #fff; border-radius: 999px; z-index: 1; }
/* final Pastella crop: whole app screen fits under the status strip, frame edges masked */
.iphone__screen.vcrop.inset-white video { width: 104.84%; left: -2.18%; top: 3.22%; }
.iphone__screen.vcrop.inset-white::before { height: 100%; background:
  linear-gradient(#fff,#fff) top / 100% 5.1% no-repeat,
  linear-gradient(#fff,#fff) left / 2.9% 100% no-repeat,
  linear-gradient(#fff,#fff) right / 2.9% 100% no-repeat; }
.iphone__screen.vcrop.inset-white::after { left: 34.8%; width: 31.2%; top: 6.3%; height: 4.5%; }

/* single laptop (case-study opener) and flat close-ups */
.stage--laptop { aspect-ratio: auto !important; display: grid; place-items: center; padding: clamp(36px, 5vw, 64px) 6% clamp(28px, 4vw, 48px); }
.stage--laptop::after { display: none; }
.stage--laptop .laptop { width: min(100%, 860px); display: flex; flex-direction: column; align-items: center; }
.stage--laptop .laptop__lid { width: 86%; padding: 2.2% 2.2% 2.6%; background: #161618; border-radius: 12px 12px 3px 3px; box-shadow: 0 0 0 1px rgba(255,255,255,.16), 0 30px 60px -24px rgba(0,0,0,.55); }
.stage--laptop .laptop__screen { border-radius: 3px; overflow: hidden; background: #fff; }
.stage--laptop .laptop__screen img { display: block; width: 100%; height: auto; }
.stage--laptop .laptop__base { position: relative; width: 100%; height: clamp(9px, 1.4vw, 16px); background: linear-gradient(#e3e3e6, #a9a9ae 70%, #7d7d82); border-radius: 2px 2px 12px 12px; box-shadow: 0 18px 30px -12px rgba(0,0,0,.5); }
.stage--laptop .laptop__base span { position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 16%; height: 40%; background: #9a9a9f; border-radius: 0 0 6px 6px; }
.closeup { margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #f6f8fc; }
.closeup img { display: block; width: 100%; height: auto; }

/* Home cover, The Library: laptop is the hero; small phone tucked low at its bottom-right corner */
.card .card__media--setup:not(.card__media--solo) { display: block; position: relative; padding: 0; }
.card .card__media--setup:not(.card__media--solo) .laptop { position: absolute; left: 6%; top: 50%; width: 78%; transform: translateY(-50%); }
.card:hover .card__media--setup:not(.card__media--solo) .laptop { transform: translateY(calc(-50% - 4px)); }
.card .card__media--setup:not(.card__media--solo) .setup__phone { position: absolute; right: 5%; width: 15%; top: 50%; transform: translateY(-14%); margin: 0; }
.card:hover .card__media--setup:not(.card__media--solo) .setup__phone { transform: translateY(calc(-14% - 6px)); }
/* video inside an inset iPhone fills the screen below the status strip */
.iphone--inset .iphone__screen video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* Pastella: original recordings with the iPhone frame baked in; clip only the black corners */
.pvid { position: relative; width: 100%; filter: drop-shadow(0 26px 24px rgba(0,0,0,.35)); }
.pvid video { display: block; width: 100%; height: auto; clip-path: inset(0.25% 1.4% round 17% / 8.5%); }
