/* public/clankford-site/what.css, What it does only (loaded by lib/clankford-site.js for "/what-it-does"),
 * round 27 W2 "Before and after, job by job", built in round 29 (Michal, 20 Oct 2026). Ported from the
 * mockup at /home/studio/clankford-ie-samples/round27/w2 (scripts/parts/page.css). Only NEW rules live
 * here: the head, the picker and the close with a photo are the inner page template in site.css (.hw,
 * .hw__head, .hw__sub, .hw__bar, .hw__picks, .hw-pick, .closer--pic), with .holo, .kicker, .lead,
 * .btn, .dot and .ic. The picture is round 16 H6's drag-to-compare (.mon there, .ba here), one per job.
 * Colour: cyan is the one accent. Amber (--state-wait) and green (--state-ok) are the dashboard's
 * state colours, used as data: amber waits on a person, green is done.
 * Front door: vault/Workspaces/clank-websmith/projects/clankford-ie/PROJECT.md */

/* the mockup's type scale for this page, as how.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; }

:root {
  --ba-before: #12171e;   /* the "without" side: a duller, greyer navy */ /* design-check-ignore */
  --ba-after: #0b1928;    /* the "with" side: the dashboard's own navy */ /* design-check-ignore */
  --ba-sheet: #1a2028;    /* a message on the pile */ /* design-check-ignore */
  --ba-wait-line: rgba(255, 180, 84, 0.5);
  --ba-wait-wash: rgba(255, 180, 84, 0.09);
}

/* ══ HEAD AND PICKER ═════════════════════════════════════════════════════════
   As How it works, with the "Pick a job" label for screen readers only (.visually-hidden). */
.wd .hw__bar { margin-top: clamp(22px, 2.2vw, 30px); }
/* the H1 is two lines, one sentence each (round 42: "Do the work you love." / "Hand the emails to Clankford.") */
.wd-h1-line { display: block; }

/* the seven jobs share one grid cell on wide screens, so the page never jumps when you pick */
.wd-jobs { display: grid; margin-top: 12px; }
.wd-job { grid-area: 1 / 1; min-width: 0; }
.js .wd-job.is-off { visibility: hidden; }
html:not(.js) .wd__bar { display: none; }
html:not(.js) .wd-job { grid-area: auto; }
html:not(.js) .wd-job + .wd-job { margin-top: clamp(40px, 5vw, 64px); }
html:not(.js) .ba__knob { display: none; }

/* ══ THE PICTURE ═════════════════════════════════════════════════════════════
   .ba            the panel (.holo).
   .ba__bar       the two side buttons (they jump the line to one side) and the clock.
   .ba__stage     two layers stacked in one grid cell, the handle on top. --pos is where the
                  line sits (0 to 100% from the left). --cut is how far down the line reaches:
                  the full height on wide screens; on one column only the rows are compared and
                  the card below them shows whole (page.js measures it). */
.ba { position: relative; margin: 0; overflow: hidden; background: var(--hud-shell-far); }
.ba__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--hud-faint); }
.ba__side {
  display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--hud-faint); border-radius: 6px; background: transparent;
  font: 600 0.95rem/1 var(--body); color: var(--hud-text); cursor: pointer;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.ba__side:hover { border-color: var(--hud-soft); background: var(--hud-wash); }
