/*
 * NxtRev — Mobile Experience Overhaul
 * Full audit & fix at 320px / 360px / 375px / 390px / 414px / 430px / 768px
 * Strategy: mobile-first fixes that NEVER touch desktop (>=1024px).
 * All rules use max-width breakpoints. style.css is untouched.
 */

/* ═══ 0. GLOBAL — OVERFLOW PREVENTION ═══ */
html, body { overflow-x: clip; max-width: 100vw; }
img, video, svg, iframe, embed, canvas { max-width: 100%; height: auto; }
button, a, [role="button"] { -webkit-tap-highlight-color: transparent; }

/* ═══ 1. HEADER — HAMBURGER & NAV ═══ */
@media (max-width: 1023px) {
  #navbar-root { display: none !important; }
  header .btn.btn-primary { display: none !important; }
  header .w-full.flex.items-center.justify-between {
    position: relative; flex-direction: row !important;
    align-items: center !important; gap: 0 !important;
    padding-left: 1.25rem !important; padding-right: 1.25rem !important;
  }
  header.fixed { padding-top: 0.875rem !important; padding-bottom: 0.875rem !important; }
}

#nxr-hamburger {
  display: none; flex-direction: column; justify-content: center;
  align-items: center; gap: 5px; width: 44px; height: 44px;
  border: 1px solid rgba(0,0,0,0.1); border-radius: 10px;
  background: rgba(255,255,255,0.9); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); cursor: pointer; z-index: 60;
  flex-shrink: 0; transition: background 0.3s ease, border-color 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
#nxr-hamburger span {
  display: block; width: 20px; height: 1.5px; background: #111827;
  border-radius: 2px; transform-origin: center;
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1), opacity 0.25s ease, width 0.3s ease;
}
#nxr-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
#nxr-hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
#nxr-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
header.fixed.scrolled #nxr-hamburger { background: rgba(255,255,255,0.96); border-color: rgba(0,0,0,0.12); }
@media (max-width: 1023px) { #nxr-hamburger { display: flex; } }

/* Mobile Drawer */
#nxr-mobile-drawer { position: fixed; inset: 0; z-index: 9999; pointer-events: none; }
#nxr-drawer-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 0.35s ease;
}
#nxr-drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(320px,85vw);
  background: #ffffff; box-shadow: -12px 0 48px rgba(0,0,0,0.12);
  transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
  display: flex; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
#nxr-mobile-drawer.open { pointer-events: auto; }
#nxr-mobile-drawer.open #nxr-drawer-backdrop { opacity: 1; }
#nxr-mobile-drawer.open #nxr-drawer-panel { transform: translateX(0); }

#nxr-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid rgba(0,0,0,0.06); flex-shrink: 0;
}
#nxr-drawer-logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: #111827; }
#nxr-drawer-logo img { height: 28px; width: auto; }
#nxr-drawer-logo span { font-family: 'Inter Tight','Inter',sans-serif; font-weight: 700; font-size: 1.125rem; letter-spacing: -0.03em; color: #111827; }
#nxr-drawer-close {
  width: 36px; height: 36px; border: 1px solid rgba(0,0,0,0.08); border-radius: 8px;
  background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #6b7280; transition: background 0.2s ease, color 0.2s ease; -webkit-tap-highlight-color: transparent;
}
#nxr-drawer-close:hover { background: rgba(0,0,0,0.04); color: #111827; }

#nxr-drawer-nav { flex: 1; padding: 1rem 0; }
#nxr-drawer-nav a {
  display: flex; align-items: center; gap: 0.875rem; padding: 1rem 1.5rem;
  color: #374151; font-family: 'Inter',sans-serif; font-size: 0.975rem; font-weight: 500;
  text-decoration: none; transition: background 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent; min-height: 52px;
}
#nxr-drawer-nav a:hover, #nxr-drawer-nav a.active { background: rgba(201,168,106,0.04); color: #8F7340; }
#nxr-drawer-nav a svg { width: 1.2rem; height: 1.2rem; flex-shrink: 0; opacity: 0.7; }
#nxr-drawer-nav .nxr-drawer-divider { height: 1px; background: rgba(0,0,0,0.06); margin: 0.5rem 1.5rem; }

