/* public/clankford-site/how.css, How it works only (loaded by lib/clankford-site.js for
 * "/how-it-works"), round 16 H4 "Watch it happen", picked by Michal on 15 Oct 2026.
 * Ported from the mockup at /home/studio/clankford-ie-samples/round16/h4-watch-it-happen
 * (scripts/parts/page.css). site.css stays the base: header, footer, type, buttons, .holo,
 * .kicker, .faq, the close band, and the pieces this page shares with the home page
 * (.ic, .dot, .swap, .sure__ic). Prefix hw- for everything new.
 * The demo pieces are the home page's chat pieces, larger and with less on them:
 *   .hw-in      the incoming message   (the .cfv2-rec record head)
 *   .hw-draft   Clankford's reply      (.cfv2-chat__say, the agent voice, with its face)
 *   .hw-yes     the approval card      (.cfv2-yes: amber while it waits, green once sent)
 *   .hw-learn   "Learned from you"     (.cfv2-learn)
 *   .hw-next    "Next time"            (the .cfv2-auto automation line)
 * Round 26 (Michal approved 15 to 20 Oct 2026, mockup round25/how-it-works): "What needs your yes" with a
 * Clank Floor picture (.yes2), the close with a photo (.closer--pic), the questions as the shared .qa block
 * (site.css), and round 25's "less noise" folded in below: no dashed slots, no placeholder labels, the
 * after row only once the Yes is pressed, no three-step strip (its buttons stay), no job tag.
 * Front door: vault/Workspaces/clank-websmith/projects/clankford-ie/PROJECT.md */

/* the mockup's type scale for this page, as home.css has it (same specificity as site.css, which loads first) */
h2 { font-size: clamp(2rem, 3.6vw, 3.2rem); }
p { text-wrap: pretty; }
.lead { font-size: clamp(1.08rem, 1.3vw, 1.18rem); }
.btn-row { gap: 12px 16px; }

.hw-stage .bot { --bot-alpha: 1; --bot-lit: #7cc6f0; --bot-eye: #e6f7ff; } /* design-check-ignore: V2 HUD colour, as home.css .demo .bot */

/* the page head, the picker and the close with a photo are the inner page template, in site.css */

/* ── the replay control, quieter (the picker itself is the inner page template in site.css) ── */
.hw-replay {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-left: auto; padding: 0 12px;
  border: 0; border-radius: 6px; background: none; color: var(--hud-text); font: 600 .95rem/1 var(--body); cursor: pointer; opacity: .8;
}
.hw-replay .ic { color: var(--hud); }
.hw-replay:hover { background: var(--hud-wash); }
.hw-replay:hover, .hw-replay:focus-visible { opacity: 1; }

/* ── the stage: one big panel, a slim top bar like the dashboard's chat head ── */
.hw-stage { margin-top: 12px; padding-bottom: clamp(18px, 1.8vw, 24px); }
.hw-stage__top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding: 10px clamp(18px, 2.4vw, 30px); border-bottom: 1px solid var(--hud-faint); font-size: .92rem;
}
.hw-stage__me { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.hw-stage__note { margin-left: auto; font-size: .88rem; color: var(--hud-dim); }

/* the three steps, left to right, an arrow between each */
.hw-flow {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.28fr) minmax(0, .94fr); column-gap: clamp(48px, 5vw, 76px);
  margin: 0; padding: clamp(18px, 1.8vw, 24px) clamp(18px, 2.4vw, 30px) 0; list-style: none;
}
.hw-step { position: relative; display: grid; grid-template-rows: auto 1fr; gap: 12px; min-width: 0; }
.hw-step__label {
  display: flex; align-items: center; gap: 10px; margin: 0;
  font-size: .78rem; font-weight: 700; letter-spacing: .16em; line-height: 24px; text-transform: uppercase; color: var(--hud-dim);
  transition: color .25s var(--ease);
}
.hw-step__n {
  display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--hud-faint); border-radius: 6px;
  font-size: .75rem; letter-spacing: 0; color: var(--hud-dim);
  transition: border-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
}
.hw-step.is-on .hw-step__label { color: var(--hud); }
.hw-step.is-on .hw-step__n { border-color: var(--hud); color: var(--hud); box-shadow: 0 0 10px var(--hud-faint); }

