/* ══════════════════════════════════════════════════════
   CABIDOTS TECHNOLOGIES — css/responsive.css
   Responsive breakpoints
   Ordered from largest viewport to smallest, plus
   orientation / device-feature queries at the end.
   ══════════════════════════════════════════════════════ */

/* ── Global overflow safety net ─────────────────────────
   Decorative absolutely-positioned elements (orbs, blobs,
   the CTA circle) must never be able to create horizontal
   scroll on any viewport. body already has overflow-x:hidden
   (base.css); this reinforces it at the root and on the
   two most common offenders. */
html, body { max-width: 100%; }
.hero, .cta-band, .trust-bar, .impact-section { overflow: hidden; }

/* ── 1920px and above — large desktop monitors ──────────
   Keep the reading measure comfortable and give the hero
   / sections a little more breathing room instead of just
   stretching the existing 1200px container edge-to-edge. */
@media (min-width: 1920px) {
  .container { max-width: 1360px; }
  .hero-body { max-width: 860px; }
  .hero-desc { max-width: 600px; }
  .section { padding: 130px 0; }
  .hero { padding: 150px 0 110px; }
}

/* ── 1440px – 1919px — standard large desktop ──────────── */
@media (min-width: 1440px) and (max-width: 1919.98px) {
  .container { max-width: 1280px; }
}

/* ── 1100px ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid      { grid-template-columns: repeat(2, 1fr); }
  .impact-grid   { grid-template-columns: repeat(2, 1fr); }
  .contact-grid  { grid-template-columns: 1fr; gap: 52px; }
  .hero-badge    { right: 3%; bottom: 12%; }
}

/* ── 1024px — iPad / tablet landscape fine-tuning ───────
   Tablets in landscape sit right at this width; nav still
   has room to stay expanded, but hero copy and the badge
   need a touch more breathing room next to the canvas. */
@media (max-width: 1024px) and (min-width: 901px) {
  .hero-body   { max-width: 640px; }
  .hero-badge  { right: 4%; bottom: 10%; }
}

