/* How it works: the page's own look (plan.md "How it works"). The page is the arsenal's `thread`: one line drawn down
   the page through the main button, the numbers 01 to 06 and the last button. On a wide screen its lane is the page's
   center (each part keeps its words off it, or lets the line pass behind a photo, a card or a plate); under 900 px the
   numbers stand at the left and the content beside them, so the line runs down the left. No part has a background of
   its own (it would cover the line): a part's ground is a ::before at z-index -1, under the line. */
@import url("../arsenal/thread.css");

.hiw-thread { --thread-ink: var(--c-brand); --thread-w: 2.5px; }

/* the step numbers: they fill with the brand as the line reaches them, and give one ring as it plugs in */
.hiw-num {
  position: relative; z-index: 1; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%;
  font: 700 1.05rem/1 var(--font-display); letter-spacing: 0.02em; background: var(--c-paper);
  color: color-mix(in srgb, var(--c-on-brand) clamp(0%, (var(--lit, 1) - 0.5) * 1000%, 100%), var(--c-brand-text));
  box-shadow: inset 0 0 0 2px var(--c-brand);
}
.hiw-num::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 50%; background: var(--c-brand); opacity: clamp(0, (var(--lit, 1) - 0.4) * 5, 1); }
.hiw-num::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 calc(var(--lit-after, 1) * 18px) var(--c-brand); opacity: calc((1 - var(--lit-after, 1)) * 0.3);
}
/* a photo the line passes behind comes to full color as the line reaches it */
.hiw-photo > img, .hiw-photo > video, .hiw-photo > figure > img { filter: saturate(calc(0.6 + 0.4 * var(--lit, 1))); }

.hiw-step__title { margin: 0; font: 700 clamp(1.3rem, 1.05rem + 0.7vw, 1.6rem)/1.25 var(--font-display); letter-spacing: -0.01em; color: var(--c-ink); }
.hiw-step__text { margin: 10px 0 0; max-width: 46ch; color: var(--c-ink-soft); }

/* ---------- hero: centered words, then one wide frame: the tablet's week filling, the notifications beside it ---------- */
.hiwh { position: relative; padding-block: clamp(28px, 3vw, 44px) clamp(64px, 7vw, 104px); }
.hiwh__inner { display: grid; justify-items: center; text-align: center; }
.hiwh__title { margin: 0; max-width: 17ch; font-size: clamp(2.2rem, 1.3rem + 2.3vw, 3.3rem); line-height: 1.08; letter-spacing: -0.025em; }
.hiwh__line { margin: 14px 0 0; max-width: 48ch; font-size: var(--fs-lead); color: var(--c-ink-soft); }
.hiwh__go { display: flex; align-items: center; gap: 18px; margin-top: 24px; }
.hiwh__go .cta-row__line { text-align: left; }
.hiwh__stage { position: relative; width: 100%; margin-top: clamp(28px, 3vw, 40px); text-align: left; }
.hiwh__frame { --pw: 1420px; --cx: 700px; height: clamp(540px, 45vw, 640px); }
/* the photo drawn 1420 px wide (the tablet's screen about 400 px, its words at full size), the screen's center 700 px from
   the frame's left: the photo still covers the frame, and the tablet clears the notifications (their 480 px box) */
.hiwh__fig { position: absolute; margin: 0; width: var(--pw); aspect-ratio: 3 / 2; left: calc(var(--cx, 57%) - var(--pw) * 0.5089); top: calc(50% - var(--pw) * 0.2836); }
.hiwh__app { position: absolute; inset: 0; background: var(--c-paper); }
.scene.hiwh__cal { position: absolute; inset: 0; padding: 18px 10px; }
.scene.hiwh__wyw { position: absolute; left: 0; top: 0; height: 430px; width: 480px; }
.hiwh__stop { top: 16px; right: 16px; }

