/* how-it-works.css: the How it works page (src\pages\how-it-works.mjs), the director's. It starts with the arsenal's
   composition `thread` and re-draws it in the site's motif: the route a faint line of day-ticks, the drawn line the
   brand's light through them, its head the site's mark (stroked, as the logo draws it), each number lit as the head
   plugs in. The line's lane is the first column of every part (--lane); words and pictures stay right of it. The
   parts keep no background of their own (they are positioned: a background would cover the line). */
@import url("../arsenal/thread.css");

/* ---------- the thread in the site's motif ---------- */
.hw { --lane: 52px; --lane-gap: 40px; --thread-radius: 40px; }
.hw .thread__track { stroke: color-mix(in srgb, var(--c-paper) 20%, transparent); stroke-width: 9px; stroke-linecap: butt; stroke-dasharray: 1.4 5.6; }
.hw .thread__glyph { fill: none; stroke: currentColor; stroke-width: 2.6px; stroke-linecap: round; stroke-linejoin: round; }

/* a step's number: dark until the head plugs in, then the brand's light, one ring spreading out (--lit-after) */
.hw-num { --l: calc(var(--lit, 0) * var(--lit, 0) * (3 - 2 * var(--lit, 0))); display: grid; place-items: center; width: var(--lane); height: var(--lane); border-radius: 50%; font: 700 19px/1 var(--font-display); letter-spacing: -0.02em;
  background: color-mix(in srgb, var(--c-brand) calc(var(--l) * 100%), var(--c-panel-2));
  color: color-mix(in srgb, var(--c-on-brand) calc(var(--l) * 100%), var(--c-paper));
  box-shadow: 0 0 0 6px var(--c-ink), inset 0 0 0 1px color-mix(in srgb, var(--c-hair-strong) calc((1 - var(--l)) * 100%), transparent), 0 0 30px -6px color-mix(in srgb, var(--c-brand) calc(var(--l) * 80%), transparent); }
.hw-node { --l: calc(var(--lit, 0) * var(--lit, 0) * (3 - 2 * var(--lit, 0))); grid-column: 1; grid-row: 1; justify-self: center; align-self: start; margin-top: 6px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: color-mix(in srgb, var(--c-brand) calc(var(--l) * 100%), var(--c-panel-2));
  box-shadow: 0 0 0 6px var(--c-ink), inset 0 0 0 1px color-mix(in srgb, var(--c-hair-strong) calc((1 - var(--l)) * 100%), transparent); }
.hw-node__mark { width: 18px; height: 18px; fill: none; stroke: color-mix(in srgb, var(--c-on-brand) calc(var(--l) * 100%), var(--c-brand)); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hw-num::after, .hw-node::after { content: ""; position: absolute; inset: 0; border-radius: 50%; 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)) * 28%), transparent); }

