/* who-we-help.css: places and sizes Who we help's parts (the components live in components.css). The site's rising bars
   carry the page: the header's five bars of footage, the wall of trades on its foot bars, the seven bars of kinds. */

/* ---------- hero: five bars of footage rising left to right, one live at a time ---------- */
.who-hero { position: relative; overflow: hidden; height: max(640px, min(calc(100svh - var(--header-h)), 860px)); background: var(--c-paper-alt); color: var(--c-ink); }
.who-hero__words { position: relative; z-index: 3; box-sizing: border-box; width: min(56vw, 760px); margin-left: max(var(--gutter), calc((100vw - var(--max-w)) / 2)); padding-top: clamp(32px, 6vh, 64px); }
.who-hero__words .lede { margin-top: 14px; max-width: 34em; color: var(--c-ink-soft); }
.who-hero__action { display: grid; justify-items: start; margin-top: 22px; }
.who-hero__action .cta-note { margin-top: 10px; }
.bars { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; align-items: end; padding-inline: 8px; }
.bar { position: relative; overflow: hidden; margin: 0; min-width: 0; border-radius: var(--radius-l) var(--radius-l) 0 0; background: var(--c-ink-raised); }
.bar:nth-of-type(1) { height: 30%; }
.bar:nth-of-type(2) { height: 37%; }
.bar:nth-of-type(3) { height: 45%; }
.bar:nth-of-type(4) { height: 70%; }
.bar:nth-of-type(5) { height: 95%; }
.bar:last-of-type::before { content: ""; position: absolute; inset: 0 0 auto; z-index: 3; height: 8px; background: var(--c-accent); }
.bar__clip { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: var(--pos, 50% 50%); opacity: 0; transition: opacity 900ms var(--ease-out, ease); }
.bar[data-kit-on] .bar__clip { opacity: 1; }
.bar__veil { position: absolute; inset: 0; z-index: 1; background: rgb(16 19 23 / 0.2); transition: opacity 900ms var(--ease-out, ease); }
.bar[data-kit-on] .bar__veil { opacity: 0; }
.bar__card { position: absolute; left: 12px; right: 12px; bottom: 14px; z-index: 2; display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--radius-m); background: var(--c-paper); color: var(--c-ink); box-shadow: var(--shadow-m); font-size: var(--fs-small); line-height: 1.25; opacity: 0; }
.bar[data-kit-on] .bar__card { opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 12px)); }
.bar[data-prev] .bar__card { opacity: 0; }
.bar__field { color: var(--c-ink-soft); }
.bars__stop { top: calc(5% + 18px); right: 20px; }
@media (max-width: 1023px) {
  .who-hero { height: auto; }
  .who-hero__words { width: auto; margin: 0; padding: 32px var(--gutter) 28px; }
  .bars { position: relative; inset: auto; height: 440px; }
  .bar:nth-of-type(1) { height: 44%; }
  .bar:nth-of-type(2) { height: 54%; }
  .bar:nth-of-type(3) { height: 66%; }
  .bar:nth-of-type(4) { height: 82%; }
  .bar:nth-of-type(5) { height: 100%; }
  .bars__stop { top: 18px; right: 18px; }
}
/* phone: the live bar opens and the others stand as slim bars, so all five keep their turn */
@media (max-width: 759px) {
  .bars { display: flex; gap: 5px; height: 420px; padding-inline: var(--gutter); }
  .bar { flex: 1 1 0; transition: flex-grow 900ms var(--ease-out, ease); }
  .bar[data-kit-on], .bars:not(:has([data-kit-on])) .bar:first-of-type { flex-grow: 5; }
  .bar__card { left: 8px; right: 8px; bottom: 8px; min-width: 150px; padding: 9px 10px; }
  .bars__stop { top: 6px; right: calc(var(--gutter) + 46px); }
}

/* ---------- every: the wall of trades, the H2 still at its middle ---------- */
.every { background: var(--c-ink); }
.every__stage { position: relative; height: 560px; }
.every__stage .every__scene { position: absolute; inset: 0; }
.every__plate { position: absolute; left: 50%; top: 50%; z-index: 2; translate: -50% -50%; width: max-content; max-width: min(620px, 90%); padding: 8px 20px; }
.every__plate h2 { margin: 0; text-align: center; font-size: clamp(2rem, 1.2rem + 2.6vw, 3.5rem); line-height: 1.04; }
.every__nb { white-space: nowrap; }
.every__stop { right: 24px; bottom: 20px; }
@media (max-width: 759px) {
  .every__stage { height: auto; }
  .every__plate { position: relative; left: auto; top: auto; translate: none; width: auto; max-width: none; padding: 20px calc(var(--gutter) + 40px) 44px var(--gutter); }
  .every__plate h2 { text-align: left; }
  .every__stage .every__scene { position: relative; inset: auto; height: 300px; }
  .every__stop { right: 12px; bottom: 44px; }
}

