Skip to content

Write HTML. Render video. Built for agents.

56.2 KB
Raw Blame
{"html":"<!doctype html>\n<html\n  lang=\"en\"\n  data-resolution=\"portrait\"\n  data-composition-variables='[{\"id\":\"prompt\",\"type\":\"string\",\"role\":\"content\",\"label\":\"User prompt\",\"description\":\"Prompt typed into ChatGPT; keep close to the original length.\",\"default\":\"Hey what&#39;s the best tool for ai avatars\"},{\"id\":\"intro1\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Answer introduction 1\",\"description\":\"First streamed answer paragraph.\",\"default\":\"It really depends on what you&#39;re trying to do, because “AI avatars” has split into a few different categories.\"},{\"id\":\"intro2\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Answer introduction 2\",\"description\":\"Second streamed answer paragraph.\",\"default\":\"For **most creators and marketers**, here&#39;s how I&#39;d rank them today:\"},{\"id\":\"tableHeadUse\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Table heading 1\",\"description\":\"Use-case column heading.\",\"default\":\"Use case\"},{\"id\":\"tableHeadTool\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Table heading 2\",\"description\":\"Tool column heading.\",\"default\":\"Best tool\"},{\"id\":\"tableHeadWhy\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Table heading 3\",\"description\":\"Explanation column heading.\",\"default\":\"Why\"},{\"id\":\"row1Use\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Row 1 use case\",\"description\":\"First comparison use case.\",\"default\":\"Overall realism\"},{\"id\":\"row1Tool\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Row 1 tool\",\"description\":\"Product in the recommended first row: the brand this video promotes, by its real name.\",\"portrays\":[\"subject_name\",\"recommended_position\"],\"default\":\"HeyGen\"},{\"id\":\"row1Why\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Row 1 explanation\",\"description\":\"Why the recommended first-row product wins. Describe the promoted brand from what its own site claims.\",\"portrays\":[\"recommended_position\"],\"default\":\"Most natural facial expressions, lip sync, gestures, voice cloning and localization. Benchmark for talking head videos.\"},{\"id\":\"row1Chip\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Row 1 source\",\"description\":\"Source chip on the first row. It asserts where the ranking came from, so use a neutral label whenever the comparison is written for this remix.\",\"portrays\":[\"authority_badge\"],\"default\":\"Official A.I Ranking\"},{\"id\":\"row2Use\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Row 2 use case\",\"description\":\"Second comparison use case.\",\"default\":\"Enterprise/training\"},{\"id\":\"row2Tool\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Row 2 tool\",\"description\":\"Product compared in the second row: a real product other than the brand this video promotes.\",\"portrays\":[\"competitor_name\"],\"default\":\"Synthesia\"},{\"id\":\"row2Why\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Row 2 explanation\",\"description\":\"Second recommendation explanation.\",\"default\":\"Better collaboration, SCORM, compliance, team workflows; less creator-focused.\"},{\"id\":\"row2Chip\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Row 2 source\",\"description\":\"Source chip on the second row. It asserts where the ranking came from, so use a neutral label whenever the comparison is written for this remix.\",\"portrays\":[\"authority_badge\"],\"default\":\"Official A.I Ranking\"},{\"id\":\"row3Use\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Row 3 use case\",\"description\":\"Third comparison use case.\",\"default\":\"Mobile UGC\"},{\"id\":\"row3Tool\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Row 3 tool\",\"description\":\"Product compared in the third row: a real product other than the brand this video promotes.\",\"portrays\":[\"competitor_name\"],\"default\":\"Captions\"},{\"id\":\"row3Why\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Row 3 explanation\",\"description\":\"Third recommendation explanation.\",\"default\":\"Extremely fast mobile workflow and social editing. Great for Reels creators.\"},{\"id\":\"row3Chip\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Row 3 source\",\"description\":\"Source chip on the third row. It asserts where the ranking came from, so use a neutral label whenever the comparison is written for this remix.\",\"portrays\":[\"authority_badge\"],\"default\":\"Creator Stack\"},{\"id\":\"row4Use\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Row 4 use case\",\"description\":\"Fourth comparison use case.\",\"default\":\"Real-time conversations\"},{\"id\":\"row4Tool\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Row 4 tool\",\"description\":\"Product compared in the fourth row: a real product other than the brand this video promotes.\",\"portrays\":[\"competitor_name\"],\"default\":\"Tavus\"},{\"id\":\"row4Why\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Row 4 explanation\",\"description\":\"Fourth recommendation explanation.\",\"default\":\"Interactive avatars that can hold live conversations.\"},{\"id\":\"row4Chip\",\"type\":\"string\",\"role\":\"content\",\"label\":\"Row 4 source\",\"description\":\"Source chip on the fourth row. It asserts where the ranking came from, so use a neutral label whenever the comparison is written for this remix.\",\"portrays\":[\"authority_badge\"],\"default\":\"Creator Stack\"}]'\n>\n  <head><base href=\"/public/catalog/items/chatgpt-exchange/\">\n    <meta charset=\"UTF-8\" />\n    <meta name=\"viewport\" content=\"width=1080, height=1920\" />\n    <script src=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js\"></script>\n    <style>\n      /* The real app sets OpenAI Sans, which is not licensed here. Inter is the\n         redistributable OFL stand-in, embedded under a neutral family name so the\n         composition remains self-contained and deterministic. */\n      @font-face {\n        font-family: \"ChatUI\";\n        font-weight: 400;\n        font-style: normal;\n        font-display: block;\n        src: url(\"/public/catalog/assets/8909904ab6c872eb.woff2\") format(\"woff2\");\n      }\n      @font-face {\n        font-family: \"ChatUI\";\n        font-weight: 500;\n        font-style: normal;\n        font-display: block;\n        src: url(\"/public/catalog/assets/f3779f1efccc4bdc.woff2\") format(\"woff2\");\n      }\n      @font-face {\n        font-family: \"ChatUI\";\n        font-weight: 600;\n        font-style: normal;\n        font-display: block;\n        src: url(\"/public/catalog/assets/f9a06e79cd3a2a20.woff2\") format(\"woff2\");\n      }\n      @font-face {\n        font-family: \"Apple Color Emoji\";\n        src: local(\"Apple Color Emoji\");\n      }\n\n      * {\n        margin: 0;\n        padding: 0;\n        box-sizing: border-box;\n      }\n      html,\n      body {\n        margin: 0;\n        width: 1080px;\n        height: 1920px;\n        overflow: hidden;\n        background: #000;\n      }\n      body,\n      #cge-root {\n        font-family: \"ChatUI\", sans-serif;\n        -webkit-font-smoothing: antialiased;\n      }\n\n      /* ---------------------------------------------------------------- tokens\n         Geometry is authored in POINTS (1pt = 1px inside .screen) exactly as\n         measured off the source screenshots, then scaled to the 1080x1920 frame.\n         The layout is measured from the source UI at 402 × 874 points.       */\n      :root {\n        --scale: 2.1968; /* 1920 / 874 */\n        --ink: #fcfcfc;\n        --dim: #a8a8ac;\n        --placeholder: #9a9a9e;\n        --bubble: #212121;\n        --kb-bg: #141414;\n        --key: #3c3c3c;\n        --key-hit: #5f5f5f;\n        --seg-track: #181818;\n        --seg-active: #3a3a3a;\n        --blue: #48aaff;\n        --rule-head: #202020;\n        --rule-row: #131313;\n        --chip-bg: #0b0b0c;\n        --chip-line: #2b2b2d;\n      }\n\n      .stage {\n        position: absolute;\n        inset: 0;\n        background: #000;\n      }\n\n      .screen {\n        position: absolute;\n        top: 0;\n        left: 50%;\n        width: 402px;\n        height: 874px;\n        margin-left: -201px;\n        background: #000;\n        overflow: hidden;\n        transform-origin: top center;\n        transform: scale(var(--scale));\n      }\n\n      /* ----------------------------------------------------------- status bar */\n      .statusbar {\n        position: absolute;\n        top: 0;\n        left: 0;\n        right: 0;\n        height: 65px;\n        display: flex;\n        align-items: center;\n        z-index: 40;\n        padding: 0 34px 0 16px;\n        color: #fff;\n      }\n      .sb-left {\n        display: flex;\n        align-items: center;\n        gap: 6px;\n        margin-left: 31.7px;\n      }\n      .sb-clock {\n        font-size: 17.2px;\n        font-weight: 600;\n        letter-spacing: 1.3px;\n      }\n      .sb-clock-box {\n        position: relative;\n        width: 38px;\n        height: 22px;\n      }\n      .sb-clock-box span {\n        position: absolute;\n        left: 0;\n        top: 0;\n        white-space: nowrap;\n      }\n      .sb-right {\n        display: flex;\n        align-items: center;\n        gap: 5px;\n        margin-left: auto;\n      }\n      .sb-net {\n        font-size: 15px;\n        font-weight: 500;\n        letter-spacing: -0.2px;\n      }\n      .sb-batt {\n        width: 30px;\n        height: 15px;\n        border-radius: 4.5px;\n        background: #fff;\n        color: #000;\n        font-size: 11px;\n        font-weight: 600;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        letter-spacing: -0.2px;\n        position: relative;\n      }\n      .sb-batt span {\n        position: absolute;\n      }\n      .sb-batt-cap {\n        width: 2px;\n        height: 6px;\n        background: rgba(255, 255, 255, 0.45);\n        border-radius: 0 2px 2px 0;\n        margin-left: -4px;\n      }\n\n      /* --------------------------------------------------------------- header */\n      .header {\n        position: absolute;\n        top: 62px;\n        left: 0;\n        right: 0;\n        height: 44px;\n        z-index: 40;\n      }\n      .status-plate {\n        position: absolute;\n        top: 0;\n        left: 0;\n        right: 0;\n        height: 54.7px;\n        z-index: 34;\n        background: #000;\n      }\n      .hdr-scrim {\n        position: absolute;\n        top: 0;\n        left: 0;\n        right: 0;\n        height: 118px;\n        z-index: 30;\n        background: rgba(0, 0, 0, 0.3);\n        backdrop-filter: blur(2px);\n        -webkit-backdrop-filter: blur(2px);\n      }\n      .circle-btn {\n        position: absolute;\n        top: 0;\n        width: 44px;\n        height: 44px;\n        border-radius: 22px;\n        background: #1c1c1e;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n      }\n      .hdr-left {\n        left: 16px;\n      }\n      .hdr-right {\n        position: absolute;\n        top: 0;\n        right: 16px;\n        width: 44px;\n        height: 44px;\n        border-radius: 22px;\n        background: #1c1c1e;\n        overflow: hidden;\n      }\n      .hdr-right-face {\n        position: absolute;\n        inset: 0;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        gap: 18px;\n      }\n      .seg {\n        position: absolute;\n        top: -1.7px;\n        left: 121.7px;\n        width: 158px;\n        height: 48px;\n        border-radius: 24px;\n        background: var(--seg-track);\n        display: flex;\n        align-items: center;\n        padding: 4px;\n      }\n      .seg-item {\n        flex: 1;\n        height: 40px;\n        border-radius: 20px;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        font-size: 16px;\n        font-weight: 500;\n        color: #fff;\n      }\n      .seg-item.on {\n        background: var(--seg-active);\n      }\n\n      /* --------------------------------------------------------------- thread */\n      .scrollport {\n        position: absolute;\n        inset: 0;\n        overflow: hidden;\n        z-index: 10;\n      }\n      .thread {\n        position: relative;\n        padding: 128px 16px 190px;\n      }\n\n      .bubble {\n        position: relative;\n        margin-left: auto;\n        width: 245.7px;\n        background: var(--bubble);\n        border-radius: 24px;\n        padding: 10px 16px;\n        color: var(--ink);\n        font-size: 16px;\n        line-height: 25.667px;\n      }\n      .answer {\n        margin-top: 36px;\n        width: 360px;\n        color: var(--ink);\n        font-size: 16px;\n        line-height: 25.667px;\n      }\n      .para {\n        overflow: hidden;\n      }\n      .para + .para {\n        margin-top: 24px;\n      }\n      .w {\n        opacity: 1;\n      }\n\n      /* ---------------------------------------------------------------- table */\n      .tbl {\n        margin: 19px 0 0 -5.7px;\n        width: 480px;\n        overflow: hidden;\n      }\n      .tr {\n        display: flex;\n        overflow: hidden;\n      }\n      .td {\n        padding: 8px 12px 8px 0;\n        font-size: 14.5px;\n        line-height: 23px;\n        color: var(--ink);\n      }\n      .c1 {\n        width: 168px;\n      }\n      .c2 {\n        width: 120px;\n        font-weight: 600;\n      }\n      .c3 {\n        width: 173px;\n      }\n      .th {\n        font-size: 14.5px;\n        line-height: 23px;\n        font-weight: 600;\n        padding-bottom: 6px;\n      }\n      .rule-head {\n        height: 2px;\n        background: var(--rule-head);\n      }\n      .rule-row {\n        height: 2px;\n        background: var(--rule-row);\n      }\n      .use {\n        display: flex;\n        gap: 8px;\n        align-items: baseline;\n      }\n      .emo {\n        font-family: \"Apple Color Emoji\";\n        font-size: 14px;\n      }\n      .chip {\n        display: flex;\n        width: fit-content;\n        align-items: center;\n        gap: 6px;\n        height: 24px;\n        margin-top: 6px;\n        padding: 0 8px;\n        border-radius: 12px;\n        background: var(--chip-bg);\n        border: 1px solid var(--chip-line);\n        font-size: 10px;\n        color: #b9b9bd;\n        white-space: nowrap;\n      }\n      .chip-dot {\n        width: 12.5px;\n        height: 12.5px;\n        border-radius: 6.25px;\n        background: #2e2e30;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        font-size: 6px;\n        font-weight: 700;\n        color: #d8d8da;\n      }\n\n      /* ---------------------------------------------------------- scroll chrome */\n      .scrollbar {\n        position: absolute;\n        right: 3.3px;\n        top: 145px;\n        width: 2.7px;\n        border-radius: 1.4px;\n        background: rgba(235, 235, 245, 0.32);\n        z-index: 20;\n      }\n      .chev-wrap {\n        position: absolute;\n        left: 0;\n        right: 0;\n        top: 738.7px;\n        z-index: 25;\n        display: flex;\n        justify-content: center;\n      }\n      .chev {\n        width: 36px;\n        height: 36px;\n        border-radius: 18px;\n        background: #1c1c1e;\n        border: 1px solid #2c2c2e;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n      }\n\n      /* ------------------------------------------------------------ suggestions */\n      .suggests {\n        position: absolute;\n        left: 0;\n        right: 0;\n        bottom: 407.7px;\n        z-index: 15;\n      }\n      .sug {\n        height: 47px;\n        display: flex;\n        align-items: center;\n        gap: 16px;\n        padding-left: 27.7px;\n        color: var(--ink);\n        font-size: 16px;\n      }\n      .sug-ico {\n        width: 15.7px;\n        height: 15.7px;\n        display: flex;\n        align-items: center;\n      }\n\n      /* -------------------------------------------------------------- composer */\n      .comp-scrim {\n        position: absolute;\n        left: 0;\n        right: 0;\n        bottom: 0;\n        height: 120px;\n        z-index: 18;\n        background: linear-gradient(to top, #000 12%, rgba(0, 0, 0, 0) 100%);\n      }\n      .composer {\n        position: absolute;\n        left: 12px;\n        bottom: 38.3px;\n        width: 378px;\n        height: 48px;\n        border-radius: 24px;\n        background: rgba(255, 255, 255, 0.055);\n        backdrop-filter: blur(22px);\n        -webkit-backdrop-filter: blur(22px);\n        z-index: 20;\n        overflow: hidden;\n      }\n      .comp-text {\n        position: absolute;\n        top: 0;\n        left: 16px;\n        right: 16px;\n        height: 44px;\n        display: flex;\n        align-items: center;\n        color: var(--ink);\n        font-size: 16px;\n        line-height: 22px;\n        white-space: pre;\n      }\n      .comp-ph {\n        position: absolute;\n        top: 0;\n        left: 48px;\n        height: 48px;\n        display: flex;\n        align-items: center;\n        color: var(--placeholder);\n        font-size: 16px;\n      }\n      .typed {\n        white-space: pre;\n      }\n      .typed .ch {\n        opacity: 0;\n      }\n      .cursor-anchor {\n        position: relative;\n        display: inline-block;\n        width: 0;\n        height: 22px;\n        vertical-align: -4px;\n      }\n      .cursor-anchor i {\n        position: absolute;\n        left: 1px;\n        top: 0;\n        width: 2px;\n        height: 22px;\n        background: var(--blue);\n      }\n      .comp-ctrls {\n        position: absolute;\n        left: 0;\n        right: 0;\n        bottom: 0;\n        height: 48px;\n      }\n      .comp-ctrls > * {\n        position: absolute;\n        top: 50%;\n        transform: translateY(-50%);\n        display: flex;\n        align-items: center;\n        justify-content: center;\n      }\n      #cge-comp-plus {\n        left: 15px;\n      }\n      .comp-mic {\n        right: 60px;\n      }\n      .blue-btn {\n        right: 8px;\n        width: 32px;\n        height: 32px;\n        border-radius: 16px;\n        background: var(--blue);\n      }\n      .blue-face {\n        position: absolute;\n        inset: 0;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n      }\n\n      /* -------------------------------------------------------------- keyboard */\n      .keyboard {\n        position: absolute;\n        left: 0;\n        right: 0;\n        top: 539px;\n        height: 335px;\n        background: var(--kb-bg);\n        z-index: 22;\n      }\n      .predict {\n        position: relative;\n        height: 52px;\n        display: flex;\n        align-items: center;\n      }\n      .pd {\n        flex: 1;\n        position: relative;\n        align-self: stretch;\n        font-size: 17px;\n        color: #e8e8ea;\n        border-right: 1px solid rgba(235, 235, 245, 0.16);\n      }\n      .pdw {\n        position: absolute;\n        inset: 0;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n      }\n      .pd:last-child {\n        border-right: none;\n      }\n      .krow {\n        position: absolute;\n        left: 0;\n        right: 0;\n        height: 43px;\n      }\n      .key {\n        position: absolute;\n        top: 0;\n        height: 43px;\n        border-radius: 5px;\n        background: var(--key);\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        color: #fff;\n        font-size: 22.2px;\n        font-weight: 400;\n      }\n      .key.dark {\n        background: #2b2b2d;\n      }\n      .key.small {\n        font-size: 16px;\n        font-weight: 400;\n      }\n      .kb-bottom {\n        position: absolute;\n        left: 0;\n        right: 0;\n        top: 279.7px;\n        height: 55px;\n        display: flex;\n        align-items: center;\n        justify-content: space-between;\n        padding: 0 29px;\n      }\n    </style>\n  </head>\n  <body>\n    <div\n      data-hf-id=\"hf-ahdx\"\n      id=\"cge-root\"\n      data-composition-id=\"chatgpt-exchange\"\n      data-fps=\"60\"\n      data-start=\"0\"\n      data-duration=\"14.9\"\n      data-width=\"1080\"\n      data-height=\"1920\"\n    >\n      <div data-hf-id=\"hf-tan6\" class=\"stage\">\n        <div\n          data-hf-id=\"hf-szt4\"\n          id=\"cge-scene\"\n          class=\"clip\"\n          data-start=\"0\"\n          data-duration=\"14.9\"\n          data-track-index=\"1\"\n        >\n          <div data-hf-id=\"hf-ylue\" class=\"screen\" id=\"cge-screen\"></div>\n        </div>\n      </div>\n    </div>\n\n    <script>\n      const variables =\n        window.__hyperframes && typeof window.__hyperframes.getVariables === \"function\"\n          ? window.__hyperframes.getVariables()\n          : {};\n      const content = (id, fallback) =>\n        typeof variables[id] === \"string\" && variables[id].trim() ? variables[id] : fallback;\n\n      const CONFIG = {\n        status: { clock: \"1:29\", clockLate: \"1:30\", net: \"5G+\", battery: 89, batteryLate: 88 },\n        prompt: content(\"prompt\", \"Hey what's the best tool for ai avatars\"),\n        suggestions: [\n          { icon: \"slack\", label: \"Summarize my to-dos\" },\n          { icon: \"gmail\", label: \"Draft follow-up emails\" },\n          { icon: \"cal\", label: \"Prep me for upcoming meetings\" },\n        ],\n        predict: {\n          start: [\"I\", \"The\", \"I'm\"],\n          mid: [\"ai\", \"AI\", \"a\"],\n          end: ['\"avatars\"', \"avatar sick\", \"avatar stressed\"],\n        },\n        paragraphs: [\n          content(\n            \"intro1\",\n            \"It really depends on what you're trying to do, because “AI avatars” has split into a few different categories.\",\n          ),\n          content(\"intro2\", \"For **most creators and marketers**, here's how I'd rank them today:\"),\n        ],\n        table: {\n          head: [\n            content(\"tableHeadUse\", \"Use case\"),\n            content(\"tableHeadTool\", \"Best tool\"),\n            content(\"tableHeadWhy\", \"Why\"),\n          ],\n          rows: [\n            {\n              emoji: \"🥇\",\n              use: content(\"row1Use\", \"Overall realism\"),\n              tool: content(\"row1Tool\", \"HeyGen\"),\n              why: content(\n                \"row1Why\",\n                \"Most natural facial expressions, lip sync, gestures, voice cloning and localization. Benchmark for talking head videos.\",\n              ),\n              chip: content(\"row1Chip\", \"Official A.I Ranking\"),\n            },\n            {\n              emoji: \"🏢\",\n              use: content(\"row2Use\", \"Enterprise/training\"),\n              tool: content(\"row2Tool\", \"Synthesia\"),\n              why: content(\n                \"row2Why\",\n                \"Better collaboration, SCORM, compliance, team workflows; less creator-focused.\",\n              ),\n              chip: content(\"row2Chip\", \"Official A.I Ranking\"),\n            },\n            {\n              emoji: \"📱\",\n              use: content(\"row3Use\", \"Mobile UGC\"),\n              tool: content(\"row3Tool\", \"Captions\"),\n              why: content(\n                \"row3Why\",\n                \"Extremely fast mobile workflow and social editing. Great for Reels creators.\",\n              ),\n              chip: content(\"row3Chip\", \"Creator Stack\"),\n            },\n            {\n              emoji: \"💬\",\n              use: content(\"row4Use\", \"Real-time conversations\"),\n              tool: content(\"row4Tool\", \"Tavus\"),\n              why: content(\"row4Why\", \"Interactive avatars that can hold live conversations.\"),\n              chip: content(\"row4Chip\", \"Creator Stack\"),\n            },\n          ],\n        },\n      };\n\n      /* Beat clock (seconds). Every tween hangs off these. */\n      const T = {\n        suggestsIn: 0.0,\n        typeStart: 0.86,\n        charBase: 0.05,\n        spaceHold: 0.11,\n        sendPad: 0.3, // stillness-before-climax between last keystroke and the tap\n        sendReact: 0.03,\n        streamLead: 0.6, // model \"thinking\" comma\n        wordStep: 0.15,\n        tableLead: 0.2,\n        rowStep: 0.7,\n        readbackDur: 1.1,\n        tailHold: 0.7,\n      };\n\n      /* =========================================================== icon set */\n      const svg = (b, d, w) =>\n        `<svg viewBox=\"0 0 ${b} ${b}\" width=\"${w || b}\" height=\"${w || b}\" fill=\"none\">${d}</svg>`;\n      const ICO = {\n        bell: svg(\n          20,\n          `<path d=\"M4.2 15h11.6M10 3.2a4.3 4.3 0 0 1 4.3 4.3c0 3.4 1 5 1.5 5.6H4.2C4.7 12.5 5.7 10.9 5.7 7.5A4.3 4.3 0 0 1 10 3.2Z\" stroke=\"#fff\" stroke-width=\"1.5\" stroke-linejoin=\"round\"/><path d=\"M8.3 16.6a1.9 1.9 0 0 0 3.4 0\" stroke=\"#fff\" stroke-width=\"1.5\"/><path d=\"M3 17L17 3\" stroke=\"#fff\" stroke-width=\"1.6\"/>`,\n          18,\n        ),\n        bars: svg(\n          20,\n          `<rect x=\"1\" y=\"12.5\" width=\"3\" height=\"4.5\" rx=\"1\" fill=\"#fff\"/><rect x=\"6\" y=\"9.5\" width=\"3\" height=\"7.5\" rx=\"1\" fill=\"#fff\"/><rect x=\"11\" y=\"6.5\" width=\"3\" height=\"10.5\" rx=\"1\" fill=\"#fff\"/><rect x=\"16\" y=\"3.5\" width=\"3\" height=\"13.5\" rx=\"1\" fill=\"rgba(255,255,255,.32)\"/>`,\n          19,\n        ),\n        burger: svg(\n          24,\n          `<path d=\"M5 9.5h14M5 15h9\" stroke=\"#fff\" stroke-width=\"2.1\" stroke-linecap=\"round\"/>`,\n          24,\n        ),\n        voiceCircle: svg(\n          24,\n          `<path d=\"M15.4 3.9a8.6 8.6 0 1 1-9.1 14.6\" stroke=\"#fff\" stroke-width=\"1.9\" stroke-linecap=\"round\"/><path d=\"M6.3 18.5 4 21.2l3.4.5\" stroke=\"#fff\" stroke-width=\"1.9\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M13.6 8.4a4.1 4.1 0 1 0-3.3 6.9\" stroke=\"#fff\" stroke-width=\"1.9\" stroke-linecap=\"round\"/>`,\n          23,\n        ),\n        compose: svg(\n          24,\n          `<path d=\"M4.5 15.5 15.2 4.8a2 2 0 0 1 2.9 2.9L7.4 18.4l-4 1 1-3.9Z\" stroke=\"#fff\" stroke-width=\"1.8\" stroke-linejoin=\"round\"/>`,\n          21,\n        ),\n        dots: svg(\n          24,\n          `<circle cx=\"5\" cy=\"12\" r=\"1.9\" fill=\"#fff\"/><circle cx=\"12\" cy=\"12\" r=\"1.9\" fill=\"#fff\"/><circle cx=\"19\" cy=\"12\" r=\"1.9\" fill=\"#fff\"/>`,\n          21,\n        ),\n        plus: svg(\n          24,\n          `<path d=\"M12 4.5v15M4.5 12h15\" stroke=\"#fff\" stroke-width=\"2.1\" stroke-linecap=\"round\"/>`,\n          18,\n        ),\n        mic: svg(\n          24,\n          `<rect x=\"9\" y=\"2.6\" width=\"6\" height=\"11.4\" rx=\"3\" stroke=\"#fff\" stroke-width=\"1.8\"/><path d=\"M5.5 11.4a6.5 6.5 0 0 0 13 0M12 18v3.2\" stroke=\"#fff\" stroke-width=\"1.8\" stroke-linecap=\"round\"/>`,\n          17,\n        ),\n        wave: svg(\n          24,\n          `<rect x=\"4\" y=\"9.5\" width=\"2.4\" height=\"5\" rx=\"1.2\" fill=\"#fff\"/><rect x=\"8.6\" y=\"6\" width=\"2.4\" height=\"12\" rx=\"1.2\" fill=\"#fff\"/><rect x=\"13.2\" y=\"8\" width=\"2.4\" height=\"8\" rx=\"1.2\" fill=\"#fff\"/><rect x=\"17.8\" y=\"10.5\" width=\"2.4\" height=\"3\" rx=\"1.2\" fill=\"#fff\"/>`,\n          19,\n        ),\n        arrowUp: svg(\n          24,\n          `<path d=\"M12 19V5.6M5.8 11.8 12 5.4l6.2 6.4\" stroke=\"#000\" stroke-width=\"2.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>`,\n          19,\n        ),\n        stop: svg(24, `<rect x=\"7\" y=\"7\" width=\"10\" height=\"10\" rx=\"2\" fill=\"#000\"/>`, 18),\n        chevDown: svg(\n          24,\n          `<path d=\"M12 5v13M6.2 12.2 12 18.2l5.8-6\" stroke=\"#fff\" stroke-width=\"2.1\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>`,\n          18,\n        ),\n        shift: svg(\n          24,\n          `<path d=\"M12 4 4.5 12h4v7h7v-7h4L12 4Z\" stroke=\"#fff\" stroke-width=\"1.7\" stroke-linejoin=\"round\" fill=\"#fff\"/>`,\n          19,\n        ),\n        del: svg(\n          24,\n          `<path d=\"M8.4 5h11a1.6 1.6 0 0 1 1.6 1.6v10.8A1.6 1.6 0 0 1 19.4 19h-11L2.6 12 8.4 5Z\" stroke=\"#fff\" stroke-width=\"1.6\" stroke-linejoin=\"round\"/><path d=\"M11.4 9.6l5.2 4.8M16.6 9.6l-5.2 4.8\" stroke=\"#fff\" stroke-width=\"1.6\" stroke-linecap=\"round\"/>`,\n          22,\n        ),\n        ret: svg(\n          24,\n          `<path d=\"M20 6v6.4H5.4M9.6 8.4 5 12.8l4.6 4.4\" stroke=\"#fff\" stroke-width=\"1.7\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>`,\n          21,\n        ),\n        emojiKey: svg(\n          24,\n          `<circle cx=\"12\" cy=\"12\" r=\"9\" stroke=\"#fff\" stroke-width=\"1.7\"/><circle cx=\"9\" cy=\"10\" r=\"1.2\" fill=\"#fff\"/><circle cx=\"15\" cy=\"10\" r=\"1.2\" fill=\"#fff\"/><path d=\"M8 14.6a5 5 0 0 0 8 0\" stroke=\"#fff\" stroke-width=\"1.7\" stroke-linecap=\"round\"/>`,\n          25,\n        ),\n        slack: svg(\n          24,\n          `<path d=\"M6.2 14.4a2 2 0 1 1-2 2v-2h2Z\" fill=\"#e01e5a\"/><path d=\"M7.3 14.4a2 2 0 0 1 4 0v5a2 2 0 1 1-4 0v-5Z\" fill=\"#e01e5a\"/><path d=\"M9.6 6.2a2 2 0 1 1 2-2v2h-2Z\" fill=\"#36c5f0\"/><path d=\"M9.6 7.3a2 2 0 0 1 0 4h-5a2 2 0 1 1 0-4h5Z\" fill=\"#36c5f0\"/><path d=\"M17.8 9.6a2 2 0 1 1 2 2h-2v-2Z\" fill=\"#2eb67d\"/><path d=\"M16.7 9.6a2 2 0 0 1-4 0v-5a2 2 0 1 1 4 0v5Z\" fill=\"#2eb67d\"/><path d=\"M14.4 17.8a2 2 0 1 1-2 2v-2h2Z\" fill=\"#ecb22e\"/><path d=\"M14.4 16.7a2 2 0 0 1 0-4h5a2 2 0 1 1 0 4h-5Z\" fill=\"#ecb22e\"/>`,\n          16,\n        ),\n        gmail: svg(\n          24,\n          `<path d=\"M3 6.6 12 13l9-6.4V18a1 1 0 0 1-1 1h-3V11l-5 3.6L7 11v8H4a1 1 0 0 1-1-1V6.6Z\" fill=\"#ea4335\"/><path d=\"M17 11v8h3a1 1 0 0 0 1-1V6.6L17 9.5V11Z\" fill=\"#34a853\"/><path d=\"M3 6.6 7 9.5V19H4a1 1 0 0 1-1-1V6.6Z\" fill=\"#4285f4\"/><path d=\"M3 5.6A1.6 1.6 0 0 1 5.4 4.3L12 9l6.6-4.7A1.6 1.6 0 0 1 21 5.6v1L12 13 3 6.6v-.8Z\" fill=\"#fbbc04\"/>`,\n          16,\n        ),\n        cal: svg(\n          24,\n          `<rect x=\"3\" y=\"4\" width=\"18\" height=\"17\" rx=\"3\" fill=\"#1a73e8\"/><rect x=\"3\" y=\"4\" width=\"18\" height=\"4.5\" rx=\"3\" fill=\"#1967d2\"/><text x=\"12\" y=\"17.6\" font-size=\"9\" font-weight=\"700\" fill=\"#fff\" text-anchor=\"middle\" font-family=\"Helvetica\">31</text>`,\n          16,\n        ),\n      };\n\n      /* ============================================================== build */\n      const screen = document.getElementById(\"cge-screen\");\n      const el = (cls, html, tag) => {\n        const n = document.createElement(tag || \"div\");\n        if (cls) n.className = cls;\n        // Editable strings reach innerHTML; the template delivery gate rejects angle brackets.\n        if (html != null) n.innerHTML = html;\n        return n;\n      };\n\n      // --- status bar\n      const sb = el(\"statusbar\");\n      sb.innerHTML =\n        `<div class=\"sb-left\"><div class=\"sb-clock sb-clock-box\">` +\n        `<span id=\"cge-clock-early\">${CONFIG.status.clock}</span>` +\n        `<span id=\"cge-clock-late\">${CONFIG.status.clockLate}</span></div>${ICO.bell}</div>` +\n        `<div class=\"sb-right\">${ICO.bars}<div class=\"sb-net\">${CONFIG.status.net}</div>` +\n        `<div class=\"sb-batt\"><span id=\"cge-batt-early\">${CONFIG.status.battery}</span>` +\n        `<span id=\"cge-batt-late\">${CONFIG.status.batteryLate}</span></div>` +\n        `<div class=\"sb-batt-cap\"></div></div>`;\n\n      // --- thread\n      const port = el(\"scrollport\");\n      const thread = el(\"thread\");\n      thread.setAttribute(\"data-layout-allow-overflow\", \"true\");\n      thread.setAttribute(\"data-layout-allow-overlap\", \"true\");\n      thread.setAttribute(\"data-layout-allow-occlusion\", \"true\");\n      thread.id = \"cge-thread\";\n\n      const bubble = el(\"bubble\");\n      bubble.id = \"cge-bubble\";\n      bubble.textContent = CONFIG.prompt + \"?\";\n      thread.appendChild(bubble);\n\n      const answer = el(\"answer\");\n      answer.id = \"cge-answer\";\n      thread.appendChild(answer);\n\n      // paragraphs -> word spans (**bold** supported)\n      const paraEls = [];\n      CONFIG.paragraphs.forEach((txt) => {\n        const p = el(\"para\");\n        const inner = el(\"para-inner\");\n        let bold = false;\n        txt.split(/(\\s+)/).forEach((tok) => {\n          if (!tok) return;\n          if (/^\\s+$/.test(tok)) {\n            inner.appendChild(document.createTextNode(tok));\n            return;\n          }\n          let word = tok;\n          let open = false;\n          if (word.startsWith(\"**\")) {\n            bold = true;\n            open = true;\n            word = word.slice(2);\n          }\n          let close = false;\n          if (word.includes(\"**\")) {\n            close = true;\n            word = word.replace(\"**\", \"\");\n          }\n          const s = el(\"w\", null, \"span\");\n          if (bold) s.style.fontWeight = \"600\";\n          s.textContent = word;\n          if (close) bold = false;\n          void open;\n          inner.appendChild(s);\n        });\n        p.appendChild(inner);\n        answer.appendChild(p);\n        paraEls.push({ p: p, inner: inner, words: [].slice.call(inner.querySelectorAll(\".w\")) });\n      });\n\n      // table\n      const tbl = el(\"tbl\");\n      tbl.id = \"cge-tbl\";\n      const headRow = el(\"tr\");\n      headRow.innerHTML =\n        `<div class=\"td th c1\">${CONFIG.table.head[0]}</div>` +\n        `<div class=\"td th c2\">${CONFIG.table.head[1]}</div>` +\n        `<div class=\"td th c3\">${CONFIG.table.head[2]}</div>`;\n      const headRule = el(\"rule-head\");\n      headRule.id = \"cge-head-rule\";\n      tbl.appendChild(headRow);\n      tbl.appendChild(headRule);\n      answer.appendChild(tbl);\n\n      const rowEls = [];\n      CONFIG.table.rows.forEach((r, i) => {\n        const row = el(\"tr\");\n        row.id = \"cge-row\" + i;\n        const whyWords = r.why\n          .split(\" \")\n          .map((w) => `<span class=\"w\">${w}</span>`)\n          .join(\" \");\n        row.innerHTML =\n          `<div class=\"td c1\"><div class=\"use\"><span class=\"emo\">${r.emoji}</span>` +\n          `<span class=\"w\">${r.use}</span></div></div>` +\n          `<div class=\"td c2\"><span class=\"w\">${r.tool}</span></div>` +\n          `<div class=\"td c3\">${whyWords}` +\n          `<div class=\"chip\"><span class=\"chip-dot\">AI</span>${r.chip}</div></div>`;\n        const rule = el(\"rule-row\");\n        rule.id = \"cge-rule\" + i;\n        tbl.appendChild(row);\n        tbl.appendChild(rule);\n        rowEls.push({\n          row: row,\n          rule: rule,\n          words: [].slice.call(row.querySelectorAll(\".w\")),\n          emo: row.querySelector(\".emo\"),\n          chip: row.querySelector(\".chip\"),\n        });\n      });\n\n      port.appendChild(thread);\n\n      // --- scroll chrome\n      const sbar = el(\"scrollbar\");\n      sbar.id = \"cge-scrollbar\";\n      const chevWrap = el(\"chev-wrap\", `<div class=\"chev\" id=\"cge-chev\">${ICO.chevDown}</div>`);\n\n      // --- suggestions\n      const suggests = el(\"suggests\");\n      const sugEls = CONFIG.suggestions.map((s) => {\n        const n = el(\"sug\", `<div class=\"sug-ico\">${ICO[s.icon]}</div><div>${s.label}</div>`);\n        suggests.appendChild(n);\n        return n;\n      });\n\n      // --- composer\n      const composer = el(\"composer\");\n      composer.setAttribute(\"data-layout-allow-occlusion\", \"true\");\n      composer.setAttribute(\"data-layout-allow-overlap\", \"true\");\n      composer.id = \"cge-composer\";\n      composer.innerHTML =\n        `<div class=\"comp-text\" id=\"cge-comp-text\"><span class=\"typed\" id=\"cge-typed\"></span></div>` +\n        `<div class=\"comp-ph\" id=\"cge-comp-ph\">Ask ChatGPT</div>` +\n        `<div class=\"comp-ctrls\"><div id=\"cge-comp-plus\">${ICO.plus}</div>` +\n        `<div class=\"comp-mic\" id=\"cge-comp-mic\">${ICO.mic}</div>` +\n        `<div class=\"blue-btn\" id=\"cge-blue-btn\">` +\n        `<div class=\"blue-face\" id=\"cge-face-wave\">${ICO.wave}</div>` +\n        `<div class=\"blue-face\" id=\"cge-face-send\">${ICO.arrowUp}</div>` +\n        `<div class=\"blue-face\" id=\"cge-face-stop\">${ICO.stop}</div></div></div>`;\n\n      // one span per character, each followed by a zero-width caret slot. Hidden\n      // characters still occupy their final space, so the caret needs no measuring.\n      const typedEl = composer.querySelector(\"#cge-typed\");\n      const chEls = [];\n      const curEls = [];\n      const mkCursor = () => {\n        const a = el(\"cursor-anchor\", \"<i></i>\", \"span\");\n        typedEl.appendChild(a);\n        curEls.push(a);\n      };\n      mkCursor();\n      CONFIG.prompt.split(\"\").forEach((c) => {\n        const sp = el(\"ch\", c === \" \" ? \"&nbsp;\" : c, \"span\");\n        typedEl.appendChild(sp);\n        chEls.push(sp);\n        mkCursor();\n      });\n\n      // --- keyboard\n      const KB = { w: 33.44, gap: 6.03, inset: 6.67 };\n      const keyboard = el(\"keyboard\");\n      keyboard.setAttribute(\"data-layout-allow-overflow\", \"true\");\n      keyboard.setAttribute(\"data-layout-allow-overlap\", \"true\");\n      keyboard.id = \"cge-keyboard\";\n      const predict = el(\"predict\");\n      predict.id = \"cge-predict\";\n      const PRED_STAGES = [\"start\", \"mid\", \"end\"];\n      const pdEls = [0, 1, 2].map((col) => {\n        const n = el(\"pd\");\n        const stages = PRED_STAGES.map((k) => {\n          const w = el(\"pdw\", CONFIG.predict[k][col]);\n          n.appendChild(w);\n          return w;\n        });\n        predict.appendChild(n);\n        return { cell: n, stages: stages };\n      });\n      keyboard.appendChild(predict);\n\n      const keyIndex = {};\n      const mkKey = (row, label, x, w, cls) => {\n        const k = el(\"key\" + (cls ? \" \" + cls : \"\"), label);\n        k.style.left = x + \"px\";\n        k.style.width = w + \"px\";\n        row.appendChild(k);\n        if (/^[A-Z]$/.test(label)) keyIndex[label] = k;\n        return k;\n      };\n      const rowsDef = [\n        { y: 52, keys: \"QWERTYUIOP\".split(\"\"), x0: KB.inset },\n        { y: 106, keys: \"ASDFGHJKL\".split(\"\"), x0: 26.33 },\n        { y: 160, keys: \"ZXCVBNM\".split(\"\"), x0: 65.67 },\n      ];\n      rowsDef.forEach((rd, ri) => {\n        const row = el(\"krow\");\n        row.style.top = rd.y + \"px\";\n        rd.keys.forEach((k, i) => mkKey(row, k, rd.x0 + i * (KB.w + KB.gap), KB.w));\n        if (ri === 2) {\n          mkKey(row, ICO.shift, KB.inset, 45.33, \"dark\");\n          mkKey(row, ICO.del, 350, 45.67, \"dark\");\n        }\n        keyboard.appendChild(row);\n      });\n      const row4 = el(\"krow\");\n      row4.style.top = \"214px\";\n      const kNum = mkKey(row4, \"123\", KB.inset, 92.67, \"dark small\");\n      const kSpace = mkKey(row4, \"\", 105.33, 191.33);\n      const kRet = mkKey(row4, ICO.ret, 302.67, 93, \"dark\");\n      keyboard.appendChild(row4);\n      keyboard.appendChild(el(\"kb-bottom\", `<div>${ICO.emojiKey}</div><div>${ICO.mic}</div>`));\n      void kNum;\n      void kRet;\n\n      // --- header (built last so it stacks above the thread)\n      const hdrScrim = el(\"hdr-scrim\");\n      hdrScrim.setAttribute(\"data-layout-allow-occlusion\", \"true\");\n      hdrScrim.id = \"cge-hdr-scrim\";\n      const header = el(\"header\");\n      header.innerHTML =\n        `<div class=\"circle-btn hdr-left\">${ICO.burger}</div>` +\n        `<div class=\"seg\" id=\"cge-seg\"><div class=\"seg-item on\">Chat</div><div class=\"seg-item\">Work</div></div>` +\n        `<div class=\"hdr-right\" id=\"cge-hdr-right\">` +\n        `<div class=\"hdr-right-face\" id=\"cge-hdr-voice\">${ICO.voiceCircle}</div>` +\n        `<div class=\"hdr-right-face\" id=\"cge-hdr-actions\">${ICO.compose}${ICO.dots}</div></div>`;\n\n      const statusPlate = el(\"status-plate\");\n      statusPlate.setAttribute(\"data-layout-allow-occlusion\", \"true\");\n      const compScrim = el(\"comp-scrim\");\n      compScrim.setAttribute(\"data-layout-allow-occlusion\", \"true\");\n      [\n        port,\n        sbar,\n        chevWrap,\n        suggests,\n        compScrim,\n        composer,\n        keyboard,\n        hdrScrim,\n        statusPlate,\n        header,\n        sb,\n      ].forEach((n) => screen.appendChild(n));\n\n      /* ============================================================ measure\n         All layout reads happen here, once, before any state is set. Widths\n         come off getBoundingClientRect (sub-pixel) divided by --scale; block\n         offsets come off offsetTop, which is unscaled. Deterministic: the same\n         layout every load, so every seek resolves identically.               */\n      // paragraph line grouping + heights\n      const LH = 25.667;\n      paraEls.forEach((pe) => {\n        pe.height = pe.inner.offsetHeight;\n        const tops = pe.words.map((w) => w.offsetTop);\n        const uniq = [];\n        tops.forEach((t) => {\n          if (!uniq.length || t - uniq[uniq.length - 1] > 4) uniq.push(t);\n        });\n        pe.lineOf = tops.map((t) => {\n          let li = 0;\n          uniq.forEach((u, i) => {\n            if (Math.abs(t - u) <= 4) li = i;\n          });\n          return li;\n        });\n        pe.lineHeights = uniq.map((u, i) => Math.min(pe.height, (i + 1) * LH + 1));\n      });\n\n      const headRowH = headRow.offsetHeight;\n      rowEls.forEach((re) => (re.h = re.row.offsetHeight));\n\n      // Scroll anchors: keep the newest revealed element just above the composer.\n      // Read here, in the natural layout — by timeline-build time every paragraph\n      // and row has been collapsed to height 0 and offsetTop/Height would lie.\n      const ANCHOR = 772;\n      const anchorOf = (node) => Math.min(0, ANCHOR - (node.offsetTop + node.offsetHeight));\n      paraEls.forEach((pe) => (pe.anchor = anchorOf(pe.p)));\n      rowEls.forEach((re) => (re.anchor = anchorOf(re.row)));\n      const Y_FINAL = 37 - bubble.offsetTop; // IMG_0937: bubble top rests at y=37\n\n      /* ====================================================== initial state */\n      gsap.set(composer, { y: -309, x: 0, width: 378, height: 48 }); // keyboard-up rest\n      gsap.set([answer], { autoAlpha: 1 });\n      gsap.set(\n        paraEls.map((p) => p.p),\n        { height: 0 },\n      );\n      paraEls.forEach((pe) => gsap.set(pe.words, { opacity: 0 }));\n      gsap.set([headRow, headRule], { height: 0, opacity: 0 });\n      rowEls.forEach((re) => {\n        gsap.set(re.row, { height: 0 });\n        gsap.set(re.rule, { height: 0 });\n        gsap.set(re.words, { opacity: 0 });\n        gsap.set([re.emo, re.chip], { opacity: 0 });\n      });\n      gsap.set(bubble, { autoAlpha: 0 });\n      gsap.set(thread, { y: 0 });\n      gsap.set(sbar, { autoAlpha: 0, y: 60, height: 250 });\n      gsap.set(chevWrap.firstChild, { autoAlpha: 0, y: 10 });\n      gsap.set(sugEls, { autoAlpha: 0, y: 14 });\n      gsap.set(chEls, { opacity: 0 });\n      gsap.set(curEls, { autoAlpha: 0 });\n      gsap.set(document.getElementById(\"cge-comp-ph\"), { autoAlpha: 1 });\n      gsap.set(document.getElementById(\"cge-face-send\"), { autoAlpha: 0, scale: 0.6 });\n      gsap.set(document.getElementById(\"cge-face-stop\"), { autoAlpha: 0, scale: 0.6 });\n      gsap.set(document.getElementById(\"cge-hdr-actions\"), { autoAlpha: 0 });\n      gsap.set(document.getElementById(\"cge-hdr-right\"), { width: 44 });\n      gsap.set(document.getElementById(\"cge-seg\"), { autoAlpha: 1, scale: 1 });\n      gsap.set(hdrScrim, { autoAlpha: 1 });\n      gsap.set(keyboard, { y: 0 });\n      pdEls.forEach((pd) => {\n        gsap.set(pd.stages[0], { autoAlpha: 1 });\n        gsap.set([pd.stages[1], pd.stages[2]], { autoAlpha: 0 });\n      });\n      gsap.set(document.getElementById(\"cge-clock-late\"), { autoAlpha: 0 });\n      gsap.set(document.getElementById(\"cge-batt-late\"), { autoAlpha: 0 });\n\n      /* ============================================================ timeline */\n      window.__timelines = window.__timelines || {};\n      const tl = gsap.timeline({ paused: true });\n\n      /* ---- 1. suggestions cascade in (waterfall entry, weight-ordered) */\n      sugEls.forEach((n, i) => {\n        tl.to(\n          n,\n          { autoAlpha: 1, y: 0, duration: 0.42, ease: \"power3.out\" },\n          T.suggestsIn + i * 0.09,\n        );\n      });\n\n      /* ---- 2. typing. Each keystroke IS the cause: key flash -> width step. */\n      const t0 = T.typeStart;\n      const chars = CONFIG.prompt.split(\"\");\n      const charT = [];\n      let t = t0;\n      chars.forEach((c, i) => {\n        charT.push(t);\n        t += c === \" \" ? T.charBase + T.spaceHold : T.charBase;\n        void i;\n      });\n      const typeEnd = t;\n\n      // composer grows to two rows on the first keystroke\n      tl.to(composer, { height: 92, duration: 0.24, ease: \"power2.out\" }, t0 - 0.02);\n      tl.to(document.getElementById(\"cge-comp-ph\"), { autoAlpha: 0, duration: 0.12 }, t0 - 0.02);\n      tl.to(curEls[0], { autoAlpha: 1, duration: 0.01 }, t0 - 0.02);\n      // suggestions clear — caused by the first keystroke\n      sugEls.forEach((n, i) => {\n        tl.to(n, { autoAlpha: 0, y: 10, duration: 0.2, ease: \"power2.in\" }, t0 - 0.02 + i * 0.04);\n      });\n      // voice waveform -> send arrow\n      tl.to(\n        document.getElementById(\"cge-face-wave\"),\n        { autoAlpha: 0, scale: 0.6, duration: 0.14 },\n        t0,\n      );\n      tl.to(\n        document.getElementById(\"cge-face-send\"),\n        { autoAlpha: 1, scale: 1, duration: 0.24, ease: \"back.out(1.6)\" },\n        t0 + 0.04,\n      );\n\n      chars.forEach((c, i) => {\n        tl.to(chEls[i], { opacity: 1, duration: 0.01 }, charT[i]);\n        tl.to(curEls[i], { autoAlpha: 0, duration: 0.01 }, charT[i]);\n        tl.to(curEls[i + 1], { autoAlpha: 1, duration: 0.01 }, charT[i]);\n        const k = keyIndex[c.toUpperCase()];\n        const target = c === \" \" ? kSpace : k;\n        if (target) {\n          tl.to(target, { backgroundColor: \"#5f5f5f\", duration: 0.04 }, charT[i] - 0.03);\n          tl.to(\n            target,\n            { backgroundColor: c === \" \" ? \"#3c3c3c\" : \"#3c3c3c\", duration: 0.09 },\n            charT[i] + 0.02,\n          );\n        }\n      });\n\n      // caret blink (finite, deterministic)\n      const blinkFrom = t0 + 0.1;\n      const blinks = Math.floor((typeEnd + T.sendPad - blinkFrom) / 1.06);\n      const lastCur = curEls[curEls.length - 1];\n      for (let i = 0; i < blinks; i++) {\n        const off = blinkFrom + i * 1.06 + 0.53;\n        const on = blinkFrom + i * 1.06 + 1.06;\n        if (off > typeEnd) tl.to(lastCur, { autoAlpha: 0, duration: 0.02 }, off);\n        if (on > typeEnd) tl.to(lastCur, { autoAlpha: 1, duration: 0.02 }, on);\n      }\n\n      // predictive row swaps at word boundaries\n      const swapPredict = (at, stage) => {\n        pdEls.forEach((pd) => {\n          tl.to(pd.stages[stage - 1], { autoAlpha: 0, duration: 0.06 }, at);\n          tl.to(pd.stages[stage], { autoAlpha: 1, duration: 0.08 }, at + 0.06);\n        });\n      };\n      swapPredict(charT[CONFIG.prompt.indexOf(\" ai \") + 1], 1);\n      swapPredict(charT[CONFIG.prompt.length - 1], 2);\n\n      /* ---- 3. send. Tap ignites: bubble flight + keyboard down + header morph */\n      const tSend = typeEnd + T.sendPad;\n      const blueBtn = document.getElementById(\"cge-blue-btn\");\n      tl.to(blueBtn, { scale: 0.86, duration: 0.06, ease: \"power2.out\" }, tSend);\n      tl.to(blueBtn, { scale: 1, duration: 0.18, ease: \"power2.out\" }, tSend + 0.06);\n\n      const tGo = tSend + T.sendReact;\n      // composer empties and collapses; keyboard leaves downward\n      tl.to(chEls, { opacity: 0, duration: 0.01 }, tGo);\n      tl.to(curEls, { autoAlpha: 0, duration: 0.01 }, tGo);\n      tl.to(composer, { height: 48, width: 326, duration: 0.3, ease: \"power2.out\" }, tGo);\n      tl.to(composer, { y: 0, x: 26, duration: 0.32, ease: \"power2.out\" }, tGo);\n      tl.to(document.getElementById(\"cge-comp-ph\"), { autoAlpha: 1, duration: 0.2 }, tGo + 0.12);\n      tl.to(keyboard, { y: 340, duration: 0.3, ease: \"power2.out\" }, tGo);\n      tl.to(document.getElementById(\"cge-face-send\"), { autoAlpha: 0, duration: 0.12 }, tGo + 0.28);\n      tl.to(\n        document.getElementById(\"cge-face-stop\"),\n        { autoAlpha: 1, scale: 1, duration: 0.2, ease: \"power2.out\" },\n        tGo + 0.34,\n      );\n\n      // header: segmented control out, right control widens into the actions pill\n      tl.to(document.getElementById(\"cge-seg\"), { autoAlpha: 0, scale: 0.92, duration: 0.16 }, tGo);\n      tl.to(document.getElementById(\"cge-hdr-voice\"), { autoAlpha: 0, duration: 0.12 }, tGo + 0.02);\n      tl.to(\n        document.getElementById(\"cge-hdr-right\"),\n        { width: 108, duration: 0.26, ease: \"power2.out\" },\n        tGo + 0.06,\n      );\n      tl.to(\n        document.getElementById(\"cge-hdr-actions\"),\n        { autoAlpha: 1, duration: 0.18 },\n        tGo + 0.16,\n      );\n\n      // the bubble: born at the composer's text position, lands in its thread slot\n      const bubbleTop = bubble.offsetTop + thread.offsetTop; // 128\n      const dy = 526.7 - 48 + 10 - bubbleTop; // keyboard-up composer text row -> slot\n      tl.fromTo(\n        bubble,\n        { autoAlpha: 0, y: dy, scale: 0.94, transformOrigin: \"100% 50%\" },\n        { autoAlpha: 1, y: 0, scale: 1, duration: 0.34, ease: \"power3.out\" },\n        tGo + 0.02,\n      );\n\n      /* ---- 4. stream. Words land in reading order; the box grows by the line. */\n      let tw = tGo + 0.34 + T.streamLead;\n      const scrollTo = (target, at, dur) =>\n        tl.to(thread, { y: target, duration: dur || 0.5, ease: \"power2.out\" }, at);\n\n      paraEls.forEach((pe, pi) => {\n        let lastLine = -1;\n        pe.words.forEach((w, wi) => {\n          const li = pe.lineOf[wi];\n          if (li !== lastLine) {\n            tl.to(pe.p, { height: pe.lineHeights[li], duration: 0.16, ease: \"power2.out\" }, tw);\n            lastLine = li;\n          }\n          tl.to(w, { opacity: 1, duration: 0.1 }, tw);\n          tw += T.wordStep;\n        });\n        scrollTo(pe.anchor, tw - T.wordStep * 2, 0.6);\n        if (pi === 0) tw += 0.12;\n      });\n\n      /* ---- 5. the table assembles, row by row */\n      tw += T.tableLead;\n      tl.to(\n        [headRow, headRule],\n        { height: (i) => (i === 0 ? headRowH : 2), opacity: 1, duration: 0.2, ease: \"power2.out\" },\n        tw,\n      );\n      tw += 0.34;\n\n      rowEls.forEach((re) => {\n        tl.to(re.row, { height: re.h, duration: 0.22, ease: \"power2.out\" }, tw);\n        tl.to(re.emo, { opacity: 1, duration: 0.14 }, tw + 0.04);\n        re.words.forEach((w, wi) => {\n          tl.to(w, { opacity: 1, duration: 0.09 }, tw + 0.08 + wi * 0.028);\n        });\n        tl.to(re.chip, { opacity: 1, duration: 0.2, ease: \"power2.out\" }, tw + 0.42);\n        tl.to(re.rule, { height: 2, duration: 0.12 }, tw + 0.2);\n        scrollTo(re.anchor, tw + 0.1, 0.72);\n        tw += T.rowStep;\n      });\n\n      /* ---- 6. streaming ends, then the read-back scroll lands on the hero frame */\n      tl.to(document.getElementById(\"cge-face-stop\"), { autoAlpha: 0, duration: 0.14 }, tw);\n      tl.to(\n        document.getElementById(\"cge-face-wave\"),\n        { autoAlpha: 1, scale: 1, duration: 0.22, ease: \"power2.out\" },\n        tw + 0.06,\n      );\n\n      const tRead = tw + 0.24;\n      tl.to(sbar, { autoAlpha: 1, duration: 0.14 }, tRead);\n      // the minute rolls over between the source frames — keep that\n      tl.to(\n        document.getElementById(\"cge-clock-early\"),\n        { autoAlpha: 0, duration: 0.01 },\n        tRead - 0.5,\n      );\n      tl.to(\n        document.getElementById(\"cge-clock-late\"),\n        { autoAlpha: 1, duration: 0.01 },\n        tRead - 0.5,\n      );\n      tl.to(\n        document.getElementById(\"cge-batt-early\"),\n        { autoAlpha: 0, duration: 0.01 },\n        tRead - 0.5,\n      );\n      tl.to(\n        document.getElementById(\"cge-batt-late\"),\n        { autoAlpha: 1, duration: 0.01 },\n        tRead - 0.5,\n      );\n      tl.to(thread, { y: Y_FINAL, duration: T.readbackDur, ease: \"power2.inOut\" }, tRead);\n      tl.to(sbar, { y: 0, duration: T.readbackDur, ease: \"power2.inOut\" }, tRead);\n      tl.to(\n        chevWrap.firstChild,\n        { autoAlpha: 1, y: 0, duration: 0.3, ease: \"back.out(1.5)\" },\n        tRead + T.readbackDur - 0.35,\n      );\n\n      /* ---- caret-following scroll in the composer.\n         `prompt` is an editable slot, but `.comp-text` is a fixed-width single line with\n         `white-space: pre` inside a composer that clips, and the packaged prompt already reaches\n         the mic. A longer one therefore slides under the mic and the send button and loses its\n         tail, with the caret hidden behind them -- the remix looks like it typed into nowhere.\n         A real single-line input scrolls its text left to keep the caret in view; this does the\n         same, on the very times the reveal already uses. Shrinking the type instead was the other\n         option and it is worse: it would shrink the packaged prompt too, since that prompt has no\n         headroom, and it still cannot absorb a prompt twice as long without becoming unreadable.\n         A prompt that fits emits no keyframes at all, so the packaged composition is untouched. */\n      const compTextEl = composer.querySelector(\"#cge-comp-text\");\n      // The obstacle is the opaque round button, not the mic: the packaged prompt's caret already\n      // sits 2px past the mic's left edge, so measuring to the mic would scroll the packaged\n      // composition. The caret has 35px of clearance to the button, which is the real boundary.\n      const compStopEl = composer.querySelector(\"#cge-blue-btn\");\n      const CARET_PAD = 8;\n      // The rebuild below has to discard exactly what the previous pass added, and `tl.to()`\n      // returns the TIMELINE, not the tween it just created -- so collecting those return values\n      // and killing them on the second pass kills the master timeline, and the composition stops\n      // dead. It only bites when there are keyframes to discard, i.e. an overflowing prompt: the\n      // exact remix this scroll exists for, and why a packaged-defaults render never saw it.\n      // One nested child timeline is a real object that can be killed and replaced, and killing\n      // it cannot reach `tl`.\n      let caretTl = null;\n      const layoutCaretScroll = () => {\n        if (caretTl) {\n          caretTl.kill();\n          caretTl = null;\n          // Only ever touch typedEl when there was scrolling to undo. A zero translate — or even\n          // a clearProps on an untouched element — stamps and removes a transform, which changes\n          // how the text rasterizes and makes the packaged render differ for no reason.\n          gsap.set(typedEl, { clearProps: \"transform\" });\n        }\n        if (!compTextEl || !compStopEl) return;\n        // Rects live in the scaled .screen space while offsets are layout px, so convert with the\n        // element's own ratio rather than reading --scale -- this then survives a change to it.\n        const box = compTextEl.getBoundingClientRect();\n        const ratio = compTextEl.offsetWidth ? box.width / compTextEl.offsetWidth : 1;\n        const limit =\n          (compStopEl.getBoundingClientRect().left - box.left) / (ratio || 1) - CARET_PAD;\n        if (!(limit > 0)) return;\n        // Collect the steps first, so a prompt that fits leaves typedEl alone entirely.\n        const steps = [];\n        let shift = 0;\n        chars.forEach((c, i) => {\n          const caret = curEls[i + 1];\n          if (!caret) return;\n          const want = Math.max(0, caret.offsetLeft - limit);\n          if (want > shift + 0.5) {\n            shift = want;\n            steps.push([charT[i], -shift]);\n          }\n        });\n        if (!steps.length) return;\n        // Children sit at the same absolute times as before, and the nest is added at 0, so the\n        // nested timeline's local clock is the master's -- the motion is unchanged.\n        caretTl = gsap.timeline();\n        steps.forEach(([at, x]) => {\n          caretTl.to(typedEl, { x, duration: 0.08, ease: \"none\" }, at);\n        });\n        // Back to the start when the composer empties, so the collapse animates from x=0.\n        caretTl.to(typedEl, { x: 0, duration: 0.01 }, tGo);\n        tl.add(caretTl, 0);\n      };\n      layoutCaretScroll();\n      // This composition builds its timeline once, so the first pass measures whatever font was\n      // live then. Re-measure when the embedded faces are ready.\n      document.fonts.ready.then(layoutCaretScroll);\n\n      window.__timelines[\"chatgpt-exchange\"] = tl;\n    </script>\n  </body>\n</html>\n"}