/* v7 agent shots: a coding agent's turn in Claude Desktop, drawn in HTML from the Figma "Agent kit" (207:1516)
   and its shot frames (Website, Nov: "Artwork & Grpahics"): 01 Agent turn, 06 Sweep and 19 Product hero turn.
   The markup for each lives with the page that shows it; this sheet draws the kit's parts, the frame and the
   beats.

   The kit: Bubble, Tool row, Edit row, Composer, the LeoTrace block (the quoted block LeoTrace has the agent
   print at the top of its reply, tinted, with a red rule and the 🛡️ shield, a PNG so it never depends on the
   reader's emoji font), the question card and the title bar. Claude Desktop shows no code, so neither does a
   shot: no code card, ever.

   Scale: every size is in --u, one Figma pixel. The shot draws at its Figma size and scales with its slot,
   so text wraps exactly as in the frame; below 85% (a narrow slot or a phone) it stops shrinking and reflows
   instead, so text stays readable.

   Beats: js/v7/loop.js writes data-step on the shot root. Each part names the scenes it is in (data-on, a
   list of step numbers) and fades in when its scene comes; the chat sits at the top of its window until it
   fills it, then the newest line stays above the composer, as a chat scrolls. The markup carries the final
   scene's step, so with no script, and for a reader who asks for less motion, the finished turn is shown. */

/* ── The depicted app's own colours ──────────────────────────────────────────────────────────────────────
   These depict a third-party app, Claude Desktop: its warm surface, bubble, muted text, ink, lines and send
   button, and the tint and rule the kit gives the LeoTrace block inside it. They are not LeoTrace colours and
   are declared once, here, for the agent shots only. tools/check.py allows no hex, rgb() or hsl() in css/v7,
   so they are written as color(srgb), each with its hex alongside. Everything else is a token. */
.ashot {
  --cd-surface: color(srgb 0.9843 0.9765 0.9608);    /* #fbf9f5 window */
  --cd-bubble: color(srgb 0.9373 0.9255 0.8941);     /* #efece4 the person's message */
  --cd-muted: color(srgb 0.5137 0.5059 0.4902);      /* #83817d secondary text */
  --cd-ink: color(srgb 0.1216 0.1176 0.1137);        /* #1f1e1d text */
  --cd-line: color(srgb 0.9098 0.8941 0.8549);       /* #e8e4da borders and rules */
  --cd-bar-line: color(srgb 0.9255 0.9098 0.8745);   /* #ece8df under the title bar */
  --cd-accent: color(srgb 0.8510 0.4667 0.3412);     /* #d97757 send button */
  --cd-code: color(srgb 0.6039 0.2314 0.1686);       /* #9a3b2b inline code */
  --cd-command: color(srgb 0.1843 0.4353 0.6902);    /* #2f6fb0 a slash command */
  --cd-option: color(srgb 0.9608 0.9490 0.9255);     /* #f5f2ec the highlighted answer */
  --cd-leo-tint: color(srgb 0.9922 0.9569 0.9373);   /* #fdf4ef LeoTrace block */
  --cd-leo-rule: color(srgb 0.8784 0.3765 0.2471);   /* #e0603f LeoTrace block's rule */
  --cd-glow: color(srgb 0.9608 0.9529 0.9333);       /* #f5f3ee 19's light */
  --cd-shade: color(srgb 0.1216 0.1020 0.0588);      /* #1f1a0f the app's shadows */
  --cd-field: var(--lt-background-canvas);
  --cd-cast: var(--lt-foreground-primary-strong);

  container: ashot / inline-size;
  position: relative;
  display: block;
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  text-align: left;
}

/* In a panel the shot runs to the panel's square edges, so it has no corners of its own */
.ptx__demo > .ashot { border-radius: 0; }

/* ── The frame: Figma's stage at its size (--fw x --fh), scaled to the slot ──────────────────────────── */
.ashot__stage {
  --u: max(0.85px, 100cqw / var(--fw));
  position: relative;
  aspect-ratio: var(--fw) / var(--fh);
  overflow: hidden;
  font-family: var(--lt-font-sans);
  color: var(--cd-ink);
  font-size: calc(15 * var(--u));
  line-height: calc(24 * var(--u));
  font-weight: 400;
}
.ashot--turn, .ashot--sweep { --fw: 926; --fh: 724; }
.ashot--hero { --fw: 900; --fh: 700; }

