/* ═══════════════════════════════════════════════════════════════════════════
   DX Media — responsive.css
   All mobile / tablet / handheld scaling. Load AFTER style.css.

   BREAKPOINTS
     1200px  small laptop / iPad Pro landscape
     1024px  iPad landscape
      960px  iPad portrait / large tablet
      860px  small tablet — mobile nav engages here
      640px  phone landscape / large phone
      480px  phone portrait
      360px  small phone (iPhone SE, Galaxy Fold unfolded)
   Plus: pointer-coarse (touch targets), orientation, reduced-motion, print.
   ═══════════════════════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════════════
   0. FOUNDATIONS — apply at every width
   ═══════════════════════════════════════════════════════════ */

/* body already sets overflow-x:hidden, but iOS Safari ignores it unless html
   clips too. Without both, a single overflowing child lets the page pan. */
html { overflow-x: hidden; -webkit-text-size-adjust: 100%; }

/* Never let media exceed its column. */
img, svg, video, canvas, iframe, embed, object {
  max-width: 100%;
  height: auto;
}
/* (The icon rules in style.css are class-scoped, so they outrank the bare
   element selector above and keep their explicit 22px/26px sizing.) */

/* Long words, URLs and client names must wrap rather than force a scrollbar. */
h1, h2, h3, h4, p, li, a, blockquote, cite, .trust-client, .testi-quote {
  overflow-wrap: break-word;
  word-wrap: break-word;
}
h1, h2, h3, .sec-title, .page-hero h1, .cta-banner h2 {
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Grid/flex children default to min-width:auto, which lets wide content
   (long words, <pre>, tables) push a track past its share. Fix at the source. */
.svcs-grid > *, .testi-grid > *, .blog-grid > *, .values-grid > *,
.team-grid > *, .pricing-grid > *, .faq-grid > *, .quick-faq-grid > *,
.process-grid > *, .about-inner > *, .contact-inner > *, .hero > *,
.form-row > *, .svc-card > *, .footer-top > * { min-width: 0; }

/* Post content can contain author-pasted tables / code / embeds. */
.post-content table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.post-content pre { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.post-content iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; }

/* Fluid type: scales smoothly BETWEEN breakpoints instead of stepping at them.
   Replaces the fixed desktop sizes in style.css. */
.sec-title      { font-size: clamp(26px, 4.2vw, 40px); }
/* Must follow .sec-title — equal specificity, so source order decides. */
.sec-title-sm   { font-size: clamp(24px, 3.6vw, 32px); }
.cta-banner h2  { font-size: clamp(28px, 5vw, 50px); }
.page-hero h1   { font-size: clamp(30px, 6vw, 60px); }
.hero h1        { font-size: clamp(34px, 6.2vw, 70px); }
.pricing-price  { font-size: clamp(38px, 5vw, 48px); }
.proof-num,
.about-stat-num { font-size: clamp(28px, 4vw, 36px); }
.value-letter   { font-size: clamp(38px, 5vw, 48px); }

/* Hero height: vh is measured against the LARGEST viewport on mobile, so 88vh
   hides content behind the browser chrome. svh = smallest (chrome visible). */
@supports (height: 1svh) {
  .hero { min-height: 88svh; }
}


/* ═══════════════════════════════════════════════════════════
   1. FIXES TO style.css COLLISIONS
   (these are bugs, not breakpoints — they apply at all widths)
   ═══════════════════════════════════════════════════════════ */

/* .svcs-grid is declared twice in style.css: 3-col for the home preview
   (~line 321) and 2-col for the Services page (~line 401). The later rule wins
   globally, so the home page renders its 3 cards 2-up with an orphan.
   Scope each to its own section. */
.services-preview .svcs-grid { grid-template-columns: repeat(3, 1fr); }
.page-hero ~ section .svcs-grid,
body:not(.home) .svcs-grid { grid-template-columns: repeat(2, 1fr); }

/* style.css carries its own @media (max-width:860px) home block. This file
   loads after it at equal specificity, so the rules below are authoritative —
   the declarations here intentionally restate every property it touches. */


/* ═══════════════════════════════════════════════════════════
   2. ≤1200px — small laptops, iPad Pro landscape
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .container { padding: 0 40px; }
  nav { padding: 15px 40px; }
  .about-inner, .contact-inner { gap: 56px; }
}


/* ═══════════════════════════════════════════════════════════
   3. ≤1024px — iPad landscape
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .nav-links { gap: 20px; }
  .nav-links a { font-size: 13px; }
  .nav-cta { padding: 9px 18px; }

  .hero { gap: 44px; padding: 80px 0 88px; }
  .process-grid { gap: 1px; }
  .process-step { padding: 28px 20px; }
  .pricing-card { padding: 34px 26px; }
  .about-visual, .contact-form-card { padding: 36px; }
}


/* ═══════════════════════════════════════════════════════════
   4. ≤960px — iPad portrait / large tablet
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .container { padding: 0 32px; }
  nav { padding: 15px 32px; }
  footer { padding: 40px 32px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand p { max-width: none; }

  /* Home */
  .hero { grid-template-columns: 1fr; gap: 48px; min-height: 0; padding: 64px 0 72px; }
  .hero-sub { max-width: 560px; }
  .services-preview .svcs-grid,
  .svcs-grid, .testi-grid { grid-template-columns: repeat(2, 1fr); }
  /* Glows are sized for a 1160px canvas; shrink so they don't force overflow. */
  .hero-glow  { width: 100%; max-width: 700px; height: 500px; left: 50%; }
  .hero-glow2 { width: 300px; height: 300px; }
  .page-hero-glow { width: 100%; max-width: 560px; }

  /* About */
  .about-inner { grid-template-columns: 1fr; gap: 48px; }
  .values-grid, .team-grid { grid-template-columns: repeat(2, 1fr); }

  /* Services */
  .process-grid { grid-template-columns: repeat(2, 1fr); }

  /* Pricing */
  .pricing-grid, .faq-grid { grid-template-columns: repeat(2, 1fr); }
  /* Odd card out (3 tiers in a 2-col grid) — center the orphan. */
  .pricing-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; max-width: 420px; margin: 0 auto; width: 100%; }

  /* Contact */
  .contact-inner { grid-template-columns: 1fr; gap: 48px; }
  .quick-faq-grid { grid-template-columns: repeat(2, 1fr); }

  /* Blog */
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ═══════════════════════════════════════════════════════════
   5. ≤860px — mobile nav engages
   ═══════════════════════════════════════════════════════════ */
