/* Loaded only by the Pep Pals case study. Keep full-bleed scenes, but cap
   reading and interactive surfaces so ultrawide screens retain their scale. */
:root {
  --case-gutter: max(clamp(20px, 5.5vw, 88px), calc((100vw - 1600px) / 2));
  --pep-screen-gutter: max(clamp(24px, 5.2vw, 90px), calc((100vw - 1480px) / 2));
}
main, .case-overview__story, .case-meta > div, .case-language > div,
.case-highlight, .pep-digital-chapter, .pep-type { min-width: 0; }
.case-intro { padding-inline: var(--case-gutter); }
.case-intro h1 { font-size: clamp(56px, 10.8vw, 180px); }
.case-intro__bottom { flex-wrap: wrap; gap: 24px 40px; }
.case-intro__bottom p { text-wrap: balance; }
.case-text-link { min-height: 44px; }
.case-hero {
  width: calc(100% - 2 * clamp(16px, 2vw, 40px));
  max-width: 1760px; margin-inline: auto; padding: 0;
}
.case-hero.case-hero--landscape .case-image {
  aspect-ratio: 3 / 2; max-height: min(90svh, 960px);
}
.case-hero--landscape .case-image img { object-position: 50% 20%; }
.case-figure figcaption { align-items: flex-start; overflow-wrap: anywhere; gap: 12px 24px; }
.case-figure figcaption > span:last-child { flex-shrink: 0; }
.case-image__expand { width: 44px; height: 44px; }
.case-overview {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr);
  gap: clamp(28px, 6vw, 100px);
  padding: clamp(48px, 6vw, 96px) var(--case-gutter) 24px;
}
.case-meta dd { overflow-wrap: anywhere; }
.case-overview h2 { text-wrap: balance; }
.case-overview__story > p:last-child { max-width: 52ch; font-size: clamp(16px, 1.35vw, 20px); }
.case-gallery { padding-inline: var(--case-gutter); }
.case-gallery__pair { gap: clamp(16px, 2vw, 32px); margin-block: clamp(24px, 3vw, 48px); }
.case-highlights { padding: clamp(48px, 5vw, 88px) var(--case-gutter); }
.case-highlights__grid { gap: clamp(24px, 3vw, 48px); }
.case-highlight h3 { text-wrap: balance; }
.case-highlight p { font-size: clamp(14px, 1.05vw, 17px); }
.case-language {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: clamp(28px, 5vw, 70px); padding-inline: var(--case-gutter);
}
.case-swatch { min-width: 0; min-height: clamp(100px, 11vw, 180px); }
.pep-digital-showcase {
  padding-left: var(--pep-screen-gutter); padding-right: var(--pep-screen-gutter);
}
.pep-digital-chapter__title { font-size: clamp(32px, 9.5vw, 145px); }
.pep-digital-chapter--sauces .pep-digital-chapter__title { font-size: clamp(29px, 8.7vw, 133px); }
.pep-digital-frame { margin-top: 36px; }
.pep-preview { max-width: 100%; }
.pep-type__controls { grid-template-columns: minmax(0, 1fr) minmax(140px, 180px) 44px; gap: clamp(18px, 2.5vw, 30px); }
.pep-type__input { font-size: 16px; min-height: 48px; }
.pep-type__try { min-width: 44px; min-height: 44px; }
.pep-type__size input { height: 44px; touch-action: pan-y; }
.pep-type__sample { min-width: 0; }
.pep-photo-journey { background: #201914; }
.pep-photo-journey .pep-photo-story { max-width: 2000px; margin-inline: auto; }
.pep-photo-story__chapter { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 80px); }
.contact-footer.onform-footer {
  --footer-gutter: max(clamp(20px, 6vw, 100px), calc((100vw - 1600px) / 2));
}
.onform-footer__grid { grid-template-columns: minmax(0, 2.7fr) minmax(0, 1fr); }
.onform-footer h2 { font-size: clamp(54px, 8.6vw, 156px); }
.onform-footer__aside, .onform-footer__aside > div { min-width: 0; }
.onform-footer__contact { max-width: 100%; }
.onform-footer__legal { flex-wrap: wrap; }
.project-lightbox {
  padding-top: max(72px, calc(env(safe-area-inset-top) + 60px));
  padding-bottom: max(80px, calc(env(safe-area-inset-bottom) + 72px));
}
.project-lightbox__close { min-width: 44px; min-height: 44px; top: max(12px, env(safe-area-inset-top)); }

/* Portrait tablets need the reading column to breathe, while the previews
   continue to select their own desktop/mobile canvas from available width. */