/* a slot holds the room a piece lands in, so nothing moves when it arrives; no outline (round 25) */
.hw-slot { position: relative; display: grid; align-items: center; min-height: 184px; }
.hw-slot > * { grid-area: 1 / 1; }

/* the arrow into each step: a line that fills, then its head */
.hw-step + .hw-step::before, .hw-step + .hw-step::after { content: ""; position: absolute; pointer-events: none; }
.hw-step + .hw-step::before {
  top: calc(50% + 18px); right: calc(100% + 12px); width: calc(clamp(48px, 5vw, 76px) - 24px); height: 2px;
  background: linear-gradient(90deg, var(--hud) 50%, var(--hud-faint) 50%); background-size: 200% 100%; background-position: 100% 0;
  transition: background-position .45s var(--ease);
}
.hw-step + .hw-step::after {
  top: calc(50% + 14px); right: calc(100% + 13px); width: 10px; height: 10px;
  border-top: 2px solid var(--hud-faint); border-right: 2px solid var(--hud-faint); transform: rotate(45deg);
  transition: border-color .2s var(--ease) .3s;
}
.hw-step.is-on + .hw-step.is-on::before, .hw-step + .hw-step.is-on::before { background-position: 0 0; }
.hw-step + .hw-step.is-on::after { border-color: var(--hud); }

/* each piece arrives: a short mechanical rise, no bounce */
.js .hw-card { opacity: 0; transform: translateY(12px); transition: opacity .3s var(--ease), transform .3s var(--ease), border-color .3s var(--ease), background-color .3s var(--ease); }
.js .hw-step.is-on .hw-card { opacity: 1; transform: none; }

/* 1. the incoming message */
.hw-in { padding: 18px 20px 20px; border: 1px solid var(--hud-soft); border-radius: 12px; background: var(--hud-shell); }
.hw-in__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; max-width: none; }
.hw-in__head b { font-size: 1.08rem; font-weight: 600; }
.hw-in__init {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--hud-soft); border-radius: 50%;
  background: var(--hud-shell-far); font-size: .95rem; font-weight: 700; color: var(--hud-text);
}
.hw-in__init .ic { color: var(--hud); }
.hw-tag {
  margin-left: auto; padding: 3px 10px; border: 1px solid var(--hud-soft); border-radius: 999px;
  font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--hud);
}
.hw-in__text { font-size: clamp(1.06rem, 1.3vw, 1.2rem); line-height: 1.5; }

/* 2. Clankford writes: its face, then the reply, word by word */
.hw-draft { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 12px; align-items: start; }
.hw-draft__av {
  display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--hud-faint); border-radius: 10px;
  background: var(--hud-shell-far); transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.hw-job.is-writing .hw-draft__av { border-color: var(--hud); box-shadow: 0 0 0 1px var(--hud-soft), 0 0 16px var(--hud-glow); }
.hw-draft__bubble {
  position: relative; padding: 16px 20px 18px; border: 1px solid var(--hud-faint); border-radius: 4px 14px 14px 14px;
  background: rgba(47, 193, 255, 0.2); /* design-check-ignore: the agent voice wash, home.css --voice-agent-wash, lighter */
}
.hw-draft__text { font-size: clamp(1.06rem, 1.3vw, 1.2rem); line-height: 1.55; max-width: none; }
.hw-draft__more { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hud-faint); font-size: .95rem; color: var(--hud-dim); }
.hw-draft__working { position: absolute; left: 20px; top: 16px; margin: 0; font-size: 1rem; color: var(--hud-dim); visibility: hidden; }
.js .hw-job.is-writing:not(.is-typing) .hw-draft__working { visibility: visible; }
.js .hw-draft__text .w { opacity: 0; }
.js .hw-draft__text .w.is-in { opacity: 1; }
.js .hw-draft__more { opacity: 0; transition: opacity .3s var(--ease); }
.js .hw-job.is-drafted .hw-draft__more { opacity: 1; }

