# Thermal Camera Effect

Motionboard shot name: Thermal Scan

A phone seen from the back at a slight angle glows in false colour: a white-hot spot at the chip spreads through the cooling chamber while a large readout falls from about 46°C to about 40°C. The heat layer wipes away top to bottom, the plain phone slides right, the caption Cooler under load. appears, and the Ember lockup follows.

- Position in a launch film: Product reveal
- Slug: thermal-camera-effect
- Preview video: https://media.motionboard.app/thermal-scan.mp4
- Recipe page: https://motionboard.app/recipes/thermal-camera-effect/
- License: MIT. Free to use in your own projects, including commercial launch films. https://github.com/krisyangdev/motionboard/blob/main/LICENSE

## How to use this recipe

You are a coding agent. The user wants this shot for their own product. Follow these steps.

1. **Know the product.** If the product is clear from the user's repo or conversation, ask nothing and start. Otherwise ask once for: product name, logo file, brand colors.
2. **Pick the output.** If the user's message says a video or their website, do that. Otherwise ask once which one they want.
   - **Video (HyperFrames).** Create a folder named `thermal-scan`. Download every file under "Source files" below with the curl commands, keeping relative paths. Adapt `index.html` (see "What to adapt"). Run `npx --yes hyperframes@0.8.209 check` on the untouched copy first and note its result. Preview with `npx --yes hyperframes@0.8.209 preview`, render an MP4 with `npx --yes hyperframes@0.8.209 render` (into `renders/`, named with a timestamp). The same commands are in `package.json` as `dev`, `check`, `render`; pass flags after `--`, as in `npm run render -- --quality draft`. Rendering needs network access for web fonts and GSAP.
   - **Website motion.** Port the GSAP timeline in `index.html` into the user's site, using their stack (React, Vue, Svelte, plain HTML). Build the same DOM structure, keep the timeline's durations, delays and easings exactly, and start it when the element scrolls into view (IntersectionObserver or ScrollTrigger). Respect `prefers-reduced-motion: reduce`: show the final frame as a static state and skip the movement.
3. **What to adapt.**
   - **Brand layer** (product name, logo, colors, fonts, copy): replace directly with the user's.
   - **UI layer** (the product screens, cards, windows, controls shown in the shot): rebuild the user's real UI as clean DOM, from their codebase (components, design tokens) or from a screenshot used as reference only. Never paste a screenshot into the shot.
   - **Motion** (timing, easing, camera moves, layering, stagger, order of events): keep exactly as in the source. This is what the recipe is.
   - The timeline targets UI elements by id and class, and camera moves land on fixed coordinates. Keep the ids the timeline uses, keep row counts and text lengths close to the source, and when the layout moves, update the target coordinates without changing the times.
4. **Fonts.** HyperFrames fetches Google Fonts such as Inter on its own. Some sources use macOS local fonts (PingFang, Songti via `local()`). Use the user's brand font when it can be bundled; for a system font such as SF Pro, use Inter. Check that text still fits its boxes.
5. **Verify.** Compare the render with the preview video above at the beat times in the Timing row. The beats, timing and camera should match; only brand and UI content differ.

## Spec

| Item | Value |
| --- | --- |
| Timing | Film 11s. Phone rises 0.1–1.2s; thermal layer fades in 0.65–1.25s; readout and scale bar rise 0.7–1.5s; chip heats 0.7–2.4s (readout 28.3°C to about 46°C); status Hot spot at the chip 0.95–2.4s; chamber spreads the heat and the peak cools 2.4–5.0s (to about 40°C) with the status Chamber spreading the heat at 2.6–4.2s and Heat spread. Peak down. at 4.4–5.4s; readout and scale fade 5.4–5.8s; wipe to the plain render 5.6–6.4s while the phone slides right 5.6–6.3s; caption rises from 6.15s; phone and caption clear 8.0–8.3s; lockup 8.3–8.75s and holds to 11s |
| Easing | Phone rise, readout, caption and lockup use expo.out; the slow phone turn and the glass sheen use sine.inOut; the slide to the right uses power3.inOut; the wipe is power2.inOut; exits use power2.in; the status lines fade in with power2.out. The heat model is not tweened: every value is a smoothstep curve of timeline time |
| Camera | Locked camera. The phone turns slowly in CSS 3D with perspective 2400px: rotationY −20° to −10° and rotationX 6° to 3° over 0.1–6.0s, then to −22° and 5° over 6.0–7.8s, rotationZ fixed at −2.5°. It rises 50px from scale 0.95 to 1 on entry |
| Subject | Phone back 436x900px with a 76px corner radius, centred at x 960 before the slide, with 16 slabs 1.8px apart behind the face for the edge, three side buttons and a 190x190px camera plateau with three 70px lenses. Heat canvas 872x1800px drawn from a 146x300 field with bilinear upscaling, clipped to the outline. Field: chip hot spot 13.2°C with σ 34px plus a 2.5°C core with σ 16px; cooling drops the chip term by 88% and widens σ to 104px; vapour chamber is two rounded rectangles (226x528px r36 and 182x170px r32) with a front travelling 40→760px and a 9°C plateau; body glow 0.3→1.2°C, camera module 2.6°C and one wandering source 3.2°C with σ 30px. Palette of 8 stops over 28–46°C: navy rgb(5,8,52), blue, cyan, green, yellow, orange, red, white-hot rgb(255,248,230). Readout 128px weight 800 with a 72px unit; scale bar 26x580px with 30px labels; status lines 32px; caption 124px weight 700; lockup mark 156px, wordmark 200px, tagline 56px |
| Sync | The hot spot and the readout rise together over 0.7–2.4s and the readout peaks at about 46°C at 2.4s, the moment cooling starts and the plateau begins to fill. The scale marker, the readout colour and a warm glow behind the phone all follow the peak computed from the field on each frame, so number, colour and marker agree. The wipe and the slide to the right start together at 5.6s; the caption waits until 6.15s, when the phone has cleared x 950, before any text enters; the lockup starts at 8.3s, after the phone and caption are gone |
| Style | Background `#09090b` with a radial lift to `#151920` and a vignette reaching 55% black; one accent ember orange `#ff6a2b`; graphite phone back with a 14% white inner rim and a diagonal glass sheen; Inter throughout, weight 800 for the readout and 700 for caption and wordmark; no grain |