.ba__side:focus-visible { outline: 3px solid var(--hud); outline-offset: 2px; }
.ba__side--before .dot { width: 9px; height: 9px; background: var(--state-wait); }
.ba__bot .bot { width: 24px; height: 24px; --bot-alpha: 1; --bot-lit: #7cc6f0; } /* design-check-ignore: the robot's lit head, as home.css .demo .bot */
.ba__clock { margin: 0; font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 0.95rem; letter-spacing: 0.08em; color: var(--hud-dim); }

.ba__stage { --pos: 40%; --cut: 100%; position: relative; display: grid; min-height: var(--ba-min, 0px); touch-action: pan-y; cursor: ew-resize; }
.ba__stage.is-dragging { user-select: none; -webkit-user-select: none; }
.ba__layer {
  grid-area: 1 / 1; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(20px, 2.6vw, 40px); align-items: start; padding: clamp(18px, 2vw, 28px);
}
.ba__layer--before { background: var(--ba-before); }
.ba__layer--after {
  background: var(--ba-after);
  clip-path: polygon(var(--pos) 0, 100% 0, 100% 100%, 0 100%, 0 var(--cut), var(--pos) var(--cut));
}

/* rows: one piece of work each, the same height on both sides so they line up across the line */
.ba__rows { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ba__row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who st";
  align-items: center; column-gap: 16px; height: 72px; padding: 0 20px; overflow: hidden;
  border: 1px solid var(--hud-faint); border-radius: 10px; background: var(--hud-shell);
}
.ba__who { grid-area: who; min-width: 0; font-size: 1.1rem; font-weight: 600; line-height: 1.3; color: var(--hud-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ba__what { grid-area: what; min-width: 0; max-width: 100%; font-size: 0.98rem; line-height: 1.4; color: var(--hud-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ba__st { grid-area: st; display: inline-flex; align-items: center; gap: 8px; font-size: 0.98rem; font-weight: 600; white-space: nowrap; }
.ba__st .ic { width: 18px; height: 18px; stroke-width: 2.4; }
.ba__st.is-ok { color: var(--state-ok); }

/* the pile: unread, tilted, stacked on older sheets, amber ages beside the name */
.ba__layer--before .ba__rows { gap: 10px; }
.ba__layer--before .ba__row {
  grid-template-columns: auto auto minmax(0, 1fr); grid-template-areas: "dot who st" ". what what";
  align-content: center; column-gap: 12px; row-gap: 2px; justify-items: start; overflow: visible; background: var(--ba-sheet);
  box-shadow: 6px 7px 0 -1px var(--ba-before), 6px 7px 0 0 var(--hud-faint), 12px 13px 0 -1px var(--ba-before), 12px 13px 0 0 rgba(47, 193, 255, 0.1);
  transform: rotate(var(--tilt, 0deg)) translateX(var(--nudge, 0px));
}
.ba__layer--before .ba__row:nth-child(1) { --tilt: -1.2deg; --nudge: 10px; }
.ba__layer--before .ba__row:nth-child(2) { --tilt: 0.9deg; --nudge: -4px; }
.ba__layer--before .ba__row:nth-child(3) { --tilt: -0.6deg; --nudge: 16px; }
.ba__layer--before .ba__row:nth-child(4) { --tilt: 1.2deg; --nudge: 2px; }
.ba__unread { grid-area: dot; width: 10px; height: 10px; border-radius: 50%; background: var(--hud); box-shadow: 0 0 8px var(--hud-glow); }
.ba__st.is-wait {
  padding: 3px 10px; border: 1px solid var(--ba-wait-line); border-radius: 999px; background: var(--ba-wait-wash);
  font-size: 0.85rem; color: var(--state-wait);
}

/* the note on the pile (without): a to-do list, or a diary page of messages still to send */
.ba-note {
  padding: 18px 22px 16px; border: 1px solid var(--ba-wait-line); border-radius: 10px; background: var(--ba-sheet);
  transform: rotate(1.5deg); box-shadow: 7px 8px 0 -1px var(--ba-before), 7px 8px 0 0 var(--hud-faint);
}
.ba-note__h { margin: 0 0 4px; font: 600 1.8rem/1 var(--display); color: var(--hud-text); }
.ba-note__list { margin: 0; padding: 0; list-style: none; }
.ba-note__list li { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px dashed var(--hud-faint); font-size: 1.05rem; color: var(--hud-text); }
.ba-note__list li:first-child { border-top: 0; }
.ba-note__box { flex: none; width: 20px; height: 20px; border: 2px solid var(--hud-dim); border-radius: 4px; }
.ba-note__time { flex: none; min-width: 3.4em; font-weight: 600; color: var(--hud-dim); font-variant-numeric: tabular-nums; }
.ba-note__foot { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; padding-top: 12px; border-top: 1px solid var(--ba-wait-line); font-weight: 600; color: var(--state-wait); max-width: none; }
.ba-note__foot .dot { width: 9px; height: 9px; background: var(--state-wait); }

/* the card (with): the approval card, amber while it waits, green once sent; .ba-yes--calm is
   the same card for a job that sends nothing (Inbox and documents, Dashboard) */
.ba__col { display: grid; gap: 14px; min-width: 0; }
.ba-yes { overflow: hidden; border: 1px solid var(--state-wait); border-radius: 12px; background: var(--hud-shell); }
.ba-yes--calm { border-color: var(--hud-soft); }
.ba-yes__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 14px 20px; border-bottom: 1px solid var(--hud-faint); max-width: none; }
.ba-yes__head b { font-size: 1.15rem; font-weight: 600; color: var(--hud-text); }
.ba-yes__names { font-size: 0.95rem; color: var(--hud-dim); }
.ba-yes__draft, .ba-yes__done { min-height: 104px; padding: 16px 20px; border-bottom: 1px solid var(--hud-faint); }
.ba-yes__draft p { padding-left: 14px; border-left: 2px solid var(--hud); font-size: 1.06rem; line-height: 1.5; color: var(--hud-text); max-width: none; }
.ba-yes__done { display: flex; align-items: center; }
.ba-yes__done p { display: flex; align-items: center; gap: 12px; font-size: 1.08rem; font-weight: 600; line-height: 1.45; color: var(--hud-text); max-width: none; }
.ba-yes__done .ic { width: 22px; height: 22px; stroke-width: 2.4; color: var(--state-ok); }
.ba-yes__list { margin: 0; padding: 6px 20px; list-style: none; border-bottom: 1px solid var(--hud-faint); }
.ba-yes__list li { padding: 10px 0; border-top: 1px solid var(--hud-faint); font-size: 1.04rem; line-height: 1.4; color: var(--hud-text); }
.ba-yes__list li:first-child { border-top: 0; }
.ba-yes__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 14px 20px; }
.ba-yes__state { margin: 0; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--state-wait); max-width: none; }
.ba-yes__state.is-ok { display: flex; align-items: center; gap: 8px; color: var(--state-ok); letter-spacing: 0.1em; }
.ba-yes__state.is-ok .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.ba-go {
  min-height: 48px; padding: 0 24px; border: 1px solid var(--hud); border-radius: 8px;
  background: var(--hud); color: var(--ink); font: 700 1.02rem/1 var(--body); cursor: pointer;
  box-shadow: 0 0 0 3px rgba(47, 193, 255, 0.28), 0 0 18px rgba(47, 193, 255, 0.4);
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.ba-go:hover { background: var(--hud-bright); border-color: var(--hud-bright); }
.ba-go:focus-visible { outline: 3px solid var(--hud-text); outline-offset: 3px; }

/* the Dashboard's one screen: a short report, label left, figure right */
.ba-screen__nums { margin: 0; padding: 4px 20px 8px; border-bottom: 1px solid var(--hud-faint); }
.ba-screen__nums div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--hud-faint); }
.ba-screen__nums div:first-child { border-top: 0; }
.ba-screen__nums dt { font-size: 1.02rem; color: var(--hud-dim); }
.ba-screen__nums dd { margin: 0; font: 600 1.9rem/1 var(--display); color: var(--hud-text); font-variant-numeric: tabular-nums; }

/* "Learned from you": How it works' card (.hw-learn), always shown here */
.ba-learn { padding: 13px 20px 15px; border: 1px solid var(--hud-soft); border-left: 3px solid var(--hud); border-radius: 12px; background: var(--hud-wash); }
.ba-learn__head { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--hud); }
.ba-learn__head .ic { width: 15px; height: 15px; }
.ba-learn__rule { margin-top: 6px; font-size: 1.08rem; font-weight: 600; line-height: 1.4; color: var(--hud-text); max-width: none; }
.ba-learn__note { margin-top: 2px; font-size: 0.95rem; color: var(--hud-dim); }

