/* Phone layout (founder, 5 Dec 2026): built to sell on a phone, not just to fit.
   Loaded last on every page, so it overrides the page styles below 641px only. Desktop is untouched.
   - Hero: one-sentence intro, proof in one compact strip, the quiz straight after, awards below it.
   - Repeated cards (case studies, reviews, comparisons, related reads) swipe sideways instead of stacking.
   - Small cards sit two to a row. Long guides, long FAQs and the footer fold away until asked for.
   The swipe counters, "show all" buttons and the folding are added by js/site.js (mobile section). */

@media (max-width: 640px) {

  /* ---------- hero (.lhero: the service pages) ---------- */
  .lhero { padding: 22px 0 40px; }
  .lhero .wrap.grid { display: flex; flex-direction: column; gap: 0; }
  .lhero .wrap.grid > div:first-child { display: contents; }
  .lhero .mono-lbl { order: 1; align-self: flex-start; }
  .lhero h1 { order: 2; margin: 12px 0 14px; font-size: clamp(34px, 9.6vw, 40px); line-height: 1.04; }
  .lhero .lede { order: 3; font-size: 16px; line-height: 1.5; margin: 0; }
  .lede-more { display: none; }
  .lhero .ctas { order: 4; margin: 20px 0 0; }
  .lhero .trust { order: 5; }
  .lhero .qstart { order: 6; margin-top: 22px; }
  .lhero .laurels { order: 7; }
  .lhero .wrap.grid > :not(div:first-child):not(.qstart) { order: 8; }

  /* proof: three short columns in one strip */
  .lhero .trust {
    display: grid; grid-template-columns: 1.05fr 1fr 1fr; align-items: start;
    gap: 0; margin-top: 18px; padding: 11px 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
    font-size: 12.5px; line-height: 1.32;
  }
  .lhero .trust i { display: none; }
  .lhero .trust .stars { grid-column: 1; grid-row: 1; font-size: 12px; letter-spacing: 1px; line-height: 1; margin-bottom: 3px; }
  .lhero .trust > span:nth-of-type(2) { grid-column: 1; grid-row: 2; padding-right: 8px; }
  .lhero .trust > span:nth-of-type(3) { grid-column: 2; grid-row: 1 / 3; padding: 0 8px 0 10px; border-left: 1px solid var(--hair); }
  .lhero .trust > span:nth-of-type(4) { grid-column: 3; grid-row: 1 / 3; padding: 0 0 0 10px; border-left: 1px solid var(--hair); }
  .lhero .trust b { font-weight: 600; }

  /* awards: three across, icon beside the headline word */
  .lhero .laurels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
  .lhero .laurels span { padding: 0; font-size: 12px; line-height: 1.32; }
  .lhero .laurels span::before { position: static; display: inline-block; width: 12px; height: 17px; margin-right: 5px; vertical-align: -3px; background-size: contain; background-repeat: no-repeat; }
  .lhero .laurels b { display: inline; font-size: 13px; }
  .lhero .laurels b::after { content: "\A"; white-space: pre; }

  /* the quiz card in the hero: tighter, so the first answers show on the first screen */
  .lhero .qstart { padding: 20px 18px 16px; }
  .lhero .qstart h3 { font-size: 22px; line-height: 1.15; margin: 10px 0 6px; }
  .lhero .qstart .qs-sub { font-size: 14px; line-height: 1.45; margin-bottom: 12px; }

  /* ---------- swipe rows ---------- */
  .csgrid2:not([data-cases=""]), .twall, .rc-grid, .pai-cards, .hm-grid, .nrt, .pdir, .plugs, .aigrid, .allcs, .rvw-grid, .pai-steps, .rz-grid, .fmts, .ts-grid9, .casegrid, .dgrid, .igrid, .wgrid, .wsteps, .qparts {
    display: flex !important; flex-wrap: nowrap !important; grid-template-columns: none !important; column-count: auto !important;
    gap: 12px !important; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
    margin-left: -20px !important; margin-right: -20px !important; padding: 4px 20px 16px !important; scroll-padding: 0 20px;
    scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
  }
  .csgrid2:not([data-cases=""])::-webkit-scrollbar, .twall::-webkit-scrollbar, .rc-grid::-webkit-scrollbar, .pai-cards::-webkit-scrollbar, .hm-grid::-webkit-scrollbar, .nrt::-webkit-scrollbar, .pdir::-webkit-scrollbar, .plugs::-webkit-scrollbar, .aigrid::-webkit-scrollbar, .allcs::-webkit-scrollbar, .rvw-grid::-webkit-scrollbar, .pai-steps::-webkit-scrollbar, .rz-grid::-webkit-scrollbar, .fmts::-webkit-scrollbar, .ts-grid9::-webkit-scrollbar, .casegrid::-webkit-scrollbar, .dgrid::-webkit-scrollbar, .igrid::-webkit-scrollbar, .wgrid::-webkit-scrollbar, .wsteps::-webkit-scrollbar, .qparts::-webkit-scrollbar { display: none; }
  .csgrid2:not([data-cases=""]) > *, .twall > *, .rc-grid > *, .pai-cards > *, .hm-grid > *, .nrt > .nr, .pdir > *, .plugs > *, .aigrid > *, .allcs > *, .rvw-grid > *, .pai-steps > *, .rz-grid > *, .fmts > *, .ts-grid9 > *, .casegrid > *, .dgrid > *, .igrid > *, .wgrid > *, .wsteps > *, .qparts > * {
    flex: 0 0 84% !important; max-width: 84%; min-width: 0; scroll-snap-align: start; margin: 0 !important;
  }
  .wrap.casegrid { margin-left: 0 !important; margin-right: 0 !important; }
  .rnav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 2px; font-family: var(--sans); font-size: 13px; letter-spacing: .02em; color: var(--muted); }
  .rnav .rnav-c { display: inline; padding: 0; margin: 0; border: 0; background: none; box-shadow: none; min-width: 4.5em; text-align: center; }
  .rnav button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--hair-2, rgba(0,0,0,.15)); background: transparent; color: inherit; font-size: 17px; line-height: 1; display: grid; place-items: center; cursor: pointer; }
  .rnav button:disabled { opacity: .35; cursor: default; }
  .rnav .rnav-c b { color: var(--ink); font-weight: 600; }
  .dark .rnav, .rnav.on-dark { color: rgba(255,255,255,.7); }
  .rnav.on-dark button { border-color: rgba(255,255,255,.3); }
  .rnav.on-dark .rnav-c b { color: #fff; }

  /* case study cards in a swipe row: shorter photo, tighter body */
  .csgrid2:not([data-cases=""]) .csc .ph { height: 220px; }
  .csc .ov { left: 20px; right: 20px; bottom: 16px; }
  .csc .ov b { font-size: 34px; }
  .csc .ov span { font-size: 15px; }
  .csc .cb { padding: 18px 20px 20px; gap: 14px; }
  .csc li { font-size: 14.5px; padding-left: 22px; }
  .csc li::before { top: 6px; width: 10px; height: 10px; }
  .csc .pill { font-size: 12.5px; padding: 11px 18px; }

  /* the case study library: two to a row, photo and headline number only (the card opens the case) */
  .csgrid2[data-cases=""] { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .csgrid2[data-cases=""] .csc .ph { height: 200px; }
  .csgrid2[data-cases=""] .csc .ov { left: 12px; right: 12px; bottom: 12px; }
  .csgrid2[data-cases=""] .csc .ov b { font-size: 23px; line-height: 1; }
  .csgrid2[data-cases=""] .csc .ov span { font-size: 12.5px; line-height: 1.3; margin-top: 5px; }
  .csgrid2[data-cases=""] .csc .cb { padding: 12px; gap: 0; }
  .csgrid2[data-cases=""] .csc .lg { height: 26px; }
  .csgrid2[data-cases=""] .csc .lg img { max-height: 24px; max-width: 120px; }
  .csgrid2[data-cases=""] .csc .lg .wm { font-size: 14px; }
  .csgrid2[data-cases=""] .csc ul, .csgrid2[data-cases=""] .csc .pill { display: none; }

  /* AI hub cards in a swipe row: the headline fits beside the app screenshot */
  .aigrid .aic .ov b { font-size: 30px !important; }
  .aigrid .aic .aph img { width: 96px; right: 16px; }

  /* reviews in a swipe row */
  .twall > * { padding: 22px 20px !important; }
  .twall q, .twall .tq q { font-size: 15px; line-height: 1.5; }

  /* comparison: a compact side-by-side table (usual agency | Blufire), first rows showing, the rest one tap away */
  .cmp.wide { margin-top: 28px !important; border-radius: 16px !important; box-shadow: 0 20px 40px -30px rgba(8,16,32,.35) !important; }
  .cmp.wide > .r { display: grid !important; grid-template-columns: 1fr 1fr !important; }
  .cmp.wide > .r:first-child > div:first-child { display: none !important; }
  .cmp.wide > .r:first-child > div { display: flex !important; align-items: center; padding: 13px 14px !important; font-size: 13px !important; line-height: 1.25 !important; }
  .cmp.wide > .r:first-child .cmplogo { height: 19px; width: auto; }
  .cmp.wide > .r:not(:first-child) > div:first-child { grid-column: 1 / -1; padding: 8px 14px !important; font-size: 12px !important; background: var(--bone); border-bottom: 1px solid var(--hair); }
  .cmp.wide > .r:not(:first-child) > div.them, .cmp.wide > .r:not(:first-child) > div.us { position: relative; padding: 12px 12px 14px 36px !important; font-size: 13.5px !important; line-height: 1.4 !important; }
  .cmp.wide > .r > div.us { background: rgba(1,71,255,.055) !important; }
  .cmp.wide > .r:not(:first-child) > div.them::before, .cmp.wide > .r:not(:first-child) > div.us::before { content: ""; position: absolute; left: 12px; top: 13px; width: 17px; height: 17px; border-radius: 50%; }
  .cmp.wide > .r:not(:first-child) > div.us::before { background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 11 9' fill='none'%3E%3Cpath d='M1 4.5 4 7.5 10 1.5' stroke='white' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center no-repeat; }
  .cmp.wide > .r:not(:first-child) > div.them::before { background: #eceef3 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 9 9' fill='none'%3E%3Cpath d='M1.5 1.5l6 6m0-6-6 6' stroke='%23697386' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E") center no-repeat; }
  .cmp.wide.m-few > .r.m-x { display: none !important; }

  /* small cards: two to a row */
  .svcgrid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .svcgrid > a.svc { padding: 16px 14px 14px !important; min-height: 0 !important; }
  .svcgrid > a.svc h3 { font-size: 15.5px !important; line-height: 1.25 !important; padding-right: 16px; }
  .svcgrid > a.svc .plat { display: block; padding-right: 22px; }
  .svcgrid > a.svc h4 { padding-right: 16px; }
  .svcgrid > a.svc p { font-size: 12.5px !important; line-height: 1.42 !important; margin-top: 6px !important; }
  .awrow { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .awrow > .awlist { grid-column: 1 / -1; }
  .awrow > .awph { margin: 0 !important; height: 170px !important; min-height: 0 !important; aspect-ratio: auto !important; }
  .awrow > .awph img { height: 100% !important; width: 100% !important; object-fit: cover; }
  .awrow > .awph figcaption { font-size: 12px !important; padding: 5px 9px !important; }

  /* long reads fold: the guide shows its opening, the FAQ its first questions, the footer its headings */
  .m-fold { position: relative; max-height: 560px; overflow: hidden; }
  .m-fold::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 140px; background: linear-gradient(180deg, rgba(255,255,255,0), var(--fold-bg, #fff) 88%); pointer-events: none; }
  .m-more { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 14px; padding: 14px 18px; border-radius: 999px; border: 1px solid var(--hair-2, rgba(0,0,0,.15)); background: #fff; font-family: var(--sans); font-weight: 500; font-size: 15px; color: var(--ink); cursor: pointer; }
  .qas.m-few > .qa.m-x { display: none; }
  .qa button { padding: 17px 2px !important; font-size: 16px !important; }

  footer .pfcols .fcol:not(.fbr) { border-bottom: 1px solid rgba(255,255,255,.12); }
  footer .pfcols .fcol:not(.fbr) .fcol-h { display: flex !important; align-items: center; justify-content: space-between; margin: 0 !important; padding: 15px 0; cursor: pointer; }
  footer .pfcols .fcol:not(.fbr) .fcol-h::after { content: "+"; font-size: 18px; letter-spacing: 0; opacity: .6; }
  footer .pfcols .fcol.open .fcol-h::after { content: "\2212"; }
  footer .pfcols .fcol:not(.fbr):not(.open) > a { display: none !important; }
  footer .pfcols .fcol.open > a { padding: 8px 0; }
  footer .pfcols .fcol.open { padding-bottom: 10px; }
  footer .pfcols { grid-template-columns: 1fr !important; gap: 0 !important; }

}

@media (min-width: 641px) { .rnav, .m-more { display: none !important; } }

/* phone and tablet menu: links scroll in their own box, Book and Call stay below it in full (js/site.js wraps the links) */
@media (max-width: 1020px) {
  .nav.mopen { background: #fff; }
  .nav.mopen .mnav { display: flex !important; flex-direction: column; overflow: hidden !important; padding-bottom: 0 !important; }
  .mnav .mscroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .mnav .mcta { position: static !important; flex: 0 0 auto; margin-top: 0 !important; padding: 14px 0 calc(16px + env(safe-area-inset-bottom, 0px)) !important; box-shadow: 0 -10px 18px -14px rgba(8,16,32,.25); }
}

/* any width: the GymMates AI card shares its photo panel with an app screenshot, so its headline runs a size smaller to fit beside it */
.aic .aph[href*="gymmates"] .ov b { font-size: clamp(26px, 2.6vw, 40px) !important; }
@media (max-width: 350px) {
  .aic .aph[href*="gymmates"] .ov b { font-size: 23px !important; }
  .aic .aph[href*="gymmates"] .ov { right: 92px !important; }
  .aic .aph[href*="gymmates"] img { width: 76px !important; right: 12px !important; }
  .csgrid2[data-cases=""] .csc .ov b { font-size: 19px; }
}

/* go-live phone fixes (5 Dec 2026): no text under 12px; AI card tags sit above the headline instead of under it;
   on the smallest phones service cards go one to a row so their text is never clipped */
@media (max-width: 640px) {
  body.pg-aib .csc.aic .ph { height: auto !important; min-height: 180px; display: flex; flex-direction: column; justify-content: flex-end; padding: 62px 0 0; }
  body.pg-aib .csc.aic .ph .ov { position: relative; left: auto; right: auto; bottom: auto; padding: 0 26px 20px; }
}
@media (max-width: 350px) {
  .svcgrid { grid-template-columns: 1fr !important; }
}
@media (max-width: 1020px) {
  .hm-mock span, .hm-mock .hm-mk { font-size: 12px !important; }
}
