/* who-we-help: the Who we help page (src/pages/who-we-help.mjs). The blueprint look: square corners, the dashed route
   and the target, the navy and the pale grid; the parts alternate navy, grid and white down the page. */

.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: clamp(2rem, 4.5vw, 3.5rem); }
.head-row .head { margin-bottom: 0; }
.head-row__stop { flex: none; }

/* ---------- hero: three businesses far apart, a booking landing on each, the words on the navy band ---------- */
.wwh-hero { --tile-h: clamp(19rem, calc(100svh - 72px - 20.5rem), 38rem); position: relative; background: var(--c-ink); }
.wwh-hero__tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; height: var(--tile-h); }
.wwh-tile { position: relative; margin: 0; overflow: hidden; container-type: size; background: var(--c-ink); }
/* each photo is sized by its tile (cq units): at least as tall as the tile, and wide enough that no more than --vis
   of its width shows; then placed by its own fractions --x and --y (as object-position would) */
.wwh-tile .wwh-tile__photo { --w: max(calc(100cqh * var(--ar)), calc(100cqw / var(--vis, 1))); position: absolute; left: calc((100cqw - var(--w)) * var(--x, 0.5)); top: calc((100cqh - var(--w) / var(--ar)) * var(--y, 0.5)); width: var(--w); max-width: none; height: auto; }
.wwh-tile--florist { --ar: 0.832; --x: 0.5; --y: 0; }
.wwh-tile--lawyer { --ar: 1.498; --vis: 0.55; --x: 1; --y: 0.06; } /* the certificate on his wall stays out */
.wwh-tile--roofers { --ar: 1.777; --x: 0.75; --y: 0.5; }
.wwh-tile__card { position: absolute; z-index: 1; width: 14.5rem; opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 14px)); }
.wwh-hero__tiles:has(.kit-end[data-kit-on]) .wwh-tile__card { transform: none; } /* the kit's hold: the cards fade out in place, never sliding back */
.wwh-tile--florist .wwh-tile__card { left: clamp(1rem, 2.2vw, 2rem); top: 38%; }
.wwh-tile--lawyer .wwh-tile__card { right: clamp(1rem, 2.2vw, 2rem); top: 54%; }
.wwh-tile--roofers .wwh-tile__card { left: clamp(1rem, 2.2vw, 2rem); bottom: clamp(1rem, 2.2vw, 2rem); }
.wwh-hero__band { padding: clamp(1.75rem, 3.4vw, 2.75rem) var(--gutter) clamp(2rem, 3.8vw, 3rem); text-align: center; color: var(--c-on-ink); }
.wwh-hero__title { max-width: 62rem; margin: 0 auto; font-size: clamp(2.1rem, 1.1rem + 2.8vw, 3.5rem); color: var(--c-on-ink); }
.wwh-hero__title span { display: block; }
.wwh-hero__line { max-width: 40rem; margin: 0.9rem auto 0; font-size: 1.1875rem; line-height: 1.5; color: color-mix(in srgb, var(--c-on-ink) 80%, transparent); }
.wwh-hero__cta { justify-content: center; margin-top: 1.4rem; }
.wwh-hero__stop { position: absolute; z-index: 3; right: 0.85rem; top: calc(var(--tile-h) - 3.35rem); }

/* ---------- every: the signature, full width on the pale blueprint ---------- */
.wwh-every { padding: var(--section-y) 0 calc(var(--section-y) + 1rem); overflow: hidden; }
.wwh-every .band__in { padding-inline: var(--gutter); }
.wwh-every__head { margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem); }
.wwh-every__stage { position: relative; }
.wwh-every__scene { display: block; width: 100%; height: 440px; }
.wwh-every__stop { position: absolute; z-index: 2; right: var(--gutter); bottom: -3.25rem; }

