/* Keep in-page destinations below the fixed header at every viewport size. */
#top section[id] { scroll-margin-top: 78px; }
.bbd-mobile-menu {
  max-height: calc(100dvh - 74px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (max-width: 1023px) {
  /* Intrinsic widths from the journey rail and diagrams must stay inside their columns. */
  #top :where(.grid, .grid > *) { min-width: 0; }
  .bbd-home-hero { min-height: 0; padding-top: 7rem; padding-bottom: 3rem; }
  .bbd-hero-layout { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .bbd-journey { max-width: 100%; }
  .bbd-orbit { width: min(84%, 26rem); }
}

@media (max-width: 640px) {
  .bbd-header nav { padding-inline: 1rem; }
  .bbd-home-hero { padding: 6.25rem 1rem 2.5rem; }
  .bbd-home-hero h1 { font-size: clamp(2rem, 7.5vw, 3rem); }
  .bbd-home-hero a[href="#contact"],
  .bbd-home-hero a[href="#bbd-os"] {
    min-height: 48px;
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }
  .bbd-journey > div { min-width: 0; flex-wrap: wrap; gap: .45rem; }
  .bbd-journey > div > div { padding: .45rem .6rem; }
  .bbd-journey > div > span { width: .55rem; }
  .bbd-orbit .bbd-gold-edge { padding: .7rem .3rem; }
  .bbd-orbit .bbd-glass {
    padding: .4rem .18rem;
    font-size: .56rem;
    line-height: 1.2;
    letter-spacing: .035em;
    overflow-wrap: anywhere;
  }
  #top section[id] { padding-inline: 1rem; }
  #contact form { min-width: 0; padding: 1rem; }
  #contact input:not([type="radio"]), #contact textarea {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    font-size: 16px;
  }
  #contact button[type="submit"] { min-height: 48px; white-space: normal; }
  #top footer a[href^="mailto:"] { overflow-wrap: anywhere; }
}

@media (max-width: 760px) and (max-height: 480px) {
  .bbd-films .era-sticky { top: 74px; }
  .bbd-films .era-screen { height: 22svh; max-height: none; }
}
