/* Site-wide responsive layer — loaded last on every page.
   Desktop design is 1280px; this collapses it for tablet (≤1024) and mobile (≤768). */

body { overflow-x: hidden; }
img { height: auto; }

/* Hamburger (injected by main.js) — hidden on desktop */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 10px;
  background: none; border: none; cursor: pointer;
}
.nav-toggle span {
  display: block; height: 2px; width: 100%; background: var(--neutral-07);
  border-radius: 2px; transition: transform 0.2s, opacity 0.2s;
}
header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ Tablet ============ */
@media (max-width: 1024px) {
  :root { --section-padding: 80px; }
  .container, .container-wide { padding: 0 32px; }

  .h1 { font-size: 48px; line-height: 56px; letter-spacing: -2px; }
  .h2 { font-size: 36px; line-height: 44px; letter-spacing: -1.5px; }

  /* Split layouts: tighten gaps */
  .two-col, .cta-layout, .story-row, .mv-row, .audience-hero,
  .case-block, .product-section { gap: 48px; }

  /* 4-col grids → 2 */
  .principles-grid, .industries-grid { grid-template-columns: repeat(2, 1fr); }
  /* 3-col grids → 2 */
  .solutions-grid, .audience-features { grid-template-columns: repeat(2, 1fr); }

  .footer-top { gap: 60px; }
  .footer-columns { gap: 40px; }

  /* Header: replace desktop nav with hamburger (JS toggles .nav-open) */
  header { padding: 20px 0; }
  header nav { display: none; }
  header.nav-open nav {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--neutral-01); border-bottom: 1px solid var(--neutral-03);
    padding: 16px 32px 24px; box-shadow: 0 24px 40px rgba(0,0,0,0.08);
  }
  header nav > a, .nav-mega > a { padding: 10px 0; margin: 0; }
  /* Hover mega-panel is desktop-only; product links live in the footer and on products.html */
  .nav-mega-panel { display: none; }
  .nav-mega > a::after { display: none; }
  .nav-toggle { display: flex; }
  html { scroll-padding-top: 100px; }
}


/* ============ Mobile ============ */
@media (max-width: 768px) {
  :root { --section-padding: 56px; }
  .container, .container-wide { padding: 0 20px; }

  .h1 { font-size: 36px; line-height: 44px; letter-spacing: -1px; }
  .h2 { font-size: 28px; line-height: 36px; letter-spacing: -1px; }
  .h4 { font-size: 20px; line-height: 28px; }
  .body-18 { font-size: 16px; line-height: 26px; }

  /* Header + footer logos share .logo; !important overrides the inline height:32px */
  .logo img { height: 26px !important; }

  .hero { padding: 40px 0 56px; }
  .hero-ctas { flex-wrap: wrap; }
  .btn { padding: 16px 28px; }

  /* Every split layout stacks */
  .two-col, .cta-layout, .story-row, .mv-row, .audience-hero, .case-block,
  .product-section, .product-section.reverse,
  .cards-row, .features-row, .dashboard-showcase,
  .case-header { flex-direction: column; }
  .two-col, .cta-layout, .story-row, .mv-row, .audience-hero,
  .case-block, .product-section { gap: 32px; }
  .case-header { gap: 24px; align-items: flex-start; }
  .cards-row, .features-row, .dashboard-showcase { gap: 20px; }
  .feature-item { max-width: none; }
  .product-section { padding: 48px 0; }

  /* Remaining grids → 1 column */
  .principles-grid, .industries-grid, .why-grid, .audience-features,
  .solutions-grid, .case-cards { grid-template-columns: 1fr; }
  /* index.html .case-cards is flex, not grid */
  .case-cards { flex-direction: column; gap: 20px; }

  .reach-stats { flex-wrap: wrap; gap: 40px; }
  .card { padding: 24px; }
  .segment-card, .why-card { padding: 28px; }

  /* CTA split: stack the two white cards too */
  .cta-right { flex-direction: column; }
  .cta-left .body-18 { margin-bottom: 32px; }

  /* Footer stacks */
  footer { padding: 64px 0 32px; }
  .footer-top { flex-direction: column; gap: 40px; margin-bottom: 48px; }
  .footer-columns { flex-direction: column; gap: 32px; }
  .footer-col { display: flex; flex-direction: column; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 16px; align-items: flex-start; }

  header.nav-open nav { padding: 12px 20px 20px; }
  html { scroll-padding-top: 92px; }
}

/* Small phones */
@media (max-width: 480px) {
  .header-actions { display: none; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .reach-stat-number { font-size: 40px; }
}
