/* Mobile compositions use the original media with their own measured frames.
   Desktop stages and playback controls keep their existing behaviour. */
.focus-summary-mobile,.focus-mobile-overview{display:none}
.material-hero-link span>svg{display:block;width:20px;height:20px}

@media screen and (max-width:900px){
  /* Fill the image row, rather than letterboxing a landscape image at its foot. */
  #home.material-hero{
    height:100svh;
    min-height:600px;
    grid-template-rows:auto minmax(180px,1fr) auto;
    padding-top:var(--header-height);
    align-items:stretch;
  }
  #home .material-hero-copy{padding:20px var(--scene-gutter) 12px}
  #home .material-hero-copy .eyebrow{margin-bottom:12px;line-height:1.6}
  #home h1{font-size:clamp(31px,7.5vw,48px);line-height:1.1;margin-bottom:14px}
  #home .material-hero-description{font-size:14px;line-height:1.55;margin-bottom:12px}
  #home .material-hero-link{font-size:13px;min-height:44px;padding:6px 0;gap:24px}
  #home .material-hero-scene{
    position:relative;inset:auto;align-self:stretch;
    width:100%;height:auto;min-height:180px;overflow:hidden;
  }
  #home .material-hero-scene img{
    position:absolute;inset:0;width:100%;height:100%;max-width:none;
    aspect-ratio:auto;object-fit:cover;object-position:88% center;
    -webkit-mask-image:linear-gradient(180deg,transparent,#000 15%,#000);
    mask-image:linear-gradient(180deg,transparent,#000 15%,#000);
    -webkit-mask-composite:source-over;mask-composite:add;
  }
  #home .material-hero-base{min-height:44px;padding:8px var(--scene-gutter);gap:15px}
  #home .material-hero-base>span{max-width:185px;font-size:7px;line-height:1.5}
  #home .material-hero-base>a{min-height:28px;font-size:8px}

  /* No fixed visual track: the frame, caption and disclosure all own their height.
     In particular a 16:9 film never sits in a tall gradient-filled rectangle. */
  #process.science-focus,#process.science-focus[data-science-topic=quality]{
    --mobile-film-height:clamp(170px,calc(100svh - 420px),310px);
    height:auto;min-height:0;padding:24px var(--scene-gutter) 34px;gap:14px;
    background:var(--scene-stone) var(--section-art-ba5cfb2f05,url('/media/backgrounds/certus-hero-wallpaper-v48/casting-materials-certus.webp')) center/cover no-repeat;
  }
  #process.science-focus::before{display:none}
  #process .science-focus-intro h2,#process[data-science-topic=quality] .science-focus-intro h2{
    max-width:620px;font-size:clamp(28px,6.7vw,38px);line-height:1.12;
  }
  #process .science-focus-intro .eyebrow{font-size:9px;line-height:1.5;margin-bottom:10px}
  #process .science-topic-tabs,#process[data-science-topic=quality] .science-topic-tabs{
    display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;max-width:none;gap:12px;
  }
  #process .science-topic-tabs[hidden]{display:none}
  #process .science-topic-tabs button{
    min-width:0;min-height:46px;align-items:center;padding:6px 0 9px;
    font-size:clamp(10px,2.8vw,13px);line-height:1.4;white-space:normal;
  }
  #process .science-focus-panel,#process #science-quality,
  #process.scene-expanded .science-focus-panel,#process.scene-overflow .science-focus-panel{
    position:relative;display:grid;grid-template-columns:minmax(0,1fr);
    grid-template-rows:auto auto auto;grid-template-areas:'summary' 'visual' 'details';
    gap:12px;flex:none;min-height:0;width:100%;margin:0;
  }
  #process .focus-summary h3{font-size:clamp(24px,5.9vw,32px);line-height:1.16;margin-bottom:8px}
  #process .focus-summary>p:last-child,#process .focus-summary-mobile{font-size:13px;line-height:1.55;max-width:620px;margin:0}
  #process .focus-summary-desktop{display:none}
  #process .focus-summary-mobile{display:block}
  #process .focus-mobile-overview{display:block;font-size:13px;line-height:1.7;color:#4d5a65;margin:8px 0 18px}
  #process .focus-visual,#process #science-quality .focus-visual,
  #process.science-focus:not(.science-ready) .focus-visual{
    position:relative;inset:auto;grid-area:visual;align-self:start;
    width:100%;height:auto;min-height:0;max-width:680px;margin:0;padding:0;
    background:transparent;overflow:visible;pointer-events:auto;
  }
  #process .focus-film-frame,#process #science-quality .focus-film-frame,
  #process .focus-visual-flask .focus-film-frame{
    position:relative;inset:auto;height:auto;min-height:0;max-height:none;
    width:100%;margin:0 auto;aspect-ratio:16/9;overflow:hidden;background:transparent;
    -webkit-mask-image:linear-gradient(90deg,transparent,#000 5%,#000 95%,transparent),linear-gradient(180deg,transparent,#000 6%,#000 94%,transparent);
    mask-image:linear-gradient(90deg,transparent,#000 5%,#000 95%,transparent),linear-gradient(180deg,transparent,#000 6%,#000 94%,transparent);
    -webkit-mask-composite:source-in;mask-composite:intersect;
  }
  #process .focus-visual-flask .focus-film-frame{
    width:min(100%,calc(var(--mobile-film-height) * 1.2));aspect-ratio:6/5;
  }
  #process #science-quality .focus-film-frame{
    width:min(100%,calc(var(--mobile-film-height) * 1.777778));
  }
  #process .focus-video,#process .focus-visual-flask .focus-video,#process #science-quality .focus-video{
    display:block;position:absolute;inset:0;width:100%;height:100%;max-width:100%;
    object-fit:contain;object-position:center;aspect-ratio:auto;
    background:transparent;filter:none;transform:none;
    -webkit-mask-image:none;mask-image:none;
  }
  /* Full source height, with only the empty left side outside the portrait window. */
  #process .focus-visual-flask .focus-video{object-fit:cover;object-position:right center}
  #process .focus-video[hidden]{display:none}
  #process #science-quality .focus-visual::before{display:none}
  #process .focus-visual figcaption,#process #science-quality .focus-visual figcaption{
    position:relative;inset:auto;display:flex;justify-content:space-between;align-items:center;
    min-height:44px;margin:4px 0 0;padding:0;gap:12px;
    font-size:9px;line-height:1.5;letter-spacing:0;color:#354b5e;
  }
  #process .focus-motion{
    width:44px;height:44px;min-width:44px;min-height:44px;padding:0;
    color:#354b5e;background:transparent;border-color:#354b5e66;
  }
  #process .focus-motion:focus-visible{outline-color:#294357!important}
  #process .focus-visual-support .focus-still-frame{
    position:relative;inset:auto;height:auto;aspect-ratio:2200/1532;
    width:min(100%,calc(var(--mobile-film-height) * 1.436));margin:0 auto;
  }
  #process .focus-notes{grid-area:details;min-width:0;margin:0}
  #process .focus-notes-toggle{min-height:44px;font-size:13px;line-height:1.5}
  #process .focus-details summary{font-size:13px;min-height:44px}
  #process.scene-expanded,#process.scene-overflow{height:auto!important;min-height:0!important}
  #process.science-focus:not(.science-ready) .science-focus-panel{min-height:0}
}

@media screen and (max-width:760px){
  :root{--header-height:100px}
  body.certus-refined>header.site-header-brands{height:var(--header-height);grid-template-rows:56px 44px}
  .site-header-brands .header-brand-links{height:44px}
  .site-header-brands .header-brand-link{height:44px}
}

@media screen and (max-width:900px) and (orientation:landscape){
  #home .material-hero-scene img{object-fit:contain;object-position:center}
}

@media screen and (max-width:380px){
  #home h1{font-size:30px}
  #home .material-hero-copy{padding-top:16px;padding-bottom:8px}
  #home .material-hero-description{font-size:13px}
  #home .material-hero-base>span{max-width:155px}
  #process .science-focus-intro h2{font-size:27px}
  #process .science-topic-tabs,#process[data-science-topic=quality] .science-topic-tabs{gap:9px}
}