## Why it works

The heat map is computed from one temperature field that is redrawn every frame, so the spread follows physics. A hot spot at the chip rises first, then a front travels through the L-shaped vapour chamber and fills it with an even plateau while the chip's own peak falls. The viewer reads the cooling from three places that agree: the colour moves from white-hot to yellow-orange, the large readout drops from about 46°C to about 40°C, and the marker on the scale bar slides down. A thin 28–46°C scale and a THERMAL pill make the layer look like an instrument, and the false colour is clipped to the phone outline so the device stays the subject on a dark frame. The wipe back to the plain render runs top to bottom with a thin scan line, so the same phone appears again as a product. The caption Cooler under load. enters only after the phone has slid to the right and cleared the left half, so text and phone never overlap. The phone is a CSS 3D slab seen at a slight angle that turns slowly, which keeps it a solid object under the overlay. There is one accent color, ember orange #ff6a2b, used on the THERMAL dot and the lockup mark; the heat palette is the only other color.

## Prompt

> Build an 11-second, 1920x1080, 30 fps dark product film called Thermal Camera Effect for a fictional product, Ember (a phone with a vapour-chamber cooling system). Background #09090b with a radial lift to #151920 and a vignette, one accent color ember orange #ff6a2b, font Inter, and the heat palette as the only other color. Use one GSAP timeline plus one render(t) function driven by a linear proxy tween, with canvas 2D and no WebGL, no CSS animations, no random numbers and no grain. Draw the phone back in DOM and CSS 3D: a 436x900px face with a 76px corner radius and a graphite gradient, 16 stacked slabs 1.8px apart behind it for the edge, a 190x190px camera plateau with three 70px lenses, and a diagonal glass sheen. Put it in a wrapper with perspective 2400px and turn it slowly: rotationY −20° to −10° over 0.1–6.0s (sine.inOut), then to −22° over 6.0–7.8s. Add a 872x1800px canvas over the face, clipped to the outline. Each frame compute a 146x300 temperature field in °C from timeline time and map it through an 8-stop palette over 28–46°C: navy rgb(5,8,52), blue, cyan, green, yellow, orange, red, white-hot rgb(255,248,230); upscale it with bilinear smoothing and draw static component outlines, a chip square and dimple texture on top. Field: a chip hot spot of 13.2°C with σ 34px plus a 2.5°C core, rising over 0.7–2.4s; then 2.4–5.0s the chip term falls 88% and widens to σ 104px while a front travels from the chip through an L-shaped vapour chamber (two rounded rectangles) and builds a 9°C plateau; add a 0.3→1.2°C body glow, a 2.6°C camera warmth and one wandering 3.2°C source. Show a 128px weight 800 readout of the computed peak (28.3°C rising to about 46°C at 2.4s, then falling to about 40°C), coloured from the palette, with a 28px PEAK TEMPERATURE label, a 32px status line (Hot spot at the chip, Chamber spreading the heat, Heat spread. Peak down.), a THERMAL pill, and a 26x580px scale bar with 30px labels 46°C, 37°C, 28°C and a marker that follows the peak. Fade the thermal layer in at 0.65–1.25s and the readout and scale out at 5.4–5.8s. At 5.6–6.4s wipe the canvas away top to bottom (power2.inOut, 100px soft edge, thin orange scan line) to show the plain phone while it slides 250px right (power3.inOut, 5.6–6.3s). At 6.15s the caption Cooler / under load. rises in at 124px weight 700 on the left (expo.out); clear caption and phone at 8.0–8.3s. Lockup 8.3–8.75s: a drop-shaped 156px mark, Ember at 200px, the tagline Cool by design. at 56px, held still to 11s.