/* 01 and 06: the lit stage the app's window sits on */
.ashot--turn .ashot__stage, .ashot--sweep .ashot__stage {
  display: flex;
  padding: calc(40 * var(--u));
  background: linear-gradient(180deg, color-mix(in srgb, var(--lt-background-sunken) 67%, var(--lt-background-canvas)), color-mix(in srgb, var(--lt-background-sunken) 58%, var(--lt-outline-default)));
}
.ashot__light {
  position: absolute;
  left: 7.56%;
  width: 84.23%;
  top: calc(-130 * var(--u));
  height: calc(320 * var(--u));
  border-radius: 50%;
  background: var(--lt-background-canvas);
  opacity: 0.9;
  filter: blur(calc(60 * var(--u)));
  pointer-events: none;
}

/* The Claude Desktop window */
.ashot__win {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: calc(14 * var(--u));
  background: var(--cd-surface);
  box-shadow:
    0 calc(40 * var(--u)) calc(80 * var(--u)) calc(-24 * var(--u)) color-mix(in srgb, var(--cd-cast) 14%, transparent),
    0 calc(12 * var(--u)) calc(32 * var(--u)) calc(-8 * var(--u)) color-mix(in srgb, var(--cd-cast) 7%, transparent),
    0 calc(1 * var(--u)) calc(2 * var(--u)) 0 color-mix(in srgb, var(--cd-cast) 5%, transparent);
}
.ashot__win::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 1px solid var(--lt-outline-default);
  border-radius: inherit;
  box-shadow: inset 0 1px 0 0 var(--lt-background-canvas);
  pointer-events: none;
}
.ashot__bar {
  position: relative;
  z-index: 2;
  flex: none;
  display: flex;
  align-items: center;
  gap: calc(6 * var(--u));
  height: calc(43 * var(--u));
  padding-left: calc(18 * var(--u));
  border-bottom: 1px solid var(--cd-bar-line);
  background: var(--cd-surface);
  font-size: calc(13 * var(--u));
  line-height: calc(18 * var(--u));
  font-weight: 500;
  white-space: nowrap;
}

/* The chat: at the top until it fills the window, then the newest line stays above the composer */
.ashot__chat {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  overflow: clip;
  padding: calc(24 * var(--u)) calc(16 * var(--u)) 0;
  margin-bottom: calc(18 * var(--u));
}
.ashot__col {
  flex: none;
  margin-bottom: auto;
  width: min(calc(640 * var(--u)), 100%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: calc(14 * var(--u));
}
.ashot__col > * { max-width: 100%; }
.ashot--hero .ashot__col { gap: calc(22 * var(--u)); }

/* The scroll fade under the title bar, in the scenes Figma draws it */
.ashot__fade {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  top: calc(43 * var(--u));
  height: calc(70 * var(--u));
  background: linear-gradient(180deg, var(--cd-surface), color-mix(in srgb, var(--cd-surface) 0%, transparent));
  pointer-events: none;
  opacity: 0;
}

.ashot__foot {
  flex: none;
  display: flex;
  justify-content: center;
  padding: 0 calc(16 * var(--u)) calc(23 * var(--u));
}

/* ── The kit ─────────────────────────────────────────────────────────────────────────────────────────── */

/* Bubble: the person's message */
.ash-bubble {
  width: fit-content;
  max-width: 100%;
  padding: calc(10 * var(--u)) calc(16 * var(--u));
  border-radius: calc(14 * var(--u));
  background: var(--cd-bubble);
  font-size: calc(14 * var(--u));
  line-height: calc(20 * var(--u));
}
.ash-bubble--command { color: var(--cd-command); }

/* Tool row: a collapsed line of the agent's tool use */
.ash-tool {
  display: flex;
  align-items: center;
  gap: calc(4 * var(--u));
  color: var(--cd-muted);
  font-size: calc(13 * var(--u));
  line-height: calc(18 * var(--u));
}

/* Edit row: a file the agent changed, with its line counts */
.ash-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: calc(8 * var(--u));
  font-size: calc(13 * var(--u));
  line-height: calc(18 * var(--u));
  white-space: nowrap;
}
.ash-edit > span:first-child { color: var(--cd-muted); }
.ash-edit b { font-weight: 500; }
.ash-add, .ash-del { font-family: var(--lt-font-mono); font-size: calc(12 * var(--u)); }
.ash-add { color: var(--lt-green-fg-status); }
.ash-del { color: var(--lt-red-fg-status); }