/* ---------- yours: steps 1 and 2 on the designed ground, the lane between them ---------- */
.hiwy { position: relative; padding-block: var(--section-y); overflow: clip; }
.hiwy::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--c-paper-alt); }
.frame-motif.hiwy__ground { z-index: -1; width: min(760px, 66vw); left: -14vw; bottom: -26%; }
.hiwy__inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 168px minmax(0, 1fr); column-gap: 28px; row-gap: 26px; }
/* the head sits on a plate of the ground's own color: the line passes behind it, never through its words */
.head.hiwy__head { grid-column: 1 / -1; grid-row: 1; justify-self: center; justify-items: center; text-align: center; margin: 0 0 clamp(28px, 4vw, 48px); padding: 6px 24px; background: var(--c-paper-alt); }
.hiwy__lane { display: contents; }
.hiwy__n1 { grid-column: 2; grid-row: 2; justify-self: center; align-self: start; }
.hiwy__time {
  grid-column: 2; grid-row: 2; justify-self: center; align-self: end; display: grid; place-content: center; gap: 4px;
  width: 168px; height: 168px; margin: 0; border-radius: 50%; text-align: center; background: var(--c-paper);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c-brand) 30%, transparent), var(--shadow-m);
}
.hiwy__time b { font: 700 1.6rem/1.08 var(--font-display); letter-spacing: -0.01em; color: var(--c-ink); }
.hiwy__time span { font: 500 var(--fs-label)/1.3 var(--font-ui); color: var(--c-ink-soft); }
.hiwy__n2 { grid-column: 2; grid-row: 3; justify-self: center; align-self: start; }
.hiwy__step--1 { grid-column: 1; grid-row: 2; justify-self: end; width: min(100%, 440px); padding-top: 8px; }
.hiwy__step--2 { grid-column: 3; grid-row: 3; justify-self: start; width: min(100%, 440px); padding-top: 8px; }
.hiwy__scene { position: relative; margin-top: 22px; }
.hiwy__step--1 .hiwy__scene { height: 300px; }
.scene.hiwy__goal { position: absolute; left: 0; right: 0; bottom: 0; max-width: 420px; }
.scene.hiwy__scan { max-width: 420px; }
.hiwy__stop { right: 0; bottom: -52px; }

/* ---------- ours: steps 3 to 6, photos alternating around the lane ---------- */
.hiwo { position: relative; padding-block: var(--section-y); }
.hiwo__inner { display: grid; row-gap: clamp(56px, 6vw, 88px); }
.head.hiwo__head { max-width: min(560px, calc(50% - 80px)); margin: 0; }
.hiwo__row { display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr); column-gap: 32px; align-items: start; }
.hiwo__num { grid-column: 2; grid-row: 1; justify-self: center; }
.hiwo__media { position: relative; grid-row: 1; padding-bottom: 96px; }
.hiwo__text { grid-row: 1; width: min(100%, 420px); padding-top: 12px; }
.hiwo__row--l .hiwo__media { grid-column: 1; }
.hiwo__row--l .hiwo__text { grid-column: 3; justify-self: start; }
.hiwo__row--r .hiwo__media { grid-column: 3; }
.hiwo__row--r .hiwo__text { grid-column: 1; justify-self: end; }
.hiwo__frame { aspect-ratio: 5 / 4; }
.hiwo__img--dentist { object-position: 35% 40%; }
.hiwo__img--roofer { object-position: 50% 25%; }
.hiwo__img--law { object-position: 50% 50%; }
.hiwo__img--landscaper { object-position: 20% 50%; }
/* each step's scene over the side of its photo clear of faces, hanging below the frame */
.scene.hiwo__scene { position: absolute; z-index: 2; bottom: 0; height: 300px; }
.scene.hiwo__scene--bars { right: 14px; width: min(340px, 64%); }
/* launch: its lines wrap at this width, so its stage takes V2's height for wrapped lines and the note lands above them */
.scene.hiwo__scene--launch { left: 10px; width: 270px; height: 374px; }
.scene.hiwo__scene--leads { left: 14px; width: 340px; }
.scene.hiwo__scene--tune { left: 12px; width: 280px; height: 350px; }
.hiwo__stop { top: 14px; left: 14px; }

