/* ==========================================================================
   EngineArc — Responsive Layer
   Dedicated tablet + mobile treatments (not a shrunk desktop)
   ========================================================================== */

/* ---------- Tablet (≤1100px) ---------- */
@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 56px; }
  .hero-content { max-width: 640px; margin: 0 auto; }
  .hero-actions, .hero-trust { align-items: center; justify-content: center; }
  .hero-trust { align-items: center; }
  .hero-trust-chips { justify-content: center; }
  .hero-visual { order: -1; min-height: 320px; }
  .visual-card { max-width: 380px; }

  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .research-grid { grid-template-columns: 1fr 1fr; }
  .research-card-lg { grid-column: span 2; }
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
  .showcase-grid { grid-template-columns: 1fr; }
  .store-grid { grid-template-columns: repeat(2, 1fr); }

  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .nav-wrap { padding: 0 16px; }
  .products-section, .research-section, .stack-section, .about-section, .cta-section {
    padding-left: 20px; padding-right: 20px;
  }
}

/* ---------- Mobile (≤768px) ---------- */
@media (max-width: 768px) {
  :root { --nav-height: 64px; }

  /* Nav: hide desktop menu, show hamburger */
  .navbar { height: 64px; padding: 0 8px 0 18px; }
  .nav-menu { display: none; }
  .btn-nav { display: none; }
  .menu-toggle { display: flex; }
  .nav-logo span { font-size: 0.98rem; }

  /* Hero: tighter, dedicated mobile rhythm rather than a squeezed desktop hero */
  .hero {
    min-height: auto;
    padding: 116px 20px 64px;
  }
  .hero-content { text-align: left; margin: 0; }
  .hero-title { font-size: clamp(2.1rem, 9vw, 2.7rem); text-align: left; }
  .hero-subtitle { text-align: left; font-size: 1.02rem; margin-left: 0; }
  .hero-actions { flex-direction: column; align-items: stretch; width: 100%; gap: 12px; margin-bottom: 32px; }
  .hero-actions .btn { justify-content: center; width: 100%; }
  .hero-trust { align-items: flex-start; }
  .hero-trust-chips { justify-content: flex-start; }
  .hero-scroll-cue { display: none; }
  .hero-visual { min-height: 260px; margin-top: 8px; }
  .visual-card { max-width: 300px; aspect-ratio: 1/1; }
  .visual-badge { padding: 9px 14px; font-size: 0.74rem; }

  /* Product cards: single column, calmer motion for performance */
  .products-section { padding: 90px 18px; }
  .section-pattern { display: none; }
  .section-head { text-align: left; margin: 0 0 40px; }
  .product-grid { grid-template-columns: 1fr; gap: 18px; }
  .product-card:hover { transform: none; }
  .product-media { height: 160px; }

  /* Research showcase */
  .research-section { padding: 30px 18px 90px; }
  .research-grid { grid-template-columns: 1fr; gap: 18px; }
  .research-card-lg { grid-column: auto; }
  .research-card:hover { transform: none; }
  .research-stats { flex-wrap: wrap; gap: 18px 28px; }

  /* Technology stack */
  .stack-section { padding: 30px 18px 100px; }
  .stack-grid { grid-template-columns: 1fr; gap: 14px; }
  .stack-chip:hover { transform: none; }

  /* EngineArc Ecosystem showcase */
  .showcase-section { padding: 90px 18px 100px; }
  .showcase-pattern { display: none; }
  .org-diagram { margin-bottom: 56px; }
  .org-connectors { height: 40px; }
  .org-children { gap: 12px; }
  .org-node { padding: 11px 18px; font-size: 0.86rem; }
  .showcase-grid { grid-template-columns: 1fr; gap: 18px; }
  .achievex-card, .store-card { padding: 22px; border-radius: var(--radius-lg); }
  .achievex-card:hover, .store-card:hover { transform: none; }
  .achievex-head { flex-wrap: wrap; }
  .store-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .store-toolbar { padding: 12px; }

  /* About: stacked, tighter type */
  .about-section { padding: 20px 18px 100px; }
  .about-title { font-size: clamp(1.7rem, 7vw, 2.2rem); margin-bottom: 32px; }
  .about-lead { font-size: 1.05rem; }
  .about-stats { flex-direction: row; flex-wrap: wrap; gap: 20px 28px; }
  .about-stat { flex-direction: column; align-items: flex-start; gap: 2px; }

  /* CTA */
  .cta-section { padding: 0 18px 100px; }
  .cta-card { padding: 56px 24px; border-radius: var(--radius-lg); }
  .cta-actions { flex-direction: column; }
  .cta-actions .btn { width: 100%; justify-content: center; }

  /* Footer */
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
  .footer-links { gap: 18px 22px; }

  /* Drawer takes fuller width on small phones */
  .drawer { width: min(90vw, 360px); border-radius: var(--radius-lg); }

  .splash-logo, .splash-fallback { width: 84px; height: 84px; }
}

/* ---------- Small phones (≤380px) ---------- */
@media (max-width: 380px) {
  .hero-title { font-size: 2rem; }
  .btn { padding: 15px 24px; font-size: 0.94rem; }
  .cta-card { padding: 44px 18px; }
  .visual-card { max-width: 260px; }
}

/* ---------- Large desktop refinement ---------- */
@media (min-width: 1440px) {
  .hero-title { font-size: 5rem; }
  .product-grid { gap: 30px; }
  .research-grid { gap: 28px; }
}
