/* site\assets\css\pages\how-it-works.css: the How it works page (plan.md, How it works), the director's. Tokens from
   design\system.css only. Grounds (D1): the header on its footage, your part tint, our steps white, the plan green,
   who runs it dark, the questions alt, the close on its photo. The work order (.wo) and the chat in a phone (.cp) are
   in design\components.css. */

#hero, #yours, #ours, #inside, #team, #faq, #close, .hw-step { scroll-margin-top: calc(var(--bar-h) + 16px); }
[data-kit-scene="sequence"] [data-kit-at] { opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 12px)); }
/* the close's work order keeps the kit's hold; its "Arrived" note comes and goes quickly in place, never sinking back
   the way it came (step 13, #8) */
.hw-close__job .wo__note[data-kit-at] { opacity: clamp(0, (var(--kit-in, 1) - 0.7) * 3.4, 1); transform: none; }
.hw-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.hw-tools .stop { position: relative; }

/* ---------- hero: the work goes on behind; the words on a white panel, the notifications stacking on the right ---------- */
.hw-hero { position: relative; display: grid; align-items: center; min-height: min(calc(100svh - var(--bar-h)), 760px); overflow: hidden; background: var(--c-ink); }
.hw-hero__media { position: absolute; inset: 0; overflow: hidden; --pos: 50% 40%; }
.hw-hero__media > :is(img, video) { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: var(--pos); }
.hw-hero__in { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: center; gap: 2rem; padding-block: clamp(2rem, 1rem + 3vw, 4rem); }
/* the panel keeps to the clip's left 43%: the plasterer (his head 44-50% across) works between it and the
   notifications (from 61%) */
.hw-hero__panel { position: relative; box-sizing: border-box; display: grid; justify-items: start; gap: var(--space-3); width: min(520px, 100%); padding: clamp(1.75rem, 1.2rem + 2vw, 3rem); border-radius: var(--radius-m); background: var(--c-paper); color: var(--c-ink); box-shadow: var(--shadow-l); }
/* the h1's size, so its two sentences keep to three lines on the panel */
.hw-hero__title { font-size: clamp(2.1rem, 1.3rem + 2.2vw, 3.2rem); text-wrap: balance; }
.hw-hero__line { max-width: 40ch; font-size: calc(var(--fs-body) * 1.08); color: var(--c-ink-soft); }
.hw-hero__actions { display: grid; justify-items: start; gap: var(--space-2); margin-top: var(--space-1); }
.hw-hero__cta-line { font-size: var(--fs-small); color: var(--c-ink-soft); }
/* the line of blocks starts under the button: three blocks below the panel, on the line's own x (22 px in) */
.hw-start { position: absolute; left: 15px; top: 100%; display: grid; gap: 4px; padding-top: 8px; }
.hw-start i, .hw-end i { display: block; width: 14px; height: 16px; background: var(--c-brand); clip-path: polygon(50% 3%, 96% 24%, 96% 72%, 50% 94%, 4% 72%, 4% 24%); transition: transform 0.5s var(--ease-out), opacity 0.4s var(--ease-out); }
.hw-start i:nth-child(2), .hw-end i:nth-child(2) { opacity: 0.75; transition-delay: 0.08s; }
.hw-start i:nth-child(3), .hw-end i:nth-child(3) { opacity: 0.5; transition-delay: 0.16s; }
.react-on .hw-hero[data-react~="in"]:not(.is-in) .hw-start i, .react-on .hw-close[data-react~="in"]:not(.is-in) .hw-end i { opacity: 0; transform: translateY(-10px); }
.hw-hero__stage { justify-self: end; width: min(480px, 100%); }
.hw-hero__tools { justify-content: flex-end; }
.hw-hero__tools .demo-tag { border-color: transparent; }
.scene.hw-hero__scene { position: relative; height: 400px; }

