/* How it works (plan.md, "How it works"). The thread composition carries the page: one chain of the site's mark (a
   rounded square, one new client) from the header's button through each step's number to the close's button. From
   1280 px it runs down the page's middle (the lane: each part keeps the middle clear, or lays a photo over it); under
   1280 the parts stack and the thread is a short line beside each part, from its number down. What lies over a lit
   photo takes z-index 2: the thread gives every lit photo and card z-index 1. */
@import url("../arsenal/thread.css");

@media (max-width: 1279.98px) { .hiw.thread { --thread-narrow: 1; } }

/* ---------- the step number: a larger rounded square the line plugs into; it fills as the head arrives ---------- */
.hiw-num { position: relative; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 17px; font-size: 17px; font-weight: 600; line-height: 1;
  --l: calc(var(--lit, 0) * var(--lit, 0) * (3 - 2 * var(--lit, 0)));
  background: color-mix(in srgb, var(--c-brand) calc(var(--l) * 100%), var(--c-white));
  color: color-mix(in srgb, var(--c-on-brand) calc(var(--l) * 100%), var(--c-ink-soft));
  box-shadow: 0 0 0 6px var(--thread-bg), inset 0 0 0 1px color-mix(in srgb, var(--c-line) calc((1 - var(--l)) * 100%), transparent), 0 12px 24px -10px color-mix(in srgb, var(--c-brand) calc(var(--l) * 70%), transparent); }
/* one ring spreads from it as the head plugs in, and fades */
.hiw-num::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; --a: var(--lit-after, 0);
  box-shadow: 0 0 0 calc((1 - (1 - var(--a)) * (1 - var(--a))) * 18px) color-mix(in srgb, var(--c-brand) calc((1 - var(--a)) * 26%), transparent); }
/* the small label under a step's words */
.hiw-meta { display: inline-flex; align-items: center; gap: 8px; margin: 2px 0 0; font-size: 13px; color: var(--c-ink-soft); }
.hiw-meta::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 3px; background: var(--c-brand); }
.hiw-step__text, .hiw-row__text { display: grid; gap: 10px; align-content: start; }
.hiw-step__text h3, .hiw-row__text h3 { font-size: var(--fs-h3); letter-spacing: var(--track-head); line-height: var(--lh-head); font-weight: var(--w-head); }
.hiw-step__text p:not(.hiw-meta), .hiw-row__text p:not(.hiw-meta) { max-width: 30rem; color: var(--c-ink-soft); }
.hiw h2 { font-size: var(--fs-h2); letter-spacing: var(--track-display); line-height: var(--lh-head); text-wrap: balance; }
.hiw .lead { font-size: var(--fs-lead); color: var(--c-ink-soft); max-width: var(--text-w); }

/* ---------- #hero: the headline centered on paper, the thread dropping from the button into a wide band ---------- */
.hiw-hero { padding: clamp(28px, 3.6vw, 48px) 0 64px; }
.hiw-hero__head { display: grid; justify-items: center; gap: clamp(12px, 1.3vw, 18px); text-align: center; }
.hiw-hero__title { font-size: clamp(2.375rem, 1.1rem + 3.9vw, 4.25rem); line-height: 1.02; letter-spacing: var(--track-display); font-weight: var(--w-display); max-width: 14ch; text-wrap: balance; }
.hiw-hero__lead { max-width: 34rem; font-size: var(--fs-lead); line-height: 1.45; color: var(--c-ink-soft); text-wrap: balance; }
.hiw-hero__cta { display: grid; justify-items: center; gap: 12px; margin-top: 6px; }
.hiw-hero__cta .cta-note { margin-top: 0; }
.hiw-hero__band { margin-top: clamp(28px, 3.4vw, 40px); aspect-ratio: 4 / 5; max-height: 620px; background: var(--c-paper-alt); }
.hiw-hero__img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 30% 50%; }
/* wyw: the notifications stack at the foot of its box (and hang 30 px under it) */
.scene.hiw-hero__scene { position: absolute; z-index: 2; left: 0; right: 0; top: 42%; bottom: 46px; }
@media (min-width: 700px) {
  .hiw-hero__cta { display: flex; align-items: center; gap: 14px 22px; }
  .hiw-hero__cta .cta-note { max-width: 17rem; text-align: left; }
  .hiw-hero__band { aspect-ratio: 16 / 9; max-height: none; }
  .hiw-hero__img { object-position: 40% 50%; }
  .scene.hiw-hero__scene { left: auto; right: clamp(16px, 3vw, 40px); top: 16px; bottom: 54px; width: min(380px, 48%); }
}
@media (min-width: 1280px) {
  .hiw-hero__band { aspect-ratio: 21 / 9; }
  .hiw-hero__img { object-position: 50% 58%; }
  /* all four notifications (the scene shows two in a box of 480 px or less); the feed ends high enough to stand in
     the first screen, over the empty wood right of the tablet */
  .scene.hiw-hero__scene { right: 28px; bottom: auto; width: 488px; height: 360px; }
}