#nxr-drawer-footer {
  padding: 1.25rem 1.5rem; border-top: 1px solid rgba(0,0,0,0.06);
  display: flex; flex-direction: column; gap: 0.75rem; flex-shrink: 0;
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
}
#nxr-drawer-footer .nxr-cta-primary {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.875rem 1.5rem; background: #111827; color: #ffffff;
  border-radius: 100px; font-size: 0.875rem; font-weight: 600;
  text-decoration: none; min-height: 50px; transition: background 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
#nxr-drawer-footer .nxr-cta-primary:hover { background: #374151; }
#nxr-drawer-footer .nxr-cta-whatsapp {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.875rem 1.5rem; background: #25D366; color: #ffffff;
  border-radius: 100px; font-size: 0.875rem; font-weight: 600;
  text-decoration: none; min-height: 50px; transition: background 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
#nxr-drawer-footer .nxr-cta-whatsapp:hover { background: #20bd5a; }

/* ═══ 2. TYPOGRAPHY ═══ */
@media (max-width: 768px) {
  h1.text-6xl, h1.text-7xl, h1.text-8xl, h1.text-9xl {
    font-size: clamp(2rem, 9vw, 2.5rem) !important;
    line-height: 1.06 !important; letter-spacing: -0.03em !important;
  }
  h2, .h2 { font-size: clamp(1.6rem, 7vw, 2.2rem) !important; line-height: 1.15 !important; }
  .section-title { font-size: clamp(1.7rem, 7.5vw, 2.3rem) !important; line-height: 1.15 !important; margin-bottom: 1rem !important; }
  h3 { font-size: clamp(1.2rem, 5vw, 1.6rem) !important; }
  .lead { max-width: 100% !important; font-size: 1rem !important; line-height: 1.7 !important; }
  .body-text { max-width: 100% !important; font-size: 0.95rem !important; }
  .section { padding: 6rem 0 !important; }
}
@media (max-width: 480px) {
  h1.text-6xl, h1.text-7xl { font-size: clamp(1.75rem, 9vw, 2.25rem) !important; }
  .section-title { font-size: clamp(1.5rem, 8vw, 2rem) !important; }
  .section { padding: 5rem 0 !important; }
}
@media (max-width: 360px) {
  h1.text-6xl, h1.text-7xl { font-size: 1.75rem !important; }
  .container, .px-6 { padding-left: 1rem !important; padding-right: 1rem !important; }
}

/* ═══ 3. ORBS ═══ */
@media (max-width: 768px) {
  .orb-1 { width: 240px !important; height: 240px !important; left: -6% !important; }
  .orb-2 { width: 260px !important; height: 260px !important; right: -6% !important; }
  .orb-3 { width: 200px !important; height: 200px !important; left: 5% !important; }
  .orb { filter: blur(80px) !important; }
}
@media (max-width: 480px) { .orb-1, .orb-2, .orb-3 { opacity: 0.03 !important; } }

/* ═══ 4. HERO SECTION ═══ */
@media (max-width: 768px) {
  main > section:first-child, section.pt-44 {
    padding-top: 6.5rem !important; padding-bottom: 2rem !important;
    padding-left: 1.25rem !important; padding-right: 1.25rem !important;
  }
  .animate-fade-in-up.text-lg, .animate-fade-in-up.text-xl {
    font-size: 1rem !important; margin-bottom: 2rem !important;
    padding: 0 !important; max-width: 100% !important;
  }
  .animate-fade-in-up .flex.flex-wrap.justify-center { gap: 0.75rem !important; }
  .animate-fade-in-up .flex.flex-wrap.justify-center a.btn {
    width: 100% !important; max-width: 280px !important;
    justify-content: center !important; min-height: 50px !important;
    font-size: 0.9rem !important;
  }
  .hero-grid-bg { opacity: 0.5 !important; background-size: 40px 40px !important; }
  .hero-radial-glow { width: 300px !important; height: 300px !important; filter: blur(30px) !important; }
}
@media (max-width: 480px) {
  section.pt-44 { padding-top: 5.5rem !important; }
  .animate-fade-in-up .flex.flex-wrap.justify-center a.btn { max-width: 100% !important; }
}

/* ═══ 5. MARQUEE STRIP ═══ */
@media (max-width: 768px) {
  .animate-marquee { animation-duration: 18s !important; }
  .animate-marquee > span { margin-left: 1.25rem !important; margin-right: 1.25rem !important; }
}

