/* =====================================================================
   OjarisLabs — Responsive
   Breakpoints: laptop <=1200, tablet <=980, small tablet <=768, mobile <=560
   ===================================================================== */

/* ---- Laptop ---- */
@media (max-width: 1200px) {
  .footer-top { grid-template-columns: 1.4fr repeat(3, 1fr); }
  .footer-brand { grid-column: 1 / -1; max-width: none; }
  .home-page .process-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-page .process-grid::before { display: none; }
  .home-page .technology-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---- Tablet & below: mobile navigation ---- */
@media (max-width: 980px) {
  .nav-toggle { display: inline-flex; }

  .primary-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(86vw, 360px);
    background: var(--bg-dark-2);
    border-left: 1px solid var(--border-dark);
    padding: calc(var(--header-h) + 1.5rem) 1.75rem 2rem;
    transform: translateX(100%);
    transition: transform var(--dur-slow) var(--ease);
    overflow-y: auto;
    z-index: var(--z-menu);
    box-shadow: var(--shadow-dark);
  }
  body.menu-open .primary-nav { transform: translateX(0); }
  .primary-nav ul { flex-direction: column; align-items: stretch; gap: 0.25rem; }
  .primary-nav a { display: block; padding: 0.9rem 0.25rem; font-size: 1.05rem; color: #fff; border-bottom: 1px solid var(--border-dark); }
  .primary-nav a::after { display: none; }

  /* Below the header (z 100) so the off-canvas menu — which lives inside the
     header's stacking context — paints above the backdrop, not behind it. */
  .nav-backdrop {
    position: fixed; inset: 0; background: rgba(3, 8, 23, 0.6);
    opacity: 0; visibility: hidden; transition: opacity var(--dur) var(--ease); z-index: 90; backdrop-filter: blur(2px);
  }
  body.menu-open .nav-backdrop { opacity: 1; visibility: visible; }

  .header-cta .btn { display: none; }
  .header-cta .btn.mobile-visible { display: inline-flex; }

  /* layout collapses */
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero p.lead, .hero .measure { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-visual { order: -1; }
  .hero-visual img { width: min(78%, 380px); }
  /* homepage hero: text first, energy visual second (per approved mobile spec) */
  .page-home .hero-visual { order: 0; margin-top: 1.75rem; }
  .page-home .hero-visual img { width: min(88%, 440px); }
  .capabilities { grid-template-columns: repeat(2, 1fr); text-align: left; }
  .hero-badges { grid-template-columns: repeat(2, 1fr); text-align: left; max-width: 520px; margin-inline: auto; }
  .hero-stats { justify-content: center; }
  .trusted-logos { justify-content: center; }

  .split { grid-template-columns: 1fr; }
  .cols-4, .cols-5 { grid-template-columns: repeat(2, 1fr); }
  .process { grid-template-columns: repeat(2, 1fr); gap: 2.5rem 1.5rem; }
  .process::before, .process .line-progress { display: none; }
  .slider-track { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .cap-strip { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; }
  .toc { position: static; }

  .home-page .home-section { padding-block: clamp(4.5rem, 3.6rem + 3vw, 6rem); }
  .home-page .ojas-layout,
  .home-page .why-grid,
  .home-page .faq-layout,
  .home-page .final-cta-panel { grid-template-columns: 1fr; }
  .home-page .why-visual { max-width: 520px; margin-inline: auto; }
  .home-page .final-cta-graphic { justify-self: center; max-width: 360px; opacity: 0.34; }
}

/* ---- Small tablet ---- */
@media (max-width: 768px) {
  .cols-3, .cols-2 { grid-template-columns: repeat(2, 1fr); }
  .stats-strip { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; }
  .stats-strip .stat:not(:last-child)::after { display: none; }
  .stats-strip .stat:nth-child(5) { grid-column: 1 / -1; }

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

  .cta-banner { flex-direction: column; align-items: flex-start; text-align: left; }

  .timeline { grid-template-columns: 1fr; gap: 0; }
  .timeline::before { top: 0; bottom: 0; left: 12px; right: auto; width: 2px; height: auto; }
  .tl-item { text-align: left; padding: 0 0 2rem 3rem; }
  .tl-item .dot { left: 12px; top: 2px; transform: translateX(-50%); }

  .newsletter { flex-direction: column; align-items: stretch; }
  .newsletter-form { max-width: none; }

  .home-page .home-container { width: min(100% - 44px, 1280px); }
  .home-page .process-grid,
  .home-page .technology-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-page .ojas-values { grid-template-columns: 1fr; }
  .home-page .ojas-core-card { min-height: 118px; }
}

/* ---- Mobile ---- */
@media (max-width: 560px) {
  :root { --header-h: 66px; }
  .brand-logo { width: 146px; max-height: 36px; }

  .cols-2, .cols-3, .cols-4, .cols-5,
  .card-grid.cols-2, .card-grid.cols-3 { grid-template-columns: 1fr; }
  .capabilities, .hero-badges { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { gap: 1.25rem 2rem; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .cap-strip { grid-template-columns: 1fr; }
  .home-page .home-container { width: min(100% - 40px, 1280px); }
  .home-page .home-section { padding-block: clamp(3.5rem, 2.8rem + 3vw, 4.5rem); }
  .home-page .process-grid,
  .home-page .technology-grid { grid-template-columns: 1fr; }
  .home-page .process-card { min-height: 0; }
  .home-page .ojas-value-card,
  .home-page .why-benefit { flex-direction: column; }
  .home-page .final-cta-panel { min-height: 0; }
  .home-page .final-cta-actions .btn { width: 100%; }
  .home-page .final-cta-graphic { display: none; }

  .contact-info { gap: 0.75rem; }
  .newsletter-form { flex-direction: column; }
  .newsletter-form .btn { width: 100%; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 380px) {
  .footer-top { grid-template-columns: 1fr; }
  .stats-strip, .stat-grid { grid-template-columns: 1fr; }
}

/* ---- Mobile performance: lighter shadows + reduced blur ---- */
@media (max-width: 560px) {
  :root {
    --shadow-card: 0 6px 16px -10px rgba(11, 16, 32, 0.18);
    --shadow-card-hover: 0 10px 24px -12px rgba(11, 16, 32, 0.24);
    --shadow-float: 0 16px 36px -22px rgba(11, 16, 32, 0.4);
  }
  .site-header.is-scrolled { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  .hero-visual img { filter: drop-shadow(0 12px 24px rgba(139, 61, 255, 0.28)); }
}
