/*
 * iPhone-specific rendering safeguards.
 *
 * iOS can terminate a page after its WebContent process exceeds the device's
 * memory/GPU budget. Keep desktop and iPad compositions intact, but exchange
 * the most expensive iPhone-only layers for existing lightweight posters.
 */

.project-scene__iphone-feature { display: none; }

html.is-iphone .work-canvas { display: none; }

html.is-iphone .work__sticky {
  background-color: #071112;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

html.is-iphone .work.iphone-work-poster-ready .work__sticky {
  background-image: url("./dist/client/sequences/sequence-1/frame-0.webp");
}

html.is-iphone .approach-card__backdrop { display: none; }

/* Keep one viewport-sized Explorations atmosphere on iPhone. WebKit's fixed
   3600px section background and filtered duplicate inside the glass can be
   composited at the wrong scale and defeat rounded clipping. */
html.is-iphone .explorations {
  background-image: none;
  background-attachment: scroll;
}

html.is-iphone .explorations .explorations__sticky {
  background-color: var(--spirit);
  background-image: none;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

html.is-iphone .explorations.iphone-explorations-ready .explorations__sticky {
  background-image: url("./dist/client/site/explorations/atmosphere-iphone.avif");
}

html.is-iphone .explorations .explorations__panel-backdrop {
  display: none;
}

html.is-iphone .explorations .explorations__panel {
  isolation: isolate;
  overflow: hidden;
  border-radius: 24px !important;
  -webkit-clip-path: inset(0 round 24px);
  clip-path: inset(0 round 24px);
  contain: paint;
}

/* iPhone Safari keeps the Welcome scroll choreography, but uses the single
   unfiltered world layer instead of decoding and compositing a second copy. */
html.is-iphone .hero__glass-backdrop,
html.is-iphone .hero-handoff__glass-clip,
html.is-iphone .hero-handoff__rays,
html.is-iphone .hero-handoff__exposure,
html.is-iphone .hero-handoff__edge-glow {
  display: none !important;
}

html.is-iphone .hero__glass {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
}

html.is-iphone .hero__atmosphere,
html.is-iphone .hero__character,
html.is-iphone .hero__glass {
  will-change: auto !important;
}

html.is-iphone .project-scene__parallels-composition,
html.is-iphone .project-scene__clearwire-animation,
html.is-iphone .project-scene__videostudio-animation,
html.is-iphone .project-scene__coreldraw-animation { display: none; }

html.is-iphone .project-scene__iphone-feature {
  display: block;
  width: min(47vw, 820px);
  height: auto;
  max-height: min(54svh, 760px);
  margin: 0;
  object-fit: contain;
}

html.is-iphone .project-scene__parallels-lockup {
  width: min(47vw, 820px);
  height: auto;
  aspect-ratio: 1855 / 1900;
  overflow: visible;
}

html.is-iphone .project-scene__parallels-lockup > .project-scene__iphone-feature {
  position: static;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

html.is-iphone .project-scene__feature--clearwire-animated .project-scene__iphone-feature {
  aspect-ratio: 1900 / 1384;
  border-radius: clamp(14px, 1.4vw, 28px);
  box-shadow: 0 28px 42px rgb(0 0 0 / 18%);
}

html.is-iphone .project-scene__feature--videostudio .project-scene__iphone-feature {
  object-position: center;
}

html.is-iphone .pd-systems__feature-static {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

html.is-iphone .cw-p12__feature-static {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: none;
}

html.is-iphone .cw-p12__feature--animated > object {
  display: none;
}

@media (max-width: 700px) {
  html.is-iphone .project-scene__iphone-feature,
  html.is-iphone .project-scene__parallels-lockup {
    width: 100%;
    max-height: min(42svh, 430px);
  }
}