/* ---------- kinds: seven bars, tops rising, the one under the pointer open ---------- */
.kinds-part__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 48px; align-items: end; }
.kinds-part__head h2 { max-width: 15em; }
.kinds { list-style: none; display: flex; align-items: flex-end; gap: 10px; height: 640px; margin: clamp(24px, 3vw, 36px) 0 0; padding: 0; }
.kind { --open: 3.6; position: relative; flex: 1 1 0; min-width: 0; transition: flex-grow 480ms var(--ease-out, ease); }
.kind:nth-child(1) { height: 76%; }
.kind:nth-child(2) { height: 80%; }
.kind:nth-child(3) { height: 84%; }
.kind:nth-child(4) { height: 88%; }
.kind:nth-child(5) { height: 92%; }
.kind:nth-child(6) { height: 96%; }
.kind:nth-child(7) { height: 100%; }
.kind:first-child { flex-grow: var(--open); }
.kinds:has(.kind:not(:first-child) .kind__in:hover) .kind:first-child, .kinds:has(.kind:not(:first-child) .kind__in:focus-visible) .kind:first-child { flex-grow: 1; }
.kinds .kind:has(.kind__in:hover), .kinds .kind:has(.kind__in:focus-visible) { flex-grow: var(--open); }
.kind__in { position: absolute; inset: 0; display: block; overflow: hidden; border-radius: var(--radius-l); background: var(--c-ink-raised); color: var(--c-on-ink); text-decoration: none; }
.kind__photo { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: var(--pos, 50% 50%); }
.kind__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgb(16 19 23 / 0) 38%, rgb(16 19 23 / 0.82) 100%); }
.kind__tab { position: absolute; left: 50%; bottom: 18px; translate: -50% 0; writing-mode: vertical-rl; rotate: 180deg; white-space: nowrap; font-weight: 700; font-size: 1.0625rem; transition: opacity 240ms; }
.kind__text { position: absolute; left: 20px; bottom: 20px; width: min(340px, 30vw); display: grid; gap: 6px; opacity: 0; transition: opacity 240ms; pointer-events: none; }
.kind__name { font-family: var(--font-display); font-stretch: var(--stretch-display); font-weight: 800; font-size: 1.5rem; line-height: 1.1; letter-spacing: -0.02em; }
.kind__fields { color: var(--c-on-ink-soft); }
.kind__line { font-size: var(--fs-small); }
.kind__go { display: grid; place-items: center; width: 36px; height: 36px; margin-top: 6px; border-radius: var(--radius-s); background: var(--c-accent); color: var(--c-on-accent); }
.kind:first-child .kind__tab { opacity: 0; }
.kind:first-child .kind__text { opacity: 1; transition-delay: 160ms; }
.kinds:has(.kind:not(:first-child) .kind__in:hover) .kind:first-child .kind__tab, .kinds:has(.kind:not(:first-child) .kind__in:focus-visible) .kind:first-child .kind__tab { opacity: 1; }
.kinds:has(.kind:not(:first-child) .kind__in:hover) .kind:first-child .kind__text, .kinds:has(.kind:not(:first-child) .kind__in:focus-visible) .kind:first-child .kind__text { opacity: 0; transition-delay: 0ms; }
.kinds .kind__in:hover .kind__tab, .kinds .kind__in:focus-visible .kind__tab { opacity: 0; }
.kinds .kind__in:hover .kind__text, .kinds .kind__in:focus-visible .kind__text { opacity: 1; transition-delay: 160ms; }
.kind__in:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 3px; }
@media (max-width: 899px) {
  .kinds-part__head { grid-template-columns: 1fr; }
  .kinds { display: grid; height: auto; gap: 12px; }
  .kind, .kind:nth-child(n) { height: 340px; }
  .kind__tab { display: none; }
  .kind__text, .kind:first-child .kind__text { position: absolute; left: 16px; right: 16px; bottom: 16px; width: auto; opacity: 1; }
  .kinds:has(.kind:not(:first-child) .kind__in:hover) .kind:first-child .kind__text, .kinds:has(.kind:not(:first-child) .kind__in:focus-visible) .kind:first-child .kind__text { opacity: 1; }
  .kind__shade { background: linear-gradient(180deg, rgb(16 19 23 / 0) 26%, rgb(16 19 23 / 0.88) 78%); }
}