/* ---------- #yours: the designed ground (the paper, a faint grid of rounded-square slots, the sunrise light in one
   corner), laid under the line (z-index -1), so the part itself paints no ground over it ---------- */
.hiw-ground { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(55% 60% at 100% 0%, color-mix(in srgb, var(--c-brand) 12%, transparent), transparent 70%), radial-gradient(38% 46% at 96% 4%, color-mix(in srgb, var(--c-accent) 15%, transparent), transparent 70%), var(--c-paper); }
.hiw-ground::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--c-ink) 7%, transparent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Crect x='8.5' y='8.5' width='39' height='39' rx='10' fill='none' stroke='black' stroke-width='1.2'/%3E%3C/svg%3E") 0 0 / 56px 56px repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Crect x='8.5' y='8.5' width='39' height='39' rx='10' fill='none' stroke='black' stroke-width='1.2'/%3E%3C/svg%3E") 0 0 / 56px 56px repeat; }
.hiw-yours__grid { display: grid; gap: 48px; }
.hiw-yours__head { display: grid; gap: var(--space-3); }
.hiw-step { display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 18px; row-gap: 22px; align-items: start; }
.hiw-step .hiw-num { grid-column: 1; grid-row: 1; }
.hiw-step__text { grid-column: 2; grid-row: 1; padding-top: 4px; }
.hiw-step__stage { grid-column: 2; grid-row: 2; position: relative; }
/* goal grows with its chat: it stands at the foot of a box of its full height */
.hiw-step__stage--goal { height: 340px; }
.scene.hiw-goal { position: absolute; left: 0; bottom: 0; width: min(100%, 420px); }
.scene.hiw-scan { width: min(100%, 420px); }
/* by the chat's foot, which stays put while the chat grows upward */
.hiw-step__stop { position: absolute; right: 0; bottom: -48px; }
@media (min-width: 1280px) {
  .hiw-yours__grid { grid-template-columns: minmax(0, 1fr) 128px minmax(0, 1fr); column-gap: 0; row-gap: 56px; align-items: start; }
  .hiw-yours__head { grid-column: 1; grid-row: 1; max-width: 34rem; }
  .hiw-step { grid-row: 2; column-gap: 0; row-gap: 26px; }
  .hiw-step .hiw-num { justify-self: center; }
  .hiw-step--1 { grid-column: 1 / span 2; grid-template-columns: minmax(0, 1fr) 128px; }
  .hiw-step--1 .hiw-num { grid-column: 2; }
  .hiw-step--1 .hiw-step__text, .hiw-step--1 .hiw-step__stage { grid-column: 1; justify-self: end; width: min(100%, 420px); }
  .hiw-step--2 { grid-column: 2 / span 2; grid-template-columns: 128px minmax(0, 1fr); margin-top: 210px; }
  .hiw-step--2 .hiw-num { grid-column: 1; }
  .hiw-step--2 .hiw-step__text, .hiw-step--2 .hiw-step__stage { grid-column: 2; justify-self: start; width: min(100%, 420px); }
  .scene.hiw-goal, .scene.hiw-scan { width: 100%; }
}

/* ---------- #plan: step 3, the plan itself in glass over the owner's evening at his desk ---------- */
.hiw-plan__head { display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 18px; align-items: start; }
.hiw-plan__text { display: grid; gap: var(--space-3); }
.hiw-plan__stage { position: relative; display: grid; margin: 36px auto 0; padding-inline: var(--gutter); max-width: var(--max-w); }
.hiw-plan__photo { margin: 0; height: max(400px, calc(min(100vw, var(--max-w)) / 1.5)); max-height: 560px; }
.hiw-plan__img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 45% 40%; }
/* the card stands 54% on the photo's foot, under the face; its source chips in ink (the rose text on its blush
   reads 4.2:1) */
.scene.hiw-plan__scene { --lb-chip-ink: var(--c-ink); position: relative; z-index: 2; width: min(560px, 100%); height: auto; margin: -236px auto 0; justify-self: center; }
@media (min-width: 1280px) {
  .hiw-plan__head { grid-template-columns: minmax(0, 1fr) 128px minmax(0, 1fr); column-gap: 0; }
  .hiw-plan__head .hiw-num { grid-column: 2; justify-self: center; }
  .hiw-plan__text { grid-column: 3; max-width: 34rem; }
  .hiw-plan__stage { display: block; max-width: none; padding: 0; margin-top: 44px; }
  .hiw-plan__photo { width: calc(62% - var(--frame)); height: auto; max-height: none; margin-left: var(--frame); aspect-ratio: 16 / 10; }
  .hiw-plan__img { object-position: 50% 40%; }
  /* over the window, bridging the photo's right edge; clear of the owner's face */
  .scene.hiw-plan__scene { position: absolute; left: calc(62% - 330px); top: 50%; translate: 0 -50%; width: 560px; margin: 0; }
}