/* ═══ 6. TRANSFORMATION ENGINE (Sticky scroll section) ═══ */
/* ═══ TRANSFORMATION ENGINE — MOBILE OVERRIDE ═══ */
@media (max-width: 768px) {
  /* Collapse the tall sticky scroll container — mobile gets static layout */
  #transformation-engine {
    height: auto !important;
    overflow: visible !important;
    padding: 3rem 1.25rem !important;
  }
  /* Make sticky container non-sticky on mobile */
  #hero-engine {
    position: relative !important;
    height: auto !important;
    min-height: 0 !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 0 !important;
    gap: 2rem !important;
    overflow: visible !important;
  }
  /* Engine heading */
  #hero-engine > .text-center { 
    margin-bottom: 1.5rem !important;
    padding-top: 0 !important;
  }
  #hero-engine h2 {
    font-size: clamp(1.6rem, 7vw, 2.2rem) !important;
    margin-bottom: 0.75rem !important;
  }
  /* Card stack — make visible and static on mobile */
  #engine-ui {
    position: relative !important;
    top: auto !important; left: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
    perspective: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
  }
  /* On mobile: show all 3 engine cards stacked cleanly — no overlapping */
  .engine-layer {
    transform: none !important;
    opacity: 1 !important;
    position: relative !important;
    inset: auto !important;
    margin-bottom: 0 !important;
    display: flex !important;
  }
  .engine-layer.el-top { z-index: 3; }
  .engine-layer.el-mid { z-index: 2; opacity: 1 !important; transform: none !important; }
  .engine-layer.el-bot { z-index: 1; opacity: 1 !important; transform: none !important; }
  /* Show unified overlay always on mobile */
  .unified-overlay {
    position: relative !important;
    opacity: 1 !important;
    inset: auto !important;
    margin-top: 0.5rem !important;
    border-radius: 1rem !important;
  }
  .engine-energy { display: none !important; }
  #hero-engine > div.relative.w-full {
    margin-top: 0 !important;
    height: auto !important;
  }
}
@media (max-width: 480px) {
  #engine-ui { max-width: calc(100vw - 2.5rem) !important; }
}

/* ═══ 7. OUR PROCESS ═══ */
@media (max-width: 768px) {
  #our-process { padding-top: 4rem !important; padding-bottom: 4rem !important; padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
  #process-visualizer { display: none !important; }
  .process-steps-container { padding-top: 1rem !important; padding-bottom: 1rem !important; }
  .process-steps-container .process-step { margin-bottom: 4.5rem !important; }
  .process-steps-container .process-step:last-child { margin-bottom: 0 !important; }
  .process-steps-container .process-step h3 { font-size: 1.3rem !important; margin-bottom: 0.5rem !important; }
  .process-steps-container .process-step p { font-size: 0.95rem !important; line-height: 1.6 !important; }
}

/* ═══ 8. TRUST & SLA BENTO ═══ */
@media (max-width: 768px) {
  .grid.grid-cols-1 { gap: 1rem !important; }
  .rounded-3xl.p-8 { padding: 1.5rem !important; }
}
@media (max-width: 480px) {
  .rounded-3xl.p-8 { padding: 1.25rem !important; border-radius: 1rem !important; }
}

/* ═══ 9. GRID CARDS ═══ */
@media (max-width: 768px) {
  .grid-card { padding: 1.75rem 1.5rem !important; }
  @media (hover: none) {
    .grid-card { touch-action: auto !important; }
    .grid-card:hover { transform: none !important; }
  }
}
@media (max-width: 480px) { .grid-card { padding: 1.5rem 1.25rem !important; } }

/* ═══ 10. FOOTER ═══ */
@media (max-width: 768px) {
  footer#footer { padding-top: 2.5rem !important; padding-bottom: 1.5rem !important; }
  footer#footer h2 { font-size: clamp(1.5rem, 7vw, 2rem) !important; margin-bottom: 0.75rem !important; }
  footer#footer .footer-logo { height: 36px !important; }
  footer#footer .grid.grid-cols-2 { grid-template-columns: 1fr 1fr !important; gap: 1.5rem 1rem !important; }
  footer#footer > div:last-child { padding-top: 1.25rem !important; flex-direction: column !important; align-items: center !important; gap: 1rem !important; text-align: center !important; }
}
@media (max-width: 360px) {
  footer#footer .grid.grid-cols-2 { grid-template-columns: 1fr !important; }
}

