
/* Delyx mobile optimisation layer
   Loaded after the shared and page-specific styles. */

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 96px;
}

body {
  overflow-x: hidden;
}

img {
  height: auto;
}

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

a,
p,
li,
h1,
h2,
h3 {
  overflow-wrap: break-word;
}

.menu-open {
  overflow: hidden;
}

/* Tablet */
@media (max-width: 900px) {
  .section {
    padding: 66px 0;
  }

  .page-hero {
    padding: 82px 0 64px;
  }

  .page-hero h1 {
    max-width: 760px;
  }

  .button-row {
    gap: 12px;
  }

  .service-nav,
  .industry-nav,
  .work-nav {
    position: relative !important;
    top: auto !important;
  }

  .service-nav-inner,
  .industry-nav-inner,
  .work-nav-inner {
    width: 100%;
    padding: 11px 18px;
    margin: 0;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .service-nav-inner::-webkit-scrollbar,
  .industry-nav-inner::-webkit-scrollbar,
  .work-nav-inner::-webkit-scrollbar {
    display: none;
  }

  .service-nav a,
  .industry-nav a,
  .work-nav-link {
    scroll-snap-align: start;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .service-image,
  .service-image img,
  .industry-image,
  .industry-image img,
  .simple-visual,
  .simple-visual img,
  .operator-image,
  .operator-image img {
    min-height: 0 !important;
  }

  .service-image img,
  .industry-image img,
  .simple-visual img,
  .operator-image img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }

  .qualipak-project-panel {
    gap: 28px !important;
  }

  .footer-grid {
    gap: 28px;
  }
}

/* Mobile */
@media (max-width: 720px) {
  :root {
    --radius: 15px;
  }

  html {
    scroll-padding-top: 82px;
  }

  .container {
    width: min(calc(100% - 30px), var(--max-width));
  }

  .section,
  .section-sm {
    padding: 52px 0;
  }

  .page-hero {
    padding: 64px 0 50px;
  }

  h1 {
    font-size: clamp(2.15rem, 10.5vw, 3.35rem);
    line-height: 1.05;
  }

  h2 {
    font-size: clamp(1.72rem, 8vw, 2.35rem);
    line-height: 1.1;
  }

  h3 {
    font-size: 1.18rem;
  }

  .lead {
    font-size: 1.02rem;
    line-height: 1.58;
  }

  .eyebrow {
    gap: 8px;
    font-size: .69rem;
    letter-spacing: .11em;
  }

  .eyebrow::before {
    width: 22px;
    height: 2px;
  }

  .card {
    padding: 22px 18px;
  }

  .button-row {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .button-row .button {
    width: 100%;
    min-height: 52px;
    padding-inline: 18px;
    text-align: center;
  }

  .button {
    min-height: 50px;
  }

  /* Header */
  .hmi-site-header {
    position: sticky;
  }

  .hmi-header-container {
    width: calc(100% - 14px);
    min-height: 72px;
    display: grid;
    grid-template-columns: minmax(118px, 1fr) 92px 44px;
    gap: 6px;
    padding: 6px 0;
  }

  .hmi-brand-panel {
    width: auto;
    min-width: 0;
    padding: 4px 7px;
    border-width: 2px;
  }

  .hmi-brand-panel img {
    width: 100%;
    height: 46px;
    object-fit: contain;
  }

  .hmi-header-clock {
    width: auto;
    min-width: 0;
    min-height: 50px;
    padding: 6px 4px;
    border-width: 2px;
  }

  .hmi-header-clock strong {
    font-size: .78rem;
    letter-spacing: .025em;
  }

  .hmi-header-clock span {
    margin-top: 4px;
    font-size: .57rem;
  }

  .hmi-menu-toggle {
    display: block;
    width: 44px;
    height: 50px;
    border-width: 2px;
  }

  .hmi-menu-toggle[aria-expanded="true"] span {
    opacity: 0;
  }

  .hmi-menu-toggle[aria-expanded="true"]::before {
    transform: translateY(6px) rotate(45deg);
  }

  .hmi-menu-toggle[aria-expanded="true"]::after {
    transform: translateY(-6px) rotate(-45deg);
  }

  .hmi-menu-toggle::before,
  .hmi-menu-toggle::after {
    transition: transform .2s ease;
  }

  .hmi-mobile-nav {
    max-height: calc(100vh - 72px);
    overflow-y: auto;
    padding: 8px 12px 14px;
  }

  .hmi-mobile-button {
    min-height: 52px;
    margin: 7px 0;
    font-size: .94rem;
  }

  /* Home */
  .story-hero {
    min-height: auto !important;
    background-position: 62% center;
  }

  .story-hero-content {
    padding: 68px 0 92px !important;
  }

  .story-promise {
    display: grid;
    gap: 10px;
    margin: 24px 0 28px;
  }

  .story-trust {
    margin-top: -34px !important;
  }

  .story-trust-panel {
    border-radius: 15px;
  }

  .story-trust-item {
    padding: 20px 18px;
  }

  .home-service-card {
    min-height: 0 !important;
    padding: 22px 18px !important;
  }

  .industry-image-grid {
    grid-template-columns: 1fr !important;
    grid-template-rows: none !important;
  }

  .industry-image-grid figure,
  .industry-image-grid figure:first-child {
    grid-row: auto !important;
    min-height: 0;
  }

  .industry-image-grid img {
    aspect-ratio: 4 / 3;
  }

  /* Services and Industries */
  .service-layout,
  .service-layout.reverse,
  .industry-layout,
  .industry-layout.reverse {
    gap: 28px !important;
  }

  .service-list,
  .process-grid {
    gap: 10px !important;
  }

  .service-item,
  .process-item {
    min-height: 0 !important;
    padding-top: 14px !important;
    padding-bottom: 14px !important;
  }

  .service-image,
  .industry-image {
    border-radius: 18px !important;
  }

  .support-band,
  .conveyor-banner,
  .closing-panel {
    padding: 28px 20px !important;
    border-radius: 18px !important;
  }

  .conveyor-tags {
    gap: 8px !important;
  }

  .conveyor-tag {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .conveyor-actions {
    margin-top: 24px !important;
  }

  /* Projects */
  .capability-head {
    gap: 20px !important;
  }

  .capability-head .check-list {
    margin-top: 0;
  }

  .capability-gallery {
    gap: 12px !important;
  }

  .capability-gallery figure,
  .capability-gallery figure:first-child,
  .capability-gallery figure:not(:first-child) {
    min-height: 0 !important;
  }

  .capability-gallery img {
    width: 100%;
    height: auto !important;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }

  .hmi-hardware-card {
    padding: 18px !important;
    gap: 18px !important;
  }

  .hmi-primary-gallery,
  .hmi-screen-gallery {
    gap: 14px !important;
  }

  .hmi-primary-gallery figure,
  .hmi-screen-gallery figure {
    border-radius: 12px !important;
  }

  .hmi-primary-gallery figcaption,
  .hmi-screen-gallery figcaption {
    padding: 11px 12px !important;
    font-size: .82rem !important;
  }

  .qualipak-relationship-wrap {
    padding: 24px 0 30px !important;
  }

  .qualipak-project-panel {
    grid-template-columns: 1fr !important;
    min-height: 0 !important;
    padding: 26px 20px !important;
    gap: 22px !important;
    border-radius: 20px !important;
  }

  .qualipak-project-logo {
    min-height: 150px !important;
    padding: 18px !important;
  }

  .qualipak-project-logo img {
    max-height: 135px !important;
  }

  .qualipak-project-points {
    gap: 8px !important;
  }

  .qualipak-project-points span {
    width: 100%;
    text-align: center;
  }

  /* About */
  .split {
    gap: 30px;
  }

  .visual-panel {
    min-height: 360px;
    padding: 24px 20px;
  }

  .visual-stat {
    left: 18px;
    right: 18px;
    bottom: 18px;
  }

  .about-logo-box {
    min-height: 94px !important;
    padding: 14px 18px !important;
  }

  .team-photo {
    margin: 28px 0 24px;
    border-radius: 16px;
  }

  .team-role {
    min-height: 0;
  }

  /* Contact */
  .contact-card .button {
    width: 100%;
    margin-top: 4px;
  }

  .form-grid {
    gap: 14px;
  }

  input,
  textarea,
  select {
    font-size: 16px; /* prevents iOS zoom */
  }

  iframe[title*="workshop location"] {
    height: 340px;
  }

  /* Footer */
  .site-footer {
    padding: 48px 0 24px;
  }

  .footer-logo {
    width: min(240px, 100%);
  }

  .footer-bottom {
    margin-top: 30px;
  }
}

/* Small phones */
@media (max-width: 390px) {
  .container {
    width: calc(100% - 24px);
  }

  .section,
  .section-sm {
    padding: 44px 0;
  }

  .page-hero {
    padding: 54px 0 42px;
  }

  h1 {
    font-size: clamp(2rem, 11vw, 2.65rem);
  }

  h2 {
    font-size: clamp(1.58rem, 8.5vw, 2rem);
  }

  .hmi-header-container {
    width: calc(100% - 10px);
    grid-template-columns: minmax(105px, 1fr) 84px 42px;
    gap: 4px;
  }

  .hmi-brand-panel img {
    height: 42px;
  }

  .hmi-header-clock {
    min-height: 46px;
  }

  .hmi-header-clock strong {
    font-size: .7rem;
  }

  .hmi-header-clock span {
    font-size: .52rem;
  }

  .hmi-menu-toggle {
    width: 42px;
    height: 46px;
  }

  .story-hero-content {
    padding: 58px 0 84px !important;
  }

  .card {
    padding: 19px 16px;
  }

  .cta-band {
    padding: 24px 18px;
  }
}

@media (hover: none) {
  .button:hover,
  .service-card:hover,
  .hmi-nav-button:hover,
  .photo-gallery figure:hover img {
    transform: none;
  }
}