/* ---------- every part after the header: the lane, then the words and pictures ---------- */
.hw-in { display: grid; grid-template-columns: var(--lane) minmax(0, 1fr); column-gap: var(--lane-gap); }
.hw-in > * { grid-column: 2; }
.hw-in > .hw-node { grid-column: 1; grid-row: 1; }
.hw-in > .hw-steps { grid-column: 1 / -1; }
.hw-head { max-width: 780px; margin-bottom: clamp(40px, 5vw, 64px); }
.hw-head h2 { margin: 0 0 14px; font-size: var(--fs-h2); line-height: 1.08; letter-spacing: -0.02em; }
.hw-steps { display: grid; gap: clamp(64px, 7vw, 108px); margin: 0; padding: 0; list-style: none; }
.hw-step { display: grid; grid-template-columns: var(--lane) minmax(0, 5fr) minmax(0, 6fr); column-gap: var(--lane-gap); align-items: start; }
.hw-step--photo { grid-template-columns: var(--lane) minmax(0, 4fr) minmax(0, 8fr); }
.hw-text { padding-top: 6px; }
.hw-text h3 { margin: 0 0 12px; font: 600 var(--fs-h3)/1.2 var(--font-display); letter-spacing: -0.01em; }
.hw-text p { margin: 0; color: var(--c-text-soft); max-width: 46ch; }
.hw-text .hw-who { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font: 500 var(--fs-small)/1.3 var(--font-ui); color: var(--c-brand-on-ink); }
.hw-who__mark { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* the firm's steps: each scene on a framed dark stage, growing from its foot */
.hw-stage { position: relative; display: grid; align-items: end; justify-items: center; min-height: 340px; padding: clamp(22px, 3vw, 40px); border-radius: var(--radius-l); border: 1px solid var(--c-hair);
  background: radial-gradient(110% 80% at 100% 0%, rgba(0, 200, 255, 0.1), rgba(0, 200, 255, 0) 62%), var(--c-panel); }
.hw-stage [data-scene] { width: min(100%, 420px); }
.hw-stage [data-scene="leadbars"] { width: min(100%, 560px); }
.hw-stage__stop { top: 14px; right: 14px; }

/* our steps: each scene in dark glass over its photo, on the side clear of faces */
.hw-shot { position: relative; margin: 0; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius-l); background: var(--c-panel); box-shadow: var(--shadow-l); }
.hw-shot__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hw-shot--claims .hw-shot__img, .hw-shot--tune .hw-shot__img { object-position: 32% 50%; }
.hw-shot::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, 0.5)); }
.hw-shot__scene { position: absolute; z-index: 2; right: clamp(14px, 3%, 28px); bottom: clamp(14px, 4%, 28px); width: min(47%, 340px); }
.hw-shot__stop { top: 14px; right: 14px; }