/* ---------- inside: the plan's three cards over the photo of an agent reading hers ---------- */
.hiwi { position: relative; padding-block: var(--section-y); }
.head.hiwi__head { max-width: min(560px, calc(50% - 80px)); }
.hiwi__stage { position: relative; }
.hiwi__frame { height: clamp(560px, 46vw, 660px); }
.hiwi__frame > img { object-position: 50% 30%; }
.scene.hiwi__scene { position: absolute; z-index: 2; left: 24px; top: 50%; width: min(540px, 45%); transform: translateY(-50%); --pc-stage: transparent; --pc-tint: transparent; }
/* its cards float on the photo itself: the stage's own panel (ground, glow, edge) is left out here */
.scene.hiwi__scene .pc-stage { border-color: transparent; box-shadow: none; }
.scene.hiwi__scene .pc-stage::before { display: none; }
.hiwi__stop { top: 16px; right: 16px; }

/* ---------- team: the words, then the owner's office with her dashboard chat ---------- */
.hiwt { position: relative; padding-block: var(--section-y); }
.hiwt__inner { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); column-gap: clamp(32px, 4vw, 56px); align-items: start; }
.hiwt__text { display: grid; gap: 14px; padding-top: clamp(12px, 3vw, 40px); }
.hiwt__list { display: grid; gap: 12px; margin: 10px 0 0; padding: 0; list-style: none; }
.hiwt__list li { position: relative; padding-left: 28px; color: var(--c-ink-soft); }
.hiwt__list li::before { content: ""; position: absolute; left: 4px; top: 0.5em; width: 10px; height: 10px; border-radius: 50%; background: var(--c-accent); box-shadow: 0 0 0 4px var(--c-brand-light); }
.hiwt__list b { color: var(--c-ink); }
.hiwt__stage { position: relative; }
.hiwt__frame { aspect-ratio: 3 / 2; }
.hiwt__frame > img { object-position: 60% 40%; }
.scene.hiwt__scene { position: absolute; z-index: 2; left: 24px; bottom: 24px; width: min(340px, 52%); }
/* the chat as the owner sees it on her screen: her message on the right in the brand's green, the team's answer on the left */
.scene.hiwt__scene .fr-them { justify-self: end; border-radius: 18px 18px 5px 18px; background: var(--c-brand); color: var(--c-on-brand); font-weight: 650; transform-origin: 100% 100%; }
.scene.hiwt__scene .fr-mine { justify-items: start; }
.scene.hiwt__scene .fr-mine > * { transform-origin: 0 100%; }
.scene.hiwt__scene .fr-us { border-radius: 18px 18px 18px 5px; background: color-mix(in srgb, var(--c-ink) 7%, transparent); color: var(--c-ink); font-weight: 500; }
.scene.hiwt__scene .fr-typing { border-radius: 18px 18px 18px 5px; background: color-mix(in srgb, var(--c-ink) 7%, transparent); }
.hiwt__stop { top: 16px; right: 16px; }

/* ---------- faq: on the pale ground; the list is a plate the line passes behind ---------- */
.hiwq { position: relative; padding-block: var(--section-y); }
.hiwq::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--c-paper-alt); }
.hiwq__inner { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(28px, 4vw, 64px); align-items: start; }
.hiwq__list { background: var(--c-paper-alt); }

/* ---------- close: the full-bleed clip, the box over it, the line ending in its button ---------- */
.hiwc { position: relative; padding-top: var(--section-y); }
.hiwc__band { display: grid; align-items: center; min-height: clamp(560px, 46vw, 680px); border-radius: 0; }
.hiwc__band > video { object-position: 70% 35%; }
.hiwc__inner { position: relative; z-index: 2; display: grid; justify-items: center; padding-block: 48px; }
.close__box.hiwc__box { position: relative; left: auto; top: auto; transform: none; width: min(580px, 100%); justify-items: center; text-align: center; }
.hiwc__go { display: grid; justify-items: center; gap: 10px; }
.hiwc__seq { position: absolute; z-index: 2; left: clamp(20px, 5vw, 72px); bottom: 32px; }
.hiwc__item { opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 12px)); }
.hiwc__stop { top: 24px; right: 24px; }