/* a quiet read-only line under the card (Connection: the other system is only read) */
.ba-aside { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border: 1px solid var(--hud-faint); border-radius: 12px; background: var(--hud-shell); font-size: 1rem; line-height: 1.4; color: var(--hud-text); max-width: none; }
.ba-aside .ic { width: 18px; height: 18px; color: var(--hud); }

/* sent: driven by .ba.is-sent */
.ba__sw .is-sent { display: none; }
.ba.is-sent .ba__sw .is-ready { display: none; }
.ba.is-sent .ba__sw .is-sent { display: inline; }
.ba.is-sent .ba-yes { border-color: var(--state-ok); }
.ba.is-sent .ba-yes__state { color: var(--state-ok); }
.ba.is-sent .ba-go { background: transparent; color: var(--hud-text); border-color: var(--hud-soft); box-shadow: none; }

/* the handle: a cyan line and a round knob, keyboard and pointer */
.ba__handle { position: absolute; top: 0; left: var(--pos); width: 0; height: var(--cut); z-index: 2; pointer-events: none; }
.ba__line { position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: var(--hud); box-shadow: 0 0 14px var(--hud-glow); }
.ba__knob {
  position: absolute; top: 50%; left: 0; display: grid; place-items: center; width: 52px; height: 52px;
  border-radius: 50%; background: var(--hud); color: var(--ink); transform: translate(-50%, -50%);
  box-shadow: 0 0 0 5px rgba(10, 20, 32, 0.85), 0 0 22px var(--hud-glow);
  pointer-events: auto; cursor: ew-resize; touch-action: none;
}
.ba__knob .ic { width: 24px; height: 24px; stroke-width: 2.4; }
.ba__knob:focus-visible { outline: 3px solid var(--hud-text); outline-offset: 6px; }

