/* ==========================================================================
   MOBILE-FIRST & MULTI-DEVICE RESPONSIVE SYSTEM
   Project: AI-Powered Digital Marketing & Growth Agency
   Coverage: 320px, 375px, 414px, 480px, 600px, 768px, 900px, 1024px, 1280px, 1440px, 1920px+
   Touch Optimizations: 48px Min Tap Targets, iOS Auto-Zoom Fix, GPU Acceleration, No Overflow
   Motion & Neon Optimization: 100% Visible & Smooth on All Devices
   ========================================================================== */

/* --- Universal Fluidity & Word-Wrap Safeguards --- */
h1, h2, h3, h4, h5, h6, .hero-title, .section-title, .cta-headline {
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

/* Ensure no horizontal scrollbar ever on any device */
html, body {
  max-width: 100vw;
  overflow-x: hidden !important;
}

/* GPU Hardware Acceleration for Smooth 60fps Motion on Mobile */
.bg-grid-overlay,
.orbit-track,
.orbit-icon-box,
.btn-primary,
.btn-primary::after,
.floating-badge {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* ==========================================================================
   1. LARGE DESKTOPS & HIGH-RES MONITORS (1440px - 1920px+)
   ========================================================================== */
@media (min-width: 1440px) {
  :root {
    --container-width: 1360px;
  }

  .orbit-motion-wrapper {
    width: 720px;
    height: 620px;
  }

  .orbit-outer {
    width: 700px;
    height: 600px;
    margin-top: -300px;
    margin-left: -350px;
  }

  .orbit-inner {
    width: 580px;
    height: 500px;
    margin-top: -250px;
    margin-left: -290px;
  }
}

/* ==========================================================================
   2. STANDARD LAPTOPS & DESKTOPS (1025px - 1439px)
   ========================================================================== */
@media (max-width: 1280px) {
  .hero-grid {
    gap: 3rem;
  }
  
  .industries-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .dropdown-menu.mega-menu {
    min-width: 640px;
  }

  .orbit-motion-wrapper {
    transform: translate(-50%, -50%) scale(0.92);
  }
}

/* ==========================================================================
   3. TABLETS LANDSCAPE & SMALL LAPTOPS (769px - 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  /* Navigation switch to mobile drawer & hide header CTA button on mobile/tablet */
  .desktop-nav {
    display: none !important;
  }

  .site-header .header-actions .btn,
  .site-header .btn-primary {
    display: none !important;
  }

  .mobile-toggle {
    display: flex !important;
  }

  .site-header {
    height: 72px;
  }

  /* Hero section stacked */
  .hero-section {
    padding-top: calc(72px + 2rem);
    padding-bottom: 4rem;
    min-height: auto;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3.5rem;
  }

  .hero-badge-container {
    display: flex;
    justify-content: center;
  }

  .hero-title {
    font-size: clamp(3.2rem, 7.5vw + 0.5rem, 4.4rem);
    line-height: 1.08;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta-group {
    justify-content: center;
  }

  .hero-trust-metrics {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    gap: 1.5rem !important;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
  }

  /* 3D Ecosystem Carousel on Tablets */
  .ecosystem-carousel-wrapper {
    height: 420px;
    margin-top: 3rem;
  }

  .ecosystem-carousel-wrapper .ecosystem-card {
    width: 320px !important;
    padding: 1.85rem 1.4rem !important;
    margin-top: -115px !important;
    margin-left: -160px !important;
  }

  /* Multi-column to 2-column grids */
  .process-timeline,
  .testimonials-grid,
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 2.5rem;
  }

  .stat-item:nth-child(3)::after {
    display: none;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  /* Orbit Motion Scale for Tablets */
  .hero-visual-wrapper {
    min-height: 520px;
  }

  .hero-visual-card {
    max-width: 420px;
  }

  .orbit-motion-wrapper {
    transform: translate(-50%, -50%) scale(0.88);
  }
}

/* ==========================================================================
   4. TABLETS PORTRAIT & PHABLETS (481px - 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .section {
    padding: 4.5rem 0;
  }

  .section-sm {
    padding: 3rem 0;
  }

  .section-lg {
    padding: 5.5rem 0;
  }

  .section-header {
    margin-bottom: 2.5rem;
  }

  .hero-title {
    font-size: clamp(2.85rem, 8.5vw + 0.5rem, 3.85rem);
    line-height: 1.08;
    font-weight: 800;
  }

  /* 3D Ecosystem Carousel on Tablet Portrait */
  .ecosystem-carousel-wrapper {
    height: 390px;
    margin-top: 2.5rem;
  }

  .ecosystem-carousel-wrapper .ecosystem-card {
    width: 290px !important;
    padding: 1.6rem 1.25rem !important;
    margin-top: -110px !important;
    margin-left: -145px !important;
  }

  /* Full-width Single Column Cards */
  .services-grid,
  .process-timeline,
  .portfolio-grid,
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .service-card {
    transition: opacity 0.25s ease, transform 0.25s ease, border-color var(--transition-normal);
  }

  /* Service Category Tabs - Auto-Sliding Horizontal Pill Bar on Mobile */
  .services-tabs-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 0.5rem 0.5rem 1rem 0.5rem;
    margin-bottom: 2.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.65rem;
    scroll-behavior: auto;
    touch-action: pan-x;
  }

  .services-tabs-nav::-webkit-scrollbar {
    display: none;
  }

  /* View More Buttons on Mobile */
  .ai-view-more-container,
  .industries-view-more-container {
    display: flex;
  }

  .tab-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.65rem 1.35rem;
    font-size: 0.875rem;
  }

  .industries-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.85rem !important;
  }

  .industry-card {
    padding: 1.25rem 0.85rem !important;
    gap: 0.65rem !important;
  }

  .industry-icon {
    width: 40px !important;
    height: 40px !important;
  }

  .stats-banner {
    padding: 3rem 1.5rem;
  }

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

  .stat-item::after {
    display: none !important;
  }

  .stat-item:last-child {
    grid-column: span 2;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 1.25rem;
  }

  .footer-legal-links {
    justify-content: center;
  }

  .final-cta-card {
    padding: 3.5rem 1.5rem;
  }

  /* Testimonials Marquee on Tablet/Mobile */
  .testimonials-marquee-wrapper {
    padding: 1rem 0;
    margin-top: 2.25rem;
    mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
  }

  .testimonials-marquee-track {
    gap: 1.25rem;
    animation-duration: 35s;
  }

  .testimonial-card {
    width: 320px !important;
    padding: 1.6rem 1.25rem !important;
  }

  .testimonial-quote {
    font-size: 0.9rem !important;
    margin-bottom: 1.25rem !important;
  }

  /* Hero Visual & 14 Motion Orbit Scaling on Tablet Portrait */
  .hero-visual-wrapper {
    min-height: 520px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hero-visual-card {
    max-width: 360px;
    padding: 1.75rem 1.35rem;
    position: relative;
    z-index: 2;
  }

  .orbit-motion-wrapper {
    width: 520px;
    height: 500px;
    transform: translate(-50%, -50%);
    z-index: 3;
  }

  .orbit-outer {
    width: 510px;
    height: 490px;
    margin-top: -245px;
    margin-left: -255px;
  }

  .orbit-inner {
    width: 430px;
    height: 410px;
    margin-top: -205px;
    margin-left: -215px;
  }

  .orbit-icon-box {
    width: 48px;
    height: 48px;
  }

  .floating-badge {
    transform: scale(0.85);
    z-index: 4;
  }

  .floating-badge-1 {
    top: -15px;
    left: -12px;
  }

  .floating-badge-2 {
    bottom: 15px;
    right: -12px;
  }
}

