/* Phone and tablet refinements loaded after the core theme styles. */
@media (max-width: 1024px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body[data-page] .container,
  .hero-content,
  .hero-grid,
  .about-hero-stage,
  .about-hero-body,
  .about-founder-grid,
  .about-support-content,
  .clients-hero-grid,
  .client-story-stack,
  .contact-hero-grid,
  .contact-hero-contact-grid,
  .careers-services-hero-grid,
  .careers-openings,
  .service-explorer,
  .team-hero-stage,
  .team-hero-top {
    min-width: 0;
  }

  /* Make the supporting line and partner logos legible on touch devices. */
  body[data-page="home"] .home-hero-kicker {
    padding: 9px 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(9px, 1.45vw, 12px);
    font-weight: 700;
    letter-spacing: 0.035em;
  }

  body[data-page="home"] .logos.home-hero-logos {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(620px, 100%);
    max-width: 620px;
    gap: 22px 26px;
  }

  body[data-page="home"] .logos.home-hero-logos .logo-tile {
    height: 32px;
    min-height: 32px;
  }

  body[data-page="home"] .logos.home-hero-logos .logo-tile:nth-child(n) img {
    width: auto;
    height: 26px;
    max-width: 100%;
    max-height: 26px;
  }

  /* Keep the six most important services available on phones and tablets. */
  body[data-page="home"] .why-section .home-services-row {
    display: flex;
    align-items: center;
    flex-direction: row;
    margin-top: 42px;
  }

  body[data-page="home"] .why-section .home-services-row .section-title {
    margin: 0;
    padding: 0;
    font-size: clamp(28px, 4.4vw, 40px);
    text-align: left;
  }

  body[data-page="home"] .why-section .home-services-view {
    min-height: 44px;
    align-items: center;
  }

  body[data-page="home"] .why-section .home-services-pills {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
  }

  body[data-page="home"] .home-service-pill {
    min-height: 58px;
    gap: 11px;
    padding: 9px 13px 9px 9px;
    border-radius: 999px;
    font-size: clamp(12px, 1.65vw, 15px);
    line-height: 1.2;
  }

  body[data-page="home"] .home-service-ring {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  body[data-page="home"] .home-service-ring::after {
    inset: 6px;
  }

  /* Prevent grid tracks from expanding to desktop max-content widths. */
  body[data-page="about"] .about-support-content {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page="about"] .about-support-title,
  body[data-page="about"] .about-support-content > p,
  body[data-page="about"] .about-client-row,
  body[data-page="about"] .logo-showcase,
  body[data-page="about"] .logo-showcase-viewport {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body[data-page="about"] .about-support-title {
    font-size: clamp(38px, 6.7vw, 56px);
  }

  body[data-page="about"] .about-founder-heading a,
  body[data-page="about"] .about-client-row a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
  }

  body[data-page="clients"] .clients-hero-grid,
  body[data-page="contact"] .contact-hero-grid,
  body[data-page="careers"] .careers-services-hero-grid,
  body[data-page="services"] .services-hero-grid,
  body[data-page="team"] .team-hero-top {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page="clients"] .clients-hero-copy,
  body[data-page="contact"] .contact-hero-copy,
  body[data-page="careers"] .careers-services-hero-copy,
  body[data-page="services"] .services-hero-copy,
  body[data-page="team"] .team-hero-copy {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body[data-page="clients"] .clients-hero-copy h1,
  body[data-page="clients"] .clients-hero-copy h1 > span,
  body[data-page="contact"] .contact-hero-copy h1,
  body[data-page="careers"] .careers-services-hero-copy h1,
  body[data-page="team"] .team-hero-copy h1 {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body[data-page="clients"] .clients-hero-copy h1 {
    font-size: clamp(52px, 8.6vw, 70px);
  }

  body[data-page="contact"] .contact-hero-copy h1,
  body[data-page="careers"] .careers-services-hero-copy h1 {
    font-size: clamp(52px, 8.2vw, 70px);
  }

  body[data-page="team"] .team-hero-copy h1 {
    font-size: clamp(58px, 10vw, 82px);
  }

  body[data-page="clients"] .client-story-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
  }

  body[data-page="clients"] .client-story-stack .testimonial {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 26px;
    overflow-wrap: anywhere;
  }

  body[data-page="clients"] .clients-hero-logo-panel,
  body[data-page="clients"] .logo-showcase,
  body[data-page="clients"] .logo-showcase-viewport {
    width: 100%;
    min-width: 0;
  }

  body[data-page="contact"] .contact-list a,
  body[data-page="contact"] .contact-list span {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
  }

  body[data-page="careers"] .careers-openings {
    padding-top: 54px;
  }

  body[data-page="careers"] .careers-vacancy-board {
    border-radius: 16px;
  }

  body[data-page="careers"] .vacancy-tools {
    padding: 24px 26px 12px;
  }

  body[data-page="services"] .service-explorer-controls button {
    width: 44px;
    height: 44px;
  }

  body[data-page="services"] .service-explorer-contact {
    min-height: 48px;
  }

  body[data-page="remote-support"] .remote-support-page .section-title {
    font-size: clamp(48px, 7vw, 64px);
    line-height: 1.05;
  }

  .main-nav.is-open {
    overflow-x: hidden;
  }

  /* Keep high-priority support and client shortcuts inside the touch menu. */
  .main-nav.is-open .main-nav-top {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    /* Keep both shortcuts clear of the fixed close control at every tablet width. */
    padding: 22px 72px 0 0;
  }

  .main-nav.is-open .main-nav-top .main-nav-support {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    height: auto;
    padding: 10px 12px;
    border: 1px solid var(--accent);
    border-radius: 999px;
    font-size: clamp(10px, 1.8vw, 13px);
    line-height: 1.2;
    text-align: center;
  }

  .main-nav.is-open .main-nav-marketplace {
    background: var(--accent);
    color: var(--navy);
  }

  .main-nav.is-open .main-nav-links {
    padding-top: clamp(28px, 5vh, 52px);
    padding-bottom: clamp(28px, 5vh, 52px);
  }

  .scroll-top-toggle {
    width: 44px;
    height: 44px;
  }

  .site-footer a,
  .footer-access-links a {
    min-height: 44px;
  }
}

@media (min-width: 1025px) {
  /* The premium desktop panel is compact, so make its shortcuts size to the grid
     instead of retaining the legacy 233px minimum width. */
  .main-nav.is-open {
    overflow-x: hidden;
  }

  .main-nav.is-open .main-nav-top {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    padding: 0 84px 0 0;
  }

  .main-nav.is-open .main-nav-top .main-nav-support {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    height: auto;
    padding: 10px 12px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1.2;
    text-align: center;
  }
}

body[data-page="clients"] .clients-logo-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}

body[data-page="clients"] .clients-logo-summary h2 {
  margin: 0;
  color: var(--white);
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1;
}

body[data-page="clients"] .clients-logo-summary p {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
  text-transform: uppercase;
}

body[data-page="clients"] .clients-logo-summary strong {
  color: var(--accent);
  font-size: clamp(34px, 4.8vw, 64px);
  line-height: 0.85;
}

body[data-page="clients"] .clients-logo-summary span {
  max-width: 110px;
  font-size: 12px;
  line-height: 1.2;
}

@media (max-width: 699px) {
  body[data-page] .container {
    width: calc(100% - 32px);
    margin-inline: 16px;
  }

  body[data-page="home"] .home-hero-copy h1 {
    font-size: clamp(36px, 11vw, 48px);
  }

  body[data-page="home"] .home-hero-copy::after {
    width: calc(100% + 16px);
    margin-right: -16px;
  }

  body[data-page="home"] .logos.home-hero-logos {
    gap: 18px 14px;
    margin: 28px 0 40px;
  }

  body[data-page="home"] .logos.home-hero-logos .logo-tile {
    height: 28px;
    min-height: 28px;
  }

  body[data-page="home"] .logos.home-hero-logos .logo-tile:nth-child(n) img {
    height: 23px;
    max-height: 23px;
  }

  body[data-page="home"] .home-hero-actions {
    width: calc(100% + 32px);
    margin-inline: -16px;
  }

  body[data-page="home"] .why-section {
    padding-bottom: 58px;
  }

  body[data-page="home"] .why-section .home-services-row {
    margin-top: 34px;
  }

  body[data-page="home"] .why-section .home-services-pills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body[data-page="home"] .home-service-pill {
    min-height: 54px;
    gap: 8px;
    padding: 8px 10px 8px 8px;
    font-size: 11px;
  }

  body[data-page="home"] .home-service-ring {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
  }

  body[data-page="home"] .home-service-ring::after {
    inset: 5px;
  }

  body[data-page="about"] .about-support-title {
    font-size: clamp(34px, 10.5vw, 46px);
    line-height: 1.08;
  }

  body[data-page="about"] .about-support-content > p {
    font-size: 15px;
  }

  body[data-page="clients"] .clients-hero {
    padding-top: 112px;
  }

  body[data-page="clients"] .clients-hero-copy h1 {
    font-size: clamp(40px, 12vw, 50px);
    line-height: 1.03;
  }

  body[data-page="clients"] .clients-hero-copy .lead {
    margin-top: 30px;
  }

  body[data-page="clients"] .client-story-stack {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  body[data-page="clients"] .client-story-stack .testimonial {
    padding: 24px;
    border-radius: 16px;
  }

  body[data-page="clients"] .clients-logo-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 18px;
  }

  body[data-page="clients"] .clients-logo-summary p {
    align-items: center;
  }

  body[data-page="clients"] .clients-logo-summary span {
    max-width: none;
  }

  body[data-page="contact"] .contact-hero,
  body[data-page="careers"] .careers-services-hero {
    padding-top: 112px;
  }

  body[data-page="contact"] .contact-hero-copy h1,
  body[data-page="careers"] .careers-services-hero-copy h1 {
    font-size: clamp(42px, 12.2vw, 50px);
    line-height: 1.04;
  }

  body[data-page="contact"] .contact-hero-contact-grid > .card,
  body[data-page="contact"] .form-shell {
    padding: 22px;
    border-radius: 18px;
  }

  body[data-page="careers"] .careers-openings {
    padding-top: 38px;
  }

  body[data-page="careers"] .vacancy-tools,
  body[data-page="careers"] .vacancy-list,
  body[data-page="careers"] .vacancy-preview {
    padding-inline: 18px;
  }

  body[data-page="careers"] .vacancy-tools {
    gap: 10px;
    padding-top: 20px;
  }

  body[data-page="careers"] .vacancy-search,
  body[data-page="careers"] .vacancy-tools select {
    width: 100%;
    flex-basis: 100%;
  }

  body[data-page="careers"] .vacancy-preview:has(.vacancy-empty-preview) {
    min-height: 180px;
  }

  body[data-page="services"] .service-explorer {
    gap: 18px;
  }

  body[data-page="services"] .service-explorer-panel {
    padding: 20px;
  }

  body[data-page="services"] .service-explorer-copy h2 {
    font-size: clamp(28px, 9vw, 34px);
    margin-bottom: 20px;
  }

  body[data-page="services"] .service-explorer-copy p {
    font-size: 15px;
  }

  body[data-page="services"] .service-explorer-contact {
    width: 100%;
  }

  body[data-page="team"] .team-hero-copy h1 {
    font-size: clamp(46px, 14vw, 58px);
  }

  body[data-page="team"] .team-showcase-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page="team"] .team-flip-inner {
    min-height: 300px;
  }

  body[data-page="remote-support"] .remote-support-page {
    padding-top: 128px;
  }

  body[data-page="remote-support"] .remote-support-page .section-title {
    font-size: clamp(40px, 11.5vw, 48px);
  }

  body[data-page="remote-support"] .remote-support-card {
    min-height: 60px;
    padding: 12px 16px;
  }

  body[data-page="remote-support"] .remote-support-card span:nth-child(2) {
    font-size: 18px;
  }

  .main-nav.is-open .main-nav-top {
    grid-template-columns: minmax(0, 1fr);
    padding-right: 58px;
  }

  .main-nav.is-open .main-nav-top .main-nav-support {
    font-size: 12px;
  }

  .mobile-footer-contact a,
  .copyright a {
    min-height: 44px;
  }
}