/* ---------- the header: the words where the thread starts, the week filling up on a tablet ---------- */
.hwh { position: relative; overflow: clip; padding: clamp(108px, 11vw, 140px) 0 clamp(64px, 7vw, 104px); }
.hwh__in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(32px, 4vw, 56px); align-items: center; }
.hwh__words { max-width: 540px; }
.hwh h1 { margin: 0 0 20px; font-size: clamp(2.3rem, 1.2rem + 3.1vw, 4.1rem); line-height: 1.04; letter-spacing: -0.028em; }
.hwh h1 .nw { white-space: nowrap; }
.hwh .lede { margin: 0 0 32px; }
.hwh__media { --bleed: max(var(--gutter), (100vw - var(--max-w)) / 2); position: relative; container-type: inline-size; margin-right: calc(-1 * var(--bleed)); }
.hwh__frame { position: relative; overflow: hidden; container-type: size; height: clamp(560px, calc(100svh - 200px), 880px); border-radius: var(--radius-l) 0 0 var(--radius-l); background: #241a12; box-shadow: var(--shadow-l); }
/* the photo sized by the frame: the tablet's screen 46% of its width, 6% in from its left, centered in its height */
.hwh__photo { position: absolute; margin: 0; width: 149.64cqw; height: 99.76cqw; left: -22.03cqw; top: calc(50cqh - 49.07cqw); }
.hwh__photo > img { display: block; width: 100%; height: 100%; filter: brightness(0.66) saturate(0.85); }
.hwh__stop { top: 18px; right: 18px; }
/* over 300 px wide the chat's phone is 428 high, room for its whole story without cutting a line */
.hwh__chat { position: absolute; z-index: 2; right: 3cqw; top: 50%; width: clamp(304px, 36cqw, 320px); transform: translateY(-50%); }

/* the tablet's screen, designed at 360 x 480: this week's inspections */
.wk { position: absolute; inset: 0; display: grid; grid-template-rows: auto auto 1fr; overflow: hidden; padding: 22px 22px 18px; background: linear-gradient(180deg, #0B1218 0%, #05080B 100%); color: var(--c-paper); font-family: var(--font-ui); }
.wk__top { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 16px; }
.wk__top b { font: 700 24px/1.1 var(--font-display); letter-spacing: -0.01em; }
.wk__top span { font-size: 18px; color: var(--c-brand-light); }
.wk__days { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0 0 14px; padding: 0 0 14px; list-style: none; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.wk__days li { display: grid; justify-items: center; gap: 7px; }
.wk__days b { font: 600 18px/1 var(--font-ui); color: rgba(255, 255, 255, 0.7); }
.wk__days i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); transition: background 0.3s, box-shadow 0.3s; }
/* each day's dot lights once its inspection has landed (the kit marks a landed item data-kit-on) */
.wk:has(.wk__ev:nth-child(1)[data-kit-on]) .wk__days li:nth-child(1) i,
.wk:has(.wk__ev:nth-child(2)[data-kit-on]) .wk__days li:nth-child(2) i,
.wk:has(.wk__ev:nth-child(3)[data-kit-on]) .wk__days li:nth-child(3) i,
.wk:has(.wk__ev:nth-child(4)[data-kit-on]) .wk__days li:nth-child(4) i,
.wk:has(.wk__ev:nth-child(5)[data-kit-on]) .wk__days li:nth-child(5) i { background: var(--c-brand); box-shadow: 0 0 10px var(--c-glow); }
.wk__list { display: grid; align-content: start; gap: 9px; margin: 0; padding: 0; list-style: none; }
.wk__ev { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 12px 9px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border-left: 3px solid var(--c-brand);
  opacity: var(--kit-in, 0); transform: translateY(calc((1 - var(--kit-in, 0)) * 12px)); }
.wk__ev--new { background: rgba(0, 200, 255, 0.16); box-shadow: inset 0 0 0 1px rgba(0, 200, 255, 0.45); }
.wk__when { display: grid; gap: 3px; font-size: 18px; line-height: 1.1; color: rgba(255, 255, 255, 0.72); }
.wk__when b { font-weight: 700; color: var(--c-paper); }
.wk__what { display: grid; gap: 3px; min-width: 0; font-size: 17px; line-height: 1.15; color: rgba(255, 255, 255, 0.78); white-space: nowrap; }
.wk__what b { font: 700 19px/1.1 var(--font-ui); color: var(--c-paper); }

/* ---------- the audit: the plan building over the photo's right side ---------- */
.hwa__shot { position: relative; margin: 0; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius-l); background: #140e09; box-shadow: var(--shadow-l); }
.hwa__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 0% 35%; }
.hwa__shot::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgba(0, 0, 0, 0) 34%, rgba(0, 0, 0, 0.55) 62%); }
.hwa__scene { position: absolute; z-index: 2; right: clamp(16px, 2.6%, 32px); top: 50%; width: min(600px, 54%); height: 640px; transform: translateY(-50%); }
.hwa__scene > [data-scene] { width: 100%; height: 100%; }
.hwa__stop { top: 14px; right: 14px; }
/* the plan's badges draw the site's mark as the logo does: stroked, not filled */
.hwa__scene [data-scene="plan-builder"] .pb-badge path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
/* the plan's head in two lines at every width (its title, then "Nothing starts until you say yes" under it), so the
   title never squeezes behind the pill and the plan is as tall at every width; its rows sized so that, once open, it
   covers the list's lower steps whole, never across a line (step 13, finding 1) */
.hwa__scene [data-scene="plan-builder"] .pb-phead { flex-wrap: wrap; row-gap: 8px; }
.hwa__scene [data-scene="plan-builder"] .pb-ptitle { flex: 1 0 calc(100% - 47px); }
.hwa__scene [data-scene="plan-builder"] .pb-ready { margin-left: 47px; }
.hwa__scene [data-scene="plan-builder"] .pb-pil { min-height: 58px; }
@container (width < 600px) {
  .hwa__scene [data-scene="plan-builder"] .pb-ptitle { flex-basis: calc(100% - 41px); }
  .hwa__scene [data-scene="plan-builder"] .pb-ready { margin-left: 41px; }
  .hwa__scene [data-scene="plan-builder"] .pb-pil { min-height: 52px; }
}
@container (width < 420px) {
  .hwa__scene [data-scene="plan-builder"] .pb-pil { min-height: 60px; }
}
@container (width < 340px) {
  .hwa__scene [data-scene="plan-builder"] .pb-plan { top: 44%; }
  .hwa__scene [data-scene="plan-builder"] .pb-ptitle { flex-basis: 100%; }
  .hwa__scene [data-scene="plan-builder"] .pb-ready { margin-left: 0; }
  .hwa__scene [data-scene="plan-builder"] .pb-pil { min-height: 52px; }
}

