/* ============================================================
   Qyverix — Mobile Responsive Overrides
   Single source of truth for all breakpoints ≤ 1024px
   ============================================================ */

/* ─── 0. Global: kill horizontal overflow ─────────────────── */
html, body { overflow-x: hidden; max-width: 100%; }
img, svg, canvas { max-width: 100%; }

/* ─── 1. Navigation ──────────────────────────────────────── */
/* Pill nav: hide links + show toggle at 1024px */
@media (max-width: 1024px) {
  .qx-nav--pill .qx-nav__links { display: none; }
  .qx-nav--pill .qx-nav__social { display: none; }
  .qx-nav__toggle { display: inline-flex; }
  .qx-nav__mobile { display: flex; }
}

/* Shrink nav padding on small phones */
@media (max-width: 480px) {
  .qx-nav-shell { padding: 0 10px; }
  .qx-nav--pill { padding: 6px 6px 6px 10px; }
  /* Hide the CTA button on very small screens to prevent overflow */
  .qx-nav--pill .qx-nav__cta { display: none; }
}

/* Mobile menu: comfortable tap targets */
.qx-nav__mobile a {
  padding: 6px 20px;
  width: 100%;
  text-align: center;
}
@media (max-width: 480px) {
  .qx-nav__mobile a { font-size: 1.6rem; }
  .qx-nav__mobile { gap: 16px; }
}

/* ─── 2. Hero (classic centred) ──────────────────────────── */
@media (max-width: 768px) {
  .qx-hero--classic {
    padding: 7rem 5vw 5rem;
    min-height: 100svh;
  }
  .qx-hero--classic .qx-hero__title {
    font-size: clamp(3rem, 11vw, 5rem);
  }
  .qx-hero--classic .qx-hero__ring--2,
  .qx-hero--classic .qx-hero__ring--3 { display: none; }
  .qx-hero--classic .qx-hero__ring--1 { width: 280px; height: 280px; }
}

@media (max-width: 480px) {
  .qx-hero--classic {
    padding: 5.5rem 5vw 4rem;
  }
  .qx-hero--classic .qx-hero__title {
    font-size: clamp(2.6rem, 10.5vw, 3.5rem);
    margin-bottom: 0.8rem;
  }
  .qx-hero__eyebrow {
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    padding: 0.3rem 0.9rem;
    margin-bottom: 1.2rem;
  }
  .qx-hero__tagline-wrap {
    margin: 1rem auto 1.5rem;
    padding: 0.6rem 1rem;
  }
  .qx-hero__tagline { font-size: 0.9rem; line-height: 1.5; }
  .qx-hero--classic .qx-hero__lede {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 2rem;
  }
  .qx-hero--classic .qx-hero__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .qx-hero--classic .qx-hero__actions .qx-btn {
    width: 100%;
    justify-content: center;
  }
  .qx-hero__scroll-cue { display: none; }
}

/* ─── 3. Ledger / Stats ──────────────────────────────────── */
@media (max-width: 900px) {
  .qx-ledger { grid-template-columns: repeat(2, 1fr); }
  .qx-ledger__cell:nth-child(2) { border-right: 0; }
  .qx-ledger__cell:nth-child(3) { border-top: 1px solid var(--border); }
}
@media (max-width: 480px) {
  .qx-ledger { grid-template-columns: 1fr; }
  .qx-ledger__cell {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 28px 20px;
  }
  .qx-ledger__cell:nth-child(n) { border-right: 0; border-top: none; }
  .qx-ledger__cell:last-child { border-bottom: 0; }
  .qx-ledger__v { font-size: clamp(2.25rem, 10vw, 3rem); }
}

/* ─── 4. Services ────────────────────────────────────────── */
@media (max-width: 768px) {
  .qx-services__header {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 36px;
  }
  .qx-services--editorial .qx-services__featured {
    grid-template-columns: 1fr;
  }
  .qx-service-featured {
    min-height: 180px;
    padding: 28px 24px;
  }
  .qx-service-featured__title { font-size: 1.5rem; }
  .qx-service-row {
    grid-template-columns: 40px 1fr auto;
    gap: 10px;
    padding: 14px 0;
  }
  .qx-service-row__title { font-size: 1.05rem; }
}