/* ==========================================================================
   5. SMARTPHONES (360px - 480px) - COMPACT BOX & PROMINENT ORBITING ICONS
   ========================================================================== */
@media (max-width: 480px) {
  .container {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .site-header {
    height: 68px;
  }

  .brand-logo {
    display: inline-flex;
    align-items: baseline;
    min-width: 175px;
    flex-shrink: 0;
  }

  .brand-logo-text {
    display: inline-flex;
    align-items: baseline;
    line-height: 1;
  }

  .logo-sc-neon {
    font-size: 1.35rem;
  }

  .logo-typing-wrapper {
    min-width: 128px !important;
  }

  .logo-typing-text {
    font-size: 1.35rem;
  }

  .logo-cursor {
    font-size: 1.25rem;
  }

  .hero-section {
    padding-top: calc(68px + 1.5rem);
    padding-bottom: 3.5rem;
  }

  .hero-title {
    font-size: clamp(2.55rem, 9.2vw, 3.4rem);
    line-height: 1.08;
    font-weight: 800;
  }

  .hero-subtitle {
    font-size: 1.05rem;
    margin-bottom: 2rem;
  }

  /* Full Width Stacked CTAs for Natural Thumb Reach */
  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    gap: 0.85rem;
  }

  .hero-cta-group .btn,
  .cta-buttons .btn {
    width: 100%;
    padding: 0.95rem 1.5rem;
  }

  /* Horizontal 3-Column Trust Metrics Alignment */
  .hero-trust-metrics {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    width: 100% !important;
    padding-top: 1.75rem !important;
    text-align: center !important;
  }

  .trust-metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 0.15rem;
  }

  .trust-metric-value {
    font-size: 1.45rem !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
  }

  .trust-metric-label {
    font-size: 0.72rem !important;
    line-height: 1.25 !important;
    margin-top: 0.25rem !important;
    color: var(--text-muted) !important;
  }

  /* Exact Original Placement & Compact Sizing for Graph Simulator Card */
  .hero-visual-wrapper {
    min-height: 500px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 1.5rem 0;
  }

  /* Original Placement Preserved with Compact Proportions */
  .hero-visual-card {
    width: 100%;
    max-width: 300px !important;
    padding: 1.35rem 1.1rem !important;
    border-radius: var(--border-radius-lg) !important;
    box-shadow: var(--shadow-lg) !important;
    position: relative;
    z-index: 2;
  }

  .hero-visual-header {
    margin-bottom: 1rem !important;
    padding-bottom: 0.75rem !important;
  }

  .visual-status-pill {
    font-size: 0.7rem !important;
    padding: 0.2rem 0.6rem !important;
  }

  .terminal-code {
    font-size: 0.75rem !important;
    margin-bottom: 1.15rem !important;
    line-height: 1.4 !important;
  }

  .chart-box {
    padding: 0.85rem 0.75rem !important;
    border-radius: var(--border-radius-md) !important;
  }

  .chart-title {
    font-size: 0.72rem !important;
  }

  .chart-kpi {
    font-size: 0.78rem !important;
  }

  .chart-bars {
    height: 60px !important;
    gap: 6px !important;
  }

  /* Floating Badges Kept in Original Top-Left & Bottom-Right Placement */
  .floating-badge {
    display: flex !important;
    padding: 0.5rem 0.85rem !important;
    transform: scale(0.82) !important;
    z-index: 4 !important;
  }

  .floating-badge-1 {
    top: -15px !important;
    left: -12px !important;
  }

  .floating-badge-2 {
    bottom: 12px !important;
    right: -12px !important;
  }

  .badge-icon-box {
    width: 30px !important;
    height: 30px !important;
  }

  .badge-title {
    font-size: 0.7rem !important;
  }

  .badge-value {
    font-size: 0.85rem !important;
  }

  /* Wide Orbit Track Surrounding the Entire Box + Badges */
  .orbit-motion-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 440px;
    height: 500px;
    pointer-events: none;
    z-index: 3;
  }

  .orbit-outer {
    width: 430px;
    height: 490px;
    margin-top: -245px;
    margin-left: -215px;
    animation: orbit-rot-ccw 40s linear infinite;
  }

  .orbit-inner {
    width: 380px;
    height: 440px;
    margin-top: -220px;
    margin-left: -190px;
    animation: orbit-rot-cw 32s linear infinite;
  }

  /* Bigger Prominent Orbit Icons on Mobile */
  .orbit-icon-box {
    width: 46px !important;
    height: 46px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12), 0 0 10px rgba(245, 158, 11, 0.25) !important;
  }

  .orbit-icon-box svg {
    width: 24px !important;
    height: 24px !important;
  }

  .glass-card,
  .ai-tech-card,
  .service-card,
  .process-step-card,
  .testimonial-card,
  .contact-info-card,
  .form-card {
    padding: 1.75rem 1.25rem;
  }

  /* 3D Ecosystem Carousel on Mobile */
  .ecosystem-carousel-wrapper {
    height: 380px;
    margin-top: 2rem;
  }

  .ecosystem-carousel-wrapper .ecosystem-card {
    width: 255px !important;
    padding: 1.25rem 1.1rem !important;
    margin-top: -100px !important;
    margin-left: -127px !important;
  }

  .ecosystem-carousel-wrapper .ecosystem-num {
    font-size: 1.6rem !important;
    margin-bottom: 0.6rem !important;
  }

  .ecosystem-carousel-wrapper .ecosystem-title {
    font-size: 1.15rem !important;
    margin-bottom: 0.5rem !important;
  }

  .ecosystem-carousel-wrapper p {
    font-size: 0.88rem !important;
    line-height: 1.5 !important;
  }

  /* Industries We Transform: 2-Column Compact Grid on Mobile */
  .industries-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  .industry-card {
    padding: 1.15rem 0.75rem !important;
    border-radius: var(--border-radius-md) !important;
    gap: 0.55rem !important;
    min-height: auto !important;
  }

  .industry-icon {
    width: 38px !important;
    height: 38px !important;
    font-size: 1rem !important;
  }

  .industry-icon svg {
    width: 20px !important;
    height: 20px !important;
  }

  .industry-name {
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    text-align: center !important;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .stat-item:last-child {
    grid-column: span 1;
  }

  .stat-number {
    font-size: 2.5rem;
  }

  /* Form Controls: 16px Font & 48px Min Height to Prevent iOS Safari Auto-Zoom */
  .form-control {
    font-size: 16px !important;
    padding: 0.85rem 1rem;
    min-height: 48px;
  }

  textarea.form-control {
    min-height: 120px;
  }

  /* Mobile Drawer Full Screen on Mobile Devices */
  .mobile-nav-drawer {
    max-width: 100vw;
    width: 100vw;
    padding: 1.5rem 1.25rem;
  }

  .mobile-nav-link {
    font-size: 1.1rem;
    padding: 0.4rem 0;
  }

  .toast-notification {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    padding: 1rem 1.25rem;
  }

  .back-to-top-btn {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 42px;
    height: 42px;
  }
}