/* ---------- #ours: steps 4 to 6, one business at work each, its scene in glass on the side clear of faces ---------- */
.hiw-ours__head { display: grid; gap: var(--space-3); margin-bottom: clamp(36px, 5vw, 72px); }
.hiw-ours__rows { display: grid; gap: clamp(56px, 8vw, 104px); max-width: var(--max-w); margin-inline: auto; padding-inline: var(--gutter); container-type: inline-size; }
.hiw-row { display: grid; }
.hiw-row--launch { --mh: 320px; --mpos: 45% 50%; --hang: 164px; }
.hiw-row--leads { --mh: 300px; --mpos: 80% 50%; --hang: 136px; }
.hiw-row--tune { --mh: 360px; --mpos: 100% 50%; --hang: 154px; }
/* narrower: the photo at its own shape or taller, the scene standing 54% on its foot (under the faces), the words under */
.hiw-row__media { position: relative; height: max(var(--mh), calc(100cqi / 1.78)); margin-bottom: var(--hang); }
.hiw-row__photo { position: absolute; inset: 0; margin: 0; }
.hiw-row__img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: var(--mpos); }
.scene.hiw-row__scene { position: absolute; z-index: 2; left: 50%; top: 100%; translate: -50% -54%; width: min(300px, calc(100% - 24px)); }
.hiw-row__stop { position: absolute; z-index: 3; top: 12px; right: 12px; }
.hiw-row__body { display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 18px; align-items: start; margin-top: 24px; }
.hiw-row__text { padding-top: 4px; }
@media (min-width: 1280px) {
  .hiw-ours__head { grid-template-columns: minmax(0, 1fr) 128px minmax(0, 1fr); column-gap: 0; }
  .hiw-ours__head > * { grid-column: 1; max-width: 36rem; }
  .hiw-ours__rows { max-width: none; padding-inline: var(--frame); container-type: normal; }
  .hiw-row { grid-template-columns: minmax(0, 1fr) 128px minmax(0, 1fr); align-items: center; }
  .hiw-row__media { grid-row: 1; height: auto; margin: 0; aspect-ratio: var(--wr); }
  .hiw-row[data-side="l"] .hiw-row__media { grid-column: 1; }
  .hiw-row[data-side="r"] .hiw-row__media { grid-column: 3; }
  .hiw-row__img { object-position: var(--wpos); }
  .scene.hiw-row__scene { left: 24px; top: auto; bottom: 24px; translate: none; width: var(--sw); }
  .hiw-row__body { grid-row: 1; margin: 0; column-gap: 0; }
  .hiw-row .hiw-num { justify-self: center; }
  .hiw-row[data-side="l"] .hiw-row__body { grid-column: 2 / span 2; grid-template-columns: 128px minmax(0, 1fr); }
  .hiw-row[data-side="r"] .hiw-row__body { grid-column: 1 / span 2; grid-template-columns: minmax(0, 1fr) 128px; }
  .hiw-row[data-side="r"] .hiw-num { grid-column: 2; grid-row: 1; }
  .hiw-row[data-side="r"] .hiw-row__text { grid-column: 1; grid-row: 1; justify-self: end; }
  .hiw-row__text { width: min(100%, 26rem); }
  /* each photo's shape, crop and card width at this size: the card on the side clear of faces */
  .hiw-row--launch { --wr: 1.3; --wpos: 0% 50%; --sw: 280px; }
  /* a little narrower than the photo, kept from its left edge: more sky beside the roofers for the card */
  .hiw-row--leads { --wr: 1.65; --wpos: 0% 50%; --sw: 290px; }
  .hiw-row--leads .scene.hiw-row__scene { left: 16px; }
  .hiw-row--tune { --wr: 16 / 9; --wpos: 50% 50%; --sw: 300px; }
}