/* ══ UNDER THE PICTURE: what the job does, its price, the two ways on ═══════ */
.wd-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 40px; margin-top: 18px; }
.wd-foot__say { min-width: 0; flex: 1 1 520px; }
.wd-foot__line { font-size: clamp(1.15rem, 1.5vw, 1.35rem); font-weight: 600; line-height: 1.4; color: var(--hud-text); max-width: none; }
.wd-foot__line b { font-weight: 700; color: var(--hud); }
.wd-foot__price { margin-top: 4px; font-size: 1rem; line-height: 1.5; color: var(--hud-dim); max-width: none; }
.wd-foot__btns { margin-top: 0; }
.wd-fine { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hud-faint); font-size: 0.9rem; color: var(--hud-dim); max-width: none; }

/* ══ NARROWER SCREENS ════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* one column: only the rows are compared, the card shows whole below them (see --cut) */
  .ba__layer { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ba__layer--before .ba-note { display: none; }
}
@media (max-width: 720px) {
  .js .wd-job.is-off { display: none; }
  .wd-foot__say { flex-basis: 100%; }
}
@media (max-width: 560px) {
  .ba__bar { padding: 8px; gap: 8px; }
  .ba__clock { display: none; }
  .ba__side { flex: 1 1 0; justify-content: center; gap: 8px; padding: 0 8px; font-size: 0.82rem; }
  .ba__bot { display: none; }
  .ba__layer { padding: 14px 12px; gap: 14px; }
  .ba__row { height: 86px; padding: 0 14px; column-gap: 10px; }
  .ba__layer--before .ba__row {
    grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "dot who" ". st" ". what";
    column-gap: 10px; row-gap: 3px;
  }
  .ba__layer--before .ba__row:nth-child(n) { --nudge: 0px; --tilt: 0deg; }
  .ba__layer--before .ba__row { box-shadow: 4px 5px 0 -1px var(--ba-before), 4px 5px 0 0 var(--hud-faint); }
  /* the done side: the status wraps inside the right 40% of the row, so at rest (56%) it shows whole */
  .ba__layer--after .ba__row { grid-template-columns: minmax(0, 1fr) minmax(0, 40%); }
  .ba__layer--after .ba__st { justify-self: end; white-space: normal; text-align: left; line-height: 1.25; }
  /* the seven chips: one row that scrolls sideways, edge to edge, so the picture stays near the top */
  .wd .hw__bar { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); }
  .wd .hw__picks { flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; padding: 2px var(--gutter) 4px; scrollbar-width: none; }
  .wd .hw__picks::-webkit-scrollbar { display: none; }
  .wd .hw-pick { flex: none; }
  .ba__who { font-size: 1rem; }
  .ba__what, .ba__st { font-size: 0.88rem; }
  .ba__st.is-wait { padding: 2px 8px; font-size: 0.78rem; }
  .ba__knob { width: 46px; height: 46px; }
  .ba-yes__head, .ba-yes__draft, .ba-yes__done, .ba-yes__foot, .ba-learn, .ba-aside { padding-left: 14px; padding-right: 14px; }
  .ba-yes__list, .ba-screen__nums { padding-left: 14px; padding-right: 14px; }
  .ba-go { flex: 1 1 auto; }
  .wd-foot__btns .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .wd *, .wd *::before, .wd *::after { transition: none !important; animation: none !important; }
}