/* ---------- the team: its answer arriving in the dashboard, over the photo's left side ---------- */
.hwt__shot { position: relative; margin: 0; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-l); background: var(--c-panel); box-shadow: var(--shadow-l); }
.hwt__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.hwt__stop { top: 14px; right: 14px; }
.hwt__chat { position: absolute; z-index: 2; left: clamp(16px, 3%, 36px); bottom: clamp(16px, 5%, 40px); width: min(400px, 40%); display: grid; padding: 16px 16px 18px; border-radius: var(--radius-m); }
.hwt__head { display: flex; align-items: center; gap: 10px; margin: 0; padding-bottom: 12px; border-bottom: 1px solid var(--c-hair); font: 600 15px/1.2 var(--font-ui); color: var(--c-paper); }
.hwt__head span { margin-left: auto; font-weight: 400; font-size: 13px; color: var(--c-text-faint); }
.hwt__head-mark { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--c-brand); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
/* a message takes room only as it lands, so the card never holds an empty space */
/* each message keeps its place and fades in it (the kit's hold): the loop ends in a fade, never the chat closing back */
.hwt__msg { margin: 12px 0 0; padding: 10px 14px; border-radius: 14px; opacity: var(--kit-in, 0); transform: translateY(calc((1 - var(--kit-in, 0)) * 8px)); font: 400 15px/1.4 var(--font-ui); }
.hwt__msg--me { justify-self: end; max-width: 86%; background: var(--c-brand); color: var(--c-on-brand); border-bottom-right-radius: 4px; }
.hwt__msg--team { justify-self: start; max-width: 94%; background: rgba(255, 255, 255, 0.09); color: var(--c-paper); border-bottom-left-radius: 4px; }
.hwt__msg--team b { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--c-brand-on-ink); }

/* ---------- the questions ---------- */
.hwf__list { max-width: 820px; border-top: 1px solid var(--c-line); }

/* ---------- the close: the thread ends in the main button ---------- */
.hwc .hw-in { grid-template-columns: var(--lane) minmax(0, 5fr) minmax(0, 6fr); align-items: center; }
.hwc .hw-in > .hwc__shot { grid-column: 3; }
.hwc h2 { margin: 0 0 16px; font-size: var(--fs-h2); line-height: 1.08; letter-spacing: -0.02em; }
.hwc .lede { margin: 0 0 32px; }
.hwc__btn { --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 16px 34px -14px color-mix(in srgb, var(--c-brand) calc(var(--l) * 85%), transparent); }
.hwc__shot { margin: 0; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius-l); box-shadow: var(--shadow-l); }
.hwc__img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }

/* ---------- under 1280: a tall frame, his face at its top, the audit's plan on the photo's lower part (no face) ---------- */
@media (max-width: 1279.98px) {
  .hwa__shot { aspect-ratio: auto; height: 1120px; }
  .hwa__img { object-position: 22% 0%; }
  .hwa__shot::after { background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.6) 55%); }
  .hwa__scene { top: auto; bottom: 16px; right: 50%; width: min(calc(100% - 32px), 720px); transform: translateX(50%); }
  .hwa__stop { top: auto; bottom: 666px; right: 16px; }
}

/* ---------- under 1100: each step's picture under its words ---------- */
@media (max-width: 1099.98px) {
  .hw-step, .hw-step--photo { grid-template-columns: var(--lane) minmax(0, 1fr); }
  .hw-step > .hw-num { grid-row: 1; }
  .hw-step > .hw-stage, .hw-step > .hw-shot { grid-column: 2; margin-top: 28px; }
  .hwc .hw-in { grid-template-columns: var(--lane) minmax(0, 1fr); }
  .hwc .hw-in > .hwc__shot { grid-column: 2; margin-top: 40px; }
}