@media (min-width: 700px) and (max-width: 1024px) {
  body[data-page="services"] .service-explorer-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 22px;
    max-height: none;
    overflow: visible;
  }

  body[data-page="services"] .service-explorer-list [role="tab"] {
    min-height: 48px;
  }
}

/* Standardised customer-logo carousel: equal visual weight without distortion. */
.home-client-section .logo-showcase-set,
body[data-page="clients"] .clients-hero-logo-panel .logo-showcase-set,
body[data-page="about"] .about-support-section .logo-showcase-set {
  gap: 52px;
  padding-right: 52px;
}

.home-client-section .logo-showcase .logo-tile,
body[data-page="clients"] .clients-hero-logo-panel .logo-showcase .logo-tile,
body[data-page="about"] .about-support-section .logo-showcase .logo-tile {
  --logo-width: 104px;
  --logo-height: 56px;
  --logo-scale: 1;
  --logo-hover-scale: 1.06;
  display: grid;
  width: 156px;
  height: 88px;
  min-height: 88px;
  flex: 0 0 156px;
  place-items: center;
  padding: 10px 5px;
  overflow: visible;
  border: 1px solid transparent;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.home-client-section .logo-showcase .logo-size-wide,
body[data-page="clients"] .clients-hero-logo-panel .logo-showcase .logo-size-wide,
body[data-page="about"] .about-support-section .logo-showcase .logo-size-wide {
  --logo-width: 146px;
  --logo-height: 38px;
}

.home-client-section .logo-showcase .logo-size-landscape,
body[data-page="clients"] .clients-hero-logo-panel .logo-showcase .logo-size-landscape,
body[data-page="about"] .about-support-section .logo-showcase .logo-size-landscape {
  --logo-width: 124px;
  --logo-height: 48px;
}

.home-client-section .logo-showcase .logo-size-compact,
body[data-page="clients"] .clients-hero-logo-panel .logo-showcase .logo-size-compact,
body[data-page="about"] .about-support-section .logo-showcase .logo-size-compact {
  --logo-width: 76px;
  --logo-height: 62px;
}

.home-client-section .logo-showcase .logo-optical-boost,
body[data-page="clients"] .clients-hero-logo-panel .logo-showcase .logo-optical-boost,
body[data-page="about"] .about-support-section .logo-showcase .logo-optical-boost {
  --logo-scale: 1.42;
  --logo-hover-scale: 1.48;
}

.home-client-section .logo-showcase .logo-optical-subtle,
body[data-page="clients"] .clients-hero-logo-panel .logo-showcase .logo-optical-subtle,
body[data-page="about"] .about-support-section .logo-showcase .logo-optical-subtle {
  --logo-scale: 1.16;
  --logo-hover-scale: 1.22;
}

.home-client-section .logo-showcase .logo-tile img,
body[data-page="clients"] .clients-hero-logo-panel .logo-showcase .logo-tile img,
body[data-page="about"] .about-support-section .logo-showcase .logo-tile img {
  width: var(--logo-width) !important;
  height: var(--logo-height) !important;
  max-width: calc(100% - 8px) !important;
  max-height: 64px !important;
  object-fit: contain;
  transform: scale(var(--logo-scale));
}

.home-client-section .logo-showcase .logo-tile:hover img,
.home-client-section .logo-showcase .logo-tile:focus-within img,
body[data-page="clients"] .clients-hero-logo-panel .logo-showcase .logo-tile:hover img,
body[data-page="clients"] .clients-hero-logo-panel .logo-showcase .logo-tile:focus-within img,
body[data-page="about"] .about-support-section .logo-showcase .logo-tile:hover img,
body[data-page="about"] .about-support-section .logo-showcase .logo-tile:focus-within img {
  transform: scale(var(--logo-hover-scale));
}

@media (hover: hover) and (pointer: fine) {
  .home-client-section .logo-showcase .logo-tile:hover,
  body[data-page="clients"] .clients-hero-logo-panel .logo-showcase .logo-tile:hover,
  body[data-page="about"] .about-support-section .logo-showcase .logo-tile:hover {
    background: rgba(255, 255, 255, 0.76);
    border-color: rgba(51, 186, 158, 0.48);
    box-shadow: 0 14px 32px rgba(0, 8, 20, 0.24);
    backdrop-filter: blur(8px);
    transform: translateY(-2px);
  }

  .home-client-section .logo-showcase .logo-hover-dark:hover,
  body[data-page="clients"] .clients-hero-logo-panel .logo-showcase .logo-hover-dark:hover,
  body[data-page="about"] .about-support-section .logo-showcase .logo-hover-dark:hover {
    background: rgba(7, 31, 55, 0.98);
  }

  .home-client-section .logo-showcase .logo-hover-white:hover,
  body[data-page="clients"] .clients-hero-logo-panel .logo-showcase .logo-hover-white:hover,
  body[data-page="about"] .about-support-section .logo-showcase .logo-hover-white:hover {
    background: rgba(255, 255, 255, 0.76);
  }

  .home-client-section .logo-showcase .logo-tile:hover img,
  body[data-page="clients"] .clients-hero-logo-panel .logo-showcase .logo-tile:hover img,
  body[data-page="about"] .about-support-section .logo-showcase .logo-tile:hover img {
    filter: none !important;
    mix-blend-mode: normal !important;
    opacity: 1;
    transform: scale(var(--logo-hover-scale));
  }

  .home-client-section .logo-showcase .logo-hover-white:hover img,
  body[data-page="clients"] .clients-hero-logo-panel .logo-showcase .logo-hover-white:hover img,
  body[data-page="about"] .about-support-section .logo-showcase .logo-hover-white:hover img {
    mix-blend-mode: multiply !important;
  }
}

@media (max-width: 1024px) {
  .home-client-section .logo-showcase-set,
  body[data-page="clients"] .clients-hero-logo-panel .logo-showcase-set,
  body[data-page="about"] .about-support-section .logo-showcase-set {
    gap: 38px;
    padding-right: 38px;
  }

  .home-client-section .logo-showcase .logo-tile,
  body[data-page="clients"] .clients-hero-logo-panel .logo-showcase .logo-tile,
  body[data-page="about"] .about-support-section .logo-showcase .logo-tile {
    width: 144px;
    flex-basis: 144px;
  }
}

@media (max-width: 640px) {
  .home-client-section .logo-showcase-set,
  body[data-page="clients"] .clients-hero-logo-panel .logo-showcase-set,
  body[data-page="about"] .about-support-section .logo-showcase-set {
    gap: 26px;
    padding-right: 26px;
  }

  .home-client-section .logo-showcase .logo-tile,
  body[data-page="clients"] .clients-hero-logo-panel .logo-showcase .logo-tile,
  body[data-page="about"] .about-support-section .logo-showcase .logo-tile {
    width: 128px;
    height: 78px;
    min-height: 78px;
    flex-basis: 128px;
    padding-block: 7px;
  }
}
