{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"answer-stream","type":"registry:component","title":"Answer Stream","description":"Streaming AI response animation, from the send button to the answer typing in. The beat after send: a macro shot on the button that cuts — hard, on its fastest frame — to the answer building itself on the page, while the camera pulls back 1.364× about a focal point above the frame to keep up with it.","dependencies":["remotion","@remotion/google-fonts"],"docs":"Needs a Remotion project. If a frame renders black, the component is drawing on a transparent layer: put a background behind it, e.g. <AbsoluteFill style={{ background: \"#faf9f6\" }}><Component /></AbsoluteFill>. Pass mode=\"dark\" for dark frames.","registryDependencies":["https://kuchi.kalarislabs.com/r/kuchi-ui.json","https://kuchi.kalarislabs.com/r/input.json"],"files":[{"path":"components/kuchi/answer-stream.tsx","type":"registry:component","target":"components/kuchi/answer-stream.tsx","content":"/*! Portions Copyright (c) 2026 Sri Nath (snap-cn). MIT License. See THIRD_PARTY_LICENSES. */\n\"use client\";\r\n\r\nimport { loadFont as loadSans } from \"@remotion/google-fonts/Inter\";\r\nimport { loadFont as loadSerif } from \"@remotion/google-fonts/SourceSerif4\";\r\nimport {\r\n  AbsoluteFill,\r\n  getRemotionEnvironment,\r\n  useCurrentFrame,\r\n  useVideoConfig,\r\n} from \"remotion\";\r\nimport { inputStyleContext } from \"@/components/kuchi/input\";\r\nimport {\r\n  clamp01,\r\n  easings,\r\n  Item,\r\n  mixOklch,\r\n  resolveFont,\r\n  type KuchiTheme,\r\n  useKuchiTheme,\r\n} from \"@/lib/kuchi-ui\";\r\n\r\n// Loaded through @remotion/google-fonts, never a CSS variable — a Remotion\r\n// bundle has none of the app's CSS, so a `var(--font-…)` gets you the right face\r\n// in the Player and a fallback in the mp4 (design-system rule 4).\r\nconst { fontFamily: SERIF } = loadSerif(\"normal\", {\r\n  weights: [\"400\", \"600\"],\r\n  subsets: [\"latin\"],\r\n});\r\nconst { fontFamily: SANS } = loadSans(\"normal\", {\r\n  weights: [\"400\", \"500\"],\r\n  subsets: [\"latin\"],\r\n});\r\n\r\nexport interface AnswerCard {\r\n  title: string;\r\n  body: string;\r\n  /** SVG path for the card's lead glyph, on a 24×24 viewBox. */\r\n  icon?: string;\r\n}\r\n\r\nexport interface AnswerStreamProps {\r\n  /** The prompt. Fills the pill, and stays in the composer. */\r\n  question?: string;\r\n  /** The reply. `\\n` is a hard break; everything else wraps. */\r\n  answer?: string;\r\n  /** The line that lands under the reply and introduces the cards. */\r\n  headline?: string;\r\n  /** The plan. Each lands as an empty card, then fills. */\r\n  cards?: AnswerCard[];\r\n  /** Composer footer. */\r\n  model?: string;\r\n\r\n  // --- timeline (seconds) ---\r\n  /** When the push into the send button starts accelerating. */\r\n  commitAt?: number;\r\n  /** When the shot **cuts** to the answer. Not a transition — one frame. */\r\n  cutAt?: number;\r\n  /** When the camera starts pulling back to keep up with the answer. */\r\n  pullbackAt?: number;\r\n  /** How long the pull-back takes. */\r\n  pullbackDuration?: number;\r\n  /** Streaming rate, in words per second. */\r\n  wordsPerSecond?: number;\r\n  /** How long a word stays hot before it has cooled to `foreground`. */\r\n  coolSeconds?: number;\r\n\r\n  // --- camera ---\r\n  /** Scale of the opening macro shot on the send button. */\r\n  macroZoom?: number;\r\n  /** How far in the answer shot starts, relative to where it settles. */\r\n  pullbackFrom?: number;\r\n  /** How far past its mark the pull-back goes before easing back onto it. */\r\n  pullbackUndershoot?: number;\r\n  /** The pull-back's focal point, as a fraction of the frame. It is *above*\r\n   *  the top edge, which is what makes the page rise as it shrinks. */\r\n  focusX?: number;\r\n  focusY?: number;\r\n  /** Peak motion blur, in reference px, at the pull-back's fastest frame. */\r\n  blur?: number;\r\n\r\n  /** The send button and the hot edge of the stream. Defaults to `theme.primary`. */\r\n  accentColor?: string;\r\n  theme?: Partial<KuchiTheme>;\r\n  mode?: \"light\" | \"dark\";\r\n  /**\r\n   * The face this scene paints its words in — a label from `fonts.ts`\r\n   * (\"Inter\", \"Space Grotesk\", \"Instrument Serif\") or a CSS family you have\r\n   * loaded yourself. Unset, the scene keeps the face it was designed around.\r\n   *\r\n   * Overrides `theme.fontFamily`, which is how a brand kit re-skins a whole\r\n   * timeline from one value.\r\n   */\r\n  fontFamily?: string;\r\n  speed?: number;\r\n}\r\n\r\n// --- Pure helpers (unit-tested) -------------------------------------------\r\n\r\n/**\r\n * The answer shot's camera scale, where 1 is the framing it settles on.\r\n *\r\n * Three segments, all measured: it holds where the cut left it, pulls back on\r\n * a **symmetric** curve to slightly past its mark, and creeps back onto it.\r\n *\r\n * The symmetry is the measurement, not a default. Tracking the column's two\r\n * edges across the reference puts peak velocity at 48–52% of the move — dead\r\n * centre, which is a cubic in-out and *not* a spring (a spring peaks at a\r\n * third). Re-measured on the *rendered* frames against the reference's, the two\r\n * curves start together, end together, and part by at most **0.048 of scale**\r\n * around the midpoint — the reference is fractionally front-loaded against a\r\n * symmetric cubic. A quadratic in-out closes about a third of that. It is not\r\n * worth a second easing curve: the residual is one frame of timing in the\r\n * middle of a 33-frame move, and `easings.inOut` is the one the rest of the\r\n * registry already moves on.\r\n *\r\n * `1` is where the shot **settles**, not where the pull-back bottoms out. That\r\n * distinction is worth a sentence because getting it wrong is silent: normalise\r\n * against the bottom of the move instead and every constant here is 2.8% out,\r\n * the layout never lands where it was measured, and the curve reads as lagging\r\n * the reference by two frames in the middle with the ends still matching.\r\n */\r\nexport function shotBScale(\r\n  fc: number,\r\n  pullF: number,\r\n  pullDurF: number,\r\n  from: number,\r\n  undershoot: number,\r\n  recoverF: number,\r\n): number {\r\n  if (fc <= pullF) return from;\r\n  const bottom = 1 - undershoot;\r\n  const u = clamp01((fc - pullF) / pullDurF);\r\n  if (u < 1) return from + (bottom - from) * easings.inOut(u);\r\n  // The reference does not stop dead. It sits ~3 frames at the bottom of the\r\n  // move and then comes back in by 2.8% — the same slow push that is under\r\n  // every other shot in the clip, and like the rest of them it runs at a\r\n  // constant rate, so this is linear and not an ease.\r\n  //\r\n  // **Bounded**, unlike the drift itself: model it as an open-ended creep and\r\n  // the composer walks off the bottom edge somewhere after four seconds, which\r\n  // is a bug you only ever see in a long config.\r\n  const v = clamp01((fc - pullF - pullDurF - 3) / recoverF);\r\n  return bottom + undershoot * v;\r\n}\r\n\r\n/**\r\n * How cooled a word is: 0 the frame it lands, 1 once it has settled to\r\n * `foreground`. Words are born hot and cool on a fixed clock, so the hot band\r\n * is `wordsPerSecond × coolSeconds` words wide no matter how fast the stream\r\n * runs — on the reference, six.\r\n */\r\nexport function heat(fc: number, bornF: number, coolF: number): number {\r\n  if (coolF <= 0) return 1;\r\n  return clamp01((fc - bornF) / coolF);\r\n}\r\n\r\n/** Frame at which word `i` of a stream that opened at `startF` lands. */\r\nexport function wordBirth(\r\n  i: number,\r\n  startF: number,\r\n  wordsPerFrame: number,\r\n): number {\r\n  return wordsPerFrame <= 0 ? startF : startF + i / wordsPerFrame;\r\n}\r\n\r\n// --- Icons -----------------------------------------------------------------\r\n\r\nfunction Glyph({ d, size, color }: { d: string; size: number; color: string }) {\r\n  return (\r\n    <svg\r\n      viewBox=\"0 0 24 24\"\r\n      width={size}\r\n      height={size}\r\n      fill=\"none\"\r\n      stroke={color}\r\n      strokeWidth={1.8}\r\n      strokeLinecap=\"round\"\r\n      strokeLinejoin=\"round\"\r\n      style={{ display: \"block\", flexShrink: 0 }}\r\n    >\r\n      <title>icon</title>\r\n      <path d={d} />\r\n    </svg>\r\n  );\r\n}\r\n\r\nconst CARD_ICONS = [\r\n  \"M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z\", // pencil\r\n  \"M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7L12 19\", // link\r\n  \"M12 2 4 6v6c0 5 3.4 8.9 8 10 4.6-1.1 8-5 8-10V6l-8-4Z\", // shield\r\n  \"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20ZM2 12h20M12 2a15 15 0 0 1 0 20 15 15 0 0 1 0-20Z\", // globe\r\n];\r\n\r\nconst DEFAULT_CARDS: AnswerCard[] = [\r\n  {\r\n    title: \"Content\",\r\n    body: \"Build pages around the exact questions buyers ask, so there is something accurate to cite.\",\r\n  },\r\n  {\r\n    title: \"Citations\",\r\n    body: \"Run outreach to the sources that already get quoted for those questions.\",\r\n  },\r\n  {\r\n    title: \"Authority\",\r\n    body: \"Earn links from the publishers the models already trust.\",\r\n  },\r\n  {\r\n    title: \"Coverage\",\r\n    body: \"Place press so the name turns up wherever people go looking.\",\r\n  },\r\n];\r\n\r\n// --- Streaming text --------------------------------------------------------\r\n\r\n/**\r\n * A block of text that arrives a word at a time, each word hot and cooling.\r\n *\r\n * The separator is a text node **between** the spans, never a trailing space\r\n * inside one: a trailing space at the end of an inline box is stripped by CSS,\r\n * and per-word spans render as `Noextracharge`.\r\n */\r\nfunction Stream({\r\n  text,\r\n  fc,\r\n  startF,\r\n  wordsPerFrame,\r\n  coolF,\r\n  ramp,\r\n  style,\r\n}: {\r\n  text: string;\r\n  fc: number;\r\n  startF: number;\r\n  wordsPerFrame: number;\r\n  coolF: number;\r\n  /** Colours from hot (index 0) to cooled (last). Quantised on purpose. */\r\n  ramp: string[];\r\n  style: React.CSSProperties;\r\n}) {\r\n  // Hard breaks are the author's; everything else is left to wrap.\r\n  const lines = text.split(\"\\n\");\r\n  let n = 0;\r\n  return (\r\n    <div style={{ ...style, textRendering: \"geometricPrecision\" }}>\r\n      {lines.map((line, li) => {\r\n        const words = line.split(\" \");\r\n        return (\r\n          // biome-ignore lint/suspicious/noArrayIndexKey: lines are positional\r\n          <div key={li}>\r\n            {words.map((w, wi) => {\r\n              const born = wordBirth(n++, startF, wordsPerFrame);\r\n              const h = heat(fc, born, coolF);\r\n              // Hidden, not absent. A word that is removed until its frame lets\r\n              // the line reflow under it, and every word already on screen\r\n              // shifts as the next one lands — on the reference they do not\r\n              // move at all. The cool-down is the reveal; there is no fade\r\n              // under it, because on the reference a word arrives at full\r\n              // accent and only the *colour* moves after that.\r\n              const opacity = fc >= born ? 1 : 0;\r\n              return (\r\n                <span\r\n                  // biome-ignore lint/suspicious/noArrayIndexKey: words are positional\r\n                  key={wi}\r\n                  style={{\r\n                    color:\r\n                      ramp[\r\n                        Math.min(\r\n                          ramp.length - 1,\r\n                          Math.round(h * (ramp.length - 1)),\r\n                        )\r\n                      ],\r\n                    opacity,\r\n                  }}\r\n                >\r\n                  {wi > 0 ? \" \" : \"\"}\r\n                  {w}\r\n                </span>\r\n              );\r\n            })}\r\n          </div>\r\n        );\r\n      })}\r\n    </div>\r\n  );\r\n}\r\n\r\n// --- The reference's own frame ---------------------------------------------\r\n//\r\n// Every number below was measured on a 886×498 recording, in that recording's\r\n// pixels, at the framing the shot **settles** on. Laying out in these units\r\n// means no number here is a conversion of a number that was measured.\r\n\r\nconst REF_W = 886;\r\nconst REF_H = 498;\r\n\r\nconst PILL = { right: 706, top: 22, h: 28, padX: 15, size: 11 };\r\nconst ANSWER = { x: 171, top: 82, w: 400, size: 13, line: 17 };\r\nconst HEAD = { x: 171, top: 152, size: 16 };\r\nconst ROW = { x: 171, top: 190, w: 128, h: 140, gap: 5, r: 6 };\r\nconst BOX = { x: 163, y: 362, w: 549, h: 128, r: 20 };\r\n// The send button, measured inside the composer. It is what the opening macro\r\n// shot is framed on, so it has to be right in both shots — it is one element.\r\nconst SEND = { size: 28, r: 9, right: 19, bottom: 28 };\r\n// Where the macro shot parks the send button, as a fraction of the frame.\r\n// Measured once the shot has finished decelerating (reference frames 70–82).\r\nconst MACRO_X = 0.571;\r\nconst MACRO_Y = 0.591;\r\n\r\n// --- Main composition ------------------------------------------------------\r\n\r\n/**\r\n * The beat after you press send: the macro shot on the button, the **cut**, and\r\n * the answer building itself on the page while the camera pulls back to keep up\r\n * with it.\r\n *\r\n * ## Scene to scene, the frame cuts. It never transitions.\r\n *\r\n * Read frame by frame, the reference has exactly one grammar for changing\r\n * shot, and it is a hard cut — one frame wide, no blur, no ramp. What makes the\r\n * cuts invisible is not a transition, it is what happens **either side** of\r\n * them:\r\n *\r\n * - **Every cut lands on motion.** The camera here is 8 frames into an\r\n *   accelerating push toward the button when the cut fires. It is moving fastest\r\n *   at the moment it is replaced, which is the oldest trick there is for hiding\r\n *   an edit.\r\n * - **Every cut is followed by a glide, not a stop.** The frame arrives slightly\r\n *   off and eases in — measured, the answer page lands 27px high and settles\r\n *   down over 15 frames on an ease-out. Cut to a static frame and the edit is\r\n *   the loudest thing in the shot.\r\n *\r\n * The only *move* in the whole reference is inside a shot, and there are two\r\n * kinds: a slow idle drift that never stops, and one fast blurred push to\r\n * whatever is about to happen.\r\n *\r\n * ## The pull-back is fitted to the content, not to the clock\r\n *\r\n * As the answer grows — paragraph, then headline, then four cards, then the\r\n * composer sliding up — the camera pulls back and rises to keep the block in\r\n * frame. Tracking the column's left and right edges across the move recovers a\r\n * scale of **1.404× → 1.0** about a fixed point at **(0.5, −0.548)** of the\r\n * frame: dead centre horizontally, and 273px *above the top edge*. Both edges\r\n * agree on that point to within 1px, which is what makes it a measurement and\r\n * not a guess. A focal point above the frame is the whole reason the page\r\n * appears to rise as it shrinks, instead of collapsing toward its middle.\r\n *\r\n * Peak velocity sits at 48–52% of the move, so the curve is a cubic in-out —\r\n * see `shotBScale`. And the move carries **motion blur** at its fastest frames,\r\n * derived from the camera's own speed rather than dialled in by eye.\r\n *\r\n * ## Containers land empty; content streams into them\r\n *\r\n * The pill, and every card, arrive as an empty surface first and fill after.\r\n * The text itself arrives a word at a time, each word **hot** — at the accent —\r\n * cooling to `foreground` on a fixed clock, which keeps a moving band of about\r\n * six words lit at the head of the stream.\r\n *\r\n * ## What is not measured\r\n *\r\n * The colours and the copy. The reference is a specific product with its own\r\n * coral, its own four icon tints and its own marketing lines. None of that\r\n * belongs in a component that lands next to somebody else's `Input`\r\n * (design-system rule 5). The paint is the shadcn token set, the composer takes\r\n * its surface from the `Input` primitive's own style context, and every string\r\n * is a prop.\r\n */\r\nexport function AnswerStream({\r\n  question = \"How do I rank higher in AI answers?\",\r\n  answer = \"Analysing your prompt gaps…\\nFound 27 prompts you should rank for and don't yet, so your name shows up everywhere AI looks.\",\r\n  headline = \"Your AI visibility score: 34% — here's how I'd fix it:\",\r\n  cards = DEFAULT_CARDS,\r\n  model = \"Auto\",\r\n  commitAt = 1.0,\r\n  cutAt = 1.284,\r\n  pullbackAt = 1.933,\r\n  pullbackDuration = 1.1,\r\n  wordsPerSecond = 25,\r\n  coolSeconds = 0.23,\r\n  macroZoom = 2.36,\r\n  pullbackFrom = 1.364,\r\n  pullbackUndershoot = 0.028,\r\n  focusX = 0.5,\r\n  focusY = -0.548,\r\n  blur = 3,\r\n  accentColor,\r\n  theme,\r\n  mode,\r\n  fontFamily,\r\n  speed = 1,\r\n}: AnswerStreamProps) {\r\n  const frame = useCurrentFrame();\r\n  const { width, height, fps } = useVideoConfig();\r\n  const t = useKuchiTheme(theme, mode);\r\n  const face = resolveFont(fontFamily ?? t.fontFamily) ?? SANS;\r\n  const ui = inputStyleContext(t);\r\n  const accent = accentColor ?? t.primary;\r\n\r\n  const fc = frame * speed;\r\n  const stageScale = Math.min(width / REF_W, height / REF_H);\r\n\r\n  // A hairline is specified at a 40px control; these surfaces are 128–140 tall,\r\n  // so the token is walked toward the foreground through the system's own mix\r\n  // rather than by picking a darker grey (design-system rule 3b). No drop\r\n  // shadow — under a surface this size a visible one is a grey smear (rule 3).\r\n  const border = `1px solid ${mixOklch(ui.idleBorder, t.foreground, 0.18)}`;\r\n\r\n  // Hot → cooled, quantised to 9 steps and built once. A frame of this shot\r\n  // colours ~110 words; 110 live `mixOklch` calls per frame is the one thing in\r\n  // here a Player cannot afford, and nobody can see the ninth of a step.\r\n  const ramp = Array.from({ length: 9 }, (_, i) =>\r\n    mixOklch(accent, t.foreground, i / 8),\r\n  );\r\n  const mutedRamp = Array.from({ length: 9 }, (_, i) =>\r\n    mixOklch(t.mutedForeground, t.foreground, i / 8),\r\n  );\r\n\r\n  // --- timeline (frames) ---\r\n  const commitF = commitAt * fps;\r\n  const cutF = cutAt * fps;\r\n  const pullF = pullbackAt * fps;\r\n  const pullDurF = pullbackDuration * fps;\r\n  const wpf = wordsPerSecond / fps;\r\n  const coolF = coolSeconds * fps;\r\n  const cut = fc >= cutF;\r\n\r\n  const isRendering = getRemotionEnvironment().isRendering;\r\n  // Right for the Player, wrong for the render: parallel render tabs inherit a\r\n  // stale raster and the type shimmers while standing still.\r\n  const willChange = isRendering ? undefined : (\"transform\" as const);\r\n\r\n  // --- shot A: the macro on the send button -------------------------------\r\n  //\r\n  // Same composer as the answer shot, scaled about the button. One element, two\r\n  // framings, so the two cannot drift apart.\r\n  const btnX = BOX.x + BOX.w - SEND.right - SEND.size / 2;\r\n  const btnY = BOX.y + BOX.h - SEND.bottom - SEND.size / 2;\r\n  // The shot opens still decelerating out of the push that arrived on it —\r\n  // measured, the button slides 158px left and 14px up over 15 frames.\r\n  const settle = easings.out(clamp01(fc / 15));\r\n  // …and closes accelerating into the next one. The cut fires here, at the\r\n  // fastest frame of the move, which is what hides it.\r\n  const commit = clamp01((fc - commitF) / Math.max(1, cutF - commitF)) ** 3;\r\n  // The press, on its own clock so it *causes* the push rather than competing\r\n  // with it: three frames down, five back. The reference has none — its cursor\r\n  // is already on the button when the shot opens, and the accelerating push\r\n  // does all the work. Synthesised, the cut needs a visible cause.\r\n  const press =\r\n    fc < commitF\r\n      ? 0\r\n      : fc < commitF + 3\r\n        ? (fc - commitF) / 3\r\n        : 1 - clamp01((fc - commitF - 3) / 5);\r\n\r\n  // --- shot B: the answer -------------------------------------------------\r\n  const cam = (f: number) =>\r\n    shotBScale(f, pullF, pullDurF, pullbackFrom, pullbackUndershoot, 26);\r\n  const sB = cam(fc);\r\n  // Blur from the camera's own speed: a frame that carries a typical element\r\n  // d px smears it by d/4. The radius is taken to the frame's *centre*, not its\r\n  // far edge — a corner-radius model is four times too strong, and measured on\r\n  // the reference the smear at peak is 4–6px on type that is still legible, not\r\n  // the wash that comes out of a far-edge estimate.\r\n  // ponytail: uniform blur, not radial. The reference's is radial about the\r\n  // focal point; at 3px nobody reads the difference. Per-element radial blur\r\n  // needs a filter per element — reach for it only if a slower push shows it up.\r\n  const camBlur = Math.min(\r\n    blur,\r\n    (Math.abs(sB - cam(fc - 1)) * (REF_H / 2 - focusY * REF_H)) / 4,\r\n  );\r\n  // The cut lands 27px high and eases down. A cut to a static frame is the\r\n  // loudest edit in the shot.\r\n  const entry = (1 - easings.out(clamp01((fc - cutF) / 15))) * -27;\r\n\r\n  const streamStart = cutF + 0.075 * fps;\r\n  const headStart = streamStart + (2.717 - 1.359) * fps;\r\n  const composerIn = easings.out(\r\n    clamp01((fc - (cutF + (2.442 - 1.284) * fps)) / 12),\r\n  );\r\n  const cardsAt = cutF + (2.642 - 1.284) * fps;\r\n\r\n  const composer = (\r\n    <div\r\n      style={{\r\n        position: \"absolute\",\r\n        left: BOX.x,\r\n        top: BOX.y,\r\n        width: BOX.w,\r\n        height: BOX.h,\r\n        borderRadius: BOX.r,\r\n        background: t.card,\r\n        border,\r\n        boxShadow: \"none\",\r\n      }}\r\n    >\r\n      <div\r\n        style={{\r\n          position: \"absolute\",\r\n          left: 28,\r\n          top: 26,\r\n          right: 28,\r\n          fontFamily: face,\r\n          fontSize: 14,\r\n          lineHeight: 1.4,\r\n          color: t.foreground,\r\n          textRendering: \"geometricPrecision\",\r\n        }}\r\n      >\r\n        {question}\r\n      </div>\r\n      <div\r\n        style={{\r\n          position: \"absolute\",\r\n          left: 28,\r\n          right: SEND.right,\r\n          bottom: SEND.bottom - SEND.size / 2,\r\n          height: SEND.size,\r\n          display: \"flex\",\r\n          alignItems: \"center\",\r\n          justifyContent: \"space-between\",\r\n          fontFamily: face,\r\n          fontSize: 9,\r\n          color: t.mutedForeground,\r\n        }}\r\n      >\r\n        <Glyph d=\"M12 5v14M5 12h14\" size={16} color={t.mutedForeground} />\r\n        <div style={{ display: \"flex\", alignItems: \"center\", gap: 10 }}>\r\n          <span>{model}</span>\r\n          <div\r\n            style={{\r\n              width: SEND.size,\r\n              height: SEND.size,\r\n              borderRadius: SEND.r,\r\n              background: accent,\r\n              display: \"flex\",\r\n              alignItems: \"center\",\r\n              justifyContent: \"center\",\r\n              transform: `scale(${1 - 0.07 * press})`,\r\n            }}\r\n          >\r\n            <Glyph\r\n              d=\"M12 19V5M5 12l7-7 7 7\"\r\n              size={15}\r\n              color={t.primaryForeground}\r\n            />\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </div>\r\n  );\r\n\r\n  return (\r\n    <AbsoluteFill style={{ background: t.background, overflow: \"hidden\" }}>\r\n      <div\r\n        style={{\r\n          position: \"absolute\",\r\n          left: \"50%\",\r\n          top: \"50%\",\r\n          width: REF_W,\r\n          height: REF_H,\r\n          overflow: \"hidden\",\r\n          transform: `translate(-50%, -50%) scale(${stageScale})`,\r\n        }}\r\n      >\r\n        {cut ? (\r\n          // ---- Shot B: the answer.\r\n          <div\r\n            style={{\r\n              position: \"absolute\",\r\n              inset: 0,\r\n              transform: `translateY(${entry}px)`,\r\n              filter:\r\n                camBlur > 0.15 ? `blur(${camBlur.toFixed(2)}px)` : undefined,\r\n              willChange,\r\n            }}\r\n          >\r\n            <div\r\n              style={{\r\n                position: \"absolute\",\r\n                inset: 0,\r\n                transform: `scale(${sB})`,\r\n                transformOrigin: `${focusX * REF_W}px ${focusY * REF_H}px`,\r\n                willChange,\r\n              }}\r\n            >\r\n              {/* ---- The question, as a pill. It lands empty and fills. */}\r\n              <div\r\n                style={{\r\n                  position: \"absolute\",\r\n                  right: REF_W - PILL.right,\r\n                  top: PILL.top,\r\n                  height: PILL.h,\r\n                  padding: `0 ${PILL.padX}px`,\r\n                  borderRadius: PILL.h / 2,\r\n                  background: t.muted,\r\n                  display: \"flex\",\r\n                  alignItems: \"center\",\r\n                }}\r\n              >\r\n                <Stream\r\n                  text={question}\r\n                  fc={fc}\r\n                  startF={cutF}\r\n                  wordsPerFrame={16 / fps}\r\n                  coolF={coolF}\r\n                  ramp={mutedRamp}\r\n                  style={{\r\n                    fontFamily: face,\r\n                    fontSize: PILL.size,\r\n                    lineHeight: 1,\r\n                    whiteSpace: \"nowrap\",\r\n                  }}\r\n                />\r\n              </div>\r\n\r\n              {/* ---- The reply. */}\r\n              <Stream\r\n                text={answer}\r\n                fc={fc}\r\n                startF={streamStart}\r\n                wordsPerFrame={wpf}\r\n                coolF={coolF}\r\n                ramp={ramp}\r\n                style={{\r\n                  position: \"absolute\",\r\n                  left: ANSWER.x,\r\n                  top: ANSWER.top,\r\n                  width: ANSWER.w,\r\n                  fontFamily: SERIF,\r\n                  fontWeight: 600,\r\n                  fontSize: ANSWER.size,\r\n                  lineHeight: `${ANSWER.line}px`,\r\n                }}\r\n              />\r\n\r\n              {/* ---- The line that introduces the plan. */}\r\n              <Stream\r\n                text={headline}\r\n                fc={fc}\r\n                startF={headStart}\r\n                wordsPerFrame={16 / fps}\r\n                coolF={coolF}\r\n                ramp={ramp}\r\n                style={{\r\n                  position: \"absolute\",\r\n                  left: HEAD.x,\r\n                  top: HEAD.top,\r\n                  width: ROW.w * cards.length + ROW.gap * (cards.length - 1),\r\n                  fontFamily: SERIF,\r\n                  fontWeight: 400,\r\n                  fontSize: HEAD.size,\r\n                  lineHeight: 1.25,\r\n                }}\r\n              />\r\n\r\n              {/* ---- The plan. Each card lands empty, then fills. */}\r\n              {cards.map((c, i) => {\r\n                const boxF = cardsAt + i * 3.5;\r\n                if (fc < boxF) return null;\r\n                const fill = boxF + 4;\r\n                return (\r\n                  <Item key={c.title} index={i}>\r\n                    <div\r\n                      style={{\r\n                        position: \"absolute\",\r\n                        left: ROW.x + i * (ROW.w + ROW.gap),\r\n                        top: ROW.top,\r\n                        width: ROW.w,\r\n                        height: ROW.h,\r\n                        borderRadius: ROW.r,\r\n                        background: t.card,\r\n                        border,\r\n                        opacity: clamp01((fc - boxF) / 3),\r\n                      }}\r\n                    >\r\n                      <div style={{ position: \"absolute\", left: 12, top: 12 }}>\r\n                        <Glyph\r\n                          d={c.icon ?? CARD_ICONS[i % CARD_ICONS.length]}\r\n                          size={11}\r\n                          color={t.mutedForeground}\r\n                        />\r\n                      </div>\r\n                      <Stream\r\n                        text={c.title}\r\n                        fc={fc}\r\n                        startF={fill}\r\n                        wordsPerFrame={wpf}\r\n                        coolF={coolF}\r\n                        ramp={ramp}\r\n                        style={{\r\n                          position: \"absolute\",\r\n                          left: 12,\r\n                          top: 32,\r\n                          right: 12,\r\n                          fontFamily: SERIF,\r\n                          fontWeight: 600,\r\n                          fontSize: 8,\r\n                          lineHeight: 1.2,\r\n                        }}\r\n                      />\r\n                      <Stream\r\n                        text={c.body}\r\n                        fc={fc}\r\n                        startF={fill + 2}\r\n                        wordsPerFrame={wpf}\r\n                        coolF={coolF}\r\n                        ramp={ramp}\r\n                        style={{\r\n                          position: \"absolute\",\r\n                          left: 12,\r\n                          top: 46,\r\n                          right: 12,\r\n                          fontFamily: face,\r\n                          fontSize: 7,\r\n                          lineHeight: \"10px\",\r\n                        }}\r\n                      />\r\n                    </div>\r\n                  </Item>\r\n                );\r\n              })}\r\n\r\n              {/* ---- The composer, sliding back up under the answer. */}\r\n              <div\r\n                style={{\r\n                  transform: `translateY(${(1 - composerIn) * (REF_H - BOX.y)}px)`,\r\n                  willChange,\r\n                }}\r\n              >\r\n                {composer}\r\n              </div>\r\n            </div>\r\n          </div>\r\n        ) : (\r\n          // ---- Shot A: the macro on the send button.\r\n          <div\r\n            style={{\r\n              position: \"absolute\",\r\n              inset: 0,\r\n              transform: `translate(${(1 - settle) * 158}px, ${(1 - settle) * 14 + commit * 82}px)`,\r\n              willChange,\r\n            }}\r\n          >\r\n            <div\r\n              style={{\r\n                position: \"absolute\",\r\n                inset: 0,\r\n                transform: `translate(${MACRO_X * REF_W - btnX}px, ${MACRO_Y * REF_H - btnY}px) scale(${macroZoom * (1 + 0.12 * commit)})`,\r\n                transformOrigin: `${btnX}px ${btnY}px`,\r\n                willChange,\r\n              }}\r\n            >\r\n              {composer}\r\n            </div>\r\n          </div>\r\n        )}\r\n      </div>\r\n    </AbsoluteFill>\r\n  );\r\n}\r\n"}]}