@media (max-width: 1000px) {
  .case-overview { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .case-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; }
  .case-meta > div:last-child { grid-column: auto; }
  .case-language { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .case-language p:last-child { max-width: 50ch; }
  .onform-footer__grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .onform-footer h2 { font-size: clamp(54px, 10.8vw, 108px); }
  .onform-footer__aside { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
  .onform-footer__aside > p { max-width: 25ch; }
  .onform-footer__contact { margin-top: 0; }
}
@media (min-width: 701px) and (max-width: 1000px) {
  .pep-character-stage .pep-character-pal__art { height: clamp(215px, 29vw, 290px); }
  .pep-character-pal__name { font-size: clamp(18px, 2.2vw, 23px); }
  .pep-character-pal__voice { font-size: 9px; letter-spacing: .015em; }
  .case-highlights__grid { gap: 24px; }
  .case-highlight h3 { font-size: 20px; }
}
@media (max-width: 700px) {
  :root { --case-gutter: clamp(20px, 5vw, 32px); --pep-screen-gutter: clamp(20px, 5vw, 32px); }
  .case-intro { padding-top: 28px; padding-bottom: 32px; }
  .case-intro h1 { font-size: clamp(54px, 13vw, 88px); margin: 28px 0 22px; }
  .case-intro__bottom { align-items: flex-start; gap: 16px; }
  .case-intro__bottom p { font-size: clamp(21px, 5.3vw, 28px); }
  .case-hero { width: calc(100% - 32px); }
  .case-overview { gap: 32px; padding-top: 48px; }
  .case-overview h2 { font-size: clamp(28px, 7.5vw, 40px); }
  .case-meta { gap: 22px; }
  .case-meta dd { font-size: 14px; }
  .case-highlights__grid, .case-gallery__pair { grid-template-columns: minmax(0, 1fr); }
  .case-gallery__pair { gap: 28px; }
  .case-figure figcaption { font-size: 10px; gap: 12px; }
  .case-highlights > h2 { font-size: clamp(30px, 7.6vw, 44px); }
  .case-highlight p { max-width: 48ch; font-size: 15px; }
  .case-language { padding-top: 32px; padding-bottom: 48px; }
  .case-language h2 { font-size: clamp(28px, 7vw, 40px); }
  .case-swatch { padding: 12px; }
  .pep-character-stage { min-height: clamp(470px, 126vw, 600px); overflow: clip; clip-path: none; }
  .pep-character-pal { --depth: clamp(10px, 2.4vw, 14px); --step: clamp(100px, 28vw, 150px); }
  .pep-character-pal--mango { --step: clamp(150px, 44vw, 220px); }
  .pep-character-pal--fire { --step: clamp(200px, 60vw, 300px); }
  .pep-character-stage .pep-character-pal__art { height: clamp(130px, 36vw, 200px); }
  .pep-character-pal figcaption { padding: 18px 7px; }
  .pep-character-pal__name { font-size: clamp(16px, 3.9vw, 23px); overflow-wrap: normal; }
  .pep-character-pal__voice { font-size: 8px; letter-spacing: 0; line-height: 1.5; }
  .pep-digital-showcase { padding-top: 40px; margin-bottom: 48px; }
  .pep-digital-chapter__title { font-size: clamp(27px, 9.9vw, 68px); margin-bottom: 24px; }
  .pep-digital-chapter--sauces .pep-digital-chapter__title { font-size: clamp(25px, 9vw, 62px); }
  .pep-digital-chapter--sauces { margin-top: 48px; }
  .pep-digital-frame { margin-top: 32px; }
  .pep-type__controls { grid-template-columns: minmax(0, 1fr) 44px; gap: 16px; }
  .pep-type__size { grid-row: 2; grid-column: 1 / -1; width: min(100%, 230px); }
  .pep-type__try { grid-row: 1; grid-column: 2; }
  .pep-type__intro { font-size: 11px; line-height: 1.65; }
  .pep-photo-story__eyebrow { left: var(--case-gutter); font-size: 10px; letter-spacing: .12em; }
  .pep-photo-story__next-photo { left: var(--case-gutter); width: clamp(100px, 29vw, 160px); }
  .pep-photo-story__chapter { display: block; left: var(--case-gutter); right: var(--case-gutter); }
  .pep-photo-story__chapter > p { max-width: 34ch; }
  .onform-footer__aside { display: block; }
  .onform-footer__contact { margin-top: 20px; font-size: 18px; }
  .onform-footer .footer-bottom { margin-inline: var(--footer-gutter); }
  .onform-footer__navigation { gap: 8px 20px; }
  .onform-footer__navigation a { min-height: 44px; }
  .onform-footer__legal { gap: 12px 20px; line-height: 1.6; }
  .project-lightbox { padding: 72px 16px 132px; }
  .project-lightbox__bottom { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .project-lightbox__caption { max-width: none; overflow-wrap: anywhere; }
  .project-lightbox__controls { justify-content: flex-end; gap: 12px; }
}
@media (max-width: 480px) {
  .case-meta > div:nth-child(n + 3) { grid-column: 1 / -1; }
  .case-figure figcaption > span:last-child { font-size: 9px; }
  .onform-footer h2 { font-size: clamp(40px, 11.5vw, 55px); }
  .onform-footer__socials { flex-wrap: wrap; gap: 16px; }
}
/* Keep the image chapter usable on a phone held sideways. */
@media (max-height: 540px) and (min-width: 701px) {
  .pep-photo-story__next-photo { width: min(22vw, 32svh); top: 14%; }
  .pep-photo-story__chapter { bottom: 5%; gap: 32px; }
  .pep-photo-story__chapter h3, .pep-photo-journey .pep-photo-story__title { font-size: clamp(48px, 8vw, 90px); }
  .pep-photo-story__chapter p:first-child { margin-bottom: 12px; font-size: 9px; }
  .pep-photo-story__chapter > p { font-size: 13px; line-height: 1.45; }
}

/* Deep links leave the fixed navigation clear of the section heading. */
.pep-character-stage[id], .pep-digital-chapter[id], .pep-type[id],
.pep-photo-story[id], .contact-footer[id], #pep-sauces-title { scroll-margin-top: 88px; }
