/* ==========================================================================
   RESPONSIVE LAYER — every desktop behaviour has a mobile translation
   1. touch: hover effects replay as the element crosses the screen centre (.is-inview, set in site.js)
   2. copy:  .d-only / .m-only swap long desktop lines for short mobile ones
   3. components re-laid for small screens
   4. floating WhatsApp button
   ========================================================================== */

/* ---------- 1. hover → in-view (touch) ---------- */
@media (hover: none) {
  .side-card.photo.is-inview img, .lcard.is-inview .lm img, .dev.is-inview img, .gallery .g.is-inview img, .ex-card.is-inview .ex-media img { transform: scale(1.06); }
  .ex-card.is-inview .ring-badge { transform: scale(1.06) rotate(-6deg); background: var(--lime); color: var(--ink); }
  .aud.is-inview .shape { transform: translateX(-10px) scale(1.03); }
  .lcard.is-inview .go, .ex-card.is-inview .go, .member.is-inview .go, .side-card.is-inview .go { transform: rotate(-45deg); background: var(--lime); color: var(--ink); }
  .member.is-inview .ph img { filter: grayscale(0); transform: scale(1.05); }
  .step.is-inview { background: rgba(179, 205, 8, .12); transform: translateY(-6px); }
  .light-steps .step.is-inview { background: var(--lime-tint); }
  .team-cta.is-inview .ph img { transform: translateY(-6px) rotate(-4deg); }
  .plan.is-inview, .w.is-inview, .ccard.is-inview, .kpi.is-inview { transform: translateY(-6px); transition: transform .6s var(--ease); }
  .region.is-inview { background: rgba(179, 205, 8, .14); }
  /* values: the in-view card becomes the active (dark) card */
  .value { transition: background .5s var(--ease), color .5s var(--ease), transform .5s var(--ease); }
  .value:not(.active) { transform: none; }
}

/* ---------- 2. copy swaps + no orphan wraps ---------- */
.m-only { display: none; }
@media (max-width: 640px) {
  .d-only { display: none !important; }
  .m-only { display: inline; }
}
.h1, .h2, .h3, h1, h2, h3 { text-wrap: balance; }
p, .lede { text-wrap: pretty; }

/* ---------- 3. components ---------- */
@media (max-width: 640px) {
  /* eyebrows always stay on one line */
  .eyebrow { white-space: nowrap; letter-spacing: .1em; font-size: .6rem; }

  /* section heads: one column, tight rhythm */
  .s-head, .s-head.wide-r { grid-template-columns: 1fr !important; gap: 14px; }
  .s-head .lede { max-width: none; }

  /* listings head: tabs become a single swipeable chip row, arrows sit beside "View all" */
  .s-head.wide-r > div:last-child { flex-direction: row !important; align-items: center !important; justify-content: space-between; width: 100%; gap: 10px !important; }
  .l-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: calc(100vw - 32px - 112px); background: #fff; box-shadow: inset 0 0 0 1px var(--line); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .l-tabs::-webkit-scrollbar { display: none; }
  .l-tabs button { padding: 9px 14px; white-space: nowrap; flex: none; font-size: .82rem; }
  .rail-ctrl { flex: none; }
  .rail-ctrl button { width: 44px; height: 44px; }
  .rail { grid-auto-columns: 84%; }

  /* quote card: meta tab sized to its text, controls move to the top-right corner */
  .quote-card { min-height: 0; padding-bottom: 86px; }
  .quote-body { padding: 28px 22px 10px; }
  .quote-stage { min-height: 250px; }
  .quote blockquote { font-size: 1.55rem; }
  .quote-meta { max-width: 82%; padding: 14px 18px 2px 2px; }
  .quote-meta b { font-size: .98rem; }
  .quote-meta small { display: block; font-size: .7rem; line-height: 1.35; }
  .q-ctrl { top: 18px !important; bottom: auto !important; right: 16px !important; width: auto !important; gap: 6px; padding: 5px !important; }
  .q-ctrl button { width: 34px; height: 34px; }
  .q-ctrl .qdots { display: none; }

  /* headings scale so designed one-liners stay one line */
  .h1 { font-size: clamp(2.3rem, 10.5vw, 3rem); }
  .h2 { font-size: clamp(1.9rem, 8.4vw, 2.4rem); }
  .lede { font-size: .98rem; }

  /* specialty cards: compact, pattern stays in the corner */
  .svc { min-height: 0; padding: 24px 22px 26px; }
  .svc .obj { width: 110px; height: 110px; }
  .svc h3 { margin-top: 18px; }
  .svc[data-pat]::after { width: 58%; }

  /* buttons never wrap */
  .btn { white-space: nowrap; }
}