/* ---------- #team: the café owner at her laptop; her dashboard's chat with the team in glass over the pastry case ---------- */
.hiw-team__grid { display: grid; gap: 28px; max-width: var(--max-w); margin-inline: auto; padding-inline: var(--gutter); }
.hiw-team__text { display: grid; gap: var(--space-3); grid-row: 1; }
.hiw-team__media { position: relative; display: grid; }
.hiw-team__photo { margin: 0; height: 400px; }
.hiw-team__img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 62% 30%; }
.hiw-dash { position: relative; z-index: 2; display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(360px, calc(100% - 24px)); height: 360px; margin: -195px auto 0; overflow: hidden; border-radius: var(--radius-l);
  background: color-mix(in srgb, var(--c-white) 80%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid color-mix(in srgb, var(--c-white) 64%, transparent); box-shadow: var(--shadow-l); font-family: var(--font-ui); color: var(--c-ink); }
.hiw-dash__bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid color-mix(in srgb, var(--c-line) 80%, transparent); font-size: 15px; }
.hiw-dash__bar b { font-weight: 600; }
.hiw-dash__mark { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--grad-sunrise); }
.hiw-dash__mark svg { width: 13px; height: 13px; fill: var(--c-white); }
.hiw-dash__live { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--c-ink-soft); }
.hiw-dash__live::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--c-brand); }
.hiw-dash__log { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 14px; overflow: hidden; }
.hiw-msg { margin: 0; max-width: 84%; padding: 9px 13px; border-radius: 18px; font-size: 14px; line-height: 1.4; opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 10px)); }
.hiw-dash [data-kit-msg]:not(:first-child) { opacity: calc(var(--kit-in, 1) * (1 - var(--kit-out, 0))); }
.hiw-msg--ask { align-self: stretch; max-width: none; display: grid; justify-items: start; gap: 10px; padding: 12px 14px 14px; border-radius: 16px; background: color-mix(in srgb, var(--c-paper) 70%, transparent); border: 1px solid color-mix(in srgb, var(--c-line) 70%, transparent); }
.hiw-msg__hint { font-size: 14px; color: var(--c-ink-soft); }
.hiw-dash__btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--radius-pill); border: 1.5px solid var(--c-ink); font-size: 14px; font-weight: 600; transition: none; }
.hiw-dash__btn[data-kit-on] { background: var(--c-ink); color: var(--c-paper); }
.hiw-msg--team { align-self: flex-start; display: grid; gap: 2px; background: var(--c-paper-alt); border-bottom-left-radius: 6px; }
.hiw-msg--team b { font-size: 13px; font-weight: 600; color: var(--c-brand-text); }
.hiw-msg--me { align-self: flex-end; background: var(--c-ink); color: var(--c-paper); border-bottom-right-radius: 6px; }
.hiw-msg--like { display: grid; place-items: center; padding: 8px 12px; background: var(--c-brand-light); color: var(--c-brand-text); }
.hiw-msg--typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: var(--c-paper-alt); border-bottom-left-radius: 6px; }
.hiw-msg--typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-ink-soft); animation: hiw-dot 1s infinite var(--ease-in-out); }
.hiw-msg--typing i:nth-child(2) { animation-delay: 0.15s; }
.hiw-msg--typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes hiw-dot { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-3px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hiw-msg--typing i { animation: none; } }
@media (min-width: 1280px) {
  .hiw-team__grid { grid-template-columns: minmax(0, 58fr) minmax(0, 42fr); align-items: center; gap: 0; max-width: none; padding: 0 max(var(--gutter), calc((100vw - var(--max-w)) / 2 + var(--gutter))) 0 0; }
  .hiw-team__text { grid-column: 2; grid-row: 1; padding-left: 150px; }
  .hiw-team__media { grid-column: 1; grid-row: 1; display: block; }
  .hiw-team__photo { height: auto; margin-left: var(--frame); aspect-ratio: 1.46; }
  .hiw-team__img { object-position: 50% 40%; }
  /* over the pastry case, bridging the photo's right edge */
  .hiw-dash { position: absolute; right: -96px; bottom: -32px; width: 360px; margin: 0; }
}

/* ---------- #faq: the middle stays clear for the line ---------- */
.hiw-faq__grid { display: grid; gap: 8px; }
@media (min-width: 1280px) {
  .hiw-faq__grid { grid-template-columns: minmax(0, 1fr) 128px minmax(0, 1fr); align-items: start; gap: 0; }
  .hiw-faq__grid > .section-head { grid-column: 1; position: sticky; top: 112px; }
  .hiw-faq__grid > .faq { grid-column: 3; }
}

/* ---------- #close: the thread ends in the picker's button, which takes a ring as the head arrives ---------- */
.hiw-close .close-frame__media > video { object-position: 50% 35%; }
.hiw-last { --l: calc(var(--lit, 0) * var(--lit, 0) * (3 - 2 * var(--lit, 0)));
  box-shadow: 0 0 0 calc(var(--l) * 7px) color-mix(in srgb, var(--c-brand) 18%, transparent), 0 8px 22px color-mix(in srgb, var(--c-brand) 32%, transparent); }