/* The agent's prose */
.ash-p { margin: 0; width: 100%; }
.ash-p b, .ash-li b { font-weight: 600; }
.ash-c { font-family: var(--lt-font-mono); font-size: calc(13.5 * var(--u)); color: var(--cd-code); overflow-wrap: anywhere; }
.ash-li { display: flex; gap: calc(10 * var(--u)); width: 100%; padding-left: calc(4 * var(--u)); }
.ash-li::before { content: '•'; flex: none; color: var(--cd-muted); }
.ash-rule { width: 100%; height: 1px; background: var(--cd-line); }

/* Icons drawn in the markup (chevrons, send, check), coloured here */
.ash-ico { flex: none; display: block; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.ash-ico--12 { width: calc(12 * var(--u)); height: calc(12 * var(--u)); stroke-width: 1.05; }
.ash-ico--10 { width: calc(10 * var(--u)); height: calc(10 * var(--u)); stroke-width: 1; color: var(--cd-muted); }
.ash-ico--14 { width: calc(14 * var(--u)); height: calc(14 * var(--u)); stroke-width: 1.4875; }
.ash-ico--16 { width: calc(16 * var(--u)); height: calc(16 * var(--u)); stroke-width: 1.33333; }
.ash-logo { flex: none; display: block; width: calc(16 * var(--u)); height: calc(16 * var(--u)); }

/* The 🛡️ shield LeoTrace prints, as Apple Color Emoji draws it */
.ash-shield { display: inline-block; width: calc(16 * var(--u)); height: calc(16 * var(--u)); vertical-align: calc(-3 * var(--u)); }

/* LeoTrace block: the quoted block the agent prints first, tinted, with its red rule */
.ash-leo {
  width: 100%;
  display: flex;
  overflow: hidden;
  border-radius: calc(10 * var(--u));
  background: var(--cd-leo-tint);
}
.ash-leo::before { content: ''; flex: none; width: calc(3 * var(--u)); background: var(--cd-leo-rule); }
.ash-leo__in { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: calc(6 * var(--u)); padding: calc(12 * var(--u)) calc(16 * var(--u)) calc(12 * var(--u)) calc(14 * var(--u)); }
.ash-leo__head { font-size: calc(14 * var(--u)); line-height: calc(20 * var(--u)); color: var(--cd-muted); }
.ash-leo__head .ash-shield { margin-right: calc(7 * var(--u)); }
.ash-leo__head b { margin-right: calc(7 * var(--u)); font-weight: 600; color: var(--cd-ink); }
.ash-leo__body { margin: 0; }
/* The same block when LeoTrace has checked the agent's fix: its rule and tint turn green, so the close of the
   turn reads as plainly as the flag that opened it */
.ash-leo--ok { background: var(--lt-green-fill-row); }
.ash-leo--ok::before { background: var(--lt-green-accent); }

/* Question card: the agent asks the person to choose */
.ash-ask {
  width: calc(560 * var(--u));
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: calc(10 * var(--u));
  padding: calc(14 * var(--u)) calc(16 * var(--u));
  border: 1px solid var(--cd-line);
  border-radius: calc(14 * var(--u));
  background: var(--cd-field);
  box-shadow: 0 calc(10 * var(--u)) calc(24 * var(--u)) calc(-10 * var(--u)) color-mix(in srgb, var(--cd-shade) 8%, transparent);
}
.ash-ask__q { display: flex; align-items: flex-start; gap: calc(7 * var(--u)); font-size: calc(14 * var(--u)); line-height: calc(20 * var(--u)); font-weight: 500; }
.ash-ask__q .ash-shield { flex: none; margin-top: calc(2 * var(--u)); vertical-align: 0; }
.ash-opt { display: flex; align-items: flex-start; gap: calc(10 * var(--u)); padding: calc(10 * var(--u)) calc(12 * var(--u)) calc(10 * var(--u)) calc(10 * var(--u)); border-radius: calc(10 * var(--u)); }
.ash-opt--on { background: var(--cd-option); }
.ash-opt__n { flex: none; display: grid; place-items: center; width: calc(20 * var(--u)); height: calc(20 * var(--u)); border: 1px solid var(--cd-line); border-radius: calc(6 * var(--u)); font-size: calc(11 * var(--u)); line-height: 1; font-weight: 500; color: var(--cd-muted); }
.ash-opt__t { display: flex; flex-direction: column; gap: calc(2 * var(--u)); min-width: 0; }
.ash-opt__t b { font-size: calc(14 * var(--u)); line-height: calc(20 * var(--u)); font-weight: 500; }
.ash-opt__t span { font-size: calc(12 * var(--u)); line-height: calc(18 * var(--u)); color: var(--cd-muted); }
.ash-ask__a { display: flex; align-items: center; gap: calc(6 * var(--u)); font-size: calc(14 * var(--u)); line-height: calc(20 * var(--u)); }

/* Progress: the agent working through a list, with its tool rows boxed under it */
.ash-run { width: 100%; display: flex; flex-direction: column; gap: calc(8 * var(--u)); }
.ash-run__head { display: flex; align-items: center; gap: calc(8 * var(--u)); font-size: calc(14 * var(--u)); line-height: calc(20 * var(--u)); }
.ash-run__box { display: flex; flex-direction: column; border: 1px solid var(--cd-line); border-radius: calc(12 * var(--u)); }
.ash-run__box .ash-tool { min-height: calc(38 * var(--u)); padding: calc(10 * var(--u)) calc(14 * var(--u)); gap: calc(6 * var(--u)); }
.ash-run__box .ash-tool + .ash-tool { border-top: 1px solid var(--cd-line); }

/* Composer */
.ash-composer {
  width: min(calc(640 * var(--u)), 100%);
  height: calc(56 * var(--u));
  display: flex;
  align-items: center;
  gap: calc(12 * var(--u));
  padding: 0 calc(10 * var(--u)) 0 calc(18 * var(--u));
  border: 1px solid var(--cd-line);
  border-radius: calc(18 * var(--u));
  background: var(--cd-field);
  box-shadow:
    0 calc(12 * var(--u)) calc(28 * var(--u)) calc(-10 * var(--u)) color-mix(in srgb, var(--cd-shade) 8%, transparent),
    0 calc(1 * var(--u)) calc(3 * var(--u)) 0 color-mix(in srgb, var(--cd-cast) 4%, transparent);
  font-size: calc(14 * var(--u));
  line-height: calc(18 * var(--u));
}
.ash-composer__text { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; color: var(--cd-muted); }
.ash-composer__text--typed { color: var(--cd-ink); }
.ash-composer__send { flex: none; display: grid; place-items: center; width: calc(32 * var(--u)); height: calc(32 * var(--u)); border-radius: calc(10 * var(--u)); background: var(--cd-accent); color: var(--lt-foreground-on-accent); }

/* ── 19 Product hero turn: the turn alone, flat, on a white page (the page tilts it) ──────────────── */
.ashot--hero .ashot__stage { background: var(--lt-background-canvas); }
.ashot--hero .ashot__light {
  left: 7.78%;
  width: 84.44%;
  top: 14.29%;
  height: 74.29%;
  background: var(--cd-glow);
  filter: blur(calc(80 * var(--u)));
}
/* The plane: its bottom edge (--lb, a share of the frame's height) is where the newest line sits; it starts
   at the top of the frame until the turn fills it */
.ashot__plane {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--lb, 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: calc(80 * var(--u)) calc(16 * var(--u)) 0;
}
.ashot--hero .ashot__plane .ash-composer { width: calc(640 * var(--u)); max-width: 100%; }
.ashot__whiteout {
  position: absolute;
  left: 0;
  right: 0;
  top: 74.29%;
  height: 25.71%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--lt-background-canvas) 0%, transparent), var(--lt-background-canvas) 70%, var(--lt-background-canvas));
  pointer-events: none;
}
/* Where each scene's newest line sits, from the frames: 388, 444 and 364 of 700 */
.ashot--hero[data-step='1'] { --lb: 55.43%; }
.ashot--hero[data-step='2'] { --lb: 63.43%; }
.ashot--hero[data-step='3'] { --lb: 52%; }
/* Out of focus, everything but the scene's own lines is soft */
.ashot--hero .ash-i > * { opacity: 0.38; filter: blur(calc(1.25 * var(--u))); transition: opacity 600ms ease, filter 600ms ease; }
:is(.ashot--hero[data-step='0'] [data-focus~='0'], .ashot--hero[data-step='1'] [data-focus~='1'], .ashot--hero[data-step='2'] [data-focus~='2'], .ashot--hero[data-step='3'] [data-focus~='3']) > * { opacity: 1; filter: none; }
/* The prompt is typed into the composer */
.ashot--hero[data-step='0'] .ash-composer__text--typed { animation: ash-type 1500ms steps(23, end) 300ms both; }
/* 01: the turn opens on the prompt being typed, then sent */
.ashot--turn .ash-composer__text--typed { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: clip; vertical-align: top; }
/* The prompt types in 1s and is sent 300ms later, so LeoTrace speaks 3s in and each turn shows what sets it apart
   while it is still on screen (Johnny, 12 Nov: the turns looked alike as the page scrolled) */