/* ---------- 4. floating WhatsApp ---------- */
.wa-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 120; width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center; background: var(--lime); color: var(--ink);
  box-shadow: 0 14px 34px rgba(10, 11, 6, .28), inset 0 0 0 2px rgba(10, 11, 6, .9);
  transition: transform .5s var(--ease), bottom .5s var(--ease), background .3s, color .3s;
  animation: waIn .8s var(--ease-out) 1.2s both;
}
.wa-fab .wa-ic { position: relative; z-index: 1; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; }
.wa-fab svg { width: 30px; height: 30px; }
.wa-fab .wa-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--lime); animation: waPulse 2.6s ease-out infinite; }
.wa-fab .wa-tip {
  position: absolute; right: calc(100% + 12px); top: 50%; transform: translate(8px, -50%); opacity: 0; pointer-events: none; white-space: nowrap;
  background: var(--ink); color: #fff; font: 500 .82rem/1 var(--font); padding: 11px 15px; border-radius: 999px; transition: opacity .3s, transform .4s var(--ease);
}
.wa-fab .wa-tip::after { content: ""; position: absolute; right: -4px; top: 50%; width: 9px; height: 9px; background: var(--ink); transform: translateY(-50%) rotate(45deg); }
.wa-fab:hover { transform: scale(1.08) rotate(-8deg); background: var(--ink); color: var(--lime); }
.wa-fab:hover .wa-tip { opacity: 1; transform: translate(0, -50%); }
.wa-fab.lifted { bottom: 96px; }
@keyframes waPulse { 0% { transform: scale(1); opacity: .9; } 80%, 100% { transform: scale(1.7); opacity: 0; } }
@keyframes waIn { from { transform: scale(.4) translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 640px) { .wa-fab { right: 16px; bottom: 16px; width: 56px; height: 56px; } .wa-fab .wa-tip { display: none; } .wa-fab.lifted { bottom: 16px; } }
@media (prefers-reduced-motion: reduce) { .wa-fab, .wa-fab .wa-ring { animation: none; } }

/* proxy used by the clip-reveal observer (see site.js) */
.reveal-proxy { position: absolute; width: 1px; height: 1px; pointer-events: none; opacity: 0; }
@media (max-width: 640px) { .sticky-bar { background: rgba(255, 255, 255, .94); } }
@media (max-width: 640px) {
  .step { padding: 22px 20px; }
  .step h3 { margin-top: 18px; }
  .steps-line { display: none; }
  .steps { gap: 10px; }
}
.note { display: block; position: relative; padding-left: 24px; }
.note::before { position: absolute; left: 0; top: 1px; }
@media (max-width: 640px) {
  .member.lead { grid-column: 1 / -1; }
  .member.lead .ph { grid-template-columns: 1fr 1fr; aspect-ratio: auto; min-height: 280px; }
  .member.lead .ph img { min-height: 280px; }
  .lead-info { padding: 20px 16px 18px; }
  .lead-info h3 { font-size: 1.35rem; }
  .lead-info ul { margin: 6px 0 10px; gap: 6px; }
  .lead-info li { font-size: .74rem; }
  .team { gap: 22px 12px; align-items: start; }
  .member h3 { font-size: 1.02rem; }
}

/* contact form sits on a light card: ink text + visible placeholders (was white-on-white) */
.contact-form .field { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.contact-form .field::placeholder { color: var(--muted-2, #8a8c80); }
.contact-form .field:focus { box-shadow: inset 0 0 0 1.5px var(--ink); }
@media (max-width: 640px) {
  .ccards { gap: 10px; }
  .ccard { min-height: 0; padding: 20px; gap: 14px; }
  .ccard b { font-size: 1rem; }
}
