/* ─────────────────────────────────────────────────────
   AMSYS — responsive.css
   Layout-only overrides. Decorative colors, fonts, and
   border styles are never touched here.
   Breakpoints: mobile <600px · tablet 600–899px · desktop 900px+
   ───────────────────────────────────────────────────── */

/* ── 1. PAGE WRAPPER ── */
.am-page-wrap {
  min-width: 0 !important;
  overflow-x: hidden;
}

/* ── 2. SECTION CONTAINER — responsive side padding ── */
.am-container {
  padding-left:  clamp(16px, 5vw, 64px) !important;
  padding-right: clamp(16px, 5vw, 64px) !important;
  box-sizing: border-box;
}

/* ── 3. GRID CLASSES ── */

/* 3-column card grid  →  2-col tablet  →  1-col mobile */
@media (max-width: 899px) {
  .am-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 599px) {
  .am-grid-3 {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* 4-column grid  →  2-col tablet/mobile */
@media (max-width: 999px) {
  .am-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 599px) {
  .am-grid-4 {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  #how .am-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  #how .am-grid-4 > div {
    padding: 16px 14px !important;
  }
}

/* 6-column icon row  →  3-col tablet  →  2-col mobile */
@media (max-width: 899px) {
  .am-grid-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 399px) {
  .am-grid-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* 2-column editorial layout  →  stacks below 768px */
@media (max-width: 767px) {
  .am-editorial {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 32px !important;
  }
}

/* ── 4. TYPOGRAPHY — responsive heading scale ── */
@media (max-width: 899px) {
  .am-h1-hero  { font-size: clamp(32px, 8vw, 48px)   !important; line-height: 1.08 !important; }
  .am-h2-large { font-size: clamp(28px, 6vw, 38px)   !important; line-height: 1.1  !important; }
  .am-h2-mid   { font-size: clamp(26px, 5.5vw, 36px) !important; line-height: 1.1  !important; }
  .am-h2-sm    { font-size: clamp(24px, 5vw, 32px)   !important; }
  .am-h3       { font-size: clamp(20px, 4vw, 28px)   !important; }
  .am-stat-one { font-size: clamp(44px, 10vw, 56px)  !important; }
}
@media (max-width: 599px) {
  .am-h1-hero  { font-size: clamp(28px, 9vw, 36px)   !important; }
  .am-h2-large { font-size: clamp(24px, 7.5vw, 30px) !important; }
  .am-h2-mid   { font-size: clamp(22px, 7vw, 28px)   !important; }
  .am-h2-sm    { font-size: clamp(20px, 6.5vw, 26px) !important; }
  .am-h3       { font-size: clamp(18px, 5.5vw, 22px) !important; }
  .am-stat-one { font-size: clamp(36px, 11vw, 44px)  !important; }
}

/* ── 5. FOOTER — responsive column collapse ── */
@media (max-width: 899px) {
  .am-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 32px !important;
  }
}
@media (max-width: 599px) {
  .am-footer {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 28px 20px !important;
  }
  .am-footer > :first-child,
  .am-footer > :last-child {
    grid-column: 1 / -1;
  }
  .am-footer-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
  }
  .am-footer-bar > div:last-child {
    flex-wrap: wrap;
    gap: 14px 18px !important;
  }
}

/* Group company boxes — two columns, short padding, on a phone */
@media (max-width: 599px) {
  #group .am-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  #group .am-grid-3 > a {
    padding: 14px 12px !important;
    min-height: 0 !important;
    justify-content: flex-start !important;
  }
}