@media (max-width: 480px) {
  .qx-service-row { grid-template-columns: 1fr auto; gap: 8px; }
  .qx-service-row__n { display: none; }
}

/* ─── 5. Build Modes / CMS demo ──────────────────────────── */
@media (max-width: 900px) {
  .qx-cms__grid { grid-template-columns: 1fr; }
  .qx-cms__preview-wrap { position: static; }
  .qx-cms__features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .qx-cms__intro { flex-direction: column; gap: 12px; }
  .qx-cms__intro-p { max-width: 100%; }
}
@media (max-width: 480px) {
  .qx-cms__features { grid-template-columns: 1fr; }
}

/* ─── 6. Studio / About ──────────────────────────────────── */
@media (max-width: 900px) {
  .qx-studio__philosophy { grid-template-columns: 1fr; gap: 32px; padding: 40px 0; margin-bottom: 56px; }
  .qx-studio__reach { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .qx-studio { padding: 56px 0; }
  .qx-studio__origin { margin-bottom: 40px; }
  .qx-studio__quote { font-size: clamp(1.4rem, 4vw, 2rem); max-width: 100%; }
  .qx-studio__collective-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .qx-studio__reach-title { font-size: clamp(1.35rem, 4vw, 1.75rem); }
}
@media (max-width: 640px) {
  .qx-studio__metrics { grid-template-columns: repeat(3, 1fr); }
  .qx-studio__reach-cards { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .qx-studio__metrics { grid-template-columns: repeat(2, 1fr); }
  .qx-studio__metric { padding: 20px 12px; }
  .qx-studio__metric-v { font-size: 1.4rem; }
  .qx-studio__metric-k { font-size: 8px; }
  .qx-studio__spotlight { grid-template-columns: 72px 1fr; gap: 14px; padding: 24px 0; }
  .qx-studio__spotlight-name { font-size: 1.2rem; }
  .qx-studio__spotlight-bio { font-size: 13px; line-height: 1.6; }
}

/* Team marquee card size */
@media (max-width: 640px) { .qx-team-card { width: 220px; } }
@media (max-width: 480px) { .qx-team-card { width: 200px; } }

/* ─── 7. Process ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .qx-process { padding-top: 64px; overflow: visible; }
  .qx-process__header { flex-direction: column; gap: 12px; padding-bottom: 36px; }
  .qx-process__header > div:last-child { text-align: left; }
  .qx-process__pin { height: auto !important; padding-bottom: 48px; }
  .qx-process__track {
    position: static !important;
    flex-direction: column !important;
    height: auto !important;
    padding: 0 16px;
    transform: none !important;
    gap: 20px;
  }
  .qx-process__card {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 32px 24px;
    flex-shrink: 1;
  }
  .qx-process__card-n { font-size: 56px; }
  .qx-process__card-title { font-size: 28px; }
}

/* ─── 8. Work / Portfolio rail ───────────────────────────── */
@media (max-width: 768px) {
  .qx-work-pin { height: auto !important; padding: 20px 0 56px; overflow: visible; }
  .qx-work-track {
    flex-direction: column !important;
    height: auto !important;
    transform: none !important;
    padding: 0 16px;
    gap: 28px;
    align-items: center;
  }
  .qx-case { flex: none !important; width: 100% !important; max-width: 440px; }
  .qx-case__frame { transform: none !important; }
  .qx-work-counter { position: static; text-align: center; padding: 16px; }
}

/* ─── 9. Industries marquee ──────────────────────────────── */
@media (max-width: 768px) {
  .qx-industries { padding-top: 64px; }
  .qx-pill { padding: 8px 14px; font-size: 12px; }
}

/* ─── 10. Testimonials / Voices ──────────────────────────── */
/* On mobile: disable the stacked absolute layout,
   show only the active card as a normal block */
@media (max-width: 640px) {
  .qx-voices { padding-top: 64px; }
  .qx-voices__stage {
    height: auto !important;
    min-height: 0 !important;
  }
  .qx-voices__card {
    position: relative !important;
    inset: auto !important;
    display: none !important;
    transform: none !important;
    opacity: 1 !important;
    padding: 28px 20px;
  }
  .qx-voices__card.is-front {
    display: flex !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .qx-voices__quote {
    font-size: clamp(1.05rem, 4vw, 1.4rem);
    margin: 14px 0;
  }
}
/* Section header row in voices */
@media (max-width: 640px) {
  .qx-voices > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
    margin-bottom: 36px !important;
  }
}

/* ─── 11. CTA Band ───────────────────────────────────────── */
@media (max-width: 768px) {
  .qx-cta-band__inner { grid-template-columns: 1fr; gap: 28px; }
  .qx-cta-band h2 { font-size: clamp(1.75rem, 5.5vw, 2.5rem); margin-bottom: 14px; }
  .qx-cta-band { padding: 64px 0; margin-top: 64px; }
}

/* ─── 12. Footer ─────────────────────────────────────────── */
/* Mega CTA — main overflow culprit on mobile */
@media (max-width: 768px) {
  .qx-footer__mega-cta {
    padding: 0 var(--gutter-mobile) 40px;
    overflow: hidden;
  }
  .qx-footer__mega-cta a {
    font-size: clamp(2.5rem, 10vw, 5rem);
    line-height: 1.05;
    word-break: break-word;
  }
  .qx-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 48px var(--gutter-mobile);
  }
  .qx-footer__marquee { overflow: hidden; }
}
@media (max-width: 520px) {
  .qx-footer__mega-cta a { font-size: clamp(2rem, 10.5vw, 3.5rem); }
  .qx-footer__grid { grid-template-columns: 1fr; gap: 28px; padding: 40px var(--gutter-mobile); }
  .qx-footer__bar {
    flex-direction: column;
    gap: 16px;
    text-align: center;
    padding: 24px var(--gutter-mobile) 28px;
  }
  .qx-footer__bar > div:last-child { flex-direction: column; gap: 12px; align-items: center; }
}

/* ─── 13. Industry Drawer ────────────────────────────────── */
@media (max-width: 640px) {
  .qx-drawer {
    width: 100vw !important;
    padding: 56px 20px 32px !important;
    max-height: 100vh;
  }
  /* Override inline font-size on drawer title */
  .qx-drawer [data-drawer-title],
  .qx-drawer h3 {
    font-size: 2rem !important;
    line-height: 1.1 !important;
  }
  .qx-drawer__close { top: 18px; right: 18px; }
  .qx-drawer__plan { font-size: 16px !important; }
}
@media (max-width: 400px) {
  .qx-drawer [data-drawer-title],
  .qx-drawer h3 { font-size: 1.6rem !important; }
}

/* ─── 14. Contact page ───────────────────────────────────── */
@media (max-width: 900px) {
  .qx-contact-page__grid { grid-template-columns: 1fr; gap: 40px; }
  .qx-contact-page__intro { position: static; }
}
@media (max-width: 480px) {
  .qx-contact-page { padding: 100px 0 48px; }
  .qx-contact-page__title { font-size: clamp(1.75rem, 6vw, 2.25rem); }
  .qx-form-grid { grid-template-columns: 1fr; }
  .qx-form-grid .span-2 { grid-column: span 1; }
}

/* ─── 15. Shared heading scale on mobile ─────────────────── */
@media (max-width: 768px) {
  .qx-h2 { font-size: clamp(1.9rem, 5.5vw, 3rem); }
  .section-pad { padding-top: 64px; }
}
@media (max-width: 480px) {
  .qx-h2 { font-size: clamp(1.7rem, 6vw, 2.4rem); }
  .section-pad { padding-top: 48px; }
  .container { padding-left: 16px; padding-right: 16px; }
  .qx-label { margin-bottom: 20px; }
}

/* ─── 16. Buttons ────────────────────────────────────────── */
@media (max-width: 480px) {
  .qx-btn { padding: 14px 22px; font-size: 14px; }
  .qx-btn--sm { padding: 7px 14px; font-size: 11px; }
}