/* the owner's one note, in the home's own "you" voice (green, on the right): what it learns from */
.hw-you {
  grid-column: 1 / -1; justify-self: end; display: flex; align-items: baseline; gap: 10px; max-width: 100%; margin: 0 0 2px;
  padding: 9px 14px; border: 1px solid rgba(53, 224, 141, 0.5); border-radius: 14px 14px 4px 14px; /* design-check-ignore: home.css --voice-you-line */
  background: rgba(53, 224, 141, 0.16); /* design-check-ignore: home.css --voice-you-wash */
  font-size: 1rem; line-height: 1.4; color: #ffffff;
}
.hw-you b { flex: none; font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--hud-ok); }
.js .hw-draft__av, .js .hw-draft__bubble { opacity: 0; transition: opacity .3s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease); }
.js .hw-job.is-writing .hw-draft__av, .js .hw-job.is-writing .hw-draft__bubble,
.js .hw-job.is-drafted .hw-draft__av, .js .hw-job.is-drafted .hw-draft__bubble { opacity: 1; }

/* 3. the yes: the approval card, big, amber while it waits, green once sent */
.hw-yes {
  display: grid; gap: 14px; padding: 20px; border: 1px solid var(--hud-warn); border-radius: 12px;
  background: rgba(255, 180, 84, 0.07); /* design-check-ignore: the waiting amber, data not accent */
}
.hw-yes__state { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--hud-warn); }
.hw-yes__state .is-sent { color: var(--hud-ok); }
.hw-yes__btn.swap {
  position: relative; display: grid; place-items: center; width: 100%; min-height: 76px; padding: 0 20px;
  border: 1px solid var(--hud); border-radius: 10px; background: var(--hud); color: var(--ink);
  font: 700 clamp(1.35rem, 1.9vw, 1.7rem)/1.1 var(--body); cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .12s var(--ease);
}
.hw-yes__btn.swap > span { display: inline-flex; align-items: center; gap: 10px; }
.hw-yes__btn .ic { width: 26px; height: 26px; stroke-width: 2.4; }
.hw-yes__btn:hover { background: var(--hud-bright); border-color: var(--hud-bright); }
.hw-yes__btn:active { transform: scale(.98); }
.hw-yes__btn:focus-visible { outline: 3px solid var(--hud-ice); outline-offset: 4px; }
.hw-yes__hint { margin: 0; font-size: .95rem; color: var(--hud-dim); }
/* one ring when the button first waits, twice, then still: it says "this is yours to press" */
.hw-job.is-waiting .hw-yes__btn::after {
  content: ""; position: absolute; inset: -1px; border-radius: 10px; box-shadow: 0 0 0 0 var(--hud-glow);
  animation: hw-ring 1.4s var(--ease) 2;
}
@keyframes hw-ring { 0% { box-shadow: 0 0 0 0 var(--hud-glow); } 100% { box-shadow: 0 0 0 16px rgba(47, 193, 255, 0); } }
/* sent */
.hw-job.is-sent .hw-yes { border-color: var(--hud-ok); background: var(--hud-ok-wash); }
.hw-job.is-sent .hw-yes__btn.swap { border-color: var(--hud-ok); background: transparent; color: var(--hud-ok); cursor: default; }
.hw-job.is-sent .swap > .is-ready { visibility: hidden; }
.hw-job.is-sent .swap > .is-sent { visibility: visible; }

