/* ==========================================================================
   NM INNOVATION HUB — Responsive / Media Queries
   ========================================================================== */

/* ── Large Desktop (1280px+) ────────────────────────────────────────────── */
@media (min-width: 1281px) {
  .container {
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
  }
}

/* ── Desktop to Tablet (max 1024px) ─────────────────────────────────────── */
@media (max-width: 1024px) {
  :root {
    --space-section: 100px;
    --container-padding: 20px;
  }

  /* Grids -> 2 columns */
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Services preview */
  .services-preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Testimonials */
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Values */
  .values-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Mission */
  .mission-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
  }

  /* Services CTA card */
  .services-cta-card,
  .cta-card {
    flex-direction: column;
    text-align: center;
    padding: var(--space-2xl);
  }

  .services-cta-content {
    max-width: 100%;
  }

  /* Contact grid */
  .contact-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
  }
}

/* ── Tablet (max 768px) ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --space-section: 64px;
    --navbar-height: 68px;
  }

  /* ── Navbar: Mobile ──────────────────────────────────────────────────── */
  .navbar-links,
  .nav-list,
  .navbar-nav,
  .navbar-menu,
  .navbar-menu .navbar-links {
    display: none;
  }

  .navbar-cta {
    display: none;
  }

  .hamburger,
  .navbar-hamburger,
  .navbar-toggle,
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    display: none;
  }

  /* ── Hero: Single Column ─────────────────────────────────────────────── */
  .hero,
  .hero-section {
    min-height: auto;
    padding-top: calc(var(--navbar-height) + var(--space-2xl));
    padding-bottom: var(--space-2xl);
  }

  /* Hide perspective grid on mobile */
  .hero::before,
  .hero-section::before {
    display: none;
  }

  .hero-inner,
  .hero-container {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .hero-visual {
    display: none;
  }

  .hero-content {
    max-width: 100%;
    text-align: center;
  }

  .hero-subtitle {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
    gap: var(--space-xl);
  }

  .hero-stat {
    align-items: center;
  }

  /* ── Grids -> Single Column ──────────────────────────────────────────── */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .services-preview-grid {
    grid-template-columns: 1fr;
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .values-grid {
    grid-template-columns: 1fr;
  }

  .mission-grid {
    grid-template-columns: 1fr;
  }

  /* ── About: History ──────────────────────────────────────────────────── */
  .about-history-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  /* ── Services Grid ───────────────────────────────────────────────────── */
  .services-grid,
  .services-full-grid {
    grid-template-columns: 1fr;
  }

  /* ── About Grid ─────────────────────────────────────────────────────── */
  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .about-quote {
    position: static;
  }

  /* ── Contact: Stack ──────────────────────────────────────────────────── */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

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

  .contact-form-wrapper {
    padding: var(--space-xl);
  }

  /* ── Cards: Proper spacing when stacked ──────────────────────────────── */
  .card,
  .service-card,
  .testimonial-card,
  .value-item {
    margin-bottom: 0;
  }

  .testimonials-grid,
  .services-preview-grid,
  .values-grid,
  .mission-grid {
    gap: var(--space-lg);
  }

  /* ── Footer: Single Column ───────────────────────────────────────────── */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    text-align: center;
  }

  .footer-col {
    align-items: center;
  }

  .footer-inner {
    gap: var(--space-lg);
  }

  .footer-title::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .footer-links {
    align-items: center;
  }

  .footer-links ul {
    align-items: center;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: var(--space-sm);
  }

  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
    gap: var(--space-sm);
  }

  .footer-contact-item {
    justify-content: center;
  }

  .footer-contact {
    align-items: center;
  }

  .footer-contact ul {
    align-items: center;
  }

  .footer-social {
    justify-content: center;
  }

  /* ── Section Label: Center ───────────────────────────────────────────── */
  .section-label {
    justify-content: center;
  }

  /* ── Page Header ─────────────────────────────────────────────────────── */
  .page-header,
  .about-header,
  .services-header,
  .contact-header {
    padding-top: calc(var(--navbar-height) + var(--space-3xl));
    padding-bottom: var(--space-2xl);
  }

  /* ── Reduce WhatsApp Float ───────────────────────────────────────────── */
  .whatsapp-float {
    width: 56px;
    height: 56px;
    bottom: 20px;
    right: 20px;
    font-size: 1.5rem;
  }

  .whatsapp-tooltip {
    display: none;
  }

  /* ── Reduce typography ───────────────────────────────────────────────── */
  .cta-title {
    font-size: var(--fs-h2);
  }

  /* ── Mobile menu smoothness ─────────────────────────────────────────── */
  .mobile-menu {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .mobile-menu-links a,
  .mobile-menu-list a,
  .mobile-menu-link {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
  }

  /* ── Service preview card index hidden on mobile ────────────────────── */
  .service-preview-card::before {
    font-size: 3rem;
  }
}

/* ── Small Mobile (max 480px) ───────────────────────────────────────────── */
@media (max-width: 480px) {
  :root {
    --space-section: 48px;
    --container-padding: 16px;
  }

  /* Further font size reduction */
  h1 {
    font-size: clamp(1.6rem, 7vw, 2rem);
  }

  h2 {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 2.8rem);
  }

  /* Buttons: smaller on mobile */
  .btn {
    padding: 12px 24px;
    font-size: var(--fs-small);
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-buttons .btn {
    justify-content: center;
  }

  /* Stats */
  .hero-stats {
    flex-direction: column;
    gap: var(--space-lg);
    align-items: center;
  }

  .hero-stat-number {
    font-size: clamp(1.8rem, 6vw, 2.2rem);
  }

  /* Card padding */
  .card {
    padding: var(--space-lg);
  }

  .service-card {
    padding: var(--space-xl);
  }

  .services-full-grid {
    grid-template-columns: 1fr;
  }

  /* Contact form */
  .contact-form-wrapper {
    padding: var(--space-lg);
  }

  /* CTA */
  .cta-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-buttons .btn {
    justify-content: center;
  }

  /* Services CTA card */
  .services-cta-card {
    padding: var(--space-xl);
  }

  /* Clients */
  .clients-track {
    gap: var(--space-2xl);
  }

  .client-logo {
    height: 30px;
  }

  /* Footer */
  .footer {
    padding: 40px 0 24px;
  }
}

/* ── Reduced Motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fade-in,
  .fade-in-left,
  .fade-in-right,
  .fade-in-scale {
    opacity: 1;
    transform: none;
  }

  .clients-track {
    animation: none;
  }

  .whatsapp-float {
    animation: none;
  }

  .scanlines::after,
  .scanlines-overlay::after {
    display: none;
  }

  .grain::before {
    display: none;
  }

  .glitch::before,
  .glitch::after {
    display: none;
  }

  .hero-orb-core {
    animation: none;
  }

  .hero-orbit--1,
  .hero-orbit--2,
  .hero-orbit--3 {
    animation: none;
  }

  .orbit-ring {
    animation: none;
  }

  .circuit-line {
    animation: none;
  }

  .circuit-node {
    animation: none;
  }

  .neon-glow {
    animation: none;
  }

  .scan-line {
    animation: none;
    display: none;
  }

  .typewriter-cursor {
    animation: none;
    border-color: var(--color-cyan-500);
  }
}

/* ── High Contrast ──────────────────────────────────────────────────────── */
@media (prefers-contrast: high) {
  :root {
    --color-text-primary: #ffffff;
    --color-text-secondary: #e0e0e0;
    --color-text-muted: #b0b0b0;
  }

  .card {
    border-width: 2px;
  }

  .btn {
    border-width: 2px;
  }
}
