/* The two workers (js/workers.js): the figures themselves, the first screen's rows, and the scene
   and notes on Building. Uses tokens from shell.css. The reader is steel blue, the checker indigo:
   Sasaron's own blues, as in the "free first look" video. */

:root {
  --wk-rd: #739CB5; --wk-rd-d: #5E86A0;
  --wk-ck: #34378F; --wk-ck-d: #262970;
}

/* ---------- The figures: drawn at 84 by 74, scaled where they are used ---------- */
.wk-fig { display: block; width: 84px; height: 74px; }
.wk-fig--rd, .wk-face--rd { --c: var(--wk-rd); --d: var(--wk-rd-d); }
.wk-fig--ck, .wk-face--ck { --c: var(--wk-ck); --d: var(--wk-ck-d); }
.wk-fig span, .wk-fig i, .wk-fig b, .wk-fig svg { position: absolute; display: block; }
.wk-bb { inset: 0; transform-origin: 50% 100%; }

/* The reader: a rounded chip with one round lens, two feet, and a page over its shoulder. */
.wk-shell { left: 0; top: 0; width: 84px; height: 70px; border-radius: 22px; background: var(--c); box-shadow: 0 2px 3px rgba(43, 47, 58, .10), 0 10px 18px -8px rgba(43, 47, 58, .45); }
.wk-shell::after { content: ""; position: absolute; left: 10px; right: 10px; top: 6px; height: 12px; border-radius: 8px; background: rgba(255, 255, 255, .18); }
.wk-lens { left: 22px; top: 16px; width: 40px; height: 40px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 3px rgba(43, 47, 58, .12); }
.wk-pupil { left: 13px; top: 13px; width: 14px; height: 14px; border-radius: 50%; background: #2B2F3A; transition: translate .35s ease; }
.wk-pupil::after { content: ""; position: absolute; left: 3px; top: 2.5px; width: 4.5px; height: 4.5px; border-radius: 50%; background: #fff; }
.wk-glow { left: 16px; top: 10px; width: 52px; height: 52px; border-radius: 50%; box-shadow: 0 0 0 7px rgba(255, 255, 255, .6), 0 0 22px 8px rgba(255, 255, 255, .6); opacity: 0; }
.wk-ant { left: 40px; top: -22px; width: 4px; height: 24px; border-radius: 2px; background: var(--d); transform-origin: 50% 100%; }
.wk-ant i { left: -5px; top: -9px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--d); }
.wk-foot { top: 66px; width: 20px; height: 8px; border-radius: 4px; background: var(--d); }
.wk-page {
  left: 55px; top: -13px; width: 25px; height: 32px; border-radius: 4px; rotate: 13deg; border: 2.5px solid var(--d);
  background: linear-gradient(#B9C6D2, #B9C6D2) 4px 6px / 12px 2.5px no-repeat, linear-gradient(#B9C6D2, #B9C6D2) 4px 12px / 9px 2.5px no-repeat, #fff;
}

/* The checker: a shield with a visor and a check on its chest. No feet; it hovers over a soft shadow. */
.wk-fig--ck .wk-shell { background: none; border-radius: 0; box-shadow: none; filter: drop-shadow(0 7px 6px rgba(38, 41, 112, .32)); }
.wk-fig--ck .wk-shell::after { display: none; }
.wk-fig--ck .wk-shell svg { left: 0; top: 0; }
.wk-shield { fill: var(--c); }
.wk-fig--ck .wk-lens { left: 12px; top: 19px; width: 60px; height: 22px; border-radius: 11px; }
.wk-fig--ck .wk-pupil { left: 24px; top: 5px; width: 12px; height: 12px; }
.wk-fig--ck .wk-pupil::after { left: 2.5px; top: 2px; width: 4px; height: 4px; }
.wk-fig--ck .wk-glow { left: 8px; top: 15px; width: 68px; height: 30px; border-radius: 15px; }
.wk-fig--ck .wk-ant { top: -17px; height: 19px; }
.wk-ping { left: -10px; top: -15px; width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--c); opacity: 0; }
.wk-hover { left: 24px; top: 68px; width: 36px; height: 7px; border-radius: 50%; background: rgba(38, 41, 112, .22); filter: blur(2px); }

/* The small face that ties a worker to its job wherever the job is named. */
.wk-face { flex: none; display: inline-block; width: 20px; height: 20px; margin-right: 7px; }

/* ---------- The first screen: each row starts with who does it ---------- */
.intro__who .wk-fig { position: absolute; left: 50%; bottom: 2px; margin-left: -42px; transform-origin: 50% 100%; scale: .44; }
.intro__who .wk-fig--rd .wk-bb { animation: wk-bob 2.8s ease-in-out infinite; }
.intro__who .wk-fig--ck .wk-bb { translate: 0 -8px; animation: wk-float 3.4s ease-in-out infinite; }
.intro__who .wk-ant { animation: wk-sway 3.1s ease-in-out infinite; }
/* While the address field has the keyboard, both look up at it. */
.intro__steps.is-watching .wk-fig--rd .wk-pupil { translate: 5px -7px; }
.intro__steps.is-watching .wk-fig--ck .wk-pupil { translate: 14px -2px; }
@keyframes wk-bob { 50% { translate: 0 -4px; } }
@keyframes wk-float { 50% { translate: 0 -14px; } }
@keyframes wk-sway { 0%, 100% { rotate: -6deg; } 50% { rotate: 6deg; } }

/* ---------- Building: the scene. Sasaron on the left; their site and the two sets of public
   records the check also reads on the right. Everything a worker does stays inside it. ---------- */
.wk-scene { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 36px 0 30px; margin-top: 4px; }
.wk-scene > span, .wk-place, .wk-site, .wk-site__page, .wk-pips { display: block; }
.wk-scene__path { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; stroke: var(--wk-rd); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1 7; opacity: .75; }
.wk-cap { position: absolute; left: 0; top: calc(100% + 13px); font-size: var(--fs-xs); line-height: 1.3; color: var(--muted); white-space: nowrap; }
.wk-home { position: relative; flex: 0 1 128px; min-width: 84px; height: 46px; border-bottom: 1.5px solid var(--line-strong); }
.wk-home img { position: absolute; left: 0; bottom: 6px; width: 34px; height: 34px; padding: 4px; object-fit: contain; border-radius: 8px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.wk-places { display: flex !important; flex: 0 1 auto; min-width: 0; align-items: flex-end; gap: 8px; }
.wk-place { position: relative; flex: none; }
.wk-place--site { flex: 0 1 156px; width: 156px; min-width: 104px; height: 98px; }

/* Their site, small: a browser window with their address on it. It starts gray and takes on their
   name, logo, and colors once the reader has read the page. */
.wk-site { position: absolute; inset: 0; border-radius: 8px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); overflow: hidden; transition: border-color .3s; --band: #C9CED6; --soft: #ECEEEA; }
.wk-site__bar { display: flex; position: absolute; inset: 0 0 auto; align-items: center; gap: 3px; height: 17px; padding: 0 7px; background: var(--tint); border-bottom: 1px solid var(--line); }
.wk-site__bar i { flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }
.wk-site__bar span { margin-left: 5px; font-size: 10px; line-height: 1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-site__page { position: absolute; inset: 17px 0 0; }
.wk-site__page b { position: absolute; border-radius: 2px; background: var(--soft); transition: background-color .6s; }
.wk-site__page .b1 { left: 0; right: 0; top: 0; height: 22%; border-radius: 0; background: var(--band); }
.wk-site__page .b2 { left: 7%; top: 34%; width: 30%; height: 38%; }
.wk-site__page .b3 { left: 44%; top: 36%; width: 46%; height: 7%; background: #CFD3D9; }
.wk-site__page .b4 { left: 44%; top: 50%; width: 40%; height: 7%; }
.wk-site__page .b5 { left: 44%; top: 64%; width: 24%; height: 12%; background: var(--band); opacity: .75; }
.wk-site__page .b6 { left: 0; right: 0; bottom: 0; height: 10%; border-radius: 0; }
.wk-site__id { position: absolute; left: 6%; right: 4%; top: 0; height: 22%; display: flex; align-items: center; gap: 3px; overflow: hidden; font-family: 'Merriweather', Georgia, serif; font-size: 7.5px; line-height: 1; color: #fff; white-space: nowrap; text-shadow: 0 0 2px rgba(0, 0, 0, .35); }
.wk-site__id:not(:empty) { animation: wk-pop .4s both; }
.wk-site__id svg { flex: none; width: 9px; height: 9px; }
.wk-scan { position: absolute; left: 0; right: 0; top: 0; height: 22px; background: linear-gradient(180deg, rgba(85, 112, 168, 0), rgba(85, 112, 168, .16)); border-bottom: 1.5px solid rgba(85, 112, 168, .55); opacity: 0; }
.wk-site.is-reading .wk-scan { animation: wk-scan 2.4s linear infinite; }
@keyframes wk-scan { 0% { opacity: 0; translate: 0 -22px; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { opacity: 0; translate: 0 var(--scan-to, 60px); } }

/* The two sets of public records. */
.wk-card {
  display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 78px; height: 62px; padding: 0 6px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  font-size: var(--fs-xs); line-height: 1.15; text-align: center; color: var(--muted); transition: border-color .3s, color .3s;
}
.wk-card svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
/* What the checker is over right now, and what it has finished. */
.wk-place.is-on.wk-card, .wk-place.is-on .wk-site { border-color: var(--navy); }
.wk-place.is-on.wk-card, .wk-place.is-done.wk-card { color: var(--ink); }
.wk-badge { position: absolute; right: -7px; top: -7px; z-index: 2; display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; box-shadow: 0 0 0 2px var(--bg); font-size: 11.5px; font-style: normal; font-weight: 700; line-height: 1; color: #fff; scale: 0; transition: scale .35s cubic-bezier(.2, 1.5, .4, 1); }
.wk-badge.is-shown { scale: 1; }
.wk-badge.is-ok { background: var(--green); }
.wk-badge.is-warn { background: var(--gold); }
.wk-badge svg { width: 11px; height: 11px; }
/* One pip per check, under the thing being checked. Each lights as its result lands. */
.wk-pips { position: absolute; left: 2px; right: 2px; top: calc(100% + 5px); height: 3px; display: flex !important; gap: 2px; }
.wk-pips i { flex: 1 1 0; min-width: 1px; max-width: 8px; height: 3px; border-radius: 2px; background: var(--line-strong); transition: background-color .3s; }
.wk-pips i.is-lit { background: var(--wk-ck); }

/* A worker in the scene: a point its feet stand on, moved by the script. */
.wk-bot { position: absolute; left: 0; top: 0; z-index: 3; display: block; width: 0; height: 0; will-change: translate; }
.wk-bot .wk-fig { position: absolute; left: -42px; top: -74px; transform-origin: 42px 74px; scale: var(--k); }
.wk-bot__carry { position: absolute; left: 0; bottom: calc(74px * var(--k) + 13px); translate: -50% 0; display: flex; gap: 4px; white-space: nowrap; }
.wk-bot__carry > * { animation: wk-pop .3s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes wk-pop { from { opacity: 0; scale: .5; } }

/* What the reader lifts: small chips of their name, colors, logo, and headline. */
.wk-tok {
  display: inline-flex; align-items: center; gap: 4px; height: 23px; padding: 0 9px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(44, 51, 64, .08), 0 4px 10px -4px rgba(44, 51, 64, .18);
  font-size: 12px; font-weight: 500; line-height: 1; color: var(--ink); white-space: nowrap;
}
.wk-tok--name, .wk-tok--quote { font-family: 'Merriweather', Georgia, serif; font-weight: 400; font-size: 11.5px; }
.wk-tok--name { max-width: 190px; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 21px; }
.wk-tok--sw { padding: 0 5px; gap: 3px; }
.wk-tok--sw i { width: 13px; height: 13px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.wk-tok--logo { padding: 0 6px; }
.wk-tok--logo svg, .wk-tok--logo img { display: block; width: auto; max-width: 44px; height: 14px; object-fit: contain; }

/* The copies the reader sends across to the first look travel in a layer over the page. */
.wk-layer { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.wk-fly { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.wk-fly > * { position: absolute; left: 0; top: 0; translate: -50% -50%; }

/* ---------- Building: the notes, in place of a checklist. The newest is at the bottom. ---------- */
.wk-notes {
  list-style: none; margin: 14px 0 0; padding: 6px 18px; height: 126px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  -webkit-mask-image: linear-gradient(transparent, #000 30px); mask-image: linear-gradient(transparent, #000 30px);
}
.wk-note { display: flex; align-items: flex-start; gap: 2px; padding: 5px 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--text); animation: wk-note .45s cubic-bezier(.2, .9, .3, 1) both; }
.wk-note + .wk-note { border-top: 1px solid var(--line); }
.wk-note div { flex: 1; min-width: 0; }
.wk-note strong { color: var(--ink); font-weight: 600; }
.wk-note .wk-tok { height: 20px; box-shadow: none; vertical-align: -5px; margin-left: 4px; }
.wk-note--warn strong { color: var(--gold-text); }
@keyframes wk-note { from { opacity: 0; translate: 0 10px; } }

@media (max-width: 900px) {
  .wk-scene { gap: 8px; }
  .wk-home { flex-basis: 84px; }
  .wk-home img { width: 30px; height: 30px; padding: 3px; }
  .wk-places { gap: 6px; }
  .wk-place--site { flex-basis: 122px; width: 122px; height: 88px; }
  .wk-card { width: 66px; height: 66px; padding: 0 2px; }
  .wk-card svg { width: 16px; height: 16px; }
  .wk-notes { height: 176px; margin-top: 16px; padding-inline: 14px; }
  .wk-tok { font-size: 12px; }
}
