/* PROJECT HEAVEN / mobile navigation accessibility and viewport v57
   Loaded AFTER portfolio.css. The existing 3D panel remains the artwork;
   labels remain selectable real anchor text, not painted into an image. */
@media (max-width:900px), (pointer:coarse) and (max-height:650px){
  html.portfolio-mobile-controls-ready{
    --ph-header-h:66px;
    --ph-system-top:0px;
    overflow-x:clip!important;
    scroll-padding-top:calc(var(--ph-header-h) + var(--ph-system-top));
  }
  html.portfolio-mobile-controls-ready body{
    max-width:100%!important;min-width:0!important;overflow-x:clip!important;
  }
  html.portfolio-mobile-controls-ready .site-header,
  html.portfolio-mobile-controls-ready.portfolio-model-ready .site-header{
    box-sizing:border-box!important;position:sticky!important;
    top:0!important;width:100%!important;max-width:100%!important;
    height:calc(var(--ph-header-h) + var(--ph-system-top))!important;
    min-height:calc(var(--ph-header-h) + var(--ph-system-top))!important;
    display:flex!important;flex-wrap:nowrap!important;
    align-items:center!important;justify-content:flex-start!important;
    gap:9px!important;padding:calc(8px + var(--ph-system-top))
       max(13px,env(safe-area-inset-right,0px)) 8px
       max(13px,env(safe-area-inset-left,0px))!important;
    overflow:visible!important;isolation:isolate!important;
    z-index:190!important;
  }
  html.portfolio-mobile-controls-ready .site-header .brand{
    grid-column:auto!important;flex:1 1 auto!important;
    min-width:0!important;margin:0 auto 0 0!important;
    align-self:center!important;
  }
  html.portfolio-mobile-controls-ready .site-header .brand .brand-mark{
    width:44px!important;height:44px!important;flex-basis:44px!important;
  }
  html.portfolio-mobile-controls-ready .site-header .portfolio-mobile-menu-toggle,
  html.portfolio-mobile-controls-ready .site-header .portfolio-mobile-fullscreen{
    flex:0 0 59px!important;width:59px!important;height:49px!important;
    min-width:59px!important;min-height:49px!important;max-width:59px!important;
    margin:0!important;padding:0 2px 1px!important;
    align-self:center!important;position:relative!important;
    border:1px solid #285273!important;border-radius:9px!important;
    background-color:#061521!important;
    background-size:44px 38px!important;
    background-position:center 1px!important;
    color:#d0f6ff!important;display:inline-flex!important;
    align-items:flex-end!important;justify-content:center!important;
    font:700 9px/1.05 system-ui,sans-serif!important;
    letter-spacing:0!important;text-indent:0!important;
    touch-action:manipulation!important;pointer-events:auto!important;
    cursor:pointer!important;z-index:5!important;
  }
  html.portfolio-mobile-controls-ready .site-header .portfolio-mobile-menu-toggle:focus-visible,
  html.portfolio-mobile-controls-ready .site-header .portfolio-mobile-fullscreen:focus-visible,
  html.portfolio-mobile-controls-ready .site-header .navigation a:focus-visible{
    outline:2px solid #85dbff!important;outline-offset:3px!important;
  }
  html.portfolio-mobile-controls-ready .site-header .navigation,
  html.portfolio-mobile-controls-ready.portfolio-model-ready .site-header .navigation{
    position:fixed!important;display:none!important;
    left:max(10px,env(safe-area-inset-left,0px))!important;
    right:max(10px,env(safe-area-inset-right,0px))!important;
    top:calc(var(--ph-header-h) + var(--ph-system-top))!important;
    bottom:auto!important;width:auto!important;max-width:none!important;
    max-height:calc(100dvh - var(--ph-header-h) - var(--ph-system-top) - 10px)!important;
    grid-column:auto!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-auto-flow:row!important;gap:10px!important;
    padding:14px!important;margin:0!important;
    overflow-x:hidden!important;overflow-y:auto!important;
    overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch;
    border:1px solid #367895!important;border-radius:12px!important;
    background:#07111ef8!important;box-shadow:0 18px 60px #000c!important;
    z-index:200!important;
  }
  html.portfolio-mobile-controls-ready.portfolio-mobile-nav-open .site-header .navigation,
  html.portfolio-mobile-controls-ready.portfolio-model-ready.portfolio-mobile-nav-open .site-header .navigation{
    display:grid!important;
  }
  html.portfolio-mobile-controls-ready .site-header .navigation a,
  html.portfolio-mobile-controls-ready.portfolio-model-ready .site-header .navigation a{
    box-sizing:border-box!important;display:grid!important;place-items:center!important;
    position:relative!important;width:100%!important;max-width:100%!important;
    height:74px!important;min-height:74px!important;
    flex:none!important;aspect-ratio:auto!important;
    margin:0!important;padding:4px!important;overflow:hidden!important;
    border:1px solid #2a5870!important;border-radius:10px!important;
    background:transparent!important;color:#edfcff!important;
    font-size:13px!important;line-height:1.2!important;
    white-space:nowrap!important;text-indent:0!important;
    text-align:center!important;letter-spacing:0!important;
    text-decoration:none!important;touch-action:manipulation!important;
    pointer-events:auto!important;opacity:1!important;transform:none!important;
  }
  html.portfolio-mobile-controls-ready .site-header .navigation a .portfolio-model-surface{
    position:absolute!important;inset:0!important;display:block!important;
    width:100%!important;height:100%!important;z-index:0!important;
    background-size:100% 100%!important;background-position:center!important;
    pointer-events:none!important;
  }
  html.portfolio-mobile-controls-ready .site-header .navigation a .portfolio-model-label{
    display:block!important;position:relative!important;z-index:2!important;
    width:auto!important;max-width:82%!important;
    margin:0!important;padding:0!important;
    color:#f1fcff!important;font:800 clamp(11px,2.8vw,16px)/1.2 system-ui,sans-serif!important;
    text-align:center!important;text-indent:0!important;
    letter-spacing:.035em!important;white-space:nowrap!important;
    opacity:1!important;visibility:visible!important;
    text-shadow:0 2px 3px #000,0 0 9px #0b2945,0 0 3px #000!important;
    transform:none!important;pointer-events:none!important;
  }
  html.portfolio-mobile-controls-ready .site-header .navigation a.active{
    border-color:#75cef0!important;
  }
  html.portfolio-mobile-controls-ready .portfolio-nav-backdrop:not([hidden]){
    display:block!important;position:fixed!important;inset:0!important;
    width:100%!important;height:100dvh!important;
    z-index:180!important;touch-action:manipulation!important;
  }
  html.portfolio-mobile-controls-ready.portfolio-mobile-immersive .site-header{
    display:none!important;
  }
  html.portfolio-mobile-controls-ready.portfolio-mobile-immersive .portfolio-immersive-exit:not([hidden]){
    position:fixed!important;top:calc(10px + var(--ph-system-top))!important;
    right:max(10px,env(safe-area-inset-right,0px))!important;
    display:flex!important;min-height:44px!important;z-index:240!important;
    touch-action:manipulation!important;
  }
}
@media (pointer:coarse) and (orientation:landscape) and (max-height:650px){
  html.portfolio-mobile-controls-ready{--ph-header-h:54px}
  html.portfolio-mobile-controls-ready .site-header .brand .brand-mark{
    width:36px!important;height:36px!important;flex-basis:36px!important;
  }
  html.portfolio-mobile-controls-ready .site-header .portfolio-mobile-menu-toggle,
  html.portfolio-mobile-controls-ready .site-header .portfolio-mobile-fullscreen{
    flex-basis:54px!important;width:54px!important;min-width:54px!important;
    max-width:54px!important;height:42px!important;min-height:42px!important;
    background-size:40px 32px!important;font-size:8px!important;
  }
  html.portfolio-mobile-controls-ready .site-header .navigation,
  html.portfolio-mobile-controls-ready.portfolio-model-ready .site-header .navigation{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  html.portfolio-mobile-controls-ready .site-header .navigation a{
    height:62px!important;min-height:62px!important;
  }
}
@media (display-mode:standalone) and (max-width:900px),
       (display-mode:fullscreen) and (max-width:900px),
       (display-mode:standalone) and (pointer:coarse) and (max-height:650px),
       (display-mode:fullscreen) and (pointer:coarse) and (max-height:650px){
  html.portfolio-mobile-controls-ready{
    --ph-system-top:max(30px,env(safe-area-inset-top,0px));
  }
}
@media (max-width:380px) and (orientation:portrait){
  html.portfolio-mobile-controls-ready .site-header .navigation,
  html.portfolio-mobile-controls-ready.portfolio-model-ready .site-header .navigation{
    grid-template-columns:minmax(0,1fr)!important;
  }
  html.portfolio-mobile-controls-ready .site-header .navigation a{
    height:65px!important;min-height:65px!important;
  }
}
html:fullscreen.portfolio-mobile-controls-ready{--ph-system-top:env(safe-area-inset-top,0px)}
