/* =========================================================
   RESPONSIVE.CSS — breakpoints from 1600px down to 320px
   ========================================================= */

/* ---------- 1600px / large desktop ---------- */
@media (max-width: 1600px) {
  :root { --container-width: min(1140px, 92vw); }
}

/* ---------- 1440px ---------- */
@media (max-width: 1440px) {
  :root { --container-width: min(1080px, 92vw); }
}

/* ---------- 1366px / 1280px laptop ---------- */
@media (max-width: 1366px) {
  .values__grid { grid-template-columns: repeat(3, 1fr); }
  .timeline { grid-template-columns: repeat(3, 1fr); row-gap: 2.4rem; }
  .timeline::before { display: none; }
}

@media (max-width: 1280px) {
  .footer__grid { grid-template-columns: 1.2fr 1fr 1fr; row-gap: 2.4rem; }
  .footer__col:nth-child(4), .footer__col:nth-child(5) { grid-column: span 1; }
}

/* ---------- 1024px tablet landscape ---------- */
@media (max-width: 1024px) {
  .hero__content { grid-template-columns: 1fr; }
  .hero__stats { max-width: 420px; }
  .about__grid,
  .why-us__grid,
  .testimonial__inner { grid-template-columns: 1fr; }
  .about__media { max-width: 480px; margin-inline: auto; }
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .insights__grid { grid-template-columns: repeat(2, 1fr); }
  .industries__list { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 768px tablet portrait ---------- */
@media (max-width: 768px) {
  :root { --header-height: 72px; }

  .topbar__contact li:nth-child(3) { display: none; } /* hide address on small tablet */

  .main-nav,
  .header__cta { display: none; }
  .nav-toggle { display: flex; }

  .main-nav.is-open {
    display: flex;
    position: fixed;
    inset: var(--header-height) 0 0 auto;
    width: min(320px, 85vw);
    height: calc(100vh - var(--header-height));
    background: #fff;
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    overflow-y: auto;
    z-index: 99;
  }
  .main-nav.is-open .main-nav__list { flex-direction: column; align-items: flex-start; gap: 0.4rem; width: 100%; }
  .main-nav.is-open .nav-link { display: block; padding: 0.8em 0; width: 100%; }
  .main-nav.is-open .dropdown {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; display: none; padding-left: 1rem; min-width: 0;
  }
  .main-nav.is-open .has-dropdown.is-open .dropdown { display: block; }

  .hero__stats { grid-template-columns: 1fr 1fr; display: grid; max-width: 100%; }
  .stat-row { grid-template-columns: auto 1fr; border-bottom: none; padding-bottom: 0; }
  .stat-row__icon { grid-row: auto; }
  .stat-row__label { grid-column: 1 / -1; }

  .services__grid { grid-template-columns: 1fr; }
  .values__grid { grid-template-columns: repeat(2, 1fr); }
  .timeline { grid-template-columns: repeat(2, 1fr); }
  .industries__list { grid-template-columns: repeat(3, 1fr); }
  .insights__grid { grid-template-columns: 1fr; }
  .why-us__stats-grid { grid-template-columns: 1fr 1fr; }

  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }

  .carousel-arrow { display: none; } /* touch swipe used instead on small screens */
}

/* ---------- 480px / 430px / 414px / 390px / 375px / 360px / 320px mobile ---------- */
@media (max-width: 480px) {
  .topbar__contact li:nth-child(2) { display: none; } /* keep just phone visible */
  .topbar__inner { justify-content: center; }
  .topbar__social span { display: none; }

  .header__inner { padding-block: 0.8rem; }
  .logo img { height: 32px; }

  .hero { min-height: 92vh; }
  .hero__content { padding-block: 5rem 3rem; text-align: left; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { justify-content: center; }
  .hero__stats { grid-template-columns: 1fr; padding: 1rem; }
  .hero__arrow { width: 38px; height: 38px; }

  .trusted-by__inner { flex-direction: column; align-items: flex-start; }

  .about__badge { position: static; margin-top: -2.4rem; margin-inline: 1rem; }
  .about__thumbs { grid-template-columns: 1fr 1fr; }
  .feature-grid { grid-template-columns: 1fr; }

  .values__grid { grid-template-columns: 1fr 1fr; }
  .timeline { grid-template-columns: 1fr 1fr; }

  .industries__list { grid-template-columns: repeat(2, 1fr); }

  .why-us__stats-grid { grid-template-columns: 1fr; }
  .stat-block { border-right: none !important; }

  .testimonial__slide footer { flex-wrap: wrap; }
  .testimonial__logo { margin-left: 0; }

  .cta-banner__inner { flex-direction: column; align-items: flex-start; }
  .cta-banner__actions { width: 100%; }
  .cta-banner__actions .btn { flex: 1; justify-content: center; }

  .footer__grid { grid-template-columns: 1fr; }
  .footer__bottom-inner { flex-direction: column; text-align: center; }

  .back-to-top { right: 1rem; bottom: 1rem; width: 40px; height: 40px; }
}

@media (max-width: 375px) {
  .section-title { font-size: clamp(1.4rem, 1.2rem + 2vw, 1.9rem); }
  .values__grid,
  .timeline,
  .industries__list { grid-template-columns: 1fr; }
}

@media (max-width: 320px) {
  :root { --container-width: 94vw; }
  .btn { padding: 0.8em 1.2em; font-size: 0.88rem; }
}
/* --- Mobile toggle positioning --- */
@media (max-width: 768px) {
  .header__inner {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: nowrap;
  }
  .logo {
    flex-shrink: 0;
  }
  .nav-toggle {
    margin-left: auto;          /* pushes toggle to the right */
    flex-shrink: 0;
    order: 3;
    z-index: 100;
  }
  .header__cta {
    display: none;              /* hide desktop CTA on mobile */
  }

  /* Backdrop */
  .menu-backdrop {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: rgba(0,0,0,0.5);
    z-index: 98;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  .menu-backdrop.is-active {
    display: block;
    opacity: 1;
  }

  .main-nav.is-open {
    z-index: 99;
  }
}