/* ---------- kinds: one new client for each kind, its route from its name to the card ---------- */
.kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2.5rem, 4vw, 3.5rem) clamp(1.5rem, 3vw, 2.5rem); margin: 0; padding: 0; list-style: none; }
.kind { --edge: clamp(0.75rem, 1.6vw, 1.1rem); --lit: clamp(0, (var(--kit-in, 1) - 0.55) * 3, 1); --draw: clamp(0, var(--kit-in, 1) * 1.8, 1); --show: clamp(0, (var(--kit-in, 1) - 0.4) * 2.5, 1); position: relative; }
.kind__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius-m); background: var(--c-paper-alt); box-shadow: var(--shadow-m); }
.kind__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kind__name { position: absolute; z-index: 3; top: var(--edge); display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; padding: 0.45rem 0.7rem; border: 1px solid var(--c-line); border-radius: var(--radius-s); background: var(--c-paper); box-shadow: var(--shadow-s); font: 600 0.8125rem/1.2 var(--font-ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-ink); }
.kind--l .kind__name { left: var(--edge); }
.kind--r .kind__name { right: var(--edge); flex-direction: row-reverse; }
.kind__mark { position: relative; display: inline-grid; flex: none; width: 1.125rem; height: 1.125rem; color: var(--c-brand); }
.kind__mark .mark { grid-area: 1 / 1; width: 100%; height: 100%; }
.kind__mark .kind__lit { color: var(--c-accent); opacity: var(--lit); transform: scale(calc(0.6 + var(--lit) * 0.4)); }
/* the route: dashed from behind the name to behind the card, drawn solid as the new client lands */
.kind__route { position: absolute; z-index: 1; top: calc(var(--edge) + 1rem); bottom: calc(var(--edge) + 1rem); width: 0; border-left: 2px dashed color-mix(in srgb, var(--c-paper) 92%, transparent); filter: drop-shadow(0 0 1px rgb(2 25 53 / 0.7)); }
.kind--l .kind__route { left: calc(var(--edge) + 1.3rem - 1px); }
.kind--r .kind__route { right: calc(var(--edge) + 1.3rem - 1px); }
.kind__route i { position: absolute; top: 0; left: -2px; width: 2px; height: 100%; background: var(--c-brand); box-shadow: 0 0 0 1.5px var(--c-paper); transform: scaleY(var(--draw)); transform-origin: 50% 0; }
.kind__card { position: absolute; z-index: 2; bottom: var(--edge); width: min(14rem, calc(100% - 2 * var(--edge))); opacity: var(--show); transform: translateY(calc((1 - var(--show)) * 10px)); }
/* the kit's hold: from the hidden end mark on, every route, card and lit mark fades out in place as the loop ends, never
   drawing or sliding back */
.kinds:has(.kit-end[data-kit-on]) .kind__route i { opacity: var(--kit-in, 1); transform: none; }
.kinds:has(.kit-end[data-kit-on]) .kind__card, .kinds:has(.kit-end[data-kit-on]) .kind__lit { transform: none; }
.kind--l .kind__card { left: var(--edge); }
.kind--r .kind__card { right: var(--edge); }
.kind__card .booking__title { font-size: 1.0625rem; white-space: nowrap; }
.kind--home .kind__photo { object-position: 45% 50%; }
.kind--outdoor .kind__photo { object-position: 40% 50%; }
.kind--law .kind__photo { object-position: 50% 40%; }
.kind--health .kind__photo { object-position: 40% 45%; }
.kind--events .kind__photo { object-position: 45% 45%; }
.kind--realestate .kind__photo { object-position: 55% 45%; }
.kind__line { margin-top: 1.1rem; font: 600 1.25rem/1.35 var(--font-display); color: var(--c-ink); }
.kind__fields { margin-top: 0.45rem; font-size: var(--fs-small); line-height: 1.5; color: var(--c-ink-soft); }
.kind-more { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem 1.75rem; padding: clamp(1.25rem, 2.6vw, 1.9rem) clamp(1.25rem, 3vw, 2.25rem); border: 1px solid var(--c-line); border-radius: var(--radius-m); }
.kind-more__mark { display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border: 1px solid var(--c-line); border-radius: var(--radius-s); background: var(--c-paper); color: var(--c-accent); }
.kind-more__mark .mark { width: 1.75rem; height: 1.75rem; }
.kind-more__title { font-size: 1.5rem; }
.kind-more__line { max-width: 40rem; margin-top: 0.35rem; color: var(--c-ink-soft); }

