/* Narrow, source-verified fixes. Existing page layouts and artwork are unchanged. */
body > header { position: relative; }

@media (max-width: 850px) {
  /* Anchor to the real header height, including wrapping and larger text settings. */
  body > header > #nav { inset-block-start: 100%; }
}

/* Keep the existing outer monitor width. The screen ratio belongs to its content,
   not to the bezel and chin; otherwise the scaled document loses its lower edge. */
.refined-content :is(#works, .portfolio-details) .screen-case :is(.static-laptop-screen, .laptop-screen) {
  box-sizing: content-box;
  inline-size: calc(100% - 10px);
  block-size: auto;
  aspect-ratio: 1440 / 900;
}
.refined-content :is(#works, .portfolio-details) .screen-case .static-laptop-screen img {
  object-fit: contain;
}

/* The live page keeps a true 390 x 800 viewport. Padding is outside that ratio.
   This also applies to the standalone nurse preview, not to captured phone images. */
.refined-content :is(#works, .portfolio-details) .screen-case :is(.desktop-phone-pair, .single-phone) > .phone-device {
  aspect-ratio: auto;
}
.refined-content :is(#works, .portfolio-details) .screen-case .phone-screen {
  block-size: auto;
  aspect-ratio: 390 / 800;
}

@media (max-width: 640px) {
  .refined-content :is(#works, .portfolio-details) .screen-case :is(.static-laptop-screen, .laptop-screen) {
    inline-size: calc(100% - 8px);
  }
}

/* Captured phone screens keep their source ratio; never crop or stretch text. */
.refined-content :is(#works,.portfolio-details) .screen-case .desktop-phone-pair > .static-phone {aspect-ratio:auto;}
.refined-content :is(#works,.portfolio-details) .screen-case .desktop-phone-pair .static-phone img {block-size:auto;object-fit:contain;aspect-ratio:auto;}
.refined-content .screen-case .preview-poster {opacity:1;object-fit:contain;aspect-ratio:auto;}
.refined-content .portfolio-index .screen-stage {padding:0;background:transparent;border:0;}
.refined-content .portfolio-index .screen-case {margin-block-end:16px;}
.refined-content .portfolio-index .print-stage img {block-size:auto;object-fit:contain;}

.brochure-pages{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,12rem),1fr));gap:clamp(14px,2vw,28px);align-items:start;}
.brochure-pages figure{margin:0;min-inline-size:0;}
.brochure-pages img{inline-size:100%;block-size:auto;object-fit:contain;}
.brochure-pages figcaption{font-size:12px;text-align:center;margin-block-start:8px;}
.brochure-all{margin-block-start:24px;}
.brochure-all summary{cursor:pointer;padding-block:16px;}
.brochure-all summary:focus-visible{outline:2px solid currentColor;}
.brochure-all summary:active{opacity:.7;}
