/* DVSTUDIO V127 — mobile viewport hardening + performance containment
   Visual design is unchanged; this layer fixes Safari viewport gaps and
   reduces work performed for off-screen content. */

/* Keep all five language layers deterministic on every route. */
html [data-en],html [data-fr],html [data-it],html [data-es],html [data-pt]{display:none!important}
html[data-lang="en"] [data-en],html[data-lang="fr"] [data-fr],html[data-lang="it"] [data-it],html[data-lang="es"] [data-es],html[data-lang="pt"] [data-pt]{display:revert!important}

/* Work: browsers that support content-visibility can skip paint/layout for
   large archives until they approach the viewport. Content remains in DOM. */
@supports (content-visibility:auto){
  body[data-page="work.html"] :is(#photography-world,#capabilities-world,#web-world,#brands,.big-cta){
    content-visibility:auto;
    contain-intrinsic-size:auto 980px;
  }
}

@media (max-width:980px){
  /* `100dvh` alone can expose content underneath when iOS Safari expands its
     bottom toolbar. Oversize the fixed navigation beyond both visual edges,
     as is already done for the page-transition cover. */
  body.menu-open{
    overflow:hidden!important;
    overscroll-behavior:none!important;
    touch-action:auto!important;
  }
  .site-header>.mobile-menu .mobile-nav,
  .mobile-nav{
    position:fixed!important;
    left:-4vw!important;
    right:-4vw!important;
    top:-16vh!important;
    bottom:-42vh!important;
    width:auto!important;
    height:auto!important;
    min-height:158vh!important;
    padding-left:max(28px,calc(env(safe-area-inset-left) + 24px))!important;
    padding-right:max(28px,calc(env(safe-area-inset-right) + 24px))!important;
    padding-top:calc(16vh + max(122px,calc(env(safe-area-inset-top) + 104px)))!important;
    padding-bottom:calc(42vh + max(48px,calc(env(safe-area-inset-bottom) + 34px)))!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain!important;
    touch-action:pan-y!important;
    scrollbar-width:none;
  }
  .mobile-nav::-webkit-scrollbar{display:none}
  @supports (height:100lvh){
    .site-header>.mobile-menu .mobile-nav,
    .mobile-nav{
      top:-16lvh!important;
      bottom:-42lvh!important;
      min-height:158lvh!important;
      padding-top:calc(16lvh + max(122px,calc(env(safe-area-inset-top) + 104px)))!important;
      padding-bottom:calc(42lvh + max(48px,calc(env(safe-area-inset-bottom) + 34px)))!important;
    }
  }

  /* The menu background is virtually opaque: a full-screen 34px backdrop
     blur only adds GPU/memory pressure on iOS without changing the look. */
  .mobile-nav{
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
  }

  /* Five languages: the list has its own safe scroll area and can never be
     clipped by a short landscape/mobile viewport. */
  .mobile-lang.language-switcher--mobile{padding-bottom:2px!important}
  .language-switcher--mobile .language-popover{
    max-height:min(286px,42svh)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
  }
  .language-switcher--mobile .language-popover button{
    min-height:50px!important;
    flex:0 0 auto;
  }
}

@media (max-width:520px){
  .site-header>.mobile-menu .mobile-nav,
  .mobile-nav{
    padding-left:max(22px,calc(env(safe-area-inset-left) + 20px))!important;
    padding-right:max(22px,calc(env(safe-area-inset-right) + 20px))!important;
  }
  .language-switcher--mobile .language-popover{max-height:min(272px,40svh)!important}
}

/* Mobile-lite is set by JS after the page-transition system is installed.
   The ambient V73 layers are hidden by the responsive design already; this
   guarantees no stale compositor layer remains if a browser restores BFCache. */
html.dv-mobile-lite :is(.dv73-ambient,.dv73-hero-fluid,.dv73-motion-hud,.dv73-motion-status,.dv73-cursor-trail){display:none!important}
