/* Product screen treatment. Approved 13 November 2026, revised the same day.
   - Navy-frame captures (data-screen-frame): the real app screenshot with its own navy shell,
     shown directly on the page. No colour area, no added corner radius, no shadow.
   - Portrait captures (data-screen-shape="phone"): a simple dark phone bezel.
   - Detail crops (desktop captures without the navy frame): the pale colour area (#E9EDF3)
     with the screenshot as a white surface, so their white edges don't disappear into the page.
     On phones every desktop capture becomes a readable detail crop.
   launch-media.js (and the installer, for first paint) set data-screen-shape, data-screen-frame,
   data-screen-anchor and --screen-ratio / --focus-x / --focus-w on each slot. */

:is(.product-slot, .story-visual, .feature-detail-visual, .audience-screen).launch-screen {
  --phone-h: 552px;
  box-sizing: border-box; container-type: inline-size;
  display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-start;
  gap: 0; height: auto; min-height: 0; aspect-ratio: auto; padding: 0;
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
  overflow: visible; text-align: left;
}
.launch-screen > img {
  display: block; box-sizing: border-box; flex: none;
  min-width: 0; max-width: none; max-height: none; object-fit: fill; margin: 0;
  border: 0; border-radius: 0; box-shadow: none; background: #0F1528;
}

/* Navy frame: the whole screenshot with its own edges. Every frame in a wide area is the
   height of a full-width 16:10 frame, so 4:3 frames sit narrower and switches never jump. */
.launch-screen[data-screen-frame] > img { width: min(100cqw, calc(62.5cqw * var(--screen-ratio, 1.6))); height: auto; }
:is(.audience-hero-media, .product-overview) .launch-screen[data-screen-frame] { justify-content: center; }

/* Phone bezel */
.launch-screen[data-screen-shape="phone"] > img {
  width: auto; height: var(--phone-h);
  border: 8px solid #171A20; border-radius: 38px; background: #171A20;
  box-shadow: 0 18px 40px -14px rgba(15, 21, 40, .3);
}

/* Detail crop: pale colour area, white surface, deliberate crop of the lower edge. */
.launch-screen[data-screen-shape="desktop"]:not([data-screen-frame]) {
  --ls-pe: clamp(24px, 3.4vw, 48px);
  --ls-h: clamp(300px, 45vw, 650px);
  --ls-pt: var(--ls-pe); --ls-pb: 0px; --ls-px: clamp(20px, 3.9vw, 56px);
  height: var(--ls-h); padding: var(--ls-pt) var(--ls-px) var(--ls-pb);
  background: #E9EDF3; border-radius: 24px; overflow: hidden;
}
.launch-screen[data-screen-shape="desktop"]:not([data-screen-frame]) > img {
  width: min(100%, 1120px); height: auto; margin: 0 auto;
  border-radius: 10px; background: #fff;
  box-shadow: 0 16px 46px -16px rgba(15, 21, 40, .26), 0 2px 6px rgba(15, 21, 40, .07);
}
/* Captures whose essential controls sit at the bottom crop their upper edge instead. */
.launch-screen[data-screen-anchor="bottom"]:not([data-screen-frame]) { --ls-pt: 0px; --ls-pb: var(--ls-pe); align-items: flex-end; }
.launch-media-hidden[hidden] { display: none !important; }