/* ==========================================================================
   6. ULTRA-COMPACT SMARTPHONES (320px - 359px)
   ========================================================================== */
@media (max-width: 359px) {
  html {
    font-size: 14.5px;
  }

  .container {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .brand-logo {
    display: inline-flex;
    align-items: baseline;
    min-width: 150px;
    flex-shrink: 0;
  }

  .brand-logo-text {
    display: inline-flex;
    align-items: baseline;
    line-height: 1;
  }

  .logo-sc-neon {
    font-size: 1.15rem;
  }

  .logo-typing-wrapper {
    min-width: 108px !important;
  }

  .logo-typing-text {
    font-size: 1.15rem;
  }

  .logo-cursor {
    font-size: 1.05rem;
  }

  .hero-title {
    font-size: 2.25rem;
    line-height: 1.1;
    font-weight: 800;
  }

  .hero-trust-metrics {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.35rem !important;
  }

  .trust-metric-value {
    font-size: 1.25rem !important;
  }

  .trust-metric-label {
    font-size: 0.65rem !important;
  }

  .industries-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  .industry-card {
    padding: 0.95rem 0.5rem !important;
    gap: 0.45rem !important;
  }

  .industry-icon {
    width: 34px !important;
    height: 34px !important;
  }

  .industry-icon svg {
    width: 18px !important;
    height: 18px !important;
  }

  .industry-name {
    font-size: 0.8rem !important;
    line-height: 1.2 !important;
  }

  .section-title {
    font-size: 1.65rem;
  }

  .cta-headline {
    font-size: 1.8rem;
  }

  .hero-visual-wrapper {
    min-height: 440px;
  }

  .hero-visual-card {
    max-width: 250px !important;
    padding: 1rem 0.85rem !important;
  }

  .floating-badge {
    transform: scale(0.72) !important;
  }

  .orbit-motion-wrapper {
    width: 340px;
    height: 420px;
  }

  .orbit-outer {
    width: 335px;
    height: 410px;
    margin-top: -205px;
    margin-left: -167px;
  }

  .orbit-inner {
    width: 295px;
    height: 370px;
    margin-top: -185px;
    margin-left: -147px;
  }

  .orbit-icon-box {
    width: 42px !important;
    height: 42px !important;
  }

  .orbit-icon-box svg {
    width: 22px !important;
    height: 22px !important;
  }

  .ecosystem-carousel-wrapper {
    height: 350px;
  }

  .ecosystem-carousel-wrapper .ecosystem-card {
    width: 225px !important;
    padding: 1.1rem 0.85rem !important;
    margin-top: -88px !important;
    margin-left: -112px !important;
  }

  .testimonial-card {
    width: 275px !important;
    padding: 1.35rem 1rem !important;
  }

  .btn {
    padding: 0.85rem 1.25rem;
    font-size: 0.9rem;
  }
}