.nav-toggle { display: none; }

@media (max-width: 860px) {
  nav { flex-wrap: wrap; padding: 12px 20px; gap: 0; }
  .nav-logo { margin-right: auto; }
  .nav-logo img { height: 32px; }

  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center;
    gap: 5px; width: 44px; height: 44px; padding: 0 11px; order: 2;
    background: transparent; border: 1px solid rgba(255,255,255,.14);
    border-radius: 8px; cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; width: 100%; background: var(--white); border-radius: 2px; }

  .nav-cta { order: 3; margin-left: 12px; padding: 10px 16px; font-size: 12px; }

  .nav-links {
    order: 4; flex-basis: 100%; flex-direction: column; gap: 0;
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  /* Cap to the viewport and allow scroll — a short landscape phone can't fit
     six 52px rows under a sticky header. */
  .nav-links.open { max-height: min(380px, calc(100dvh - 140px)); overflow-y: auto; margin-top: 6px; }
  .nav-links li { border-top: 1px solid rgba(255,255,255,.07); }
  .nav-links a { display: block; padding: 14px 4px; font-size: 15px; border-bottom: none; min-height: 48px; }
  .nav-links a.active { border-color: transparent; color: var(--white); }

  /* iOS Safari force-zooms the page when focusing any field under 16px.
     This is the single most common "my mobile site jumps" bug. */
  .form-group input, .form-group select, .form-group textarea,
  .newsletter-input { font-size: 16px; }
}