.ashot--turn[data-step='0'] .ash-composer__text--typed { animation: ash-type 800ms steps(64, end) both; }
@keyframes ash-type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ── The beats: a part shows in the scenes its data-on names, and fades in when it arrives ────────────── */
.ash-i { display: none; width: 100%; }
:is(.ashot[data-step='0'] [data-on~='0'], .ashot[data-step='1'] [data-on~='1'], .ashot[data-step='2'] [data-on~='2'], .ashot[data-step='3'] [data-on~='3'], .ashot[data-step='4'] [data-on~='4'], .ashot[data-step='5'] [data-on~='5']) {
  display: block;
  animation: ash-in 360ms var(--ease, ease) both;
}
/* A line still waiting its turn in its scene is held out of the chat by js/v7/loop.js, so it takes no room and
   fades in when it arrives: a scene's lines come one by one */
.ashot .ash-i.is-wait { display: none !important; }
/* and the lines on screen when a scene changes stay through its thinking, until its first new line arrives */
.ashot .ash-i.is-stay { display: block !important; animation: none !important; }
@keyframes ash-in { from { opacity: 0; transform: translateY(calc(6 * var(--u))); } to { opacity: 1; transform: none; } }
.ashot--sweep[data-step='1'] .ashot__fade { opacity: 1; }

