/*
 * Phone-only composition shared by production pages.
 * Tablet and desktop layouts intentionally remain page-specific.
 */
@media (max-width: 640px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip !important;
  }

  .nav {
    top: max(10px, env(safe-area-inset-top)) !important;
    left: 10px !important;
    right: 10px !important;
    display: grid !important;
    grid-template-columns: 112px minmax(0, 1fr) !important;
    align-items: center !important;
    justify-items: stretch !important;
    gap: 8px !important;
    z-index: 100 !important;
    pointer-events: none !important;
  }

  .nav > .brand {
    display: flex !important;
    width: 112px !important;
    max-width: 112px !important;
    min-width: 0 !important;
    min-height: 48px !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 4px 8px 4px 4px !important;
    border-radius: 999px !important;
    overflow: hidden !important;
    pointer-events: auto !important;
    backdrop-filter: blur(18px) saturate(1.18) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.18) !important;
  }

  .nav > .brand .brand-mark {
    display: grid !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    flex: 0 0 40px !important;
  }

  .nav > .brand .brand-mark img {
    width: 46px !important;
    height: auto !important;
    max-width: none !important;
  }

  .nav > .brand .brand-name,
  .nav > .brand > span:last-child {
    display: block !important;
    min-width: 0 !important;
  }

  .nav > .brand .brand-name strong,
  .nav > .brand > span:last-child > strong {
    display: block !important;
    overflow: hidden !important;
    color: rgba(16, 17, 14, .92) !important;
    font-size: 13px !important;
    line-height: 1.05 !important;
    letter-spacing: -.035em !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }

  .nav > .brand .brand-name > span,
  .nav > .brand > span:last-child > span {
    display: none !important;
  }

  .nav > .nav-links {
    position: relative !important;
    display: flex !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 48px !important;
    justify-self: stretch !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 2px !important;
    padding: 5px !important;
    border-radius: 999px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 5px;
    scrollbar-width: none !important;
    pointer-events: auto !important;
    backdrop-filter: blur(20px) saturate(1.2) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.2) !important;
    -webkit-overflow-scrolling: touch;
  }

  .nav > .nav-links::-webkit-scrollbar {
    display: none !important;
  }

  .nav > .nav-links a {
    flex: 0 0 auto !important;
    min-height: 38px !important;
    padding: 0 12px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 720 !important;
    line-height: 38px !important;
    white-space: nowrap !important;
    transform: none !important;
  }

  .nav > .nav-links a.active {
    color: #a91410 !important;
    background: rgba(255, 255, 255, .7) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
  }

  .nav > .nav-links .liquid-thumb,
  .nav > .nav-links .liquid-trail,
  .nav > .nav-pill,
  .liquid-cursor,
  .cursor-dot {
    display: none !important;
  }

  .hero-actions,
  .actions,
  .service-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    align-items: stretch !important;
  }

  .hero-actions > a,
  .actions > a,
  .service-actions > a,
  .hero-actions .button,
  .hero-actions .btn,
  .hero-actions .hero-btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 50px !important;
    justify-content: center !important;
    padding-inline: 14px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  .hero-actions .arrow-bubble {
    margin-left: auto;
  }

  h1,
  h2,
  h3 {
    text-wrap: balance;
  }

  p,
  li,
  .lede,
  .summary {
    text-wrap: pretty;
  }

  /* Homepage: a dedicated editorial composition for narrow screens. */
  .home-page #home.stage {
    min-height: 100svh !important;
    padding: 82px 16px 24px !important;
    justify-content: flex-end !important;
    gap: 14px !important;
  }

  .home-page #home .copy {
    width: 100% !important;
    padding-top: clamp(150px, 20svh, 184px) !important;
  }

  .home-page #home .copy .eyebrow {
    gap: 10px !important;
    margin-bottom: 14px !important;
    font-size: clamp(12px, 3.55vw, 14px) !important;
    letter-spacing: .045em !important;
  }

  .home-page #home .copy .eyebrow::before {
    width: 28px !important;
  }

  .home-page #home .copy h1 {
    width: 100% !important;
    max-width: none !important;
    font-size: clamp(45px, 13vw, 52px) !important;
    line-height: .9 !important;
    letter-spacing: -.075em !important;
    white-space: nowrap !important;
    text-wrap: nowrap !important;
  }

  .home-page #home .copy h1 > span {
    display: block !important;
    margin-top: .06em;
    white-space: nowrap !important;
  }

  .home-page #home .hero-copy {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 18px !important;
    color: rgba(32, 33, 29, .68) !important;
    font-size: 14px !important;
    line-height: 1.72 !important;
    font-weight: 650 !important;
    text-wrap: pretty;
  }

  .home-page #home .hero-copy span {
    display: inline !important;
    white-space: normal !important;
  }

  .home-page #home .hero-actions {
    margin-top: 22px !important;
  }

  .home-page #home .hero-btn {
    min-height: 52px !important;
    padding: 6px 7px 6px 15px !important;
    justify-content: space-between !important;
    font-size: 13px !important;
  }

  .home-page #home .hero-btn .arrow-bubble {
    width: 36px !important;
    height: 36px !important;
    flex-basis: 36px !important;
  }

  .home-page #home .signal-card {
    margin-top: 10px !important;
    padding: 14px !important;
    border-radius: 24px !important;
  }

  .home-page #home .signal-card h2 {
    margin-bottom: 11px !important;
    padding-left: 2px;
    font-size: 10px !important;
    letter-spacing: .15em !important;
  }

  .home-page #home .signal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
  }

  .home-page #home .signal-stat,
  .home-page #home .signal-stat.wide-stat {
    height: auto !important;
    min-height: 92px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 9px !important;
    padding: 14px !important;
    border-radius: 18px !important;
    transform: none !important;
  }

  .home-page #home .signal-stat b,
  .home-page #home .signal-stat.wide-stat b {
    font-size: clamp(29px, 8.4vw, 36px) !important;
    line-height: .92 !important;
    letter-spacing: -.04em !important;
  }

  .home-page #home .signal-stat span {
    width: 100%;
    margin: 0 !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
    text-align: left !important;
    white-space: normal !important;
  }

  /* About: preserve the desktop identity while using phone-scale controls. */
  .about-page .about-hero {
    min-height: 100svh !important;
    padding: 76px 14px 14px !important;
  }

  .about-page .hero-inner {
    min-height: 0 !important;
    padding: 48px 2px 34px !important;
  }

  .about-page .hero-copy {
    width: 100% !important;
  }

  .about-page .hero-copy .eyebrow {
    margin-bottom: 20px !important;
    font-size: 10px !important;
    letter-spacing: .16em !important;
    white-space: nowrap !important;
  }

  .about-page .hero-copy h1 {
    font-size: clamp(43px, 12.6vw, 50px) !important;
    line-height: .94 !important;
    letter-spacing: -.07em !important;
  }

  .about-page .hero-result {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: .12em !important;
    white-space: nowrap !important;
  }

  .about-page .word-window {
    min-width: 4.1em !important;
  }

  .about-page .hero-lead {
    max-width: 100% !important;
    margin-top: 22px !important;
    font-size: 14px !important;
    line-height: 1.75 !important;
    text-wrap: pretty;
  }

  .about-page .hero-actions {
    margin-top: 22px !important;
  }

  .about-page .hero-actions .button {
    min-height: 50px !important;
    gap: 8px !important;
    padding-inline: 10px !important;
    font-size: 13px !important;
  }

  .about-page .button-arrow {
    width: 15px;
    height: 15px;
  }

  .about-page .hero-tags {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    margin-top: 18px !important;
  }

  .about-page .hero-tags li {
    min-width: 0 !important;
    padding: 7px 3px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  .about-page .metric-band {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
    padding: 0 2px 2px !important;
    border-top: 0 !important;
  }

  .about-page .metric-band article,
  .about-page .metric-band article:first-child,
  .about-page .metric-band article:nth-child(2),
  .about-page .metric-band article:nth-child(3),
  .about-page .metric-band article:nth-child(4) {
    min-width: 0 !important;
    min-height: 104px !important;
    align-items: flex-start !important;
    padding: 16px 14px !important;
    border: 1px solid rgba(255, 255, 255, .13) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, .035);
  }

  .about-page .metric-band strong {
    max-width: 100%;
    font-size: clamp(29px, 8.2vw, 34px) !important;
    letter-spacing: -.055em !important;
    white-space: nowrap !important;
  }

  .about-page .metric-band span {
    margin-top: 9px !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
  }

  .about-page .capabilities {
    min-height: 0 !important;
    display: block !important;
    padding: 88px 14px 54px !important;
  }

  .about-page .system-intro {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    margin-bottom: 26px !important;
  }

  .about-page .system-intro-copy {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "kicker"
      "title"
      "summary" !important;
    gap: 0 !important;
  }

  .about-page .system-intro-copy .heading-kicker {
    margin-bottom: 12px !important;
    font-size: 10px !important;
  }

  .about-page .system-intro-copy h2 {
    font-size: 42px !important;
    line-height: 1 !important;
  }

  .about-page .system-intro-copy > p:last-child {
    margin-top: 16px !important;
    font-size: 13px !important;
    line-height: 1.65 !important;
  }

  .about-page .company-system {
    border-radius: 20px !important;
  }

  .about-page .company-grid {
    grid-template-columns: 1fr !important;
  }

  .about-page .company-card {
    min-height: 228px !important;
    padding: 24px 20px !important;
    border-right: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, .13) !important;
  }

  .about-page .company-card:last-child {
    border-bottom: 0 !important;
  }

  .about-page .company-role {
    margin: 26px 0 7px !important;
    font-size: 12px !important;
  }

  .about-page .company-card h3 {
    font-size: 29px !important;
  }

  .about-page .company-statement {
    margin-top: 15px !important;
    font-size: 20px !important;
    line-height: 1.3 !important;
  }

  .about-page .company-scope {
    padding-top: 16px !important;
    font-size: 11px !important;
  }

  .about-page .system-note {
    min-height: 0 !important;
    display: grid !important;
    justify-content: stretch !important;
    gap: 8px !important;
    padding: 18px 20px !important;
  }

  .about-page .system-note strong {
    font-size: 13px !important;
  }

  /* Business cases: control intentional line breaks and remove orphan text. */
  .cases-page main.page {
    padding: 80px 14px 42px !important;
  }

  .cases-page .hero {
    min-height: auto !important;
    padding: 56px 0 38px !important;
    gap: 28px !important;
  }

  .cases-page .hero-copy {
    gap: 30px !important;
  }

  .cases-page .hero .eyebrow {
    gap: 14px !important;
    font-size: 14px !important;
  }

  .cases-page .hero .eyebrow::before {
    width: 44px !important;
    height: 3px !important;
  }

  .cases-page .hero h1 {
    margin-top: 22px !important;
    font-size: clamp(54px, 15.2vw, 62px) !important;
    line-height: .87 !important;
    letter-spacing: -.065em !important;
    white-space: nowrap !important;
  }

  .cases-page .hero h1 > span {
    display: block !important;
    margin-top: .08em !important;
    white-space: nowrap !important;
  }

  .cases-page .hero-text {
    max-width: 100% !important;
    font-size: 14px !important;
    line-height: 1.75 !important;
  }

  .cases-page .hero-text strong {
    margin-bottom: 20px !important;
    font-size: 17px !important;
    line-height: 1.5 !important;
    letter-spacing: -.02em !important;
  }

  .cases-page .hero-text strong > span {
    display: block !important;
    margin: 0 !important;
    white-space: nowrap !important;
  }

  .cases-page .hero-text > span {
    display: block !important;
    margin-top: .22em !important;
    white-space: normal !important;
    text-wrap: pretty;
  }

  .cases-page .hero-actions {
    margin-top: 24px !important;
  }

  .cases-page .stage-board {
    min-height: auto !important;
    padding: 16px !important;
    border-radius: 28px !important;
  }

  /* Remaining editorial pages: keep secondary title phrases intact. */
  .service-page .service-hero h1 {
    font-size: clamp(50px, 14vw, 56px) !important;
    line-height: .88 !important;
    letter-spacing: -.065em !important;
  }

  .service-page .service-hero h1 > .service-title-main {
    display: block !important;
    margin-top: 0 !important;
    font-size: 1em !important;
    white-space: nowrap !important;
  }

  .service-page .service-hero h1 > .service-title-outline {
    display: block !important;
    margin-top: .06em !important;
    white-space: nowrap !important;
  }

  .careers-page .career-hero h1 {
    font-size: clamp(50px, 14vw, 56px) !important;
    line-height: .9 !important;
    letter-spacing: -.06em !important;
  }

  .careers-page .career-hero h1 > .career-title-main {
    display: block !important;
    margin-top: 0 !important;
    font-size: 1em !important;
    line-height: 1 !important;
    letter-spacing: inherit !important;
    white-space: nowrap !important;
  }

  .careers-page .career-hero h1 > .career-title-outline {
    display: block !important;
    margin-top: .18em !important;
    font-size: .68em !important;
    line-height: 1.06 !important;
    letter-spacing: -.045em !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 359px) {
  .nav {
    grid-template-columns: 48px minmax(0, 1fr) !important;
  }

  .nav > .brand {
    width: 48px !important;
    max-width: 48px !important;
    padding: 4px !important;
  }

  .nav > .brand .brand-name,
  .nav > .brand > span:last-child {
    display: none !important;
  }

  .nav > .nav-links a {
    padding-inline: 10px !important;
    font-size: 11.5px !important;
  }
}