/* Safe area */
@supports (padding: env(safe-area-inset-bottom)) {
  #nxr-drawer-footer { padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)) !important; }
  footer#footer > div:last-child { padding-bottom: calc(1rem + env(safe-area-inset-bottom)) !important; }
  .whatsapp { bottom: calc(32px + env(safe-area-inset-bottom)); }
}

/* ═══ 11. WHATSAPP ═══ */
@media (max-width: 640px) {
  .whatsapp { display: grid !important; right: 16px !important; bottom: calc(76px + env(safe-area-inset-bottom, 16px)) !important; width: 50px !important; height: 50px !important; z-index: 45 !important; }
}

/* ═══ 12. BODY BOTTOM PADDING (sticky CTA bar) ═══ */
@media (max-width: 639px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* ═══ 13. SERVICES PAGE ═══ */
@media (max-width: 768px) {
  .service-row { padding: 1.5rem 0 !important; flex-wrap: wrap; gap: 0.5rem; }
  .service-row:hover { padding-left: 0 !important; }
  .service-title { font-size: clamp(1.2rem, 5.5vw, 1.75rem) !important; }
  @media (hover: none) { .service-arrow { opacity: 0.35 !important; } }
  .industry-tab-btn { padding: 0.875rem !important; }
  .industry-tab-btn h3 { font-size: 0.85rem !important; }
  .campaign-studio-tabs { overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; scroll-snap-type: x mandatory !important; scrollbar-width: none; -ms-overflow-style: none; }
  .campaign-studio-tabs::-webkit-scrollbar { display: none; }
  .campaign-studio-tabs button { scroll-snap-align: start; flex-shrink: 0; min-width: max-content; }
  .chat-bubble { max-width: 88% !important; }
}
@media (max-width: 480px) {
  .service-row { padding: 1.25rem 0 !important; }
  .service-title { font-size: clamp(1.1rem, 5.5vw, 1.4rem) !important; }
}

/* ═══ 14. PORTFOLIO PAGE ═══ */
@media (max-width: 768px) {
  .bento-grid .span-8, .bento-grid .span-7, .bento-grid .span-6, .bento-grid .span-4, .bento-grid .span-3 { grid-column: span 12 !important; }
  .bento-grid { gap: 1rem !important; }
}

/* ═══ 15. BLOG PAGE ═══ */
@media (max-width: 768px) {
  #blogModal > div { width: 100% !important; max-width: 100% !important; border-radius: 1.25rem 1.25rem 0 0 !important; bottom: 0 !important; top: auto !important; right: 0 !important; left: 0 !important; height: 90vh !important; transform: translateY(100%) !important; transition: transform 0.4s cubic-bezier(0.16,1,0.3,1) !important; }
  #blogModal.open > div, #blogModal:not([style*="display: none"]) > div { transform: translateY(0) !important; }
}

/* ═══ 16. CONTACT PAGE ═══ */
@media (max-width: 768px) {
  .form-group { margin-bottom: 1.5rem !important; }
  .chips-group { flex-wrap: wrap !important; gap: 0.5rem !important; }
  .chip { font-size: 0.78rem !important; padding: 0.5rem 0.875rem !important; min-height: 40px !important; }
  [class*="max-w-sm"], [class*="max-w-xs"] { max-width: 100% !important; }
}
@media (max-width: 640px) {
  .contact-ctas, .cta-group { flex-direction: column !important; width: 100%; }
  .contact-ctas a, .cta-group a { width: 100% !important; text-align: center !important; min-height: 50px !important; }
}

/* ═══ 17. STATS ═══ */
@media (max-width: 768px) { .stat-number { font-size: clamp(2rem, 10vw, 3.2rem) !important; } }

/* ═══ 18. GENERAL SPACING ═══ */
@media (max-width: 768px) {
  .py-24 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
  .py-20 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
  .py-16 { padding-top: 2.25rem !important; padding-bottom: 2.25rem !important; }
  .mb-16 { margin-bottom: 2rem !important; }
  .mb-12 { margin-bottom: 1.75rem !important; }
  .pt-32 { padding-top: 5.5rem !important; }
  .pt-44 { padding-top: 6.5rem !important; }
}
@media (max-width: 480px) {
  .py-24 { padding-top: 2.25rem !important; padding-bottom: 2.25rem !important; }
  .pt-32 { padding-top: 5rem !important; }
  .pt-44 { padding-top: 5.5rem !important; }
}

/* ═══ 19. TOUCH TARGETS ═══ */
@media (max-width: 1023px) {
  .btn { min-height: 48px; -webkit-tap-highlight-color: transparent; }
  .faq-question { min-height: 52px !important; padding: 0.5rem 0 !important; }
}

/* ═══ 20. PERFORMANCE ═══ */
@media (max-width: 768px) {
  #cursor-glow { display: none !important; }
  .noise-overlay { opacity: 0.006 !important; }
  body::before { display: none !important; }
  .hero-grid-bg { opacity: 0.4 !important; }
  .tilt-card { transform: none !important; transition: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .animate-fade-rise, .animate-fade-rise-delay, .animate-fade-rise-delay-2, .animate-fade-in-up, .animate-marquee {
    animation: none !important; opacity: 1 !important; transform: none !important; transition: none !important;
  }
  .orb, .animate-float-slow, .animate-float-medium { animation: none !important; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ═══ 21. LOGO STRIP ═══ */
@media (max-width: 768px) {
  .logo-strip, div[class*="overflow-x-auto"] { -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; scrollbar-width: none; -ms-overflow-style: none; }
  .logo-strip::-webkit-scrollbar, div[class*="overflow-x-auto"]::-webkit-scrollbar { display: none; }
}

/* ═══ 22. TYPOGRAPHY FONT FAMILY ═══ */
@media (max-width: 1023px) {
  h1, h2, h3, h4, .h1, .h2, .h3, .section-title { font-family: 'Inter Tight','Inter',sans-serif !important; font-weight: 700 !important; letter-spacing: -0.04em !important; }
  body, p, li, a, .lead, .body-text { font-family: 'Inter',sans-serif !important; line-height: 1.7 !important; }
  #nxr-drawer-logo span { font-family: 'Inter Tight',sans-serif !important; font-weight: 700 !important; letter-spacing: -0.04em !important; }
  #nxr-drawer-nav a { padding: 1rem 1.5rem !important; display: flex !important; align-items: center !important; gap: 0.875rem !important; color: #2B2B2B !important; }
  #nxr-drawer-nav a:hover, #nxr-drawer-nav a.active { color: #8F7340 !important; background: rgba(201,168,106,0.04) !important; }
  #nxr-drawer-nav a svg { color: inherit !important; opacity: 1.0 !important; width: 1.2rem !important; height: 1.2rem !important; }
}

/* ═══ 23. ULTRA-WIDE ═══ */
@media (min-width: 1920px) {
  .container { max-width: 1400px !important; }
  header .w-full.flex { max-width: 1600px; margin-left: auto; margin-right: auto; }
}


/* ═══ OUR PROCESS — MOBILE HEADING ═══ */
@media (max-width: 768px) {
  #our-process > .text-center {
    margin-bottom: 2rem !important;
    text-align: center !important;
  }
  #our-process > .text-center h2 {
    font-size: clamp(1.3rem, 6vw, 1.75rem) !important;
  }
  /* Timeline line hidden on very small screens */
  .process-steps-container > .absolute.left-\[27px\] {
    display: none !important;
  }
}

/* ═══ FOOTER BRIDGE MOBILE ═══ */
@media (max-width: 768px) {
  #footer-bridge {
    height: 48px !important;
  }
}

/* ═══ HEADER — MOBILE ROW GUARANTEE ═══ */
@media (max-width: 1023px) {
  header.fixed {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
  }
  header .w-full.flex {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
  }
  /* Guarantee hamburger always rightmost */
  #nxr-hamburger {
    order: 99 !important;
    margin-left: auto !important;
    flex-shrink: 0 !important;
  }
  /* Hide desktop Book-a-Call button */
  header .btn-primary.hidden.sm\:inline-flex {
    display: none !important;
  }
}

/* ═══ HERO SECTION — MOBILE EYEBROW ═══ */
@media (max-width: 768px) {
  section.pt-44 .animate-fade-in-up:first-of-type {
    margin-bottom: 0.5rem !important;
  }
}

/* ═══ LOGO VISIBILITY — MOBILE ═══ */
@media (max-width: 1023px) {
  .header-logo-white {
    height: 32px !important;
  }
  .header-logo-dark {
    height: 32px !important;
  }
}