/* site\assets\css\pages\who-we-help.css: the Who we help page (plan.md, Who we help), the director's. Tokens from
   design\system.css only. Grounds (D1): the header on its photos, every kind green, the kinds in photos white, however
   they buy dark, the free plan on the concrete, a way in on the tint, the close on its photo. */

#hero, #kinds, #photos, #buyers, #plan, #anyway, #close { scroll-margin-top: calc(var(--bar-h) + 16px); }

/* the work orders (.wo) are in design\components.css; each item of a sequence lands by its --kit-in */
[data-kit-scene="sequence"] [data-kit-at] { opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 12px)); }
.who-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.who-tools .stop { position: relative; }

/* ---------- hero: the words on a white plate, three trades at work below it, the one in turn widening ---------- */
.who-hero { position: relative; background: var(--c-paper-alt); }
.who-hero__head { position: relative; z-index: 3; display: grid; justify-items: center; padding-top: clamp(1.5rem, 1rem + 2vw, 2.75rem); }
.who-hero__plate { box-sizing: border-box; display: grid; justify-items: center; gap: var(--space-3); width: min(900px, 100%); margin-bottom: -28px; padding: clamp(1.5rem, 1rem + 1.6vw, 2.5rem) clamp(1.25rem, 1rem + 2vw, 3rem); border: 1px solid var(--c-line); border-radius: var(--radius-m); background: var(--c-paper); box-shadow: var(--shadow-l); text-align: center; }
.who-hero__title { max-width: 17ch; font-size: var(--fs-display); text-wrap: balance; }
.who-hero__line { max-width: 54ch; font-size: calc(var(--fs-body) * 1.08); color: var(--c-ink-soft); text-wrap: balance; }
.who-hero__actions { display: grid; justify-items: center; gap: var(--space-2); margin-top: var(--space-1); }
.who-hero__cta-line { font-size: var(--fs-small); color: var(--c-ink-soft); }
.who-hero__stage { position: relative; display: flex; gap: 10px; height: clamp(460px, 44vw, 640px); padding: 0 10px 10px; }
.who-slide { position: relative; flex: 1 1 0; min-width: 0; margin: 0; overflow: hidden; border-radius: var(--radius-m); background: var(--c-line); transition: flex-grow 1.1s var(--ease-in-out); }
.who-slide[data-kit-on], .who-hero__stage:not(:has([data-kit-on])) .who-slide:first-of-type { flex-grow: 2.3; }
.who-slide__media { position: absolute; inset: 0; overflow: hidden; }
.who-slide__media > img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; }
.who-slide--solar img { object-position: 50% 30%; }
.who-slide--roofing img { object-position: 46% 30%; }
.who-slide--plumbing img { object-position: 67% 30%; }
/* each trade's booked job lands at its foot while it is the one in turn */
.who-slide__card { position: absolute; z-index: 2; left: 20px; bottom: 24px; width: min(290px, calc(100% - 40px)); opacity: 0; transform: translateY(16px); transition: opacity 0.5s var(--ease-out), transform 0.6s var(--ease-out); }
.who-slide[data-kit-on] .who-slide__card, .who-hero__stage:not(:has([data-kit-on])) .who-slide:first-of-type .who-slide__card { opacity: 1; transform: none; transition-delay: 0.6s; }
.who-hero__stop { top: 14px; right: 24px; }
@media (prefers-reduced-motion: reduce) { .who-slide, .who-slide__card { transition: none; } }

/* ---------- kinds: tradeblocks on the green ---------- */
.scene.who-kinds__scene { height: 480px; }
.who-kinds .demo-tag { border-color: transparent; }
/* its booked line wraps under the job where the card is narrow, so no time is cut off (step 13, #4) */
.who-kinds .who-kinds__scene .tb-foot > span { flex-wrap: wrap; align-content: center; row-gap: 0; }

