/* CircuitSprint mobile overrides — load last */
html, body {
  max-width: 100%;
  overflow-x: clip;
}

@media (max-width: 1080px) {
  /* Desktop primary nav must never appear on small screens */
  .site-nav,
  .site-header__nav,
  nav.site-nav {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    pointer-events: none !important;
  }

  .site-header__cta,
  .site-header__actions .site-header__cta {
    display: none !important;
  }

  .site-header__menu {
    display: inline-flex !important;
    flex-shrink: 0;
  }

@media (max-width: 1080px) {
  /* backdrop-filter creates a containing block that traps position:fixed
     children — without this, .mobile-nav only gets ~header height. */
  .site-header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #ffffff !important;
  }

  /* Do NOT set overflow:hidden on .site-header — it clips the drawer. */
  .site-header__inner {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    min-height: var(--header-h, 78px);
    padding-top: 10px;
    padding-bottom: 10px;
    box-sizing: border-box;
    overflow: hidden; /* constrain logo/nav row only */
  }

  .mobile-nav {
    position: fixed !important;
    top: var(--header-h, 78px) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    z-index: 80 !important;
  }

  .mobile-nav.is-open {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  .brand-lockup {
    min-width: 0;
    flex: 1 1 auto;
  }

  .brand-lockup__tagline {
    max-width: 46vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Home hero: stack + kill intrinsic image min-width overflow */
  .home-hero {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    max-width: 100%;
    overflow: hidden;
  }

  .home-hero__grid {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    grid-template-columns: none !important;
  }

  .home-hero__grid > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .home-hero__visual {
    order: -1;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: min(34vh, 280px);
    border-left: 0;
    border-bottom: 1px solid rgba(15, 28, 48, 0.1);
    overflow: hidden;
  }

  .home-hero__img {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: min(34vh, 280px) !important;
    max-height: min(34vh, 280px) !important;
    object-fit: cover !important;
    object-position: center center;
  }

  .home-hero__copy,
  .home-hero__copy-top,
  .home-hero__foot {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .home-hero__copy {
    height: auto !important;
    padding: 24px 20px !important;
  }

  .home-hero__title {
    max-width: 100% !important;
    font-size: clamp(1.75rem, 7vw, 2.35rem) !important;
    overflow-wrap: anywhere;
  }

  .home-hero__eyebrow {
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.35;
    letter-spacing: 0.08em;
  }

  .home-hero__tagline {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .home-hero__actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .home-hero__actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Generic page heroes */
  .hero__grid,
  .hero-grid,
  .page-hero__grid,
  .about-hero__grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .hero__grid > *,
  .hero-grid > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .hero__visual,
  .hero__figure,
  .hero__media,
  .hero__image,
  .hero__img-wrap {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden;
  }

  .hero__img,
  .hero__visual img,
  .hero__figure img {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto;
    max-height: min(42vh, 360px);
    object-fit: cover;
  }

  .hero__copy,
  .hero__content {
    width: 100% !important;
    max-width: 100% !important;
  }

  .hero__actions .btn,
  .hero__cta-row .btn {
    width: 100%;
    justify-content: center;
  }

  img, svg, video, canvas {
    max-width: 100%;
  }

  .wrap {
    width: min(100% - 32px, var(--maxw, 1120px)) !important;
    max-width: 100%;
    box-sizing: border-box;
  }
}