## Often confused with

- [X-Ray Effect](https://motionboard.app/r/x-ray-effect.md): X-Ray Effect dissolves between a chip and the phone shell from one camera position; Thermal Camera Effect keeps the phone outside view and lays a computed heat map over it, with a readout and scale that change as the heat spreads.
- [Exploded View Animation](https://motionboard.app/r/exploded-view-animation.md): Exploded View separates the phone into layers to show its parts; here the phone stays one solid body and the only layer that changes is the temperature colour map clipped to its outline.

## Source files

Runnable HyperFrames project, 3 files.

- https://motionboard.app/source/thermal-scan/hyperframes.json (318 B)
- https://motionboard.app/source/thermal-scan/index.html (24.0 KB)
- https://motionboard.app/source/thermal-scan/package.json (301 B)

Download all of them:

```sh
curl -fsSL --create-dirs -o "thermal-scan/hyperframes.json" "https://motionboard.app/source/thermal-scan/hyperframes.json"
curl -fsSL --create-dirs -o "thermal-scan/index.html" "https://motionboard.app/source/thermal-scan/index.html"
curl -fsSL --create-dirs -o "thermal-scan/package.json" "https://motionboard.app/source/thermal-scan/package.json"
```

## index.html

```html
<!doctype html>
<html lang="en" data-resolution="landscape">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=1920, height=1080" />
    <script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
    <style>
      :root {
        --bg: #09090b;
        --ink: #f4f5f8;
        --muted: #9aa0ac;
        --accent: #ff6a2b;
        --font-ui: "Inter", sans-serif;
      }
      * { margin: 0; padding: 0; box-sizing: border-box; }
      html, body { width: 1920px; height: 1080px; overflow: hidden; background: var(--bg); }
      #root { position: relative; width: 1920px; height: 1080px; overflow: hidden; background: var(--bg); font-family: var(--font-ui); color: var(--ink); -webkit-font-smoothing: antialiased; }
      .full { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }

      #bg { background: radial-gradient(ellipse 62% 74% at 50% 50%, #151920 0%, #0b0c10 62%, #09090b 100%); }
      #vig { pointer-events: none; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 56%, rgba(0, 0, 0, 0.55) 100%); }

      /* ---------- phone ---------- */
      #phoneWrap { position: absolute; left: 742px; top: 90px; width: 436px; height: 900px; perspective: 2400px; opacity: 0; }
      #aura { position: absolute; left: -520px; top: -300px; width: 1476px; height: 1500px; pointer-events: none; background: radial-gradient(closest-side, rgba(80, 120, 200, 0.2), rgba(80, 120, 200, 0) 100%); }
      #auraW { position: absolute; left: -520px; top: -300px; width: 1476px; height: 1500px; pointer-events: none; opacity: 0; background: radial-gradient(closest-side, rgba(255, 110, 40, 0.34), rgba(255, 110, 40, 0) 100%); }
      #p3d { position: absolute; left: 0; top: 0; width: 436px; height: 900px; transform-style: preserve-3d; }
      .slab { position: absolute; left: 0; top: 0; width: 436px; height: 900px; border-radius: 76px; }
      .sbtn { position: absolute; border-radius: 3px; background: linear-gradient(90deg, #7d818b, #b8bcc5, #7d818b); }
      #face {
        position: absolute; left: 0; top: 0; width: 436px; height: 900px; border-radius: 76px; overflow: hidden;
        background: linear-gradient(155deg, #3a3d45 0%, #262930 42%, #181a1f 100%);
        box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.14), inset 0 0 60px rgba(0, 0, 0, 0.45);
      }
      #face .gloss { position: absolute; left: 0; top: 0; width: 436px; height: 900px; background: linear-gradient(120deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.05) 100%); }
      #face .ant { position: absolute; height: 3px; background: rgba(0, 0, 0, 0.35); border-radius: 2px; }
      #plate {
        position: absolute; left: 28px; top: 28px; width: 190px; height: 190px; border-radius: 46px;
        background: linear-gradient(145deg, #454851 0%, #2a2c33 60%, #202228 100%);
        box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.2), 0 8px 18px rgba(0, 0, 0, 0.4);
      }
      .lens { position: absolute; width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle at 50% 50%, #0b0c11 0 32%, #20232b 34% 46%, #596070 48% 52%, #15171d 54% 100%); box-shadow: 0 0 0 3px #1a1c22, 0 0 0 4.5px rgba(255, 255, 255, 0.18); }
      .lens i { position: absolute; left: 22px; top: 18px; width: 14px; height: 10px; border-radius: 50%; background: radial-gradient(circle, rgba(140, 150, 255, 0.85), rgba(140, 150, 255, 0)); }
      .flash { position: absolute; left: 122px; top: 20px; width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle, #f4e7c9 0 40%, #7a735f 42% 70%, #1a1c22 72%); }
      .sens { position: absolute; left: 148px; top: 144px; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle, #232733 0 45%, #0b0c11 50%); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12); }
      #backlogo { position: absolute; left: 187px; top: 612px; width: 62px; height: 62px; opacity: 0.3; }
      #sheenWrap { position: absolute; left: 0; top: 0; width: 436px; height: 900px; border-radius: 76px; overflow: hidden; pointer-events: none; }
      #sheenRot { position: absolute; left: 0; top: 0; width: 436px; height: 900px; transform: rotate(18deg); transform-origin: 50% 50%; }
      #sheen { position: absolute; left: -250px; top: -300px; width: 200px; height: 1500px; background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0)); }
      #heat { position: absolute; left: 0; top: 0; width: 436px; height: 900px; opacity: 0; }

      /* ---------- thermal UI ---------- */
      #ro { position: absolute; left: 150px; top: 332px; width: 600px; opacity: 0; }
      #ro .k { font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: 0.2em; color: var(--muted); }
      #ro .n { margin-top: 6px; font-size: 128px; line-height: 134px; font-weight: 800; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
      #ro .n .u { font-size: 72px; font-weight: 700; letter-spacing: -0.02em; margin-left: 4px; }
      #sts { position: relative; margin-top: 16px; height: 44px; }
      .st { position: absolute; left: 0; top: 0; font-size: 32px; line-height: 44px; font-weight: 500; color: #c8cdd8; white-space: nowrap; opacity: 0; }
      #sc { position: absolute; left: 1272px; top: 150px; opacity: 0; }
      #pill { display: inline-flex; align-items: center; gap: 12px; height: 52px; padding: 0 22px 0 18px; border-radius: 26px; border: 1.5px solid rgba(255, 255, 255, 0.24); font-size: 28px; font-weight: 600; letter-spacing: 0.18em; color: #e8ebf1; }
      #pill i { display: block; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
      #scale { position: absolute; left: 0; top: 88px; width: 220px; height: 580px; }
      #bar { position: absolute; left: 0; top: 0; width: 26px; height: 580px; border-radius: 13px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.22); }
      .tk { position: absolute; left: 44px; font-size: 30px; line-height: 36px; font-weight: 600; color: #d4d8e0; white-space: nowrap; font-variant-numeric: tabular-nums; }
      #mk { position: absolute; left: -10px; top: 290px; width: 46px; height: 4px; margin-top: -2px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.55); }

      /* ---------- caption ---------- */
      #cap { position: absolute; left: 150px; top: 406px; }
      .cl { display: block; font-size: 124px; line-height: 134px; font-weight: 700; letter-spacing: -0.035em; white-space: nowrap; color: var(--ink); opacity: 0; }
      .cl.b { color: #b4b9c5; }

      /* ---------- lockup ---------- */
      #lk { position: absolute; left: 0; top: 388px; width: 1920px; display: flex; flex-direction: column; align-items: center; }
      #lkRow { display: flex; align-items: center; gap: 40px; }
      #lkMark { width: 156px; height: 156px; opacity: 0; }
      #lkWord { font-size: 200px; line-height: 200px; font-weight: 700; letter-spacing: -0.04em; color: var(--ink); opacity: 0; }
      #lkTag { margin-top: 26px; font-size: 56px; line-height: 64px; font-weight: 500; letter-spacing: -0.01em; color: var(--muted); opacity: 0; }
    </style>
  </head>
  <body>
    <div id="root" data-composition-id="main" data-start="0" data-duration="11" data-width="1920" data-height="1080">
      <div id="bg" class="clip full" data-start="0" data-duration="11" data-track-index="0" data-layout-ignore data-layout-allow-overlap></div>

      <div id="stage" class="clip full" data-start="0" data-duration="11" data-track-index="1" data-layout-allow-overlap>
        <div id="phoneWrap" data-layout-allow-overlap data-layout-ignore>
          <div id="aura"></div>
          <div id="auraW"></div>
          <div id="p3d">
            <div id="face">
              <div class="gloss"></div>
              <div class="ant" style="left: 96px; top: 12px; width: 244px"></div>
              <div class="ant" style="left: 96px; top: 885px; width: 244px"></div>
              <div id="plate">
                <div class="lens" style="left: 18px; top: 18px"><i></i></div>
                <div class="lens" style="left: 18px; top: 102px"><i></i></div>
                <div class="lens" style="left: 104px; top: 60px"><i></i></div>
                <div class="flash"></div>
                <div class="sens"></div>
              </div>
              <svg id="backlogo" viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg">
                <path fill-rule="evenodd" fill="#fff" d="M60 6C60 6 100 48 100 76A40 40 0 0 1 20 76C20 48 60 6 60 6ZM60 54C60 54 80 74 80 86A20 20 0 0 1 40 86C40 74 60 54 60 54Z" />
              </svg>
              <canvas id="heat" width="872" height="1800"></canvas>
              <div id="sheenWrap"><div id="sheenRot"><div id="sheen"></div></div></div>
            </div>
          </div>
        </div>
      </div>

      <div id="ui" class="clip full" data-start="0" data-duration="11" data-track-index="2" data-layout-allow-overlap>
        <div id="ro" data-layout-allow-overlap>
          <div class="k">PEAK TEMPERATURE</div>
          <div class="n"><span id="pk">28.3</span><span class="u">°C</span></div>
          <div id="sts">
            <div class="st" id="st1">Hot spot at the chip</div>
            <div class="st" id="st2">Chamber spreading the heat</div>
            <div class="st" id="st3">Heat spread. Peak down.</div>
          </div>
        </div>
        <div id="sc" data-layout-allow-overlap>
          <div id="pill"><i></i>THERMAL</div>
          <div id="scale">
            <div id="bar"></div>
            <div class="tk" style="top: -18px">46°C</div>
            <div class="tk" style="top: 272px">37°C</div>
            <div class="tk" style="top: 562px">28°C</div>
            <div id="mk"></div>
          </div>
        </div>
      </div>

      <div id="capL" class="clip full" data-start="0" data-duration="11" data-track-index="3" data-layout-allow-overlap>
        <div id="cap" data-layout-allow-overlap>
          <span class="cl">Cooler</span>
          <span class="cl b">under load.</span>
        </div>
      </div>

      <div id="lockL" class="clip full" data-start="0" data-duration="11" data-track-index="4" data-layout-allow-overlap>
        <div id="lk" data-layout-allow-overlap>
          <div id="lkRow">
            <svg id="lkMark" viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg">
              <defs>
                <linearGradient id="mg" x1="0" y1="0" x2="0" y2="1">
                  <stop offset="0" stop-color="#ff9a52" />
                  <stop offset="1" stop-color="#ff4a18" />
                </linearGradient>
              </defs>
              <path fill-rule="evenodd" fill="url(#mg)" d="M60 6C60 6 100 48 100 76A40 40 0 0 1 20 76C20 48 60 6 60 6ZM60 54C60 54 80 74 80 86A20 20 0 0 1 40 86C40 74 60 54 60 54Z" />
            </svg>
            <div id="lkWord">Ember</div>
          </div>
          <div id="lkTag">Cool by design.</div>
        </div>
      </div>

      <div id="vig" class="clip full" data-start="0" data-duration="11" data-track-index="5" data-layout-ignore data-layout-allow-overlap></div>
    </div>

    <script>
      const DUR = 11;
      const EXPO = "expo.out";

      /* ---------- math helpers ---------- */
      const clamp = (x, a, b) => Math.min(b, Math.max(a, x));
      const sm = (a, b, t) => { const k = clamp((t - a) / (b - a), 0, 1); return k * k * (3 - 2 * k); };
      const pow2io = (k) => (k < 0.5 ? 2 * k * k : 1 - Math.pow(-2 * k + 2, 2) / 2);

      /* ---------- phone thickness: stacked slabs behind the face ---------- */
      const p3d = document.getElementById("p3d");
      const face = document.getElementById("face");
      const SL = 16;
      const mixc = (a, b, k) => a.map((v, i) => Math.round(v + (b[i] - v) * k));
      for (let i = SL; i >= 1; i--) {
        const d = document.createElement("div");
        d.className = "slab";
        const k = (i - 1) / (SL - 1);
        const c = k < 0.18 ? mixc([214, 217, 224], [150, 154, 164], k / 0.18) : mixc([150, 154, 164], [52, 55, 62], (k - 0.18) / 0.82);
        d.style.background = "rgb(" + c.join(",") + ")";
        d.style.transform = "translateZ(" + (-i * 1.8).toFixed(1) + "px)";
        p3d.insertBefore(d, face);
      }
      [[-5, 250, 6, 64], [-5, 330, 6, 64], [435, 300, 6, 112]].forEach((b) => {
        const d = document.createElement("div");
        d.className = "sbtn";
        d.style.cssText = "left:" + b[0] + "px;top:" + b[1] + "px;width:" + b[2] + "px;height:" + b[3] + "px;transform:translateZ(-14px)";
        p3d.insertBefore(d, face);
      });

      /* ---------- thermal palette ---------- */
      const STOPS = [
        [0.0, 5, 8, 52], [0.16, 22, 44, 176], [0.3, 0, 170, 255], [0.44, 24, 226, 140],
        [0.58, 250, 234, 44], [0.72, 255, 140, 22], [0.86, 238, 38, 30], [1.0, 255, 248, 230]
      ];
      const LN = 1024;
      const LR = new Float32Array(LN + 1), LG = new Float32Array(LN + 1), LB = new Float32Array(LN + 1);
      for (let i = 0; i <= LN; i++) {
        const x = i / LN;
        let s = 0;
        while (s < STOPS.length - 2 && x > STOPS[s + 1][0]) s++;
        const a = STOPS[s], b = STOPS[s + 1], k = clamp((x - a[0]) / (b[0] - a[0]), 0, 1);
        LR[i] = a[1] + (b[1] - a[1]) * k; LG[i] = a[2] + (b[2] - a[2]) * k; LB[i] = a[3] + (b[3] - a[3]) * k;
      }
      const palCss = (x) => { const i = Math.round(clamp(x, 0, 1) * LN); return "rgb(" + Math.round(LR[i]) + "," + Math.round(LG[i]) + "," + Math.round(LB[i]) + ")"; };
      (() => {
        const st = [];
        for (let i = 0; i <= 16; i++) st.push(palCss(1 - i / 16) + " " + ((i / 16) * 100).toFixed(1) + "%");
        document.getElementById("bar").style.background = "linear-gradient(180deg," + st.join(",") + ")";
      })();

      /* ---------- phone-space geometry (436 x 900) ---------- */
      const W = 436, H = 900, RAD = 76;
      const CH1 = { cx: 223, cy: 496, hw: 113, hh: 264, r: 36 };  // main chamber strip
      const CH2 = { cx: 171, cy: 317, hw: 91, hh: 85, r: 32 };    // bulge over the chip
      const sdRR = (x, y, b) => {
        const qx = Math.abs(x - b.cx) - b.hw + b.r, qy = Math.abs(y - b.cy) - b.hh + b.r;
        return Math.hypot(Math.max(qx, 0), Math.max(qy, 0)) + Math.min(Math.max(qx, qy), 0) - b.r;
      };
      const rrPath = (g, x, y, w, h, r) => { g.moveTo(x + r, y); g.arcTo(x + w, y, x + w, y + h, r); g.arcTo(x + w, y + h, x, y + h, r); g.arcTo(x, y + h, x, y, r); g.arcTo(x, y, x + w, y, r); g.closePath(); };
      const rrBox = (b) => [b.cx - b.hw, b.cy - b.hh, b.hw * 2, b.hh * 2, b.r];

      /* static detail layer: component outlines, chamber outline and dimple texture */
      const det = document.createElement("canvas");
      det.width = W * 2; det.height = H * 2;
      (() => {
        const g = det.getContext("2d");
        g.scale(2, 2);
        g.lineJoin = "round";
        // body rim
        g.strokeStyle = "rgba(130,180,255,0.5)"; g.lineWidth = 3;
        g.beginPath(); rrPath(g, 6, 6, W - 12, H - 12, RAD - 6); g.stroke();
        // faint components
        g.strokeStyle = "rgba(190,225,255,0.32)"; g.lineWidth = 1.6;
        const faint = [[28, 28, 190, 190, 46], [52, 780, 332, 92, 16], [352, 232, 40, 520, 12], [36, 420, 56, 330, 14]];
        faint.forEach((b) => { g.beginPath(); rrPath(g, b[0], b[1], b[2], b[3], b[4]); g.stroke(); });
        [[81, 81], [81, 165], [167, 123]].forEach((c) => { g.beginPath(); g.arc(c[0], c[1], 35, 0, Math.PI * 2); g.stroke(); });
        g.fillStyle = "rgba(190,225,255,0.4)";
        [[60, 250], [380, 250], [60, 752], [380, 752]].forEach((c) => { g.beginPath(); g.arc(c[0], c[1], 4.5, 0, Math.PI * 2); g.fill(); });
        // dimple texture inside the chamber
        g.save();
        g.beginPath(); rrPath(g, ...rrBox(CH1)); rrPath(g, ...rrBox(CH2)); g.clip();
        g.fillStyle = "rgba(0,0,0,0.22)";
        for (let y = 236, row = 0; y < 760; y += 11, row++) {
          for (let x = 84 + (row % 2) * 6.5; x < 340; x += 13) { g.beginPath(); rrPath(g, x, y, 8, 3.2, 1.6); g.fill(); }
        }
        g.restore();
        // chamber outline (union, no inner seam)
        g.strokeStyle = "rgba(255,255,255,0.7)"; g.lineWidth = 2.4;
        [[CH1, CH2], [CH2, CH1]].forEach((p) => {
          g.save();
          g.beginPath(); g.rect(0, 0, W, H); rrPath(g, ...rrBox(p[1])); g.clip("evenodd");
          g.beginPath(); rrPath(g, ...rrBox(p[0])); g.stroke();
          g.restore();
        });
        // chip package
        g.strokeStyle = "rgba(255,255,255,0.8)"; g.lineWidth = 2;
        g.beginPath(); rrPath(g, 136, 280, 64, 64, 9); g.stroke();
        g.strokeStyle = "rgba(255,255,255,0.45)"; g.lineWidth = 1.4;
        g.beginPath(); rrPath(g, 148, 292, 40, 40, 5); g.stroke();
      })();

      /* ---------- heat model: a function of timeline time ---------- */
      const GW = 146, GH = 300;
      const fcv = document.createElement("canvas");
      fcv.width = GW; fcv.height = GH;
      const fx = fcv.getContext("2d");
      const fimg = fx.createImageData(GW, GH);
      const fpx = fimg.data;
      for (let i = 3; i < fpx.length; i += 4) fpx[i] = 255;

      const heat = document.getElementById("heat");
      const hx = heat.getContext("2d");

      function heatState(t) {
        const a = sm(0.7, 2.4, t), cool = sm(2.4, 5.0, t), pa = sm(1.3, 5.0, t), rs = sm(1.8, 5.0, t);
        return {
          Ac: 13.2 * a * (1 - 0.88 * cool), sc: 34 + 70 * cool, core: 2.5 * a * (1 - cool),
          Pamp: 9 * pa, Rf: 40 + 720 * rs, bg: 0.3 + 0.9 * sm(1.0, 4.5, t),
          cam: 2.6 * sm(0.9, 2.4, t) * (1 - 0.7 * sm(2.6, 5.0, t)),
          wA: 3.2 * sm(1.4, 2.6, t) * (1 - 0.6 * sm(3.5, 5.0, t)),
          cx: 168 + 6 * Math.sin(2.1 * t), cy: 312 + 5 * Math.cos(1.7 * t),
          wx: 250 + 46 * Math.sin(0.9 * t), wy: 420 + 70 * Math.sin(0.6 * t + 1)
        };
      }

      function fieldPass(t) {
        const S = heatState(t);
        let peak = 0;
        const cw = W / GW, ch = H / GH;
        const i2sc = 1 / (2 * S.sc * S.sc), i2core = 1 / (2 * 16 * 16);
        let n = 0;
        for (let gy = 0; gy < GH; gy++) {
          const v = (gy + 0.5) * ch;
          for (let gx = 0; gx < GW; gx++, n += 4) {
            const u = (gx + 0.5) * cw;
            const sd = Math.min(sdRR(u, v, CH1), sdRR(u, v, CH2));
            const sig = 1 / (1 + Math.exp(sd / 9));
            const f = sig + 0.38 * Math.exp(-Math.max(sd, 0) / 55) * (1 - sig);
            const dx = u - S.cx, dy = v - S.cy, r2 = dx * dx + dy * dy;
            let d = S.Ac * Math.exp(-r2 * i2sc) + S.core * Math.exp(-r2 * i2core);
            const dd = Math.sqrt(dx * dx * 0.7 + dy * dy);
            const k = clamp((S.Rf - dd) / 90 + 0.5, 0, 1);
            const front = k * k * (3 - 2 * k);
            d += S.Pamp * front * f;
            const bx = (u - 218) / 230, by = (v - 420) / 380;
            d += S.bg * Math.exp(-(bx * bx + by * by));
            const cxd = u - 120, cyd = v - 120;
            d += S.cam * Math.exp(-(cxd * cxd + cyd * cyd) / 4050);
            const wxd = u - S.wx, wyd = v - S.wy;
            d += S.wA * front * f * Math.exp(-(wxd * wxd + wyd * wyd) / 1800);
            if (d > peak) peak = d;
            const x = clamp(d / 18, 0, 1) * LN;
            const i0 = x | 0, fr = x - i0, i1 = i0 < LN ? i0 + 1 : i0;
            fpx[n] = LR[i0] + (LR[i1] - LR[i0]) * fr;
            fpx[n + 1] = LG[i0] + (LG[i1] - LG[i0]) * fr;
            fpx[n + 2] = LB[i0] + (LB[i1] - LB[i0]) * fr;
          }
        }
        fx.putImageData(fimg, 0, 0);
        return 28 + peak;
      }

      const elPk = document.getElementById("pk");
      const elMk = document.getElementById("mk");
      const elAuraW = document.getElementById("auraW");

      function render(t) {
        const T0 = 0.5, T1 = 6.5;
        if (t < T0 || t > T1) {
          if (t > T1) hx.clearRect(0, 0, W * 2, H * 2);
          if (t < T0) hx.clearRect(0, 0, W * 2, H * 2);
          elAuraW.style.opacity = "0";
          return;
        }
        const peak = fieldPass(t);
        hx.setTransform(2, 0, 0, 2, 0, 0);
        hx.clearRect(0, 0, W, H);
        hx.save();
        hx.beginPath(); rrPath(hx, 0, 0, W, H, RAD); hx.clip();
        hx.imageSmoothingEnabled = true;
        hx.imageSmoothingQuality = "high";
        hx.drawImage(fcv, 0, 0, W, H);
        hx.drawImage(det, 0, 0, W, H);

        // wipe back to the plain render, top to bottom
        const ws = clamp((t - 5.6) / 0.8, 0, 1);
        if (ws > 0) {
          const e = pow2io(ws), yw = -110 + (H + 220) * e;
          hx.globalCompositeOperation = "destination-out";
          const gr = hx.createLinearGradient(0, yw, 0, yw + 100);
          gr.addColorStop(0, "rgba(0,0,0,1)");
          gr.addColorStop(1, "rgba(0,0,0,0)");
          hx.fillStyle = gr;
          hx.fillRect(0, 0, W, H);
          hx.globalCompositeOperation = "source-over";
          if (ws < 1) {
            const y0 = yw + 46;
            const bg = hx.createLinearGradient(0, y0 - 22, 0, y0);
            bg.addColorStop(0, "rgba(255,150,80,0)");
            bg.addColorStop(1, "rgba(255,150,80,0.38)");
            hx.fillStyle = bg;
            hx.fillRect(0, y0 - 22, W, 22);
            hx.fillStyle = "rgba(255,214,170,0.95)";
            hx.fillRect(0, y0, W, 2.5);
          }
        }
        hx.restore();

        // readout, scale marker and warm aura follow the computed peak
        const x = clamp((peak - 28) / 18, 0, 1);
        elPk.textContent = peak.toFixed(1);
        elPk.style.color = palCss(Math.max(x, 0.34));
        elMk.style.top = (580 * (1 - x)).toFixed(1) + "px";
        elAuraW.style.opacity = (clamp((peak - 33) / 13, 0, 1) * (1 - sm(5.6, 6.4, t))).toFixed(3);
      }

      /* ---------- timeline ---------- */
      const tl = gsap.timeline({ paused: true });

      gsap.set("#phoneWrap", { y: 50, scale: 0.95 });
      gsap.set("#p3d", { rotationY: -20, rotationX: 6, rotationZ: -2.5 });
      gsap.set("#ro", { y: 16 });
      gsap.set("#sc", { y: 16 });
      gsap.set(".st", { y: 10 });
      gsap.set(".cl", { y: 34 });
      gsap.set("#lkMark", { scale: 0.7, transformOrigin: "50% 50%" });
      gsap.set("#lkWord", { x: -28 });
      gsap.set("#lkTag", { y: 14 });

      /* beat 1: phone in, thermal layer fades on, heat builds then spreads */
      tl.to("#phoneWrap", { opacity: 1, y: 0, scale: 1, duration: 1.1, ease: EXPO }, 0.1);
      tl.to("#p3d", { rotationY: -10, rotationX: 3, duration: 5.9, ease: "sine.inOut" }, 0.1);
      tl.to("#heat", { opacity: 1, duration: 0.6, ease: "power2.out" }, 0.65);
      tl.to("#sheen", { x: 700, duration: 2.3, ease: "sine.inOut" }, 0.3);
      tl.to("#ro", { opacity: 1, y: 0, duration: 0.7, ease: EXPO }, 0.7);
      tl.to("#sc", { opacity: 1, y: 0, duration: 0.7, ease: EXPO }, 0.8);

      const phase = (id, tin, tout) => {
        tl.to(id, { opacity: 1, y: 0, duration: 0.35, ease: "power2.out" }, tin);
        tl.to(id, { opacity: 0, y: -10, duration: 0.3, ease: "power2.in" }, tout);
      };
      phase("#st1", 0.95, 2.4);
      phase("#st2", 2.6, 4.2);
      phase("#st3", 4.4, 5.4);
      tl.to(["#ro", "#sc"], { opacity: 0, duration: 0.4, ease: "power2.in" }, 5.4);

      /* beat 2: wipe to the plain render (canvas), phone slides right, caption */
      tl.to("#phoneWrap", { x: 250, duration: 0.7, ease: "power3.inOut" }, 5.6);
      tl.to("#p3d", { rotationY: -22, rotationX: 5, duration: 1.8, ease: "sine.inOut" }, 6.0);
      tl.set("#sheen", { x: -250 }, 5.95);
      tl.to("#sheen", { x: 700, duration: 1.7, ease: "sine.inOut" }, 6.0);
      tl.to(".cl", { opacity: 1, y: 0, duration: 0.8, ease: EXPO, stagger: 0.14 }, 6.15);

      /* clear, then lockup */
      tl.to("#phoneWrap", { opacity: 0, y: -30, duration: 0.3, ease: "power2.in" }, 8.0);
      tl.to(".cl", { opacity: 0, y: -22, duration: 0.3, ease: "power2.in" }, 8.0);
      tl.to("#lkMark", { opacity: 1, scale: 1, duration: 0.45, ease: EXPO }, 8.3);
      tl.to("#lkWord", { opacity: 1, x: 0, duration: 0.43, ease: EXPO }, 8.32);
      tl.to("#lkTag", { opacity: 1, y: 0, duration: 0.4, ease: EXPO }, 8.35);

      /* thermal canvas redrawn from timeline time */
      tl.to({ v: 0 }, { v: 1, duration: DUR, ease: "none", onUpdate: () => render(tl.time()) }, 0);
      window.addEventListener("hf-seek", (e) => render(e.detail.time));
      render(0);

      tl.set({}, {}, DUR);
      window.__timelines = window.__timelines || {};
      window.__timelines["main"] = tl;
    </script>
  </body>
</html>
```
