/* Keep the original home layout; dock shared navigation on interior routes. */
.mobile-header-tools,
.mobile-section-navigation { display: none; }
html.has-sticky-bubble-header {
  scroll-padding-top: var(--bubble-header-height, 100px);
}
body.has-sticky-bubble-header > header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  isolation: isolate;
  transform: translateZ(0);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "brand navigation tools";
  align-items: center;
  gap: 16px;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 8px 4vw;
  background: #000;
  border-bottom: 1px solid #222;
}
body.has-sticky-bubble-header > header > .home-link {
  grid-area: brand;
  position: relative;
  z-index: 1;
  transform: translateZ(0);
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
}
body.has-sticky-bubble-header > header > .header-links {
  grid-area: tools;
  justify-self: end;
  position: relative;
  z-index: 1;
  transform: translateZ(0);
  gap: 20px;
  margin: 0;
  white-space: nowrap;
}
body.has-sticky-bubble-header > header > nav {
  grid-area: navigation;
  position: static;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
}
body.has-sticky-bubble-header > header > nav .bubble {
  --size: 84px;
  position: relative;
  inset: auto;
  flex: 0 0 84px;
  width: 84px;
  height: 84px;
  margin: 0;
  transform: none !important;
}
body.has-sticky-bubble-header > header > nav .bubble span {
  flex: 0 0 82%;
  width: 82%;
  max-width: 82%;
  font-size: 12.5px;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
}
body.has-sticky-bubble-header > header > nav .bubble:focus-visible {
  outline: 2px solid #66b3ff;
  outline-offset: 3px;
}
body.has-sticky-bubble-header main {
  padding-top: calc(var(--bubble-header-height, 100px) + 24px) !important;
}
body.subject-page.has-sticky-bubble-header main {
  padding-top: var(--bubble-header-height, 100px) !important;
}
body.has-sticky-bubble-header:not(.subject-page) .work-heading {
  position: relative !important;
  inset: auto !important;
  height: auto;
  min-height: 0;
  overflow: visible;
}
body.has-sticky-bubble-header #case-study [id],
body.has-sticky-bubble-header .training-example,
body.has-sticky-bubble-header .training-thumbnails {
  scroll-margin-top: 20px;
}
@media (max-width: 900px) {
  body.has-sticky-bubble-header > header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand tools" "navigation navigation";
    gap: 2px 12px;
    padding: 4px 16px 8px;
  }
  body.has-sticky-bubble-header > header > nav {
    justify-content: safe center;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: #555 #000;
    overscroll-behavior-x: contain;
  }
  body.has-sticky-bubble-header > header > .header-links { gap: 13px; }
}
@media (max-width: 600px) {
  body.has-sticky-bubble-header > header { padding-inline: 12px; }
  body.has-sticky-bubble-header > header > .home-link strong {
    font-size: 11px;
    letter-spacing: 2px;
  }
  body.has-sticky-bubble-header > header > .header-links { gap: 10px; }
  body.has-sticky-bubble-header > header > .header-links a,
  body.has-sticky-bubble-header > header > .header-links button {
    font-size: 11px;
    letter-spacing: 0;
  }
}

/* Interior phones keep every discipline one tap away, below the work. */
@media (max-width: 800px) {
  html.has-sticky-bubble-header {
    scroll-padding-top: calc(var(--bubble-header-height, 60px) + 12px);
    scroll-padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
  body.has-sticky-bubble-header {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
  body.has-sticky-bubble-header > header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand tools";
    min-height: calc(60px + env(safe-area-inset-top, 0px));
    gap: 8px;
    padding: calc(4px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 4px max(12px, env(safe-area-inset-left, 0px));
  }
  body.has-sticky-bubble-header > header > nav[aria-label="Main navigation"],
  body.has-sticky-bubble-header > header > .header-links { display: none; }
  body.has-sticky-bubble-header > header > .home-link {
    min-width: 0;
    min-height: 48px;
  }
  body.has-sticky-bubble-header > header > .home-link strong {
    font-size: 12px;
    letter-spacing: 1.4px;
    white-space: nowrap;
  }
  body.has-sticky-bubble-header .mobile-header-tools {
    grid-area: tools;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: end;
  }
  .mobile-header-tools a,
  .mobile-header-tools summary,
  .mobile-header-tools button {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 6px;
    color: #eee;
    background: transparent;
    border: 0;
    font: 14px/1.3 Arial, sans-serif;
    text-decoration: none;
    cursor: pointer;
  }
  .mobile-more { position: relative; }
  .mobile-more summary { list-style: none; gap: 5px; }
  .mobile-more summary::-webkit-details-marker { display: none; }
  .mobile-more[open] summary { color: #b9e6ff; }
  .mobile-more-links {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: 160px;
    padding: 6px;
    background: #101316;
    border: 1px solid #45515b;
    border-radius: 8px;
    box-shadow: 0 8px 24px #0009;
  }
  .mobile-more-links a,
  .mobile-more-links button {
    width: 100%;
    justify-content: flex-start;
    padding: 0 12px;
    text-align: left;
  }
  .mobile-more-links a:hover,
  .mobile-more-links button:hover { background: #23303a; }
  body.has-sticky-bubble-header > .mobile-section-navigation {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    inset: auto 0 0;
    z-index: 41;
    box-sizing: border-box;
    width: 100%;
    min-height: 64px;
    height: auto !important;
    margin: 0;
    padding: 4px max(6px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
    gap: 2px;
    border-top: 1px solid #303941;
    background: #080b0e;
    isolation: isolate;
  }
  .mobile-section-navigation a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 56px;
    gap: 3px;
    padding: 2px;
    box-sizing: border-box;
    color: #d1d6dc;
    border-radius: 7px;
    text-decoration: none;
    font: 600 12px/1.3 Arial, sans-serif;
    touch-action: manipulation;
  }
  .mobile-section-navigation a span { white-space: nowrap; }
  .mobile-section-navigation svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .mobile-section-navigation a.is-current {
    color: #b9e6ff;
    background: #1b2c37;
    box-shadow: inset 0 2px #9cd9ff;
  }
  .mobile-section-navigation a:focus-visible,
  .mobile-header-tools a:focus-visible,
  .mobile-header-tools button:focus-visible,
  .mobile-header-tools summary:focus-visible {
    outline: 2px solid #b9e6ff;
    outline-offset: -2px;
  }
}
