/* EMMA mobile stabilization layer.
   Loaded last so phone geometry is consistent across the landing and inner pages. */

@media (max-width: 900px) {
  html {
    width: 100%;
    overflow-x: clip;
    scroll-padding-top: 60px;
  }

  body {
    width: 100%;
    min-width: 0;
    overflow-x: clip;
  }

  main,
  section,
  header,
  footer,
  nav,
  form,
  article,
  aside,
  div {
    min-width: 0;
  }

  img,
  video,
  iframe,
  canvas,
  svg {
    max-width: 100%;
  }

  :is(h1, h2, h3, p, a, button, label, address) {
    overflow-wrap: anywhere;
  }

  :is(a, button, input, select, textarea) {
    -webkit-tap-highlight-color: transparent;
  }

  nav.shared-site-nav,
  nav.shared-site-nav.nav-scrolled,
  nav.shared-site-nav.shared-nav-scrolled {
    top: 0;
    width: 100%;
    height: 60px;
    min-height: 60px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 0 14px;
    border-bottom: 0;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
  }

  .shared-site-nav .shared-nav-logo {
    align-self: stretch;
    display: flex;
    align-items: center;
  }

  .shared-site-nav .nav-logo-img {
    width: clamp(112px, 34vw, 138px);
    min-width: 0;
    height: auto;
    max-height: 38px;
    object-fit: contain;
  }

  .shared-nav-actions {
    min-width: 0;
    margin-inline-start: auto;
  }

  .shared-nav-menu,
  .nav-search-trigger {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }

  .shared-nav-links {
    top: 60px;
    max-height: calc(100dvh - 60px);
    padding: 8px 14px max(16px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-bottom: 0;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }

  html[dir="rtl"] .shared-nav-links {
    right: 0;
    left: 0;
    text-align: right;
  }

  .shared-nav-link,
  .shared-nav-link[href="about.html"] {
    min-height: 48px;
    padding-inline: 12px;
  }

  #hero {
    min-height: max(820px, 100svh);
  }

  .hero-layout {
    min-height: max(820px, 100svh);
    padding-top: 60px;
  }

  .hero-center {
    min-height: calc(max(820px, 100svh) - 60px);
  }

  .hero-copy {
    padding-inline: clamp(18px, 6vw, 34px);
  }

  .hero-copy-stage,
  .hero-copy-slide {
    width: 100%;
    min-width: 0;
  }

  .hero-title,
  .hero-title-campaign-line,
  .hero-title-product-line {
    max-width: 100%;
    white-space: normal;
  }

  .hero-ctas {
    width: 100%;
  }

  .hero-cta-primary,
  .hero-cta-secondary {
    min-width: 0;
    min-height: 44px;
    line-height: 1.25;
    white-space: normal;
  }

  .hero-slide-controls {
    max-width: 100%;
  }

  .hero-booth-wrap {
    width: 100%;
    overflow: visible;
  }

  .fp-stand-landing {
    display: none !important;
  }

  .fp-catalog-panel {
    min-height: 100svh;
    padding-inline: clamp(18px, 5vw, 32px);
    transform: none !important;
    will-change: auto;
  }

  .fp-filters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: inline proximity;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .fp-filters::-webkit-scrollbar { display: none; }
  .fp-filter { flex: 0 0 auto; scroll-snap-align: start; }

  .fp-grid-window {
    overflow: hidden;
  }

  .fp-grid {
    max-width: 100%;
    padding-bottom: 18px;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .home-car-scroll-sticky,
  .home-about-sticky {
    height: 100svh;
  }

  .home-car-scroll-content {
    max-height: 100svh;
    padding-top: max(74px, calc(env(safe-area-inset-top) + 64px));
    padding-bottom: max(22px, env(safe-area-inset-bottom));
  }

  .home-car-scroll-copy {
    max-height: calc(100svh - 190px);
  }

  .home-portfolio-ecosystem-inner {
    top: max(68px, calc(env(safe-area-inset-top) + 62px));
    bottom: max(12px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  #about-emma[data-about-scroll] .home-about-sticky {
    height: 100svh;
    min-height: 600px;
  }

  .home-about-partnership-reveal {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .home-market-inner,
  .home-b2b-inner,
  .home-story-inner,
  .contact-inner {
    width: calc(100% - 36px);
  }

  .home-story-cards {
    grid-template-columns: 1fr 1fr;
  }

  .contact-intro,
  .contact-workspace {
    grid-template-columns: 1fr;
  }

  .contact-location {
    grid-template-rows: minmax(380px, 55svh) auto;
  }

  .contact-map iframe {
    min-height: 380px;
  }

  .contact-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shared-footer-inner {
    width: calc(100% - 36px);
  }

  .shared-footer-callout h2 {
    overflow-wrap: normal;
  }
}

@media (max-width: 640px) {
  body.shared-nav-mounted:not(.shared-nav-home) {
    padding-top: 60px !important;
  }

  .shared-nav-languages { display: none; }
  .shared-nav-links { grid-template-columns: 1fr; }

  #hero,
  .hero-layout {
    min-height: max(780px, 100svh);
  }

  .hero-center {
    min-height: calc(max(780px, 100svh) - 60px);
  }

  .hero-copy {
    padding-top: 24px;
  }

  .hero-copy-logo {
    width: min(145px, 42vw);
  }

  .hero-title {
    font-size: clamp(31px, 9.6vw, 44px);
    line-height: .91;
  }

  .hero-copy-slide .hero-description {
    font-size: 11.5px;
    line-height: 1.55;
  }

  .hero-copy-slide .hero-ctas {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-booth-wrap {
    min-height: 300px;
  }

  .hero-banner-deck {
    height: auto;
    min-height: 400px;
  }

  .hero-banner-slide {
    min-height: 400px;
    padding: 34px 20px 82px;
  }

  .hero-banner-copy h2 {
    font-size: clamp(32px, 10vw, 45px);
  }

  .hero-banner-controls {
    left: 20px;
    right: 20px;
    bottom: 34px;
    width: auto;
  }

  html[dir="rtl"] .hero-banner-controls {
    right: 20px;
    left: 20px;
  }

  .fp-stand-intro {
    top: 80px;
    width: calc(100% - 32px);
  }

  .fp-stand-title {
    font-size: clamp(29px, 9vw, 40px);
  }

  .fp-catalog-panel {
    padding: 22px 18px 54px;
  }

  .fp-grid {
    grid-auto-columns: minmax(250px, 86vw);
  }

  .home-car-scroll-runway {
    height: 400svh;
  }

  .home-car-scroll-copy {
    max-height: calc(100svh - 170px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .home-car-scroll-title {
    font-size: clamp(31px, 10vw, 45px);
  }

  .home-portfolio-ecosystem-inner {
    right: 14px;
    left: 14px;
  }

  .home-portfolio-capabilities {
    grid-template-columns: 1fr 1fr;
  }

  .home-portfolio-capabilities article {
    min-height: 64px;
  }

  #about-emma[data-about-scroll] {
    height: 400svh;
    min-height: 400svh;
  }

  .home-about-partnership-reveal {
    max-height: 64svh;
  }

  .home-market-inner,
  .home-b2b-inner,
  .home-story-inner,
  .contact-inner {
    width: calc(100% - 32px);
  }

  .home-market-inner {
    padding-block: 70px;
  }

  .home-market-title,
  .home-b2b-market-title {
    white-space: normal;
  }

  .home-market-actions {
    width: 100%;
  }

  .home-market-action {
    width: 100%;
    min-width: 0;
  }

  .home-b2b-section,
  .home-b2b-inner {
    min-height: 0;
  }

  .home-b2b-inner {
    padding: 82px 0 360px;
  }

  .home-story-section {
    padding: 72px 0;
  }

  .home-story-cards {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  #contact {
    padding: 82px 0 56px;
  }

  .contact-heading {
    font-size: clamp(32px, 10vw, 46px);
  }

  .contact-field-grid,
  .contact-details {
    grid-template-columns: 1fr;
  }

  .contact-form-footer {
    align-items: stretch;
  }

  .contact-form .contact-primary {
    width: 100%;
    min-height: 52px;
  }

  .contact-location {
    grid-template-rows: 360px auto;
  }

  .contact-map iframe {
    min-height: 360px;
  }

  .contact-detail {
    border-right: 0;
    border-bottom: 1px solid rgba(21,23,25,.14);
  }

  .contact-detail:last-child { border-bottom: 0; }

  .shared-footer-callout {
    gap: 28px;
  }

  .shared-footer-callout h2 {
    font-size: clamp(31px, 10.2vw, 44px);
    line-height: .9;
  }

  .shared-footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .bp-hero {
    min-height: min(720px, calc(100svh - 60px));
    padding: 104px 20px 48px;
  }

  .bp-hero h1 {
    font-size: clamp(48px, 16vw, 72px);
    overflow-wrap: normal;
  }

  .bp-section,
  .bp-cta,
  .bp-contact-map-section {
    padding-inline: 20px;
  }

  .product-grid,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 390px) {
  .shared-site-nav .nav-logo-img {
    width: 108px;
  }

  .shared-nav-menu,
  .nav-search-trigger {
    width: 38px;
    min-width: 38px;
  }

  .hero-slide-control i { width: 24px; }
  .home-portfolio-capabilities { grid-template-columns: 1fr; }
  .product-grid,
  .related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) and (orientation: landscape) and (max-height: 520px) {
  nav.shared-site-nav,
  nav.shared-site-nav.nav-scrolled,
  nav.shared-site-nav.shared-nav-scrolled {
    height: 52px;
    min-height: 52px;
  }

  .shared-nav-links { top: 52px; max-height: calc(100dvh - 52px); }
  .shared-site-nav .nav-logo-img { max-height: 32px; }
  .home-car-scroll-content { padding-top: 58px; }
  .home-portfolio-ecosystem-inner { top: 56px; }
}

@media (hover: none) and (pointer: coarse) {
  body.no-cursor,
  body.no-cursor * {
    cursor: auto !important;
  }

  :is(.hero-cta-primary, .hero-cta-secondary, .fp-card, .home-market-action):hover {
    transform: none;
  }
}