/* ---------- buyers: the scene across an ink band, the bars at its foot ---------- */
.buyers { position: relative; overflow: clip; background: var(--c-ink); padding-block: var(--section-y); }
.foot-rise { position: absolute; left: 0; right: 0; bottom: 0; display: block; width: 100%; height: clamp(120px, 22vw, 320px); max-width: none; fill: var(--c-ink-raised); }
.buyers__in { position: relative; }
.buyers__in h2 { margin-bottom: clamp(20px, 3vw, 32px); text-align: center; }
.buyers .buyers__stop { position: sticky; top: calc(var(--header-h) + 18px); z-index: 6; margin: 0 calc(var(--gutter) * -1 + 2px) -40px auto; }
.buyers__in .buyers__scene { position: relative; min-height: 460px; background: transparent; }
@media (max-width: 759px) {
  .buyers__in h2 { text-align: left; padding-right: 24px; }
}
/* the scene turns to one column under 760 px of its own width; its cards differ a little in height, so its box holds the
   tallest and the closing line stands at the box's foot, where it never moves */
@media (max-width: 826px) {
  .buyers__in .buyers__scene { min-height: 784px; }
  .buyers__in .buyers__scene .tb { align-self: stretch; grid-template-rows: minmax(0, 1fr) auto; }
  .buyers__in .buyers__scene .tb-cards { align-self: start; }
}

/* ---------- plan: the words over the hands at the left, the scene rising out of the frame at the right ---------- */
.who-plan__in { display: grid; grid-template-columns: minmax(0, 1fr) 620px; grid-template-rows: auto 420px; column-gap: 40px; }
.who-plan__words { grid-column: 1; grid-row: 1; padding-bottom: 36px; }
.who-plan__words .lede { margin-top: 12px; }
.who-plan__action { display: grid; justify-items: start; margin-top: 20px; }
.who-plan__action .cta-note { margin-top: 10px; }
.who-plan__frame { position: relative; grid-column: 1 / -1; grid-row: 2; overflow: hidden; border-radius: var(--radius-l); background: var(--c-ink-raised); }
.who-plan__photo { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 50% 50%; transform: scale(1.25); transform-origin: 100% 52%; }
.who-plan__in .who-plan__scene { position: relative; z-index: 2; grid-column: 2; grid-row: 1 / -1; align-self: start; height: 560px; margin-right: 24px; overflow: hidden; border-radius: var(--radius-l); box-shadow: var(--shadow-l); }
.who-plan__in .who-plan__stop { position: relative; z-index: 3; grid-column: 1; grid-row: 2; justify-self: end; align-self: start; margin: 16px 4px 0 0; }
@media (max-width: 1023px) {
  .who-plan__in { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .who-plan__frame { grid-column: 1; grid-row: 1; height: 340px; }
  .who-plan__photo { transform: none; object-position: 44% 50%; }
  .who-plan__in .who-plan__scene { grid-column: 1; grid-row: 2; justify-self: center; width: min(620px, 100%); height: 560px; margin: -64px 0 0; }
  .who-plan__words { grid-column: 1; grid-row: 3; padding: 28px 0 0; }
  .who-plan__in .who-plan__stop { margin: -54px 10px 0 0; }
}
@media (max-width: 599px) {
  .who-plan__frame { height: 280px; }
  .who-plan__in .who-plan__scene { height: 700px; }
}

/* ---------- anyway: the chat in a solid phone, the comb and the scissors in sight ---------- */
.anyway__head { display: grid; justify-items: center; gap: 10px; text-align: center; }
.anyway__head h2 { max-width: 18em; }
.anyway__frame { position: relative; overflow: hidden; height: 700px; margin-top: clamp(24px, 3vw, 36px); border-radius: var(--radius-l); background: var(--c-ink-raised); }
.anyway__photo { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 50% 40%; }
.anyway__frame .phone { position: absolute; left: 44px; top: 40px; margin: 0; }
@media (max-width: 899px) {
  .anyway__frame { height: 980px; }
  .anyway__photo { height: 700px; object-position: 62% 50%; }
  .anyway__frame .phone { left: 50%; top: auto; bottom: 12px; translate: -50% 0; width: min(360px, calc(100% - 24px)); }
  .anyway__frame .stop--corner { top: 296px; right: 12px; }
}

/* ---------- close ---------- */
.who-close .close__copy { max-width: 520px; }
@media (min-width: 900px) { .who-close .close { padding-block: clamp(120px, 14vw, 200px); } }
.who-close .close__clip { transform: scale(1.12); transform-origin: 0 30%; }
@media (max-width: 899px) {
  .who-close .close__clip { transform: none; object-position: 63% 50%; }
}
/* phone: both faces above the words: the clip keeps its own height, the words start under her chin */
@media (max-width: 699px) {
  .who-close .close--inner { padding-top: 300px; }
  .who-close .close__clip { height: 330px; object-position: 72% 50%; }
  .who-close .close__shade { background: linear-gradient(180deg, rgb(16 19 23 / 0) 41%, rgb(16 19 23 / 0.7) 47%, var(--c-ink) 50%); }
}