/* ── 6. TOP BAR — wrap so the cross-site links stay tappable ── */
@media (max-width: 767px) {
  .topbar,
  .abt-top,
  div:has(> .am-topbar-links),
  div:has(> .am-topbar-label) {
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    row-gap: 8px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .am-topbar-links {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px 14px !important;
  }
  a.am-topbar-links {
    display: inline-flex !important;
  }
  .am-topbar-links,
  .am-topbar-links a,
  a.am-topbar-links {
    font-size: 11px !important;
    letter-spacing: 0.04em !important;
    line-height: 1.35;
  }
  .am-topbar-label {
    font-size: 10px !important;
    letter-spacing: 0.06em !important;
    line-height: 1.35;
  }
}

/* ── 7. HERO — min-height and padding scale ── */
@media (max-width: 899px) {
  .am-hero-wrap {
    min-height: clamp(380px, 60vw, 580px) !important;
  }
  .am-hero-inner {
    padding-top:    clamp(60px, 10vw, 100px) !important;
    padding-bottom: clamp(48px, 8vw, 80px)  !important;
  }
}

/* ── 8. OPCO HERO — 2-col splits stack on mobile ── */
.am-opco-hero {
  padding-right: clamp(16px, 5vw, 0px) !important;
}
@media (max-width: 767px) {
  .am-opco-hero {
    grid-template-columns: minmax(0, 1fr) !important;
    min-height: auto !important;
    padding-left:  clamp(16px, 5vw, 64px) !important;
    padding-right: clamp(16px, 5vw, 64px) !important;
    gap: 0 !important;
  }
  .am-opco-hero-img {
    min-height: 260px;
    order: -1;
  }
}

/* ── 9. HORIZONTAL SCROLL NAV (8-col industry, 5-col solution-sets, about anchors) ── */
.am-scroll-nav {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.am-scroll-nav::-webkit-scrollbar { display: none; }

@media (max-width: 899px) {
  .am-scroll-nav {
    display: flex !important;
    grid-template-columns: unset !important;
    gap: 0 !important;
    white-space: nowrap;
    padding-left:  clamp(16px, 5vw, 64px) !important;
    padding-right: clamp(16px, 5vw, 64px) !important;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%);
  }
  .am-scroll-nav > * {
    flex-shrink: 0;
  }
}

/* ── 10. ABOUT IN-PAGE ANCHOR NAV ── */
@media (max-width: 899px) {
  .am-anchor-nav {
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-left:  clamp(16px, 5vw, 64px) !important;
    padding-right: clamp(16px, 5vw, 64px) !important;
    gap: 0 !important;
  }
  .am-anchor-nav::-webkit-scrollbar { display: none; }
  .am-anchor-nav a {
    flex-shrink: 0;
    display: inline-block;
  }
}

/* ── 11. CANVAS HERO — cap height on mobile ── */
@media (max-width: 899px) {
  .am-canvas-hero {
    min-height: clamp(280px, 55vw, 480px) !important;
    max-height: clamp(280px, 55vw, 480px) !important;
  }
}

/* ── 12. STAT STRIP — stay two columns on a phone ── */
.am-stat-strip > * {
  white-space: normal !important;
  min-width: 0;
}
@media (max-width: 767px) {
  .am-stat-strip {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 12px 20px !important;
    align-items: start;
  }
}

/* ── 13. BUTTON PAIR — full-width stack so labels stay on one line ── */
@media (max-width: 767px) {
  .am-btn-row {
    flex-direction: column !important;
    align-items: stretch !important;
    align-self: stretch !important;
    width: 100% !important;
    gap: 12px !important;
  }
  .am-btn-row > a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
    min-height: 48px;
  }
}

/* ── 14. CTA ROW — stack copy above buttons on mobile ── */
@media (max-width: 767px) {
  .am-cta-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 24px !important;
  }
  .am-cta-row > div:last-child {
    flex-wrap: wrap !important;
    flex-shrink: 1 !important;
  }
}

/* ── 15. SECTION PADDING SCALE ── */
@media (max-width: 767px) {
  .am-section-pad {
    padding-top:    clamp(48px, 8vw, 84px) !important;
    padding-bottom: clamp(48px, 8vw, 84px) !important;
  }
}
