/* ==========================================================================
   CodeX404 Solutions — Responsive Stylesheet & Breakpoints
   Aurora Midnight Theme — Desktop-first graceful degradation
   ========================================================================== */

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

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

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

  .hero-stats-strip {
    justify-content: center;
  }

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

  .footer-grid .footer-col:first-child {
    grid-column: span 2;
  }

  .transformation-container {
    grid-template-columns: 1fr;
  }

  .transform-arrow-center {
    margin: 0 auto;
    transform: rotate(90deg);
  }

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

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

  /* Slider Card Responsiveness on Tablet */
  .slider-card {
    flex: 0 0 calc(50% - 0.75rem);
    min-width: 280px;
  }

  /* Reduce particle count on tablet */
  #particleCanvas {
    opacity: 0.6;
  }
}

/* Mobile & Small Tablets (max-width: 768px) */
@media (max-width: 768px) {
  :root {
    --space-4xl: 4.5rem;
    --space-3xl: 3.5rem;
    --space-2xl: 2.25rem;
  }

  /* Compact mobile headers for all sub-pages */
  body > .section:first-of-type,
  main > .section:first-of-type,
  .site-header + .section,
  .page-banner {
    padding-top: 1.25rem;
    padding-bottom: 1.75rem;
  }

  .section {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

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

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

  .section-subtitle {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .site-header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #060B18 !important;
    position: sticky;
    top: 0;
    z-index: 10000;
  }

  .nav-menu {
    position: fixed !important;
    top: 68px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: calc(100vh - 68px) !important;
    height: calc(100dvh - 68px) !important;
    background: #060B18 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 1.25rem 1.25rem 4rem 1.25rem !important;
    gap: 0.35rem !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    transform: translateX(100%) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s !important;
    visibility: hidden !important;
    pointer-events: none !important;
    z-index: 99999 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  .nav-menu.open {
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  body.nav-open {
    overflow: hidden !important;
  }

  .nav-toggle-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 8px !important;
    background: rgba(17, 29, 58, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--white) !important;
    cursor: pointer !important;
    transition: all var(--transition-fast) !important;
  }

  .nav-toggle-btn:hover {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
  }

  .nav-actions .btn {
    display: none !important;
  }

  .nav-item {
    width: 100% !important;
  }

  .nav-link {
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    padding: 0.75rem 0.65rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    color: var(--white) !important;
    border-radius: var(--radius-sm) !important;
    transition: background var(--transition-fast) !important;
  }

  .nav-link:hover,
  .nav-link.active {
    color: #60A5FA !important;
    background: rgba(59, 130, 246, 0.1) !important;
  }

  .nav-link.active::after {
    display: none !important;
  }

  .nav-dropdown {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: none !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: var(--radius-md) !important;
    background: rgba(11, 20, 38, 0.75) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    margin: 0.25rem 0 0.5rem 0.5rem !important;
    padding: 0.4rem !important;
    width: calc(100% - 0.5rem) !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.2rem !important;
  }

  .dropdown-link {
    padding: 0.55rem 0.75rem !important;
    border-radius: var(--radius-sm) !important;
  }

  .dropdown-link:hover {
    background: rgba(59, 130, 246, 0.15) !important;
  }

  .dropdown-link strong {
    font-size: 0.875rem !important;
    color: var(--white) !important;
  }

  .dropdown-link span {
    display: block !important;
    font-size: 0.72rem !important;
    color: var(--slate-dark) !important;
    margin-top: 2px !important;
  }

  .nav-menu .mobile-cta {
    display: block !important;
    width: 100% !important;
    margin-top: 1.25rem !important;
    padding-bottom: 2rem !important;
    text-align: center !important;
  }

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }

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

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

  .footer-grid .footer-col:first-child {
    grid-column: span 1;
  }

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

  .hero-headline {
    font-size: 2.45rem;
  }

  .hero-description {
    font-size: 1.05rem;
  }

  .hero-stats-strip {
    flex-direction: column;
    gap: 1.25rem;
    align-items: center;
  }

  .form-card {
    padding: 1.75rem 1.25rem;
  }

  .cookie-banner {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }

  /* Reduce particles and aurora on mobile for performance */
  #particleCanvas {
    opacity: 0.35;
  }

  body::before {
    animation-duration: 40s;
  }

  /* Reduce glow effects on mobile */
  .tech-frame {
    box-shadow: var(--shadow-md);
  }

  .tech-frame::before {
    display: none;
  }

  .slider-card {
    flex: 0 0 100%;
    min-width: 100%;
    padding: 1.75rem;
  }

  .terminal-tabs {
    flex-wrap: wrap;
  }

  .hero-section::before,
  .hero-section::after {
    opacity: 0.5;
  }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .hero-headline {
    font-size: 2rem;
  }

  .btn-lg {
    padding: 1rem 1.8rem;
    font-size: 0.95rem;
  }

  .card {
    padding: 1.75rem;
  }

  .process-step {
    padding: 1.5rem;
  }

  /* Hide particles on very small screens */
  #particleCanvas {
    display: none;
  }
}

/* Touch Comfort Targets (WCAG 2.2 target size: 44px) */
@media (pointer: coarse) {
  .btn,
  .nav-link,
  .faq-question,
  .form-control,
  .form-select {
    min-height: 48px;
  }
}

/* High-contrast mode enhancements */
@media (prefers-contrast: high) {
  .card {
    border-color: rgba(255, 255, 255, 0.2);
  }

  .btn-primary {
    background: var(--electric-blue);
  }

  .section-tag {
    border-color: rgba(255, 255, 255, 0.3);
  }
}
