/* ── Prevent horizontal overflow ── */
html, body { max-width: 100vw; overflow-x: hidden; }
img, video, iframe, svg { max-width: 100%; }

/* ── Mobile scroll performance ──
   These prevent native overscroll rubber-banding from fighting Lenis
   and enable hardware-accelerated scroll momentum on iOS. */
html {
  overscroll-behavior-y: none;
}
body {
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

/* Floating WhatsApp button — GPU layer so it never repaints on scroll */
.whatsapp-float {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* ══════════════════════════════════════════════
   TABLET / SMALL DESKTOP  (≤ 1024px)
   ══════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .hero-container { padding: 6rem 0 2.5rem; }
  .hero-content { width: 55%; margin-left: 5%; margin-bottom: 2rem; }
  .hero-headline { font-size: clamp(2.5rem, 5vw, 4rem); }
  .hero-description { font-size: 1rem; }
  .hero-stats { margin-left: 5%; width: 90%; padding: 1.5rem 2rem; }
  .stat-number { font-size: 1.6rem; }

  .deliver-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

  /* Process */
  .process-timeline { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
  .process-timeline::before { display: none; }
  .process-step-desc { max-width: 200px; }
  #process { padding: 3rem 0; }

  /* Industries */
  .industries-grid { grid-template-columns: repeat(2, 1fr); }
  .industries-bg { padding: 2rem 1.25rem 2.5rem; }

  /* About */
  #about { padding: 3rem 1.25rem; }
  .about-container { grid-template-columns: 1fr; gap: 2rem; }
  .about-image-frame img { height: 320px; }
  .about-stats { grid-template-columns: repeat(2, 1fr); gap: 0; padding: 1rem 0; }
  .about-accent-dots, .about-accent-hash, .about-accent-l { display: none; }
  .about-bg-world { display: none; }
  .about-bg-dots { display: none; }
  .about-desc { max-width: 100%; }

  /* Why Choose */
  .why-choose-grid { grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
  #why-choose { padding: 3rem 0; }

  /* Enquiry */
  .enquiry-form { padding: 1.5rem; }
  .form-row { grid-template-columns: 1fr; }

  /* Footer */
  .footer-top { grid-template-columns: 1fr; }
  .footer-brand { grid-column: span 1; }
  .footer-brand .nav-logo { gap: 8px; }
  .footer-brand .nav-logo-img { height: 42px; }
  .footer-brand .logo-main { font-size: 0.95rem; }
  .footer-brand .logo-sub { font-size: 0.6rem; }
  .footer-container { padding: 0 1.25rem; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 0.5rem; }

  /* Floating WhatsApp */
  .whatsapp-float { width: 48px; height: 48px; bottom: 1.25rem; right: 1.25rem; }

  .contact-container { gap: 2.5rem; }
  .contact-map iframe { height: 300px; }

  /* Section padding */
  section { padding: 4rem 0; }
  .section-container { padding: 0 1.25rem; }
}

/* ══════════════════════════════════════════════
   MOBILE  (≤ 768px)
   — Navbar hamburger, hero full-width, overlay
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Navbar ── */
  #navbar { height: 60px; padding: 0 0.75rem; }
  .nav-container { gap: 0.5rem; }

  /* Hide desktop nav links and CTA */
  .nav-links { display: none; }
  .nav-cta   { display: none; }

  /* Show hamburger */
  .hamburger {
    display: flex;
    margin-left: auto;
    flex-shrink: 0;
  }

  /* Logo sizing */
  .nav-logo { gap: 8px; min-width: 0; overflow: hidden; }
  .nav-logo-img { height: 40px; flex-shrink: 0; }
  .logo-text { min-width: 0; overflow: hidden; }
  .logo-main { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .logo-sub  { font-size: 0.58rem; }

  /* ── Mobile nav overlay ── */
  .nav-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: linear-gradient(160deg, #021B1A 0%, #021B1A 50%, #021B1A 100%);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
  }

  .nav-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-overlay-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }

  .nav-overlay-link {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.6rem;
    color: rgba(248,248,244,0.85);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
  }

  .nav-overlay-link:hover {
    color: var(--gold);
  }

  .nav-overlay-slogan {
    position: absolute;
    bottom: 3rem;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-style: italic;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    background: linear-gradient(90deg, rgba(248,248,244,0.3) 0%, #00F5C4 50%, rgba(248,248,244,0.3) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  /* ── Hero — full-width centered layout ── */
  .hero-overlay {
    background: linear-gradient(
      180deg,
      rgba(2,27,26,0.92) 0%,
      rgba(2,27,26,0.72) 35%,
      rgba(2,27,26,0.58) 65%,
      rgba(2,27,26,0.85) 100%
    );
  }

  .hero-container {
    padding: 5.5rem 0 1.5rem;
    justify-content: flex-end;
    min-height: 100vh;
    min-height: 100dvh; /* dynamic viewport height for mobile browsers */
  }

  .hero-content {
    width: auto;
    max-width: 100%;
    margin: 0 1.25rem;
    margin-bottom: 1.5rem;
    text-align: left;
  }

  .hero-gold-line { width: 45px; margin-bottom: 1rem; }

  .hero-eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    margin-bottom: 1.25rem;
  }

  .hero-headline {
    font-size: clamp(2rem, 8vw, 2.8rem);
    line-height: 1.05;
  }

  .hero-divider { width: 60px; margin: 1.25rem 0; }

  .hero-slogan {
    font-size: 0.95rem;
    margin-bottom: 1rem;
  }

  .hero-description {
    font-size: 0.92rem;
    line-height: 1.7;
    max-width: 100%;
    margin-bottom: 1.75rem;
  }

  /* Hero buttons — side by side, shrunk */
  .hero-actions {
    gap: 0.75rem;
  }

  .btn-primary-gold {
    height: 50px;
    padding: 0 1.5rem;
    font-size: 0.85rem;
    border-radius: 12px;
  }

  .btn-glass {
    height: 50px;
    padding: 0 1.25rem;
    font-size: 0.85rem;
    border-radius: 12px;
  }

  /* ── Stats panel — 2×2 grid ── */
  .hero-stats {
    margin: 0 1.25rem;
    width: calc(100% - 2.5rem);
    padding: 1.25rem;
    border-radius: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  /* Hide the vertical dividers in stats */
  .stat-divider { display: none; }

  .stat-item { gap: 0.65rem; }
  .stat-icon { width: 32px; height: 32px; }
  .stat-icon svg { width: 18px; height: 18px; }
  .stat-number { font-size: 1.5rem; }
  .stat-label { font-size: 0.72rem; }

  /* ── What We Deliver — horizontal scroll carousel ── */
  .deliver-grid {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding: 0 1.25rem 1rem;
    scrollbar-width: none; /* Firefox */
  }
  .deliver-grid::-webkit-scrollbar { display: none; } /* Chrome/Safari */

  .deliver-card {
    flex: 0 0 75vw;
    aspect-ratio: 1 / 1;
    scroll-snap-align: center;
    border-radius: 16px;
  }

  /* Hide decorative elements on mobile */
  #what-we-deliver::before,
  #what-we-deliver::after,
  .deliver-ring-inner,
  .deliver-dot-1,
  .deliver-dot-2,
  .deliver-dot-3,
  .deliver-texture {
    display: none;
  }

  /* ── Contact ── */
  .contact-container { flex-direction: column; gap: 2rem; }
  .contact-map iframe { height: 280px; }
}

/* ══════════════════════════════════════════════
   SMALL PHONES  (≤ 480px)
   ══════════════════════════════════════════════ */
@media (max-width: 480px) {
  .nav-wrapper { width: 100%; top: 0; }
  #navbar { height: 54px; padding: 0 0.75rem; }

  .nav-logo { gap: 6px; }
  .nav-logo-img { height: 36px; }
  .logo-main { font-size: 0.82rem; }
  .logo-sub  { font-size: 0.52rem; }

  .footer-brand .nav-logo-img { height: 36px; }
  .footer-brand .logo-main { font-size: 0.82rem; }
  .footer-brand .logo-sub { font-size: 0.52rem; }
  .footer-container { padding: 0 1rem; }

  .hero-container { padding: 5rem 0 1.25rem; }
  .hero-content { margin-left: 1rem; margin-right: 1rem; margin-bottom: 1.25rem; }
  .hero-headline { font-size: clamp(1.7rem, 7.5vw, 2.2rem); }
  .hero-description { font-size: 0.88rem; }

  .hero-actions .btn-primary-gold { height: 46px; font-size: 0.82rem; padding: 0 1.25rem; }
  .hero-actions .btn-glass { height: 46px; font-size: 0.82rem; padding: 0 1rem; }

  .hero-stats {
    margin: 0 1rem;
    width: calc(100% - 2rem);
    padding: 1rem 0.85rem;
    gap: 0.85rem;
  }
  .stat-number { font-size: 1.35rem; }
  .stat-label { font-size: 0.68rem; }

  .deliver-card { flex: 0 0 78vw; }
  .deliver-card-img svg { width: 34px; height: 34px; }
  .deliver-card-content { padding: 1rem; }
  .deliver-card-title { font-size: 0.85rem; }
  .deliver-card-arrow { font-size: 0.9rem; }
  .process-timeline { grid-template-columns: 1fr; max-width: 340px; }
  .about-stats { grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1rem; }
  .about-stat-divider { display: none; }
  .about-image-frame img { height: 240px; }
  #about { padding: 2.5rem 1rem; }
  .why-choose-grid { grid-template-columns: 1fr; max-width: 360px; margin: 0 auto; }
  .industries-grid { grid-template-columns: 1fr; }
  .contact-container { gap: 2rem; }
  .contact-map iframe { height: 240px; }
  .enquiry-form { padding: 1.25rem; }

  section { padding: 3rem 0; }
}

/* ── Force no horizontal overflow on all major containers ── */
#hero, section, .section-container, .nav-wrapper, #three-bg-wrapper,
.hero-container, .hero-content, .hero-stats,
.deliver-grid, .services-scroll, .gallery-grid, .leadership-grid, .industries-bg, .industries-grid, .process-timeline, .why-choose-grid,
.enquiry-form, footer, .footer-top,
.contact-map iframe { max-width: 100vw; }

/* ══════════════════════════════════════════════
   VERY NARROW  (≤ 374px)
   ══════════════════════════════════════════════ */
@media (max-width: 374px) {
  .hero-container { padding: 4.5rem 0 1rem; }
  .hero-content { margin-left: 0.75rem; margin-right: 0.75rem; margin-bottom: 1rem; }
  .hero-headline { font-size: 1.5rem; }
  .hero-description { font-size: 0.82rem; }
  .hero-stats {
    margin: 0 0.75rem;
    width: calc(100% - 1.5rem);
    padding: 0.85rem 0.65rem;
    gap: 0.65rem;
  }
  .stat-number { font-size: 1.1rem; }
  .stat-label { font-size: 0.65rem; }

  /* Stack hero buttons vertically on very small screens */
  .hero-actions {
    flex-direction: column;
    gap: 0.6rem;
  }
  .hero-actions .btn-primary-gold,
  .hero-actions .btn-glass {
    width: 100%;
    justify-content: center;
    height: 46px;
  }

  .nav-logo { gap: 5px; }
  .nav-logo-img { height: 32px; }
  .logo-main { font-size: 0.75rem; }
  .logo-sub { font-size: 0.48rem; }

  .footer-brand .nav-logo-img { height: 32px; }
  .footer-brand .logo-main { font-size: 0.75rem; }
  .footer-brand .logo-sub { font-size: 0.48rem; }

  .nav-overlay-link { font-size: 1.3rem; }

  .btn-gold { height: 40px; padding: 0 1rem; font-size: 0.75rem; }
  .btn-whatsapp-nav { width: 34px; height: 34px; }
}