/* ---------- the line of blocks: down the left of your part and our steps, a block per step ---------- */
.hw-path { position: relative; --rail-x: calc(max(var(--gutter), (100% - var(--max-w)) / 2) + 22px); --rail-w: 76px; }
.hw-rail { position: absolute; z-index: 1; top: 0; bottom: 0; left: calc(var(--rail-x) - 7px); width: 14px; overflow: hidden; pointer-events: none; background: color-mix(in srgb, var(--c-ink) 16%, transparent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='19' viewBox='0 0 14 19'%3E%3Cpath d='M7 1L13 4.5V11.5L7 15L1 11.5V4.5Z'/%3E%3C/svg%3E") 0 0 / 14px 19px repeat-y;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='19' viewBox='0 0 14 19'%3E%3Cpath d='M7 1L13 4.5V11.5L7 15L1 11.5V4.5Z'/%3E%3C/svg%3E") 0 0 / 14px 19px repeat-y; }
.hw-rail__fill { position: absolute; left: 0; top: 0; width: 100%; height: calc(var(--fill, 1) * 100%); background: var(--c-brand); }
.hw-rail__head { position: absolute; z-index: 1; left: var(--rail-x); top: calc(var(--fill, 1) * 100%); width: 30px; height: 30px; transform: translate(-50%, -50%); pointer-events: none; }
.hw-path .hw-head, .hw-path__cta { margin-left: var(--rail-w); }
.hw-steps { display: grid; gap: clamp(1.5rem, 1rem + 2vw, 2.75rem); margin: 0; padding: 0; list-style: none; }
.hw-step { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: calc(var(--rail-w) - 44px); align-items: start; }
/* each step's number, a block that clicks into place as the line's head reaches it (--at from how-it-works.js) */
.hw-no { position: relative; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; margin-top: 22px; --on: clamp(0, calc((var(--fill, 1) - var(--at, 0)) * 40), 1); }
.hw-no__blk { position: absolute; inset: 0; width: 100%; height: 100%; transform: translateY(calc((1 - var(--on)) * -14px)) scale(calc(0.7 + var(--on) * 0.3)); filter: grayscale(calc(1 - var(--on))); opacity: calc(0.45 + var(--on) * 0.55); transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s var(--ease-out), opacity 0.4s var(--ease-out); }
.hw-no b { position: relative; margin-top: -9px; font-family: var(--font-ui); font-size: 0.95rem; font-weight: 800; line-height: 1; color: var(--c-ink); }
.hw-row .hw-no { margin-top: 0; }

/* ---------- your part: three work-order cards on the tint ---------- */
.hw-card { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); align-items: center; gap: clamp(1.5rem, 1rem + 2vw, 3rem); padding: clamp(18px, 1rem + 1vw, 28px); box-shadow: var(--shadow-m); }
.hw-card__words { display: grid; justify-items: start; gap: 12px; }
.hw-card__title { font-size: var(--fs-h3); }
.hw-card__line { max-width: 44ch; color: var(--c-ink-soft); }
.hw-who { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; padding: 5px 12px 5px 9px; border-radius: var(--radius-s); background: var(--c-brand-light); color: var(--c-brand-text); font-family: var(--font-ui); font-size: 0.9rem; font-weight: 700; line-height: 1.4; }
.hw-who--you { background: color-mix(in srgb, var(--c-accent) 12%, var(--c-paper)); color: var(--c-accent-text); }
.hw-who__ico { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.hw-card__demo { position: relative; display: grid; justify-items: center; padding: 14px 18px 22px; border-radius: var(--radius-m); background: var(--c-paper-alt); }
.hw-card__demo .hw-tools { justify-self: stretch; }
/* 300 px wide or less: hiw-chat's shorter phone (368 high), so its first messages fill more of it */
.scene.hw-card__scene--chat { width: min(300px, 100%); }
.scene.hw-card__scene--scan { width: min(400px, 100%); }
.hw-plan { width: min(330px, 100%); padding: 4px 0 2px; }

/* ---------- our steps: a framed photo per step, its scene on the side clear of faces ---------- */
.hw-ours .hw-steps { gap: clamp(2.5rem, 1.5rem + 3vw, 4.5rem); }
.hw-row__body { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: center; gap: clamp(1.5rem, 1rem + 3vw, 4rem); }
.hw-row--flip .hw-row__body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); }
.hw-row--flip .hw-row__pic { grid-column: 2; grid-row: 1; }
.hw-row--flip .hw-row__words { grid-column: 1; grid-row: 1; }
.hw-row__pic { position: relative; height: clamp(440px, 38vw, 540px); }
.hw-row__frame { position: absolute; inset: 0; }
.hw-row--hiw-launch .hw-row__frame img { object-position: 30% 40%; }
.hw-row--hiw-jobs .hw-row__frame img { object-position: 60% 35%; }
.hw-row--hiw-tune .hw-row__frame img { object-position: 42% 35%; }
.hw-row__demo { position: absolute; z-index: 2; bottom: 24px; width: min(360px, 52%); }
.hw-row__demo--right { right: 24px; }
.hw-row__demo--left { left: 24px; }
.hw-row--hiw-jobs .hw-row__demo { width: min(320px, 48%); }
.hw-row--hiw-tune .hw-row__demo { width: min(330px, 42%); }
.hw-row__demo .demo-tag { border-color: transparent; }
.scene.hw-row__scene--launch { height: 310px; } /* room for its "You're live" note above the list (step 13, #7) */
.scene.hw-row__scene--tune { height: 370px; }
/* Saira's tall letters: newclients' row words on a line of 1.5, the margins giving back the height (Lessons) */
.hw-ours [data-scene="newclients"] .nc-row b { line-height: 1.5; margin-block: -2.6px; }
.hw-row__words { display: grid; justify-items: start; gap: 12px; }
.hw-row__title { font-size: var(--fs-h2); text-wrap: balance; }
.hw-row__line { max-width: 40ch; color: var(--c-ink-soft); }