/* ═══════════════════════════════════════════════════════════
   6. ≤640px — phones
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .container { padding: 0 20px; }

  /* Global rhythm — desktop section padding is ~2x what a phone needs.
     `.section` must be listed explicitly: a class (0,1,0) outranks the bare
     `section` element selector (0,0,1) regardless of file order. */
  section, .section, .services-preview, .testi-strip, .newsletter, .about-story,
  .values, .team, .testi-section, .process, .faq, .contact-section,
  .quick-faq { padding-top: 56px; padding-bottom: 56px; }
  .page-hero { padding: 48px 0 40px; }
  .legal-body, .post-body { padding: 48px 0 64px; }

  .sec-sub { font-size: 14px; margin-bottom: 32px; }
  .card { padding: 26px 22px; }
  .btn-row { flex-direction: column; }
  .btn-row > a, .btn-row > button { width: 100%; text-align: center; }

  .cta-banner { padding: 60px 0; }
  .cta-banner p { font-size: 15px; }

  /* Footer */
  footer { padding: 36px 20px; }
  .footer-top { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .footer-bottom nav { display: flex; flex-wrap: wrap; justify-content: center; }
  .footer-bottom a { margin: 0 10px; padding: 6px 0; }
  .footer-nap { padding: 4px 12px 20px; }

  /* Home */
  .hero { padding: 48px 0 56px; gap: 36px; }
  .hero-sub { font-size: 15px; margin-bottom: 32px; }
  .hero-badge { margin-bottom: 20px; }
  .proof-card { padding: 26px 22px; }
  .proof-stats { grid-template-columns: 1fr 1fr; gap: 16px; }
  .services-preview .svcs-grid,
  .svcs-grid, .testi-grid { grid-template-columns: 1fr; }
  .testi-card { padding: 26px 22px; }
  .trust-bar-inner { gap: 12px; flex-direction: column; }
  .trust-clients { gap: 8px 18px; }
  .trust-client { font-size: 13px; }

  /* About */
  .about-inner { gap: 36px; }
  .about-visual { padding: 28px 22px; }
  .values-grid, .team-grid, .about-stat-grid { grid-template-columns: 1fr; }
  .value-card { padding: 28px 24px; }
  .team-avatar { padding: 36px 0 30px; }
  .team-info { padding: 24px 22px; }

  /* Services */
  .svc-card { grid-template-columns: 1fr; gap: 16px; }
  .process-grid { grid-template-columns: 1fr; gap: 0; }
  /* Collapsed to one column the 1px gaps double up — collapse the borders. */
  .process-step { padding: 24px 22px; border-top-width: 0; }
  .process-step:first-child { border-top-width: 1px; }

  /* Pricing */
  .pricing-grid, .faq-grid { grid-template-columns: 1fr; }
  .pricing-grid > :last-child:nth-child(odd) { max-width: none; }
  .pricing-card { padding: 32px 24px; }
  /* The "Most Popular" ribbon sits at top:-12px; in a stack it collides with
     the card above. Grid gap is 20px, so add clearance. */
  .pricing-card.featured { margin-top: 12px; }
  .faq-item { padding: 24px 22px; }

  /* Contact */
  .contact-inner { gap: 36px; }
  .contact-form-card { padding: 28px 22px; }
  .quick-faq-grid, .form-row { grid-template-columns: 1fr; }

  /* Blog */
  .blog-grid { grid-template-columns: 1fr; gap: 20px; }
  .blog-body { padding: 24px 22px; }
  .newsletter-form { flex-direction: column; }
  .newsletter-btn { width: 100%; }

  /* Single post */
  .post-content { font-size: 15px; }
  .post-content h2 { font-size: 22px; }
  .post-content h3 { font-size: 18px; }
  .post-content ul, .post-content ol { margin-left: 20px; }
  .legal-content h2 { font-size: 20px; margin-top: 36px; }
}