/* ---------- photos: seven trades at work, each "Booked" landing in turn ---------- */
.who-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.4vw, 22px); margin: 0; padding: 0; list-style: none; }
.who-tile--any { grid-column: 1 / -1; }
.who-tile__link { position: relative; display: grid; grid-template-rows: auto 1fr; height: 100%; overflow: hidden; border: 1px solid var(--c-line); border-radius: var(--radius-m); background: var(--c-paper); color: inherit; text-decoration: none; box-shadow: var(--shadow-s); transition: box-shadow var(--dur-med) var(--ease-out), border-color var(--dur-med) var(--ease-out); }
.who-tile__link:hover { border-color: color-mix(in srgb, var(--c-brand) 40%, var(--c-line)); box-shadow: var(--shadow-m); }
.who-tile__top { position: relative; display: block; }
.who-tile__pic.frame { display: block; aspect-ratio: 4 / 3; border-radius: 0; }
.who-tile--any .who-tile__pic.frame { aspect-ratio: auto; height: clamp(260px, 25vw, 360px); }
.who-tile--solar img { object-position: 50% 40%; }
.who-tile--hvac img { object-position: 50% 30%; }
.who-tile--remodel img { object-position: 50% 45%; }
.who-tile--landscape img { object-position: 50% 55%; }
.who-tile--any img { object-position: 70% 40%; }
/* at the photo's foot, clear of the faces above */
.who-tile__booked { position: absolute; z-index: 2; left: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 9px; border: 1px solid var(--c-line); border-radius: var(--radius-s); background: var(--c-paper); box-shadow: var(--shadow-m); font-family: var(--font-ui); font-size: 0.9rem; font-weight: 700; color: var(--c-ink); }
.who-tile__blk { width: 18px; height: 18px; }
.who-tile__strip { display: grid; align-content: start; gap: 6px; padding: 16px 18px 18px; }
.who-tile__name { font-family: var(--font-display); font-stretch: var(--stretch-display); font-size: var(--fs-h3); font-weight: 800; line-height: 1.15; }
.who-tile__means { color: var(--c-ink-soft); }
.who-tile__go { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; font-family: var(--font-ui); font-weight: 700; color: var(--c-brand-text); }
.who-tile__go .button__arrow { transition: transform var(--dur-fast) var(--ease-out); }
.who-tile__link:hover .who-tile__go .button__arrow { transform: translateX(3px); }
.who-tile--any .who-tile__link { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); grid-template-rows: auto; }
.who-tile--any .who-tile__strip { align-content: center; padding: 24px 28px; }

/* ---------- buyers: three-buyers on the dark green ---------- */
.scene.who-buyers__scene { height: 460px; }
/* where its cards are narrow, each compared business shows its name over its stars, so no name is cut; in one
   column the Picked chip sits higher, clear of the stars under the name (step 13, #5) */
@container (width < 1100px) {
  .who-buyers .who-buyers__scene .tb-biz { grid-template-columns: minmax(0, 1fr); align-content: center; row-gap: 2px; }
  .who-buyers .who-buyers__scene .tb-biz b { font-size: 14px; }
  .who-buyers .who-buyers__scene .tb-rt { font-size: 13px; }
  .who-buyers .who-buyers__scene .tb-rt small { font-size: 12px; }
}
@container (width < 760px) {
  .who-buyers .who-buyers__scene .tb-pick { top: -9px; }
}

/* ---------- plan: plan-builder over the handshake at the door ---------- */
.who-plan__head { margin-bottom: clamp(1.5rem, 1rem + 1.5vw, 2.25rem); }
.who-plan__pic { position: relative; margin: 0; height: 780px; }
.who-plan__frame { position: absolute; inset: 0; }
.who-plan__frame img { object-position: 50% 45%; }
.who-plan__tools { position: absolute; z-index: 4; top: 16px; right: 40px; width: 380px; margin: 0; }
/* plan-builder's column (under 600 px it lays out as 360 x 700), on the tradesman's side, the handshake clear */
.scene.who-plan__scene { position: absolute; z-index: 3; top: 60px; right: 40px; width: 380px; height: 700px; }