/* ── 900px ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .about-grid   { grid-template-columns: 1fr; gap: 48px; }
  .av-stats-row { grid-template-columns: repeat(4, 1fr); }
  .cta-inner    { flex-direction: column; text-align: center; }
  .cta-copy p   { margin: 0 auto; }
  .footer-top-inner { flex-direction: column; gap: 48px; }
  .hero-badge   { display: none; }
}

/* ── 768px ───────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Nav drawer */
  .nav {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(300px, 80vw);
    background: var(--navy-dark);
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 84px 24px 40px;
    padding-top: calc(84px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
    border-left: 1px solid rgba(255,255,255,0.08);
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
    z-index: 999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav.is-open { transform: translateX(0); }
  .nav .nav-link {
    width: 100%;
    font-size: 1rem;
    padding: 14px 16px;
    color: rgba(255,255,255,0.8);
    border-radius: var(--r-sm);
  }
  .nav .nav-link:hover { background: rgba(255,255,255,0.07); color: var(--white); }
  .nav .nav-link::after { display: none; }
  .nav .btn-cta { width: 100%; justify-content: center; margin-top: 10px; }
  .nav-overlay { display: block; }

  .hamburger { display: flex; padding: 11px; }

  .services-grid { grid-template-columns: 1fr; }
  .why-grid      { grid-template-columns: 1fr; }
  .form-row      { grid-template-columns: 1fr; }
  .impact-grid   { grid-template-columns: repeat(2, 1fr); }

  .section { padding: 72px 0; }
  .hero {
    padding: 100px 0 80px;
    min-height: 100vh;
    min-height: 100svh; /* mobile browser chrome-aware viewport */
  }

  .cta-actions { flex-direction: column; align-items: center; }
  .cta-actions .btn { width: 100%; max-width: 320px; justify-content: center; }

  .ft-cols { gap: 32px; }

  /* Long CTA/hero button labels should never force horizontal
     scroll on a narrow phone — allow them to wrap gracefully. */
  .btn { white-space: normal; text-align: center; }
}

/* ── 600px ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .av-stats-row { grid-template-columns: repeat(2, 1fr); }
  .impact-grid  { grid-template-columns: 1fr 1fr; }

  .contact-form-card { padding: 28px 22px; }
  .hero-headline { letter-spacing: -0.5px; }

  .footer-bottom-inner { flex-direction: column; text-align: center; gap: 8px; }
  .footer-legal { justify-content: center; }

  .back-top {
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    right: calc(18px + env(safe-area-inset-right, 0px));
  }
}

/* ── 480px — small phones (iPhone SE/12/13 mini, compact Android) ── */
@media (max-width: 480px) {
  .container { width: 94%; }
  .section   { padding: 60px 0; }
  .hero      { padding: 96px 0 64px; }

  /* Brand lockup: drop the subtitle and shrink the logo so
     the hamburger never gets crowded on a 320–480px header. */
  .brand-logo  { width: 36px; height: 36px; }
  .brand-name  { font-size: 0.82rem; }
  .brand-sub   { display: none; }
  .header-inner{ gap: 12px; }

  .hero-eyebrow  { font-size: 0.7rem; padding: 6px 13px; }
  .hero-headline { font-size: clamp(2.1rem, 9vw, 2.6rem); }
  .hero-desc     { font-size: 1rem; }
  .hero-chips span { font-size: 0.7rem; padding: 5px 12px; }

  .section-title { font-size: clamp(1.6rem, 7vw, 2rem); }
  .section-lead  { font-size: 0.95rem; }

  .av-main-card { padding: 36px 20px; }
  .svc-card     { padding: 28px 20px 24px; }
  .why-card     { padding: 26px 20px; }
  .impact-card  { padding: 28px 18px; }

  .contact-form-card { padding: 22px 16px; }
  .btn-lg { padding: 14px 24px; font-size: 0.95rem; }

  .loader-bar { width: 160px; }
}

/* ── 420px ───────────────────────────────────────────── */
@media (max-width: 420px) {
  .impact-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .av-stats-row { grid-template-columns: repeat(2, 1fr); }
  .ft-cols { flex-direction: column; gap: 28px; }
}

/* ── 340px — smallest supported phones (min 320px width) ── */
@media (max-width: 340px) {
  .container { width: 96%; }
  .hero-headline { font-size: clamp(1.85rem, 10vw, 2.2rem); letter-spacing: -0.3px; }
  .hero-eyebrow  { font-size: 0.65rem; padding: 5px 11px; }
  .btn      { padding: 12px 18px; font-size: 0.85rem; }
  .btn-lg   { padding: 13px 20px; }
  .badge-inner { padding: 16px 20px; }
  .badge-inner strong { font-size: 1.9rem; }
}

/* ── Short / landscape viewports on phones ──────────────
   A phone rotated to landscape can be under 500px tall;
   100vh hero + floating decorations then overwhelm the
   screen and push real content out of view. */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 88px 0 56px;
  }
  .hero-badge, .scroll-hint { display: none; }
  .section { padding: 48px 0; }
}

/* ── iPhone notch / home-indicator safe areas ───────────
   Applies whenever the device reports safe-area insets
   (requires viewport-fit=cover, set in index.html). */
@supports (padding: max(0px)) {
  .header { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
  .footer-bottom-inner,
  .footer-top-inner {
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
}

/* ── Touch-friendly tap targets ──────────────────────────
   Ensures every interactive control meets the ~44px
   minimum recommended touch target on phones/tablets. */
@media (pointer: coarse) {
  .nav-link, .btn-cta, .btn, .soc-btn, .back-top, .hamburger, .svc-link {
    min-height: 44px;
  }
  .soc-btn { width: 44px; height: 44px; }
  a, button { -webkit-tap-highlight-color: transparent; }
}

/* ── Reduced motion ──────────────────────────────────────
   Keeps the experience calm (and cheaper to render) for
   visitors who have asked their OS to minimise motion. */
@media (prefers-reduced-motion: reduce) {
  .reveal-up, .reveal-left, .reveal-right {
    transition-duration: 0.01ms !important;
  }
  .trust-track,
  .dot-pulse,
  .hero-badge,
  .scroll-hint,
  .scroll-dot,
  .loader-fill {
    animation: none !important;
  }
  html { scroll-behavior: auto; }
}