/* ---------- the plan: plancards on the green ---------- */
.hw-inside__head { margin-bottom: clamp(1.5rem, 1rem + 1.5vw, 2.25rem); }
.hw-inside__tools .demo-tag { border-color: transparent; }
/* the cards stand on the green band's own field of blocks (the designed ground), not on a white stage */
.hw-inside [data-scene="plancards"] .pc-stage { border-color: transparent; background: transparent; box-shadow: none; }
.hw-inside [data-scene="plancards"] .pc-stage::before { display: none; }
/* what the plan holds, in the page's own words under the cards (the scene's caption look; each lit with its card) */
.hw-caps { list-style: none; display: grid; gap: 12px; margin: 20px 0 0; padding: 0; }
@media (min-width: 800px) { .hw-caps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
.hw-caps li { position: relative; overflow: hidden; padding: 18px 20px 20px; border-radius: var(--radius-m); background: var(--c-paper); border: 1px solid var(--c-line); box-shadow: var(--shadow-s); }
.hw-caps li::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 3px; background: linear-gradient(90deg, var(--c-brand), var(--c-brand-dark)); transform: scaleX(var(--on, 0)); transform-origin: left; }
.hw-caps__title { margin: 0 0 6px; font: 700 18px/1.25 var(--font-display); color: var(--c-ink); }
.hw-caps__text { margin: 0; font: 400 15px/1.65 var(--font-text); color: var(--c-ink-soft); }

/* ---------- who runs it: the team answers from the dashboard, over the work they bring ---------- */
.hw-team__in { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; gap: clamp(2rem, 1rem + 4vw, 5rem); }
.hw-team__pic { position: relative; height: clamp(520px, 42vw, 600px); }
.hw-team__frame { position: absolute; inset: 0; }
.hw-team__frame img { object-position: 50% 30%; }
/* the phone on the bright window side (right), his cheek's edge in the middle top clear of it */
.hw-team__phone { position: absolute; z-index: 2; right: 20px; bottom: 24px; width: 270px; min-height: 360px; }
.hw-team__stop { right: 20px; bottom: calc(24px + 370px); }
.hw-team__words { display: grid; justify-items: start; gap: var(--space-3); }
.hw-team__words .head__title { font-size: var(--fs-h2); text-wrap: balance; }
.hw-team__blk { width: 30px; height: 30px; }
.hw-daily { width: min(460px, 100%); margin-top: var(--space-2); color: var(--c-ink); }
.hw-daily__blk { width: 18px; height: 18px; }
.hw-daily__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 8px 0; list-style: none; }
.hw-daily__list li { display: flex; align-items: center; gap: 10px; padding: 10px 18px; font-family: var(--font-ui); font-weight: 700; line-height: 1.35; }
.hw-daily__ico { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--c-brand-text); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.cp-press__ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- the questions ---------- */
.hw-faq__in { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr); align-items: start; gap: clamp(2rem, 1rem + 4vw, 5rem); }
.hw-faq__head { margin-bottom: 0; }
.hw-faq__cta { margin-top: var(--space-3); }

