/* Mobile layout: flow first, with contact inside the masthead. */
@media (max-width:760px) {
  body { padding-bottom:0; }
  main,section,article,figure,.case-copy,.case-visual,.selected-copy,.footer-column { min-width:0; }
  p,li,dd,address,figcaption { overflow-wrap:break-word; }
  .utility { padding:6px 6%; }
  .utility>span { display:none; }
  .utility>div { width:100%;justify-content:flex-end;gap:24px;padding:0; }
  .utility a { font-size:12px;line-height:1.5; }
  .cinematic-home .cinematic-scene {
    display:grid;grid-template-rows:auto minmax(0,1fr) auto;
    padding-bottom:20px;
  }
  .cinematic-home .cinematic-copy {
    grid-row:2;position:relative;inset:auto;min-height:0;
    padding:16px 6%;justify-content:center;
  }
  .cinematic-home .hero-location { display:none; }
  .cinematic-home .hero-beats {
    grid-row:1;position:relative;inset:auto;
    margin:14px 6% 0;gap:12px;font-size:10px;line-height:1.4;
  }
  .cinematic-home .cinematic-copy h1 { margin:0 0 22px; }
  .cinematic-home .cinematic-detail p { margin:0 0 16px;line-height:1.6; }
  .cinematic-home .cinematic-detail .text-link { font-size:14px;line-height:1.5; }
  .cinematic-home .cinematic-foot {
    grid-row:3;position:relative;inset:auto;margin:0 6%;
    padding:10px 0 14px;display:block;line-height:1.5;
  }
  .cinematic-home .hero-skip { display:inline-block;padding:8px 0; }
  .journey-nav { width:auto;margin-left:-6.8181818%;margin-right:-6.8181818%;padding-left:6%;padding-right:6%; }
  .journey-nav a { min-width:0; }
  .trust-years { gap:20px;flex-wrap:wrap; }
  .trust-years-label { padding-left:0;max-width:100%; }
  .selected-grid { display:grid;grid-template-columns:1fr;gap:40px; }
  .selected-project { padding:0;margin:0;grid-column:auto;grid-row:auto; }
  .selected-copy .project-meta h3 { min-height:0; }
  .selected-copy .text-link { margin-top:0; }
  .mobile-nav.open,.cinematic-home .mobile-nav.open {
    position:fixed;top:var(--header-height,100px);left:0;right:0;z-index:30;
    max-height:calc(100dvh - var(--header-height,100px) - 20px - env(safe-area-inset-bottom,0px));
    overflow-y:auto;overscroll-behavior:contain;
  }

  .quote-form,.contact-direct,.directions-section { min-width:0; }
  .form-row { grid-template-columns:minmax(0,1fr); }
  input,select,textarea { max-width:100%;font-size:16px; }
  .consent-check { align-items:flex-start; }
  .contact h2,.service-page h1 { overflow-wrap:break-word; }
  dialog { width:calc(100% - 24px);max-width:calc(100% - 24px);max-height:calc(100dvh - 24px);padding:12px;overflow:auto; }
  dialog .dialog-controls { gap:8px; }
  dialog .dialog-controls button { flex:1;min-width:0;min-height:44px;padding:10px 5px;font-size:12px; }
  dialog img { max-width:100%;width:100%;max-height:calc(100dvh - 150px);object-fit:contain; }
  .dialog-caption { overflow-wrap:anywhere;line-height:1.6; }
}
@media (max-width:760px) and (max-height:700px) {
  .cinematic-home .cinematic-copy { padding-top:10px;padding-bottom:10px; }
  .cinematic-home .cinematic-copy h1 { font-size:clamp(29px,10vw,39px);margin-bottom:16px; }
  .cinematic-home .cinematic-detail p { font-size:15px;line-height:1.55; }
  .cinematic-home .cinematic-detail .text-link { display:none; }
  .cinematic-home .hero-beats { margin-top:12px;font-size:10px; }
}
/* A short landscape viewport needs normal document flow, rather than pinning. */
@media (max-width:1024px) and (max-height:520px) {
  .utility { display:none; }
  header { height:60px;display:flex;justify-content:space-between;padding:6px 5%; }
  header nav { display:none; }
  header .brand { width:48px;padding:0; }
  header .brand .long { display:none; }
  header .brand .short { display:block!important;width:48px; }
  .menu-button { display:flex;flex-direction:column;justify-content:center;gap:6px;width:44px;height:44px;padding:10px;border:1px solid #b6cbd7;border-radius:5px;background:#f3f7f8; }
  .menu-button span { width:20px;height:1.5px;background:#23475b; }
  .mobile-nav.open,.cinematic-home .mobile-nav.open { display:flex;flex-direction:column;align-items:stretch;gap:0;position:fixed;top:var(--header-height,60px);left:0;right:0;z-index:30;padding:8px 5% 20px;background:#e7eef2;max-height:calc(100dvh - var(--header-height,60px) - 20px);overflow-y:auto; }
  .mobile-nav a { padding:13px 0;border-bottom:1px solid #b7cbd6; }



  .cinematic-home .cinematic-hero { height:auto; }
  .cinematic-home .cinematic-scene { display:block;position:relative;top:0;height:auto;min-height:0;padding:0; }
  .cinematic-home .cinematic-copy { position:relative;inset:auto;min-height:0;padding:40px 6% 20px; }
  .cinematic-home .hero-location,.cinematic-home .hero-beats,.cinematic-progress { display:none; }
  .cinematic-home .cinematic-copy h1 { font-size:clamp(34px,5vw,46px);margin:0 0 24px; }
  .cinematic-home .cinematic-first,.cinematic-home .cinematic-second,.cinematic-home .cinematic-detail { opacity:1!important;visibility:visible!important;transform:none!important;clip-path:none!important; }
  .cinematic-home .cinematic-detail p { max-width:60ch;font-size:16px;line-height:1.7; }
  .cinematic-home .cinematic-detail .text-link { display:none; }
  .cinematic-home .cinematic-foot { position:relative;inset:auto;margin:0 6%;padding:0 0 28px;display:block; }
  .cinematic-home .cinematic-foot>span { display:none; }
  .cinematic-home .journey-layout { display:block; }
  .cinematic-home .journey-stage { display:none; }
  .cinematic-home .journey-chapter { min-height:0;padding:35px 0; }
  .cinematic-home .journey-mobile-photo { display:block;max-width:650px;margin:24px 0 0; }
  .journey-mobile-photo img { display:block;width:100%;height:auto;max-height:none; }
  .journey-mobile-photo figcaption { font-size:13px;line-height:1.6;margin-top:12px; }
  dialog { max-height:calc(100dvh - 20px);overflow:auto; }
  dialog img { max-height:calc(100dvh - 130px); }
}
@media (prefers-reduced-motion:reduce) {
  .cinematic-home .cinematic-scene { height:auto;min-height:0; }
  .cinematic-home .cinematic-copy { min-height:360px; }
}

/* A usable, compact masthead on phones and tablets. Contact is the last item. */
@media(max-width:1024px) {
  .utility { display:none; }
  header { display:flex;height:70px;padding:7px 6%;gap:12px; }
  header nav { display:none; }
  header .brand { width:60px;padding:0;margin-right:auto; }
  header .brand .long { display:none; }
  header .brand .short { display:block!important;width:60px; }
  .menu-button { display:flex;flex-direction:column;justify-content:center;align-items:center;gap:6px;width:44px;height:44px;padding:10px;flex:none;border:1px solid #b6cbd7;border-radius:5px;background:#f3f7f8; }
  .menu-button span { width:20px;height:1.5px;background:#23475b; }
  header .header-contact { position:static;transform:none;min-width:94px;min-height:44px;padding:11px 15px;font-size:13px;flex:none; }
  header .header-contact:active { transform:scale(.98); }
  .mobile-nav.open,.cinematic-home .mobile-nav.open { display:flex;flex-direction:column;align-items:stretch;gap:0;position:fixed;top:var(--header-height,70px);left:0;right:0;z-index:30;padding:8px 6% 20px;background:#e7eef2;max-height:calc(100dvh - var(--header-height,70px) - 20px);overflow-y:auto; }
  .mobile-nav a { padding:15px 0;border-bottom:1px solid #b7cbd6; }
}
@media(max-width:760px) {
  .workshop-capabilities { display:grid;grid-template-columns:minmax(0,1fr);gap:30px; }
  .workshop-capabilities>div { margin-top:0; }
}
@media(max-width:1024px) and (max-height:520px) {
  header { height:60px;padding-top:5px;padding-bottom:5px; }
  header .brand,header .brand .short { width:48px; }
}
@media(prefers-reduced-motion:reduce) {
  header .header-contact:active { transform:none; }
}
