/* ---- Responsive ---- */
@media (max-width: 1080px) {
  .mega-menu { left: -150px; width: 600px; }
  .hero-grid { gap: 2.5rem; }
    }

@media (max-width: 1024px) {
    .footer-top { grid-template-columns: 1fr 1fr; }
  .hero-visual { min-height: 500px; }
}

@media (max-width: 900px) {
  .nav { display: none; }
  .header-cta { display: none; }
  .nav-toggle { display: block; flex-shrink: 0; }

  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; min-height: 480px; margin-top: 8px; }
  
      .split { grid-template-columns: 1fr; gap: 2rem; }
  .lead-grid { grid-template-columns: 1fr; }
  .step-flow { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }

  .float-contact { display: none; }
  .back-top { right: 16px; bottom: 130px; }
}

@media (max-width: 720px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .check-grid { grid-template-columns: 1fr; }
    .hero-visual { min-height: 420px; }
  .phone { width: 152px; right: 0; }

  /* Footer collapses into accordion columns on small screens */
  .site-footer .footer-top { grid-template-columns: 1fr; gap: 0; }
  .footer-brand { padding-bottom: 22px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); margin-bottom: 4px; }
  .footer-col { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
  .footer-col h4 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 16px 0;
    cursor: pointer;
  }
  .foot-trigger .foot-caret { display: inline-flex; transition: transform 0.3s var(--ease); }
  .footer-col.open h4 .foot-caret { transform: rotate(180deg); }
  .footer-col ul { max-height: 0; overflow: hidden; }
  .footer-col.open ul { max-height: 320px; padding-bottom: 18px; }

  /* ---- Animated gradient border on the accordion triggers ----
     A purple→green line sweeps out along the bottom edge of a column heading
     on hover/focus, then drifts slowly while the column stays open. */
  .footer-col { transition: border-color 0.45s var(--ease); }
  .footer-col:hover,
  .footer-col:focus-within,
  .footer-col.open { border-bottom-color: rgba(151, 121, 255, 0.34); }

  .footer-col h4 { position: relative; }

  .footer-col h4::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background-image: linear-gradient(90deg, #7b4bff 0%, #9779ff 32%, #72bf44 68%, #97d75f 100%);
    background-size: 220% 100%;
    background-repeat: no-repeat;
    transform: scaleX(0);
    transform-origin: left center;
    opacity: 0;
    transition: transform 0.55s var(--ease), opacity 0.35s var(--ease);
  }

  .footer-col:hover h4::after,
  .footer-col:focus-within h4::after,
  .footer-col.open h4::after {
    transform: scaleX(1);
    opacity: 1;
  }

  /* slow drift only while the panel is actually open */
  .footer-col.open h4::after {
    animation: footEdgeDrift 6s linear infinite;
  }

  @keyframes footEdgeDrift {
    from { background-position: 0% 0; }
    to   { background-position: 100% 0; }
  }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .footer-col.open h4::after { animation: none; }
  .footer-col h4::after { transition: none; }
}

/* ---- Global small-screen safety net ----
   Captive text, minimum tap targets, and no horizontal overflow on phones. */
@media (max-width: 560px) {
  .grid-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .page-hero h1 { font-size: clamp(1.75rem, 7vw, 2.2rem); }

  /* headings and paragraphs may use the full column on narrow screens */
  p { max-width: none; }
  .section-lead { max-width: none; }

  /* comfortable minimum hit area for every control */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .form-input { min-height: 44px; }

  /* never let a long word or URL push the page sideways */
  h1,
h2,
h3,
h4,
.section-title,
.eyebrow,
.tb-tile h3 {
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
  }

  .mobile-menu { width: 100vw; }

          .hero-ctas .btn, .page-hero-actions .btn { width: 100%; }
  .sticky-cta { display: block; }

  .workflow { flex-direction: column; }
  }

/* Hide scrollbar-heavy elements gracefully on small screens */
@media (max-width: 480px) {
  .hero-visual { min-height: 400px; }
  }

/* ---- Contact page responsive refinements ---- */
@media (max-width: 900px) {
  .page-hero-meta a { padding: 9px 13px; font-size: 13px; }
}

@media (max-width: 720px) {
  .page-hero-meta { gap: 10px; }
}

@media (max-width: 560px) {
  .page-hero-meta { flex-direction: column; align-items: stretch; }
  .page-hero-meta a { justify-content: center; padding: 11px 14px; }
  .contact-card-head { padding: 22px 20px; }
  .contact-card-body { padding: 12px 20px 24px; }
  .contact-card-foot { padding: 16px 20px 22px; }
  .cta-strip { flex-direction: column; align-items: stretch; }
  .cta-strip p { text-align: center; }
  .cta-strip .btn { width: 100%; }
}

@media (min-width: 1281px) {
  .float-contact { display: block; }
}