/* ---------- close: a technician at his van, about to start a booked job; the line ends in the button ---------- */
.hw-close .endband__media > img { object-position: 60% 55%; }
.hw-end { display: grid; gap: 4px; justify-items: start; margin: 2px 0 -4px 6px; }
.hw-end i { background: var(--c-brand-on-ink); }
/* over the clear top of the photo, right (he faces into his van, lower right) */
.hw-close__demo { position: absolute; z-index: 2; right: max(var(--gutter), calc((100% - var(--max-w)) / 2)); top: clamp(28px, 4vw, 56px); width: min(290px, 30%); }
.hw-close__stop { bottom: -46px; right: 0; }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) {
  .hw-card { grid-template-columns: minmax(0, 1fr); }
  .hw-card__words .hw-card__line { max-width: 60ch; }
}
@media (max-width: 900px) {
  /* the header: the words first, then the footage with the notifications over its lower part (they start below the
     first screen of a phone, so the cookie notice never covers them) */
  .hw-hero { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto var(--top) var(--o) minmax(var(--rest), auto); min-height: 0; background: var(--c-paper-alt); --top: 340px; --o: 240px; --rest: 80px; }
  .hw-hero__in { display: contents; }
  .hw-hero__panel { grid-row: 1; grid-column: 1; width: auto; margin: 16px var(--gutter); }
  .hw-start { display: none; }
  .hw-hero__media { position: relative; inset: auto; grid-row: 2 / 4; grid-column: 1; align-self: stretch; }
  .hw-hero__stage { position: relative; z-index: 1; grid-row: 3 / 5; grid-column: 1; align-self: start; justify-self: center; width: min(440px, calc(100% - 2 * var(--gutter))); margin-bottom: 24px; }
  .scene.hw-hero__scene { height: 300px; }
  .hw-row__body, .hw-row--flip .hw-row__body { grid-template-columns: minmax(0, 1fr); }
  .hw-row--flip .hw-row__pic, .hw-row--flip .hw-row__words { grid-column: auto; grid-row: auto; }
  /* a row's photo, its scene laid over the lower part (more than half on it), faces clear above */
  .hw-row__pic { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--top) var(--o) minmax(var(--rest), auto); height: auto; --top: 220px; --o: 230px; --rest: 110px; }
  .hw-row__frame { position: relative; inset: auto; grid-row: 1 / 3; grid-column: 1; }
  .hw-row__demo, .hw-row--hiw-jobs .hw-row__demo, .hw-row--hiw-tune .hw-row__demo { position: relative; inset: auto; grid-row: 2 / 4; grid-column: 1; justify-self: center; width: calc(100% - 24px); max-width: 380px; }
  .hw-team__in { grid-template-columns: minmax(0, 1fr); }
  .hw-team__pic { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--top) var(--o) minmax(var(--rest), auto); height: auto; --top: 220px; --o: 240px; --rest: 120px; }
  .hw-team__frame { position: relative; inset: auto; grid-row: 1 / 3; grid-column: 1; }
  .hw-team__phone { position: relative; right: auto; bottom: auto; grid-row: 2 / 4; grid-column: 1; justify-self: center; width: min(290px, calc(100% - 24px)); }
  .hw-team__stop { top: calc(var(--top) - 48px); right: auto; bottom: auto; left: 14px; }
  .hw-faq__in { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .hw-path { --rail-x: calc(var(--gutter) + 16px); --rail-w: 48px; }
  .hw-step { grid-template-columns: 32px minmax(0, 1fr); column-gap: 16px; }
  .hw-no { width: 32px; height: 32px; margin-top: 16px; }
  .hw-no b { margin-top: -7px; font-size: 0.8rem; }
  .hw-rail__head { width: 24px; height: 24px; }
  .hw-hero__title { font-size: clamp(2rem, 1.1rem + 4.6vw, 2.5rem); }
  /* the chat's phone as wide as the card allows (up to 300 px), so its lines wrap as on a computer */
  .hw-card { padding: 12px 8px; }
  .hw-card__demo { padding: 10px 0 12px; }
  .hw-card__demo .hw-tools { padding-inline: 8px; }
  .hw-daily__list { grid-template-columns: minmax(0, 1fr); }
  .hw-close__demo { left: 16px; right: auto; top: 16px; width: min(250px, 66%); }
  .hw-close__stop { top: 0; right: auto; bottom: auto; left: calc(100% + 10px); }
}