/* ---------- under 1024: the header's picture under its words, full width ---------- */
@media (max-width: 1023.98px) {
  .hwh__in { grid-template-columns: minmax(0, 1fr); row-gap: 40px; }
  .hwh__words { max-width: 640px; }
  .hwh__media { margin-inline: calc(-1 * var(--gutter)); }
  .hwh__frame { height: 75cqw; border-radius: 0; }
}

/* ---------- the phone ---------- */
@media (max-width: 760px) {
  .hw { --lane: 36px; --lane-gap: 16px; }
  .hw-num { font-size: 15px; }
  .hw-node { width: 30px; height: 30px; margin-top: 2px; }
  .hw-node__mark { width: 15px; height: 15px; }
  .hwy .hw-in > .hw-head, .hwo .hw-in > .hw-head, .hwf .hw-in > .hw-head, .hwf .hw-in > .hwf__list, .hwc .hw-in > .hwc__words, .hwc .hw-in > .hwc__shot { grid-column: 1 / -1; }
  .hw-step > .hw-stage, .hw-step > .hw-shot { grid-column: 1 / -1; }
  .hw-stage { min-height: 310px; padding: 18px; }
  .hwh { padding-top: 96px; }
  .hwh h1 { font-size: clamp(2.05rem, 1.3rem + 3.4vw, 2.7rem); }
  .hwh__frame { height: 118cqw; }
  .hwh__photo { width: 240.7cqw; height: 160.5cqw; left: -32.08cqw; top: calc(50cqh - 78.95cqw); }
  /* the phone's header keeps the week on the tablet alone: the chat's own story plays in step 1 just below */
  .hwh__chat { display: none; }
  /* each card on its photo at every width: a tall frame, the face at its top, the card over its lower part */
  .hw-shot { aspect-ratio: auto; height: 620px; }
  .hw-shot--launch { height: 640px; }
  .hw-shot--tune { height: 740px; }
  .hw-shot--launch .hw-shot__img { object-position: 17% 50%; }
  .hw-shot--claims .hw-shot__img { object-position: 26% 50%; }
  .hw-shot--tune .hw-shot__img { object-position: 22% 50%; }
  /* his photo rises 130 px in its frame, so the card, at its tallest, stays under his chin */
  .hw-shot--tune .hw-shot__img { top: -130px; height: calc(100% + 130px); }
  .hw-shot::after { background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.55)); }
  .hw-shot__scene { left: 12px; right: 12px; bottom: 12px; width: auto; }
  .hwa .hw-in > .hwa__shot, .hwt .hw-in > .hwt__shot { grid-column: 1 / -1; margin-inline: calc(-1 * var(--gutter)); border-radius: 0; }
  .hwt__shot { aspect-ratio: auto; height: 600px; }
  .hwt__img { object-position: 66% 0%; }
  .hwt__chat { left: 12px; right: 12px; bottom: 12px; width: auto; }
  .hwc__shot { margin-top: 36px; }
}
@media (max-width: 599.98px) {
  .hwa__shot { height: 1150px; }
  .hwa__img { object-position: 26% 0%; }
  .hwa__scene { bottom: 12px; width: min(100%, 360px); height: 700px; }
  .hwa__stop { bottom: 662px; right: 20px; }
}

/* F3.6 (Arnold, 15 Nov): the "Example" tag on each demo (.eg-tag, design\components.css), placed per part: on the
   tablet's top row, between "This week" and "Inspections"; on the dark stages' top edge, left of their stop icon (the
   thread's line passes under their left edge); left of the audit's stop icon. */
.wk .eg-tag { top: 24px; left: 54%; right: auto; transform: translateX(-50%); padding: 4px 7px; font-size: 14px; letter-spacing: 0.04em; } /* drawn at about 0.8 on the phone: 11 px as shown */
.hw-stage > .eg-tag { right: 60px; }
.hwa__scene > .eg-tag { right: 56px; }