/* 4 and 5: under the three steps, what your yes leaves behind. Not drawn until the Yes is pressed. */
.hw-after {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px clamp(20px, 2.4vw, 32px);
  margin: clamp(16px, 1.6vw, 22px) clamp(18px, 2.4vw, 30px) 0;
}
.js .hw-job:not(.is-sent) .hw-after { display: none; }
.hw-slot--after { min-height: 0; }
.hw-learn {
  padding: 14px 20px 16px; border: 1px solid var(--hud-soft); border-left: 3px solid var(--hud); border-radius: 12px; background: var(--hud-wash);
}
.hw-learn__head { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--hud); }
.hw-learn__rule { margin-top: 6px; font-size: clamp(1.08rem, 1.3vw, 1.22rem); font-weight: 600; line-height: 1.4; max-width: none; }
.hw-learn__note { margin-top: 2px; font-size: .95rem; color: var(--hud-dim); }
.hw-next { padding: 14px 20px 16px; border: 1px solid var(--hud-faint); border-left: 3px solid var(--hud-ok); border-radius: 12px; background: var(--hud-shell); }
.hw-next__big { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--display); font-size: clamp(1.5rem, 2vw, 1.9rem); font-weight: 600; line-height: 1.1; max-width: none; }
.hw-next__big .ic { width: 22px; height: 22px; color: var(--hud-ok); }
.hw-next__line { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .95rem; color: var(--hud-dim); max-width: none; }
.hw-next__line .ic { color: var(--hud); }
.js .hw-learn, .js .hw-next { opacity: 0; transform: translateY(10px); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.js .hw-job.is-learned .hw-learn, .js .hw-job.is-next .hw-next { opacity: 1; transform: none; }

/* ── the two buttons under the demo ── */
.hw-strip { display: flex; flex-wrap: wrap; justify-content: flex-end; margin-top: clamp(22px, 2.2vw, 30px); }
.hw-strip__do { margin-top: 0; }

/* ── What needs your yes, and what doesn't: a Clank Floor picture at the page edge, two sentences beside it.
   The picture's box is the picture's own shape and the picture is contained, never cropped. ── */
.yes2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 0; }
.yes2__pic { position: relative; align-self: center; margin: 0; aspect-ratio: 1200 / 1091; background: var(--hud-shell-far); }
.yes2 .yes2__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.yes2__say {
  /* the right edge lines up with the .wrap column on every width */
  padding: clamp(56px, 7vw, 104px) max(var(--gutter), calc((100vw - var(--wrap)) / 2)) clamp(56px, 7vw, 104px) clamp(32px, 5vw, 88px);
}
.yes2__say h2 { max-width: 19ch; }
.yes2__rule { margin-top: clamp(26px, 3vw, 40px); padding-top: clamp(20px, 2.2vw, 28px); border-top: 1px solid var(--hud-faint); }
.yes2__rule + .yes2__rule { margin-top: clamp(22px, 2.4vw, 32px); }
.yes2__h { display: flex; align-items: center; gap: 10px; font-size: .8rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.yes2__h .dot { width: 9px; height: 9px; background: currentColor; }
.yes2__rule--wait .yes2__h { color: var(--state-wait); }
.yes2__rule--go .yes2__h { color: var(--state-ok); }
.yes2__line { margin: 10px 0 0; max-width: 34ch; font-size: clamp(1.2rem, 1.65vw, 1.55rem); font-weight: 500; line-height: 1.42; color: var(--hud-text); text-wrap: pretty; }

/* ── narrower screens ── */
@media (max-width: 900px) {
  .hw-flow { grid-template-columns: minmax(0, 1fr); row-gap: 34px; }
  .hw-slot { min-height: 0; }
  .hw-step + .hw-step::before { top: -30px; right: auto; left: 11px; width: 2px; height: 22px; background: linear-gradient(180deg, var(--hud) 50%, var(--hud-faint) 50%); background-size: 100% 200%; background-position: 0 100%; }
  .hw-step + .hw-step.is-on::before { background-position: 0 0; }
  .hw-step + .hw-step::after { top: -14px; right: auto; left: 7px; transform: rotate(135deg); }
  .hw-after { grid-template-columns: minmax(0, 1fr); }
  .hw-slot--after { min-height: 64px; }
  .yes2 { grid-template-columns: minmax(0, 1fr); }
  .yes2__say { padding: clamp(32px, 6vw, 48px) var(--gutter) clamp(48px, 9vw, 72px); }
}
@media (max-width: 720px) {
  .hw-draft { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; }
  .hw-draft__av { width: 36px; height: 36px; border-radius: 8px; }
  .hw-draft__av .bot { width: 28px; height: 28px; }
  .hw-draft__bubble { padding: 14px 16px 16px; }
  .hw-in { padding: 16px 16px 18px; }
  .hw-yes { padding: 16px; }
  .hw-replay { margin-left: 0; }
  .hw-stage__note { margin-left: 0; flex-basis: 100%; }
  .hw-yes__btn.swap { min-height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .hw *, .hw *::before, .hw *::after { transition: none !important; animation: none !important; }
}