/* ---------- under 900 px: one column, the numbers at the left, the line beside them ---------- */
@media (max-width: 899px) {
  .hiwh__go { flex-direction: column; gap: 10px; }
  .hiwh__go .cta-row__line { text-align: center; }
  .hiwh__frame { --pw: 1100px; --cx: 50%; height: 660px; }
  .hiwh__fig { top: calc(230px - var(--pw) * 0.2836); }
  .scene.hiwh__wyw { top: auto; bottom: 30px; width: auto; max-width: 470px; right: 0; height: 200px; }

  .hiwy__inner { grid-template-columns: 58px minmax(0, 1fr); column-gap: 14px; row-gap: 22px; }
  .head.hiwy__head { justify-self: start; justify-items: start; text-align: left; padding: 0; background: none; margin-bottom: 8px; }
  .hiwy__n1 { grid-column: 1; grid-row: 2; }
  .hiwy__step--1 { grid-column: 2; grid-row: 2; justify-self: stretch; width: auto; padding-top: 10px; }
  .hiwy__time { grid-column: 2; grid-row: 3; justify-self: start; align-self: start; width: 132px; height: 132px; }
  .hiwy__time b { font-size: 1.3rem; }
  .hiwy__n2 { grid-column: 1; grid-row: 4; }
  .hiwy__step--2 { grid-column: 2; grid-row: 4; justify-self: stretch; width: auto; padding-top: 10px; }
  .hiwy__step--1 .hiwy__scene { height: 290px; }
  .frame-motif.hiwy__ground { width: 420px; left: auto; right: -200px; bottom: -80px; }

  .head.hiwo__head { max-width: none; }
  .hiwo__row { grid-template-columns: 58px minmax(0, 1fr); column-gap: 14px; }
  .hiwo__num { grid-column: 1; grid-row: 1; }
  .hiwo__row .hiwo__text { grid-column: 2; grid-row: 1; justify-self: stretch; width: auto; }
  .hiwo__row .hiwo__media { grid-column: 1 / -1; grid-row: 2; margin-top: 18px; padding-bottom: 0; }
  /* each card stays on its photo: a taller frame, the faces above the card (below it for the landscapers) */
  .hiwo__frame { aspect-ratio: auto; height: 520px; }
  .scene.hiwo__scene, .scene.hiwo__scene--bars, .scene.hiwo__scene--launch, .scene.hiwo__scene--leads, .scene.hiwo__scene--tune { left: 8px; right: auto; bottom: 12px; width: calc(100% - 16px); max-width: 420px; height: 290px; }
  .hiwo__media:has(.hiwo__img--dentist) .hiwo__frame { height: 600px; }
  .scene.hiwo__scene--bars { height: 360px; }
  .hiwo__img--dentist { object-position: 25% 30%; }
  /* launch: its lines wrap on a phone too, so its stage is taller and the note lands above them; it hangs 50 px below
     its photo, as on the computer, so the roofer's face stays clear above it */
  .hiwo__media:has(.hiwo__img--roofer) { padding-bottom: 50px; }
  .hiwo__media:has(.hiwo__img--roofer) .hiwo__frame { height: 560px; }
  .scene.hiwo__scene--launch { height: 340px; bottom: 0; }
  .hiwo__media:has(.hiwo__img--law) .hiwo__frame { height: 640px; }
  .hiwo__img--law { object-position: 55% 50%; }
  .hiwo__media:has(.hiwo__img--landscaper) .hiwo__frame { height: 680px; }
  .hiwo__img--landscaper { object-position: 45% 50%; }
  .scene.hiwo__scene--tune { top: 12px; bottom: auto; }

  .head.hiwi__head { max-width: none; }
  .hiwi__frame { height: 760px; }
  .hiwi__frame > img { object-position: 55% 50%; }
  .scene.hiwi__scene { left: 8px; top: auto; bottom: 12px; width: calc(100% - 16px); transform: none; }

  .hiwt__inner { grid-template-columns: minmax(0, 1fr); row-gap: 28px; }
  .hiwt__text { padding-top: 0; }
  .hiwt__frame > img { object-position: 30% 40%; }
  .scene.hiwt__scene { position: relative; left: auto; bottom: auto; width: auto; margin: -56px 12px 0; }

  .hiwq__inner { grid-template-columns: minmax(0, 1fr); }

  .hiwc__band { align-items: end; min-height: 680px; }
  .hiwc__band > video { object-position: 80% 30%; }
  .hiwc__inner { padding-block: 20px; }
  .hiwc__seq { left: 14px; top: 16px; bottom: auto; }
  .hiwc__stop { top: 16px; right: 16px; }
}
