/* ═══════════════════════════════════════════════════
   RESPONSIVE.CSS — Elemental Genesis
   Mobile-first • 3 breakpoints
   • Mobile  : < 768px
   • Tablet  : 768px – 1024px
   • Desktop : > 1024px
   Touch targets : min 48×48px
   No horizontal overflow ever
═══════════════════════════════════════════════════ */

/* ── BASE ── */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; }
body { overflow-x: hidden; }
img, video, svg { max-width: 100%; height: auto; }

/* ══════════════════════════
   NAV BAR + HAMBURGER
══════════════════════════ */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  z-index: 200;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
  margin: 3px 0;
}
.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Mobile overlay menu */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(6,14,38,0.97);
  backdrop-filter: blur(24px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.mobile-overlay.open { display: flex; }
.mobile-overlay a {
  font-size: clamp(20px, 5vw, 32px);
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  padding: 14px 32px;
  min-height: 56px;
  display: flex;
  align-items: center;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: 0.85;
  width: 100%;
  text-align: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.mobile-overlay a:last-child { border-bottom: none; }
.mobile-overlay a:hover { opacity: 1; color: #a78bfa; }
.mobile-overlay-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  cursor: pointer;
  background: none;
  border: none;
}

/* ══════════════════════════
   TABLET  768px – 1024px
══════════════════════════ */
@media (max-width: 1024px) {

  /* Nav */
  .nav { padding: 0 24px; height: 56px; }
  .menu { display: none; }
  .hamburger { display: flex; }
  #eg-hamburger { display: flex !important; }

  /* Hero */
  .hero { padding: 80px 5vw 48px; min-height: auto; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { display: none; }
  h1.hero-title { font-size: clamp(42px, 7vw, 72px) !important; }
  .hero-sub { font-size: clamp(16px, 2.5vw, 22px) !important; }

  /* Frames hero/echo/promise */
  section[style*="aspect-ratio:1328/672"] > div,
  section > div[style*="aspect-ratio:1328/672"] {
    aspect-ratio: auto !important;
    min-height: 420px;
  }

  /* Grilles 2→1 col */
  .hero-grid,
  .phi-grid,
  .bento-grid,
  .agents-grid,
  .agent-type-grid,
  .choice-grid,
  .connectors-grid,
  .dropzones-grid,
  .gc-grid,
  .srv-row,
  .partners-row {
    grid-template-columns: 1fr !important;
  }

  /* Services */
  .eg-service-visual { display: none; }

  /* Capabilities */
  .gc-grid { grid-template-columns: 1fr !important; }

  /* Promise block 2 col → 1 col */
  .eg2-wrap,
  .pd-grid,
  .fm2-grid { grid-template-columns: 1fr !important; }

  /* Contact */
  .contact-row { flex-direction: column; gap: 32px; }

  /* Footer */
  .footer-inner { flex-direction: column; gap: 24px; text-align: center; }
}

/* ══════════════════════════
   MOBILE  < 768px
══════════════════════════ */
@media (max-width: 768px) {

  /* Nav */
  .nav { padding: 0 16px; height: 52px; }
  .brand span { font-size: 10px !important; letter-spacing: .10em !important; }

  /* Hero */
  .hero { padding: 72px 4vw 40px; }
  h1.hero-title { font-size: clamp(36px, 9vw, 58px) !important; letter-spacing: .04em !important; }
  .hero-sub { font-size: 16px !important; max-width: 100% !important; }
  .hero-promise { font-size: 14px !important; }
  .cta-row { gap: 10px; }
  .btn { font-size: 13px !important; padding: 0 16px !important; min-height: 44px; }

  /* Frames vidéo — pleine largeur, hauteur auto */
  section[style*="padding:24px 20px"] {
    padding: 12px 10px !important;
  }
  div[style*="aspect-ratio:1328/672"] {
    aspect-ratio: 16/10 !important;
    border-radius: 16px !important;
  }

  /* Echo frame content */
  .fm2 { padding: 16px 14px !important; }
  .fm2-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
  .fm2-title { font-size: clamp(20px, 6vw, 32px) !important; }
  .eg2-wrap { grid-template-columns: 1fr !important; }
  .pd-grid { grid-template-columns: 1fr !important; }

  /* Promise block */
  .promise-content,
  div[style*="width:61.8%"],
  div[style*="width:38.2%"] {
    width: 100% !important;
    border-left: none !important;
    padding-left: 0 !important;
  }

  /* Glow buttons */
  .glow-btn-wrap { width: 100%; }
  .glow-btn { width: 100%; justify-content: center; font-size: 12px !important; padding: 10px 16px !important; }

  /* Capabilities / services */
  .gc-grid { grid-template-columns: 1fr !important; }
  .gc-card { padding: 20px !important; }
  .srv-row { padding: 20px 0 !important; flex-direction: column !important; }
  .eg-service-visual { display: none !important; }

  /* Bento formation cards */
  .bento-grid { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns:1fr 1fr"] { 
    display: grid !important;
    grid-template-columns: 1fr !important; 
  }

  /* Agents grid */
  .agents-grid { grid-template-columns: 1fr !important; }
  .agent-type-grid { grid-template-columns: 1fr !important; }
  .choice-grid { grid-template-columns: 1fr !important; }
  .connectors-grid { grid-template-columns: 1fr !important; }
  .dropzones-grid { grid-template-columns: 1fr !important; }

  /* Hero AI button */
  #agent-btn > div:last-child { padding: 0 14px 0 10px !important; }
  #agent-btn > div:last-child span:last-child { display: none; }

  /* Logos image hero — hide entire flex-shrink:0 wrapper to prevent overflow */
  div[style*="flex-shrink:0"][style*="margin-right:6vw"] { display: none !important; }
  img[alt="AI Partners"] {
    width: clamp(100px, 45vw, 200px) !important;
    margin-right: 0 !important;
  }

  /* Comparison table 2→1 col */
  .diff-row { grid-template-columns: 1fr !important; }
  .diff-them { border-right: none !important; }

  /* Formation module hover overflow */
  .module-row:hover { margin: 0 !important; padding: 32px 0 !important; }

  /* formulaire-ai nav overflow */
  nav { padding: 0 20px !important; }
  .nav-cta:not(.nav-cta-dark) { display: none !important; }

  /* Contact */
  .contact-row { flex-direction: column !important; gap: 24px; }

  /* Footer */
  .footer-inner { flex-direction: column; gap: 20px; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; gap: 16px; }

  /* Form agentlab */
  .f-block { padding: 20px 16px !important; }
  .f-section-title { font-size: 24px !important; }
  .agent-card { padding: 14px !important; }

  /* Prevent text overflow */
  * { word-break: break-word; }
  h1, h2, h3 { overflow-wrap: break-word; }

  /* Sections padding */
  section { padding-left: 4vw !important; padding-right: 4vw !important; }

  /* Trust line wrap */
  .trust-line { flex-wrap: wrap; gap: 16px; font-size: 14px; }

  /* Stat items */
  .stat-item { min-width: 120px; }

  /* Timeline */
  .timeline { grid-template-columns: 1fr !important; }
}

/* ══════════════════════════
   SMALL MOBILE  < 640px
══════════════════════════ */
@media (max-width: 640px) {
  nav { padding: 0 16px !important; }
  .brand { font-size: 10px !important; letter-spacing: 0.10em !important; }
  .nav-cta-dark { font-size: 11px !important; padding: 8px 14px !important; letter-spacing: 0.04em !important; }
}

/* ══════════════════════════
   SMALL MOBILE  < 400px
══════════════════════════ */
@media (max-width: 400px) {
  h1.hero-title { font-size: 32px !important; }
  .brand span { display: none; }
  .nav { padding: 0 12px; }
  div[style*="aspect-ratio:1328/672"] { aspect-ratio: 4/3 !important; }
}
