/* The visible stage follows the browser toolbar, while its media and copy planes
   keep stable large/small viewport geometry. Only the clipping edge moves.
   Dynamic stage height is also added to the track, preserving 240svh travel. */
@media (max-width:700px), (max-width:1000px) and (max-height:500px) and (orientation:landscape) {
  body.main-video {
    --mobile-screen:100vh;
    --mobile-small:100vh;
    --mobile-large:100vh;
    --mobile-safe-top:env(safe-area-inset-top,0px);
    --mobile-safe-right:env(safe-area-inset-right,0px);
    --mobile-safe-bottom:env(safe-area-inset-bottom,0px);
    --mobile-safe-left:env(safe-area-inset-left,0px);
    --mobile-header:56px;
    --mobile-gutter-left:max(24px,var(--mobile-safe-left));
    --mobile-gutter-right:max(24px,var(--mobile-safe-right));
    --mobile-title-size:clamp(60px,min(20vw,calc(var(--mobile-small)*.12)),88px);
    --mobile-focal-x:74%;
  }
  @supports (height:100dvh) { body.main-video { --mobile-screen:100dvh; } }
  @supports (height:100svh) { body.main-video { --mobile-small:100svh; } }
  @supports (height:100lvh) { body.main-video { --mobile-large:100lvh; } }
  html:has(body.main-video) { scrollbar-gutter:auto; }
  body.main-video .hero-track { height:calc(240svh + var(--mobile-screen));min-height:0; }
  body.main-video .hero-stage { height:var(--mobile-screen);min-height:0; }
  body.main-video .hero-scene { inset:0 0 auto;height:var(--mobile-large); }
  body.main-video .scene-type-plane { inset:0 0 auto;height:var(--mobile-small); }
  body.main-video .hero-video {
    inset:0;width:100%;height:100%;max-height:none;aspect-ratio:auto;
  }
  body.main-video .hero-video-poster,
  body.main-video .hero-scroll-video,
  body.main-video[data-hero-framing="right-safe"] .hero-video-poster,
  body.main-video[data-hero-framing="right-safe"] .hero-scroll-video {
    object-fit:cover;object-position:var(--mobile-focal-x) 50%;
  }
  body.main-video .hero-video::after {
    content:"";position:absolute;inset:0;pointer-events:none;
    background:linear-gradient(180deg,#0204047a,transparent 24%,transparent 47%,#02040466 78%,#020404bd);
  }
  body.main-video .header,
  body.main-video .header.is-scrolled {
    height:calc(var(--mobile-header) + var(--mobile-safe-top));
    padding:var(--mobile-safe-top) var(--mobile-gutter-right) 0 var(--mobile-gutter-left);
    justify-content:flex-end;transition:background .25s,border-color .25s;
  }
  body.main-video .header:not(.is-scrolled) {
    background:transparent;border-color:transparent;backdrop-filter:none;
  }
  body.main-video .header > .brand {
    position:absolute;left:50%;top:var(--mobile-safe-top);transform:translateX(-50%);
    height:var(--mobile-header);min-height:44px;padding-left:.37em;
    font-size:11px;letter-spacing:.37em;text-shadow:0 1px 12px #0009;
  }
  body.main-video .header .desktop-nav { display:none; }
  body.main-video .header .menu-open { display:block;flex:0 0 44px;margin-left:auto; }
  body.main-video.type-study .hero-copy {
    top:auto;bottom:calc(142px + var(--mobile-safe-bottom));
    left:var(--mobile-gutter-left);width:calc(100% - var(--mobile-gutter-left) - var(--mobile-gutter-right));
    text-shadow:0 2px 24px #0007;
  }
  body.main-video.type-study .hero-copy h1 { font-size:var(--mobile-title-size);line-height:.88; }
  body.main-video.type-study .film-cue {
    top:auto;bottom:calc(var(--mobile-screen) - var(--mobile-small) + 76px + var(--mobile-safe-bottom));
    left:var(--mobile-gutter-left);max-width:calc(100% - var(--mobile-gutter-left) - var(--mobile-gutter-right));
    min-height:48px;gap:12px;text-shadow:0 1px 12px #000;
  }
  body.main-video.type-study .hero-bottom {
    left:var(--mobile-gutter-left);right:var(--mobile-gutter-right);
    bottom:calc(var(--mobile-screen) - var(--mobile-small) + 10px + var(--mobile-safe-bottom));height:44px;align-items:center;
  }
  body.main-video.type-study .hero-bottom .motion-toggle { position:static;min-height:44px;padding:8px 0; }
  body.main-video .hero-media-status {
    top:calc(var(--mobile-header) + var(--mobile-safe-top) + 12px);
    left:var(--mobile-gutter-left);right:var(--mobile-gutter-right);max-width:none;
  }
  body.main-video .menu-dialog {
    padding:calc(20px + var(--mobile-safe-top)) var(--mobile-gutter-right) calc(20px + var(--mobile-safe-bottom)) var(--mobile-gutter-left);
  }
  body.main-video.no-js .hero-track,
  html.no-motion body.main-video .hero-track,
  body.main-video.no-motion .hero-track { height:var(--mobile-screen);min-height:0; }
  body.main-video.no-js .hero-stage,
  html.no-motion body.main-video .hero-stage,
  body.main-video.no-motion .hero-stage { height:var(--mobile-screen);min-height:0;position:relative; }
  @media (prefers-reduced-motion:reduce) {
    body.main-video .hero-track,
    body.main-video .hero-stage { height:var(--mobile-screen);min-height:0; }
  }
}
@media (max-width:1000px) and (max-height:500px) and (orientation:landscape) {
  body.main-video { --mobile-header:56px;--mobile-focal-x:70%;--mobile-title-size:clamp(44px,calc(var(--mobile-small)*.21),94px); }
  body.main-video .hero-video-poster,
  body.main-video .hero-scroll-video,
  body.main-video[data-hero-framing="right-safe"] .hero-video-poster,
  body.main-video[data-hero-framing="right-safe"] .hero-scroll-video { object-position:var(--mobile-focal-x) 0%; }
  body.main-video.type-study .hero-copy {
    top:calc(var(--mobile-header) + var(--mobile-safe-top) + 16px);bottom:auto;width:40vw;
  }
  body.main-video.type-study .film-cue { bottom:calc(var(--mobile-screen) - var(--mobile-small) + 64px + var(--mobile-safe-bottom)); }
  body.main-video.type-study .hero-bottom { bottom:calc(var(--mobile-screen) - var(--mobile-small) + 4px + var(--mobile-safe-bottom)); }
}