/* ---------- buyers: however they decide, on the pale blueprint ---------- */
.wwh-buyers__stage { position: relative; max-width: 1100px; margin: 0 auto; }
.wwh-buyers__scene { display: block; width: 100%; }
.wwh-buyers__stop { position: absolute; z-index: 2; right: 0; bottom: -3.25rem; }

/* ---------- plan: the free plan beside the bakery, laid over the photo's calm left edge ---------- */
.wwh-plan .band__in { container-type: inline-size; } /* the grid's width decides its layout (a container query styles only what is inside the container) */
.wwh-plan__grid { position: relative; }
.wwh-plan__frame { position: relative; margin: 0; overflow: hidden; border-radius: var(--radius-m); background: var(--c-paper-alt); box-shadow: var(--shadow-m); aspect-ratio: 2 / 1; }
.wwh-plan__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 52% 30%; }
.wwh-plan__stage { position: relative; z-index: 2; margin: -5rem 1.5rem 0; }
.wwh-plan__scene { display: block; }
.wwh-plan__stop { position: absolute; z-index: 8; top: 0.75rem; right: 0.75rem; }
.wwh-plan [data-scene="plancards"] .pc-stage { background-color: var(--c-paper-alt); background-image: linear-gradient(var(--c-grid) 1px, transparent 1px), linear-gradient(90deg, var(--c-grid) 1px, transparent 1px); background-size: var(--grid-cell) var(--grid-cell); }
.wwh-plan [data-scene="plancards"] .pc-stage::before { background: var(--pc-tint); }
@container (min-width: 1100px) {
  .wwh-plan__grid { display: grid; grid-template-columns: 50fr 14fr 36fr; }
  .wwh-plan__frame { grid-area: 1 / 2 / 2 / 4; aspect-ratio: auto; }
  .wwh-plan__stage { grid-area: 1 / 1 / 2 / 3; align-self: center; margin: 3rem 0; }
}

/* ---------- anyway: the chat on a white phone over the groomer's van ---------- */
.wwh-anyway__cta { justify-content: center; margin-top: 1.5rem; }
.wwh-anyway__frame { position: relative; height: clamp(34rem, 46vw, 40rem); overflow: hidden; border-radius: var(--radius-m); background: var(--c-paper-alt); box-shadow: var(--shadow-m); }
.wwh-anyway__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 35%; }
.wwh-anyway__stop { position: absolute; z-index: 3; top: 0.85rem; right: 0.85rem; }
.wwh-anyway__chat { position: absolute; z-index: 2; top: 50%; left: clamp(1.5rem, 7%, 6rem); transform: translateY(-50%); } /* its look: components.css */

/* ---------- close: the new member at the desk, her booking beside her, the words on the navy box ---------- */
.wwh-close { position: relative; display: flex; align-items: center; justify-content: flex-end; min-height: clamp(34rem, 44vw, 42rem); padding: clamp(2.5rem, 5vw, 4rem) var(--gutter); overflow: hidden; background: var(--c-ink); }
.wwh-close__media { position: absolute; inset: 0; }
.wwh-close__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 32%; }
.wwh-close__seq { position: absolute; inset: 0; pointer-events: none; }
.wwh-close__card { position: absolute; left: max(var(--gutter), calc((100% - var(--max-w)) / 2)); bottom: clamp(2rem, 5vw, 3.5rem); width: 15rem; opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 14px)); }
.wwh-close__box { position: relative; z-index: 2; width: clamp(24rem, 36vw, 32rem); margin-right: max(0px, calc((100% - var(--max-w)) / 2)); padding: clamp(1.75rem, 3.4vw, 2.75rem); border-radius: var(--radius-m); box-shadow: var(--shadow-l); text-align: center; color: var(--c-on-ink); }
.wwh-close__title { font-size: var(--fs-h2); color: var(--c-on-ink); }
.wwh-close__line { margin-top: 0.85rem; font-size: 1.125rem; line-height: 1.5; color: color-mix(in srgb, var(--c-on-ink) 80%, transparent); }
.wwh-close__cta { justify-content: center; margin-top: 1.5rem; }
.wwh-close__stop { position: absolute; z-index: 3; top: 1rem; right: 1rem; }

