/* ==========================================================================
   TECHSMITHS — RESPONSIVE STYLESHEET
   Breakpoints target: 1920 / 1600 / 1440 / 1366 / 1280 / 1024 / 768 / 430 / 390 / 375
   ========================================================================== */

/* ---------- large desktop refinement ---------- */
@media (max-width: 1600px) {
  :root { --container: 1240px; }
}

/* ---------- laptop / small desktop ---------- */
@media (max-width: 1280px) {
  .hero-inner { gap: 24px; }
  .card-analytics { left: -2%; }
  .card-brand { right: -2%; }
  .projects-grid { gap: 22px; }
  .services-panel { padding-left: 40px; }
}

/* ---------- tablet ---------- */
@media (max-width: 1024px) {
  :root { --side-pad: 30px; }

  .nav-links { display: none; }
  .nav-contact { display: none; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }

  .hero { padding-top: 130px; flex-direction: column; align-items: stretch; }
  .hero-social-rail { display: none; }
  .hero-inner { grid-template-columns: 1fr; order: 1; }
  .hero-heading { font-size: clamp(46px, 8vw, 64px); }

  /* robot escapes the grid for the full-height desktop treatment, so on mobile/tablet
     it's re-flowed as a normal in-flow block AFTER the text via flex order, sized down
     and de-cluttered rather than overlapping the copy */
  .hero-shadow-img { display: none; }
  .hero-visual-robot {
    order: 2;
    position: relative;
    right: auto; bottom: auto; left: auto; top: auto;
    height: 46vh; max-height: 400px; width: auto;
    margin: 30px auto 0;
  }
  .hero-dark .card-analytics { top: -4%; left: 4%; }

  /* no motion on the hero visual on mobile/tablet — static robot image only */
  .hero-orbit, .hero-spark { display: none; }

  /* arc collapses to a simple vertical stack — the curved layout only works with room to breathe */
  .arc-dome { display: none; }
  .process-arc { height: auto; display: flex; flex-direction: column; gap: 46px; align-items: center; padding: 10px 0 20px; }
  .arc-line { display: none; }
  .process-node { position: relative; left: auto; bottom: auto; transform: none; width: 100%; max-width: 360px; }
  .process-node::before {
    content: ""; position: absolute; left: 50%; bottom: 100%; width: 2px; height: 46px;
    background: var(--border); transform: translateX(-50%);
  }
  .process-node:first-child::before { display: none; }
  .node-content { opacity: 1; transform: none; }

  .services-interactive { display: none; }
  .services-accordion { display: block; }
  .services-section { padding-bottom: 20px; }
  .service-scroll-step { display: none; }

  .why-grid { grid-template-columns: 1fr; }
  .why-center { order: -1; max-width: 420px; margin: 0 auto 20px; }
  .why-left, .why-right { text-align: left; }
  .feature-list { max-width: 520px; }

  .stats-grid { grid-template-columns: repeat(3, 1fr); row-gap: 40px; }

  .projects-top { flex-direction: column; align-items: flex-start; gap: 20px; }
  .projects-top-right { text-align: left; margin-left: 0; }
  .projects-top-right .section-text { text-align: left; margin-left: 0; }
  .projects-grid { grid-template-columns: 1fr; }

  .testimonials-grid { grid-template-columns: 1fr; gap: 36px; }
  .abstract-shape { display: none; }

  .blog-grid { grid-template-columns: 1fr; }

  .cta-inner { grid-template-columns: 1fr; text-align: left; }
  .cta-right { height: 180px; }

  .footer-top { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .footer-newsletter { grid-column: 1 / -1; max-width: 420px; }
}

/* ---------- large mobile / small tablet ---------- */
@media (max-width: 768px) {
  :root { --side-pad: 22px; --section-pad: clamp(60px, 14vw, 90px); }

  .hero { min-height: auto; padding-top: 120px; padding-bottom: 60px; }
  .hero-buttons { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero-buttons .btn { width: 100%; justify-content: center; }
  .floating-card { padding: 10px 12px; }
  .card-analytics { left: 0; top: 2%; }
  .card-brand { right: 0; bottom: 10%; }
  .card-app { display: none; }

  .marquee-label { text-align: left; }

  .services-top { text-align: left; }
  .services-top .section-text { margin: 0; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .gallery-slide { width: 260px; }

  .testimonial-slide { padding: 28px 22px; }

  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: left; }
}

/* ---------- mobile ---------- */
@media (max-width: 430px) {
  .hero-heading { font-size: clamp(38px, 11vw, 52px); }
  .hero-shot { width: 90%; }
  .why-overlay { font-size: 14px; padding: 12px 16px; left: -4%; }
  .why-avatars img, .avatar-more { width: 28px; height: 28px; }
  .cta-inner { padding: 34px 22px; border-radius: 20px; }
  .modal-panel { border-radius: 18px; }
}

@media (max-width: 390px) {
  .btn { padding: 14px 22px; font-size: 14px; }
  .section-heading { font-size: clamp(34px, 9vw, 44px); }
}

@media (max-width: 375px) {
  .nav-inner { gap: 12px; }
  .logo-img { height: 30px; }
  .avatar-stack img { width: 34px; height: 34px; }
}

/* ==========================================================================
   MOBILE AUDIT — sections rebuilt by a separate process without any
   mobile coverage (process cards, services showcase, why-choose, hero
   robot slider, testimonials, project CTA, footer). Fixed at the source
   rather than papered over with overflow:hidden.
   ========================================================================== */

/* ---------- hero robot slider: keep it a contained portrait block ---------- */
@media (max-width: 1024px) {
  .hero-visual-robot { width: min(78vw, 320px) !important; }
}

/* ---------- gallery filters: scroll instead of wrapping into messy rows ---------- */
@media (max-width: 640px) {
  .gallery-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin: 22px calc(var(--side-pad) * -1) 0;
    padding: 0 var(--side-pad) 4px;
  }
  .gallery-filters::-webkit-scrollbar { display: none; }
  .filter-btn { flex: 0 0 auto; white-space: nowrap; }
}

/* ---------- trusted brands: shrink logos, keep single-line marquee ---------- */
@media (max-width: 768px) {
  .marquee-heading { font-size: clamp(20px, 5vw, 26px); padding: 0 8px; }
  .logo-item, .marquee-group .logo-item { flex-basis: 150px !important; width: 150px !important; height: 60px !important; }
  .logo-item img { max-width: 110px !important; max-height: 34px !important; }
  .marquee-group { width: 900px !important; min-width: 900px !important; flex-basis: 900px !important; }
}

/* ---------- process timeline: vertical stack on tablet/mobile (handled in style.css) ---------- */

/* ---------- services showcase: bay-window slider stacks the heading on mobile ---------- */
@media (max-width: 1024px) {
  .services-showcase-top { grid-template-columns: 1fr; gap: 24px; align-items: start; text-align: left; }
}

/* ---------- why choose: 3-column asymmetric layout to a clean stack ---------- */
@media (max-width: 1024px) {
  .why-choose-section { padding: 64px 0 56px; }
  .why-choose-wave { display: none; }
  .why-choose-layout {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    min-height: 0;
    gap: 28px;
    align-items: stretch;
  }
  .why-choose-stats {
    flex-direction: row;
    justify-content: center;
    padding-bottom: 0;
    gap: 16px;
  }
  .why-stat { width: auto; flex: 1 1 0; min-height: 100px; }
  .why-choose-visual { order: initial; }
  .why-choose-robot { width: min(70vw, 320px); height: auto; max-height: 340px; }
  .why-choose-panel { margin: 0; padding: 30px 24px 26px; border-radius: 22px; }
  .why-benefit p { max-width: none; }
  .why-review {
    position: static;
    margin: 20px auto 0;
    width: fit-content;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(27,16,50,.12);
  }
  .why-review small { position: static; display: block; margin-top: 2px; white-space: normal; }
}
@media (max-width: 480px) {
  .why-choose-stats { flex-direction: column; }
  .why-stat { width: 100%; }
}

/* ---------- testimonials: kill the sticky pin + absolute stack on mobile ---------- */
@media (max-width: 767px) {
  .testimonials-sticky { position: static; min-height: 0; padding: 0 20px; }
  .testimonials-stage { height: auto; margin-top: 8px; }
  .testimonial-row {
    position: relative;
    inset: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    opacity: 1;
    transform: none !important;
    margin-bottom: 28px;
  }
  .testimonial-row:last-child { margin-bottom: 0; }
  .testimonial-photo { height: 170px; margin: 0 auto 18px; max-width: 260px; }
  .testimonial-avatar { width: 92px; height: 92px; }
  .testimonial-card { transform: none !important; padding: 26px 22px; text-align: center; }
  .testimonial-stars { justify-content: center; }
}

/* ---------- project CTA: giant display type needs a mobile scale ---------- */
@media (max-width: 768px) {
  .project-cta { padding: 72px 18px; min-height: 0; }
  .project-cta-title { font-size: clamp(40px, 13vw, 68px); margin: 20px 0 4px; letter-spacing: -.03em; }
  .project-cta-link {
    font-size: clamp(22px, 8vw, 32px);
    padding: 10px 34px 10px 24px;
    gap: 10px;
    transform: none;
    margin-top: 18px;
  }
  .project-cta-link:hover { transform: scale(1.02); }
  .project-cta-arrow { width: clamp(48px, 15vw, 64px); right: -10px; }
  .project-badge { font-size: 11px; }
}

/* ---------- footer: 3-column desktop grid to a clean stack ---------- */
@media (max-width: 1024px) {
  .footer-reference { padding: 0 20px 18px; }
  .footer-reference-top { min-height: 0; flex-wrap: wrap; gap: 18px; padding: 24px 0; justify-content: center; text-align: center; }
  .footer-reference-nav { flex-wrap: wrap; justify-content: center; gap: 16px 24px; }
  .footer-reference-nav a { font-size: 15px; }
  .footer-reference-grid { grid-template-columns: 1fr; min-height: 0; }
  .footer-reference-grid > div { padding: 30px 0 !important; border-left: 0 !important; }
  .footer-reference-robot { display: none; }
  .footer-reference-about > p { max-width: none; }
}


/* ---------- fine pointer only: hover-dependent niceties already gated by :hover ---------- */

/* ==========================================================================
   RESPONSIVE QA PASS - root-cause fixes from a real-browser audit
   (every page x 1920/1600/1440/1366/1280/1024/820/768/430/414/390/375/360/320)
   ========================================================================== */

/* mobile menu: one scroll area (safe on short landscape phones) and the page behind it is locked */
html.menu-open, html.menu-open body { overflow: hidden; }
/* the floating WhatsApp / call buttons sit above the menu and would cover its links */
html.menu-open .floating-contact-actions { visibility: hidden; }
.mobile-menu { overflow-y: auto; overscroll-behavior: contain; justify-content: safe center; padding-top: 96px; padding-bottom: 32px; }
.mobile-menu-links { max-height: none; overflow: visible; }
/* author display:flex was overriding the [hidden] attribute, so the Services list was always expanded */
.mobile-accordion-panel[hidden] { display: none; }
.mobile-accordion-panel a { display: flex; align-items: center; min-height: 44px; }

/* touch targets */
@media (max-width: 1024px) {
  .nav-logo { min-height: 44px; }
  .ts-footer-socials a { width: 44px; height: 44px; }
  #pfw .pfw-f { min-height: 44px; }
}

/* portfolio gallery: the mobile edge-bleed of the filter bars / card rail must equal the container padding (12px) */
@media (max-width: 768px) {
  .gallery-embed-section #pfw .pfw-bar, .gallery-embed-section #pfw .pfw-grid { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
}

/* desktop navbar between laptop and tablet: the links were absolutely centred, so they ran into the phone block
   (Career over the number at 1366/1280, About Us wrapping at 1180). Below 1440 they flow between logo and contact
   block, shrink fluidly, and the number text yields to the round call button once it cannot fit. */
.nav-link { white-space: nowrap; }
@media (min-width: 1025px) and (max-width: 1439px) {
  .nav-links { position: static; transform: none; margin-left: auto; margin-right: clamp(12px, 1.8vw, 28px); gap: clamp(14px, 1.7vw, 30px); }
  .nav-link { font-size: clamp(15px, 1.25vw, 18px); }
  .nav-contact { margin-left: 0; gap: 12px; }
  .nav-phone-copy a { font-size: 15px; }
}
@media (min-width: 1025px) and (max-width: 1239px) {
  .nav-phone-copy { display: none; }
  .nav-phone { width: 52px; height: 52px; }
}

/* homepage portfolio, mobile: filter tabs scroll sideways in one row, work cards sit in a true 2-column grid */
@media (max-width: 767px) {
  .gallery-embed-section.homepage-portfolio #pfw .pfw-bar {
    position: relative; flex-wrap: nowrap; justify-content: flex-start;
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity; scrollbar-width: none;
    /* room for the hover lift and the active tab's glow, which overflow clips */
    padding-top: 6px; padding-bottom: 16px; margin-top: -6px; margin-bottom: 2px;
  }
  .gallery-embed-section.homepage-portfolio #pfw .pfw-bar::-webkit-scrollbar { display: none; }
  .gallery-embed-section.homepage-portfolio #pfw .pfw-bar[hidden] { display: none; }
  .gallery-embed-section.homepage-portfolio #pfw .pfw-bar .pfw-f { flex: 0 0 auto; scroll-snap-align: start; }

  .gallery-embed-section.homepage-portfolio #pfw .pfw-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-count: auto !important; gap: 12px;
  }
  .gallery-embed-section.homepage-portfolio #pfw .pfw-card { margin: 0; }
  .gallery-embed-section.homepage-portfolio #pfw .pfw-wrap { height: 210px !important; }
}