/* Split sections: about 35% copy / 65% image with a smaller gap. Stacked below 901px. */
@media (min-width: 901px) {
  .audience-page .editing-layout { grid-template-columns: minmax(0, 35fr) minmax(0, 65fr); gap: clamp(32px, 3.5vw, 56px); }
  .audience-page .invoice-section { grid-template-columns: minmax(0, 65fr) minmax(0, 35fr); gap: clamp(32px, 3.5vw, 56px); }
  :is(.editing-layout, .invoice-section) .audience-screen.launch-screen[data-screen-frame] > img { width: 100%; }
  :is(.editing-layout, .invoice-section) .audience-screen.launch-screen[data-screen-shape="desktop"]:not([data-screen-frame]) {
    --ls-h: clamp(340px, 34vw, 520px);
    --ls-pt: clamp(22px, 2.7vw, 38px); --ls-pb: var(--ls-pt); --ls-px: var(--ls-pt);
  }
  :is(.editing-layout, .invoice-section) .audience-screen.launch-screen[data-screen-shape="desktop"]:not([data-screen-frame]) > img {
    width: min(100%, calc((var(--ls-h) - var(--ls-pt) - var(--ls-pb)) * var(--screen-ratio, 1.6)));
    margin: auto;
  }
}
@media (max-width: 900px) {
  .audience-page .editing-layout, .audience-page .invoice-section { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .audience-page .invoice-section > div:first-child { order: 2; }
}

/* Product story: 35% copy / 65% media in one stable box; every step's screen is centred in it. */
.job-story { --story-h: clamp(440px, calc(100svh - 190px), 640px); }
.job-story .scroll-story { grid-template-columns: 35% 65%; column-gap: 0; }
.job-story .story-narrative { padding-right: clamp(24px, 3vw, 44px); }
.job-story .story-stage { top: max(20px, calc((100svh - var(--story-h)) / 2 - 30px)); }
.job-story .story-stage .story-visual.launch-screen { height: var(--story-h); align-items: center; justify-content: center; }
@media (min-width: 651px) {
  .job-story .story-visual.launch-screen > img { margin: auto; }
  .job-story .story-visual.launch-screen[data-screen-frame] > img { width: min(100%, calc(var(--story-h) * var(--screen-ratio, 1.6))); }
  .job-story .story-visual.launch-screen[data-screen-shape="phone"] > img { height: min(var(--phone-h), 100%); }
  .job-story .story-visual.launch-screen[data-screen-shape="desktop"]:not([data-screen-frame]) {
    --ls-h: var(--story-h); --ls-pt: clamp(24px, 2.7vw, 38px); --ls-pb: var(--ls-pt); --ls-px: var(--ls-pt);
  }
  .job-story .story-visual.launch-screen[data-screen-shape="desktop"]:not([data-screen-frame]) > img {
    width: min(100%, calc((var(--ls-h) - var(--ls-pt) - var(--ls-pb)) * var(--screen-ratio, 1.6)));
  }
}
@media (max-width: 900px) {
  /* Stacked: the media stays pinned at the top while the steps scroll beneath it. */
  .job-story { --story-h: clamp(300px, 56svh, 600px); }
  .job-story .scroll-story { display: flex; flex-direction: column-reverse; gap: 15px; }
  .job-story .story-stage { position: sticky; top: 0; padding: 12px 0; background: #fff; width: 100%; z-index: 2; }
  .job-story .story-narrative { width: 100%; padding-right: 0; }
}

@media (max-width: 650px) {
  /* Phones: every desktop capture is a readable detail crop. The chosen region (--focus-x,
     --focus-w) spans the full width of the pale area, as in the approved mock-up; the colour
     shows above it (below it for bottom-anchored captures) and the far edge is cropped.
     --focus-t / --focus-b limit the crop vertically: navy frames start just below the app's
     top bar and stop above its bottom edge, so the crop is a clean white detail with square corners.
     A crop shorter than the area is centred in it. */
  :is(.product-slot, .story-visual, .feature-detail-visual, .audience-screen).launch-screen[data-screen-shape="desktop"] {
    --ls-h: calc(100vw - 32px); --ls-pe: 20px; --ls-pt: 20px; --ls-pb: 20px; --ls-px: 18px;
    height: var(--ls-h); padding: var(--ls-pt) var(--ls-px) var(--ls-pb);
    background: #E9EDF3; border-radius: 18px; overflow: hidden; justify-content: flex-start;
  }
  :is(.product-slot, .story-visual, .feature-detail-visual, .audience-screen).launch-screen[data-screen-shape="desktop"] > img {
    --zoom-w: calc((100% + 2 * var(--ls-px)) / var(--focus-w, 1));
    --zoom-h: calc(var(--zoom-w) / var(--screen-ratio, 1.6));
    width: var(--zoom-w); height: auto; align-self: flex-start;
    margin: calc(max(0px, (var(--ls-h) - var(--ls-pt) - var(--ls-pb) - (var(--focus-b, 1) - var(--focus-t, 0)) * var(--zoom-h)) / 2) - var(--focus-t, 0) * var(--zoom-h))
      0 0 calc(-1 * var(--ls-px) - var(--focus-x, 0) * var(--zoom-w));
  }
  :is(.product-slot, .story-visual, .feature-detail-visual, .audience-screen).launch-screen[data-screen-frame] > img {
    clip-path: inset(calc(var(--focus-t, 0) * 100%) 0 calc((1 - var(--focus-b, 1)) * 100%) 0);
  }
  :is(.product-slot, .story-visual, .feature-detail-visual, .audience-screen).launch-screen[data-screen-anchor="bottom"][data-screen-shape="desktop"] > img {
    margin-top: 0; margin-bottom: 0; align-self: flex-end;
  }
  .launch-screen[data-screen-shape="phone"] > img { height: min(var(--phone-h), calc((100vw - 32px) * 1.4)); }
  /* The story keeps one stable pale area for every step on phones. */
  .job-story { --story-h: clamp(300px, 60svh, 560px); }
  .job-story .story-stage .story-visual.launch-screen {
    --ls-h: var(--story-h); height: var(--story-h); padding: 20px 18px;
    background: #E9EDF3; border-radius: 18px; overflow: hidden; justify-content: flex-start;
  }
  .job-story .story-stage .story-visual.launch-screen[data-screen-shape="phone"] > img { height: min(var(--phone-h), 100%); margin: auto; }
}

/* Section headings on these media pages: about 28% smaller, same two-tone style. */
body:has(.job-story) :is(.capability-summary, .story-heading, .directory-heading) h2 { font-size: clamp(43px, 3.25vw, 78px); }
body:has(.job-story) .next-step h2 { font-size: clamp(43px, 3.8vw, 78px); }
.audience-page main h2 { font-size: clamp(38px, 3.25vw, 72px); }
.source-page.feature-detail .feature-source h2 { font-size: 35px; }
@media (max-width: 900px) {
  body:has(.job-story) :is(.capability-summary, .story-heading, .directory-heading, .next-step) h2 { font-size: 40px; }
  .audience-page main h2 { font-size: 38px; }
}
@media (max-width: 650px) {
  body:has(.job-story) :is(.capability-summary, .story-heading, .directory-heading, .next-step) h2 { font-size: 30px; }
  .audience-page main h2 { font-size: 30px; }
}
@media (max-width: 700px) {
  .source-page.feature-detail .feature-source h2 { font-size: 25px; }
}

/* Feature pages: the media sits directly below the title and short description. */
.source-page.feature-detail .feature-detail-intro { padding-bottom: 0; }
.source-page.feature-detail > .feature-detail-visual.launch-screen { margin-top: clamp(32px, 3.8vw, 54px); }
.source-page.feature-detail .feature-source { padding-top: clamp(40px, 5.6vw, 80px); }
.source-page.feature-detail .feature-source-text {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6.25vw, 90px);
  align-items: start; max-width: none;
}
.source-page.feature-detail .feature-source-text > h2,
.source-page.feature-detail .feature-source-text > p { margin: 0; }
@media (max-width: 700px) {
  .source-page.feature-detail .feature-source-text { grid-template-columns: 1fr; gap: 20px; }
}