@media (max-width: 1023px) {
  .wwh-every__scene { height: 420px; }
}

@media (max-width: 899px) {
  .wwh-hero { --strip-h: clamp(6.25rem, calc((100svh - 64px - 23.5rem) / 3), 9.5rem); }
  .wwh-hero__tiles { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(3, var(--strip-h)); height: auto; }
  .wwh-tile--florist { --y: 0.02; }
  .wwh-tile--lawyer { --y: 0.12; }
  .wwh-tile--roofers { --x: 0.5; --y: 0.3; }
  .wwh-tile .wwh-tile__card { top: 50%; bottom: auto; width: 10.75rem; padding: 0.5rem 0.7rem 0.55rem; transform: translateY(calc(-50% + (1 - var(--kit-in, 1)) * 10px)); }
  .wwh-hero__tiles:has(.kit-end[data-kit-on]) .wwh-tile .wwh-tile__card { transform: translateY(-50%); }
  .wwh-tile__card .strip { margin-bottom: 0.3rem; padding-bottom: 0.3rem; font-size: 0.6875rem; }
  .wwh-tile__card .booking__title { font-size: 0.95rem; }
  .wwh-tile__card .booking__sub { margin-top: 0.1rem; font-size: 0.75rem; }
  .wwh-tile--florist .wwh-tile__card, .wwh-tile--roofers .wwh-tile__card { left: 0.75rem; }
  .wwh-tile--lawyer .wwh-tile__card { right: 0.75rem; }
  .wwh-hero__title span { display: inline; }
  .wwh-hero__line { font-size: 1.0625rem; }
  .wwh-hero__stop { top: calc(3 * var(--strip-h) + 6px - 3.1rem); right: 0.6rem; }

  /* the phone stands half on the photo, below her face and the dog's head, and hangs below it */
  .wwh-anyway__frame { height: 34rem; margin-bottom: 15rem; overflow: visible; }
  .wwh-anyway__photo { border-radius: var(--radius-m); object-position: 95% 30%; }
  .wwh-anyway__chat { top: calc(100% - 17rem); left: 50%; width: min(19rem, calc(100% - 2rem)); transform: translateX(-50%); }

  .wwh-close { display: block; min-height: 0; padding: 0; }
  .wwh-close__media { position: relative; inset: auto; height: clamp(20rem, 70vw, 28rem); }
  .wwh-close__photo { object-position: 40% 30%; }
  .wwh-close__card { left: 1rem; bottom: 1rem; width: 13.5rem; }
  .wwh-close__box { width: auto; margin: 0; padding: 2.5rem var(--gutter) 3rem; border-radius: 0; box-shadow: none; }
  .wwh-close__stop { top: 0.75rem; right: 0.75rem; }
}

@media (max-width: 759px) {
  .wwh-buyers__scene { min-height: 49rem; }
  .wwh-buyers__stop { top: 0.6rem; right: 0.6rem; bottom: auto; } /* in view as the tall column fills the screen */
}

@media (max-width: 699px) {
  .kinds { grid-template-columns: minmax(0, 1fr); }
  .kind-more { grid-template-columns: auto minmax(0, 1fr); }
  .kind-more__go { grid-column: 2; }
}

@media (max-width: 599px) {
  .wwh-every__scene { height: 400px; }
  .wwh-plan__frame { aspect-ratio: 4 / 3; }
  .wwh-plan__stage { margin: -3rem 0 0; }
}