/* ---------- anyway: a trade not on the list, booked all the same ---------- */
.who-anyway__in { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; gap: clamp(2rem, 1rem + 3.5vw, 4.5rem); }
.who-anyway__pic { position: relative; margin: 0; height: clamp(440px, 40vw, 560px); }
.who-anyway__frame { position: absolute; inset: 0; }
.who-anyway__frame img { object-position: 60% 40%; }
.who-anyway__job { position: absolute; z-index: 2; left: 24px; bottom: 24px; width: min(300px, 64%); }
.who-anyway__stop { left: 24px; bottom: 230px; }
.who-anyway__words { display: grid; gap: var(--space-3); }
.who-anyway__words .head__title { font-size: var(--fs-h2); text-wrap: balance; }
.who-anyway__words .head__line { max-width: 40ch; }

/* ---------- close: the landscaper reading her new booking ---------- */
.who-close .endband__media > img { object-position: 60% 40%; }
.who-close__demo { position: absolute; z-index: 2; left: 48%; bottom: clamp(28px, 4vw, 56px); width: min(320px, 26%); }
.who-close__stop { top: -46px; right: 0; }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) {
  .who-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .who-close__demo { left: auto; right: var(--gutter); width: min(290px, 34%); }
}
@media (max-width: 900px) {
  .who-anyway__in { grid-template-columns: minmax(0, 1fr); }
  .who-tile--any .who-tile__link { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  /* the plan: the photo, plan-builder laid over its lower part (at least half on it), the tools under it */
  .who-plan__pic { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--top) var(--o) var(--rest) auto; height: auto; --top: 260px; --o: 280px; --rest: 280px; }
  .who-plan__frame { position: relative; inset: auto; grid-row: 1 / 3; grid-column: 1; }
  .scene.who-plan__scene { position: relative; inset: auto; grid-row: 2 / 4; grid-column: 1; width: auto; height: auto; margin-inline: 12px; }
  /* the tag and the stop icon just above the scene, over the photo's edges (the handshake stays in the middle), so the
     icon is in view as the scene first fills the screen */
  .who-plan__tools { position: relative; inset: auto; z-index: 4; grid-row: 1; grid-column: 1; align-self: end; width: auto; margin: 0 12px 10px; }
}
@media (max-width: 820px) {
  .scene.who-kinds__scene { height: 600px; }
}
@media (max-width: 815px) {
  /* three-buyers goes to one column below a 760 px box (a window of about 815 px): the box keeps the room of its
     tallest card and grows rather than cut it (step 13, #6) */
  .scene.who-buyers__scene { height: auto; min-height: 880px; }
}
@media (max-width: 760px) {
  .who-hero__plate { margin-bottom: -20px; }
  .who-hero__title { font-size: clamp(2rem, 1.1rem + 4.6vw, 2.5rem); }
  .who-hero__line { font-size: 1rem; }
  /* one tall photo at a time */
  .who-hero__stage { display: block; height: 600px; padding: 0 12px 12px; }
  .who-slide { position: absolute; inset: 0 12px 12px; opacity: 0; transition: opacity 1s var(--ease-out); }
  .who-slide[data-kit-on], .who-hero__stage:not(:has([data-kit-on])) .who-slide:first-of-type { opacity: 1; z-index: 1; }
  .who-hero__stop { top: 24px; right: 24px; }
  .who-grid { grid-template-columns: minmax(0, 1fr); }
  .who-close__demo { left: 16px; right: auto; top: 16px; bottom: auto; width: min(260px, 70%); }
  .who-close__stop { top: 0; right: auto; left: calc(100% + 10px); }
}
@media (max-width: 599px) {
  .who-plan__pic { --o: 350px; --rest: 350px; }
  .who-anyway__pic { height: 440px; }
  /* the stop icon beside the card's foot (above it, the card's taller words reached it) */
  .who-anyway__stop { left: calc(24px + min(300px, 64%) + 10px); bottom: 24px; }
}