/* ═══════════════════════════════════════════════════════════
   7. ≤480px — phone portrait
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  footer { padding: 32px 16px; }
  nav { padding: 10px 16px; }

  /* NOTE: the templates hard-code <br> in headings for desktop line breaks.
     Leave them alone. The tempting `h1 br { display:none }` trick BREAKS this
     markup — it's `Marketing that<br><span>actually works.</span>` with no
     whitespace around the <br>, so hiding it welds the words into
     "thatactually". Verified at 390px: the forced breaks wrap fine as-is. */

  .hero-badge { font-size: 10px; padding: 6px 12px; letter-spacing: .05em; }
  .proof-stats { grid-template-columns: 1fr; gap: 18px; }
  .proof-quote { padding: 16px; }
  .card, .testi-card, .pricing-card, .value-card,
  .contact-form-card, .proof-card, .faq-item, .blog-body { padding: 22px 18px; }
  .about-visual { padding: 22px 16px; }
  .about-stat { padding: 20px 14px; }
  .team-initials { width: 64px; height: 64px; font-size: 22px; }
  .contact-detail { gap: 12px; }
}


/* ═══════════════════════════════════════════════════════════
   8. ≤360px — iPhone SE, small Androids, folded devices
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 360px) {
  .container { padding: 0 14px; }
  .nav-logo img { height: 28px; }
  /* Logo + burger + CTA no longer fit one row — drop the CTA to the menu. */
  .nav-cta { padding: 8px 12px; font-size: 11px; margin-left: 8px; }
  .btn-primary, .btn-ghost { padding: 12px 18px; font-size: 13px; }
  .trust-client { font-size: 12px; }
  .pricing-name { font-size: 19px; }
}


/* ═══════════════════════════════════════════════════════════
   9. LANDSCAPE PHONES — short viewports
   ═══════════════════════════════════════════════════════════ */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: 0; padding: 40px 0 48px; }
  .page-hero { padding: 36px 0 32px; }
  /* A sticky header eats a third of a 375px-tall viewport. */
  header { position: static; }
  .nav-links.open { max-height: calc(100dvh - 100px); }
}


/* ═══════════════════════════════════════════════════════════
   10. TOUCH DEVICES — hit targets & hover cleanup
   ═══════════════════════════════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {
  /* WCAG 2.5.5 / Apple HIG: 44x44px minimum. Nav and footer links were well
     under — footer <li> gaps of 9px around 13px text is ~22px of target. */
  .nav-links a,
  .footer-col ul a,
  .footer-bottom a,
  .blog-read,
  .pricing-note a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .footer-bottom a { display: inline-flex; padding: 0 8px; }
  .footer-col ul { gap: 2px; }

  .btn-primary, .btn-ghost, .nav-cta, .form-submit,
  .pricing-btn, .newsletter-btn, .nav-toggle { min-height: 44px; }

  /* Hover transforms stick on touch (they fire on tap and never clear),
     leaving cards visually "lifted" until you tap elsewhere. */
  .card-hover:hover,
  .blog-card:hover,
  .pricing-card:hover { transform: none; box-shadow: none; }
  .card-hover:hover::before { transform: scaleX(0); }

  /* Compensate: give touch users an active-state instead. */
  .card-hover:active, .blog-card:active, .pricing-card:active { border-color: rgba(120,78,248,.45); }
}


/* ═══════════════════════════════════════════════════════════
   11. HIGH-DPI / MOTION / PRINT
   ═══════════════════════════════════════════════════════════ */

/* The fixed 52px background grid and backdrop-filter blurs are the two most
   expensive paints on the page and are a known scroll-jank source on mobile
   Safari, where a fixed layer repaints on every chrome show/hide. */
@media (max-width: 860px) {
  body::before { background-size: 40px 40px; opacity: .6; }
  .card, .proof-card, .about-visual, .contact-form-card { backdrop-filter: none; }
  header { backdrop-filter: blur(12px); }
}

@media (prefers-reduced-motion: reduce) {
  .nav-links { transition: none !important; }
}

@media print {
  header, footer, .nav-toggle, .cta-banner, .newsletter,
  .skip-link, body::before, .hero-glow, .hero-glow2, .page-hero-glow { display: none !important; }
  body { background: #fff; color: #000; }
  .container { max-width: none; padding: 0; }
  .hero, .about-inner, .contact-inner, .svcs-grid,
  .blog-grid, .pricing-grid { grid-template-columns: 1fr !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 11px; }
}