/* ── Narrow slots and phones: the window fills more of the stage and the frame grows taller ─────────── */
@container ashot (max-width: 560px) {
  .ashot--turn .ashot__stage, .ashot--sweep .ashot__stage { aspect-ratio: 4 / 6.6; padding: 10px; }
  .ashot--hero .ashot__stage { aspect-ratio: 4 / 5; }
  .ashot__chat { padding-inline: 14px; }
  .ashot__foot { padding-inline: 14px; }
  .ashot--hero .ashot__plane { padding-inline: 14px; }
  .ash-bubble, .ash-edit, .ash-tool, .ash-run__head { white-space: normal; }
}

/* ── Thinking (12 Nov): js/v7/loop.js draws one row at the foot of each chat and shows it at the start of every
   scene, before the scene's lines arrive: the agent's spark and "Thinking", or the LeoTrace shield and
   "LeoTrace is reviewing" before a LeoTrace block. The words shimmer as the app's do while it works ────── */
.ash-think { display: none; align-items: center; gap: calc(8 * var(--u)); width: 100%; color: var(--cd-muted); font-size: calc(13 * var(--u)); line-height: calc(18 * var(--u)); }
.ashot.is-thinking .ash-think { display: flex; animation: ash-in 240ms var(--ease, ease) both; }
.ash-think__mark { width: calc(10 * var(--u)); height: calc(10 * var(--u)); border-radius: 50%; background: var(--cd-accent); animation: ash-think-pulse 900ms ease-in-out infinite; }
.ash-think__shield { display: none; }
.ashot.is-leo .ash-think__mark { display: none; }
.ashot.is-leo .ash-think__shield { display: inline-block; vertical-align: 0; }
.ash-think__t { background: linear-gradient(90deg, var(--cd-muted) 0%, var(--cd-ink) 45%, var(--cd-muted) 90%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ash-think-sheen 1400ms linear infinite; }
@keyframes ash-think-pulse { 0%, 100% { transform: scale(0.7); opacity: 0.55; } 50% { transform: scale(1); opacity: 1; } }
@keyframes ash-think-sheen { from { background-position: 120% 0; } to { background-position: -120% 0; } }

@media (prefers-color-scheme: dark) {
  .ashot {
    --cd-surface: color(srgb 0.1490 0.1490 0.1412);
    --cd-bubble: color(srgb 0.1882 0.1882 0.1804);
    --cd-muted: color(srgb 0.6510 0.6392 0.6078);
    --cd-ink: color(srgb 0.9608 0.9569 0.9333);
    --cd-line: color(srgb 0.2431 0.2392 0.2235);
    --cd-bar-line: color(srgb 0.2039 0.2000 0.1843);
    --cd-code: color(srgb 0.9255 0.6078 0.5216);
    --cd-command: color(srgb 0.5412 0.7059 0.9098);
    --cd-option: color(srgb 0.1882 0.1882 0.1804);
    --cd-leo-tint: color(srgb 0.2275 0.1569 0.1373);
    --cd-glow: color(srgb 0.1647 0.1608 0.1490);
    --cd-shade: color(srgb 0 0 0);
    --cd-field: color(srgb 0.1882 0.1882 0.1804);
    --cd-cast: color(srgb 0 0 0);
  }
}
