# Exploded View Animation

A phone's cover glass, display, frame, logic board, battery, wireless coil and back glass separate in the air one by one while three callouts name the glass, the chip and the battery. The top three layers fade, the camera dives into the board and pulls out, and the seven layers close from the back up into the whole phone beside the Arden One lockup.

- Position in a launch film: Product reveal
- Slug: exploded-view-animation
- Preview video: https://media.motionboard.app/exploded-view.mp4
- Recipe page: https://motionboard.app/recipes/exploded-view-animation/
- 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 `exploded-view`. 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 11.8s. Fade in from black 0–0.9s; the seven layers start separating 1.0–1.32s (cover glass 1.0s, back glass 1.05s, display 1.1s, coil 1.14s, frame 1.2s, battery 1.26s, logic board 1.32s), each over 1.7s; camera tilts to 72° by 2.9s; three callouts appear at 2.7s, 3.0s and 3.3s (leaders draw over 0.7s) and fade 4.1–4.5s; cover glass, display and frame fade out (0.55s) and rise 100px from 4.35s, 4.45s and 4.55s; camera dives into the logic board 4.6–5.4s, holds on it until 6.9s and pulls out 6.9–7.65s; the three layers fade back from 7.3s, 7.4s and 7.5s (0.5s); the seven layers close from the back glass to the cover glass 7.55–9.14s, each over 1.05s; lockup mark at 8.4s, name at 8.5s, tagline at 8.75s; highlight 9.0–10.3s; held to the end at 11.8s |
| Easing | Separation expo.out (1.7s); closing cubic in-out (1.05s, the power3.inOut curve); camera tilt, azimuth, dolly and pan use monotone cubic interpolation between keyframes with no overshoot; the glass, display and frame fade and rise, callout fade-in and leader draw use smoothstep; mark, name and tagline expo.out; fade from black power1.out |
| Camera | CSS 3D stage with perspective 2400px; tilt is rotateX (0° faces the screen) and azimuth is rotateZ. Tilt: 46° over 0–0.9s, 72° at 2.9s, 70° at 4.6s, 50° at 5.2s, 46° at 5.8s, 42° at 6.9s, 54° at 7.4s, 48° at 8.4s, 36° at 9.0s, 16° at 10.2s, 15° to the end. Azimuth: −36° at 0s, −38° at 2.9s, −62° at 4.6s, −24° at 5.4s, −10° at 6.0s, +5° at 6.9s, −14° at 7.4s, −26° at 8.4s, −8° at 10.2s. Dolly (negative pulls back): 0 at 0.9s, −230px at 2.9s, −120px at 4.6s, +1250px at 5.4s, +1400px at 5.9s (about 2.4x), +1000px at 6.9s, +250px at 7.25s, −200px at 7.65s, −100px at 9.0s, 0 at 10.2s. The orbit pivot moves from the centre of the stack to the chip on the logic board (x 93, y 93, z 80) over 4.6–5.4s, drifts to (200, 213, −20) over 5.6–6.9s, releases over 6.9–7.3s and is back at the centre by 8.1s. The phone slides right: −34px at 2.9s, 0 at 5.4s, +380px at 8.2s, +420px at 8.9s and held |
| Subject | Seven phone layers, each 360x756px with 52px corners, moved only on z: cover glass, display (lock screen 9:41), metal frame, logic board, battery, wireless coil and back glass, top to bottom. Closed z is 21, 14, 9, 4, 4, −6, −9px; open z is 420, 300, 180, 80, −20, −110, −210px. Each layer has 1–7 copies stacked 2px apart behind it for edge thickness (cover glass 3, display 2, frame 7, board 2, battery 4, coil 1, back 3). The board is a dark green PCB with gold traces, 11 chips and 5 raised packages, the A1 package being 100x100px with an 86x86px lid; the battery is 300x344px printed 3,890 mAh with two orange pull tabs; the coil is 12 turns of copper; the back glass has three 48px lenses. While open, the layers underneath carry a shade of 0.16–0.58 opacity. An 800x1200px radial shadow sits under the phone at z=−300px. Three callouts: Cover glass (01 ceramic · 0.6 mm, pointing at the lower right corner of the glass, text on the right), Arden A1 chip (02 3 nm · 8-core CPU, pointing at the chip, text on the left) and 3,890 mAh battery (03 silicon-carbon · 15.0 Wh, pointing at the battery's right edge, text on the right) |
| Sync | Each callout's leader end is re-projected every frame to its part's current z, so it stays attached while the part rises; callout text matches what is printed on the parts (A1 · 3NM · 8-CORE on the chip lid, 3,890 mAh on the battery label, Battery health 100% · 3,890 mAh in the lock-screen notification); all callouts are gone by 4.5s and the cover glass only starts to rise at 4.35s, so a leader never sits on a moving glass; as the cover glass, display and frame fade, the shade they cast on the layers below clears with them, so the board is bright in the close-up; the layers close from the back glass up and the cover glass lands last, and when the mark appears at 8.4s the phone has already slid about 390px to the right, leaving the left side for the lockup; the 9.0s highlight and the 9.06s settle land as the last two layers close (9.02s and 9.14s) |
| Style | Background `#09090b` with a radial gradient (`#2a2d37` → `#171920` → `#0b0b0e`, centred at 58% and 40% of the frame), a 10% amber glow at the upper left and a 7% blue glow at the lower right that shift with the azimuth; one accent amber `#f5b04a`; callout title Inter 600 32px white, subtitle JetBrains Mono 20px at 70% white, number in amber; leader 1.6px with a 4.5px dot and a 9px halo at 22%; mark an 88px amber rounded square, name Arden One in Inter 600 156px with -0.045em tracking, tagline 40px `#9b9ca4`; grain at 7% opacity re-rolled every 3 frames and a vignette reaching 58% at the edges |

## Why it works

The seven layers share one axis with identical x and y and are spaced only on z, so the viewer reads one phone lifting apart and settling back together. They do not move as a block: the separation starts are staggered across 1.0–1.32s and each layer eases with expo.out over 1.7s, fast first and slow at the end; closing runs in the reverse order, back glass first and cover glass last, with a 1.05s cubic in-out, a different rhythm from the separation, so it reads as assembly. The camera tilts to 72° while the layers separate so the gaps between them show; to see the board, the cover glass, display and frame first fade and rise 100px and only then does the camera dive in, so nothing above the board blocks it. Callouts arrive one at a time, 0.3s apart, and each leader end is re-projected every frame to its part's current position, so it stays attached while the part rises; the callout text matches what is printed on the parts (A1 · 3NM · 8-CORE on the chip lid, 3,890 mAh on the battery label). The callouts fade 4.1–4.5s and the cover glass waits until 4.35s to rise. Every layer is drawn with edge thickness and real detail (traces, chips and raised packages on the board, a label and orange pull tabs on the battery, copper on the coil), so the close-up on the board holds up. There is one accent color, amber #f5b04a.

## Prompt

> Build an 11.8-second, 1920x1080, 30 fps dark product film called Exploded View Animation for a fictional product, Arden One (a phone). The background is a radial gradient (centre #2a2d37, through #171920 to #0b0b0e at the edges, base #09090b), the only accent color is amber #f5b04a, the font is Inter and callout subtitles use JetBrains Mono. Use CSS 3D: a stage with perspective 2400px and one rig container that acts as the camera (translate3d, rotateX for tilt, rotateZ for azimuth). Inside it stack seven phone layers on one axis, each 360x756px with 52px corners, and from then on change only each layer's translateZ. Top to bottom: cover glass (a thin bright border), display (a lock screen in a dark blue-violet to orange gradient with the time 9:41, Thursday, 26 November, and a notification Arden Care / Battery health 100% · 3,890 mAh), metal frame (screw bosses, antenna breaks), logic board (dark green PCB, gold traces, 11 chips, a raised A1 chip package of 100x100px whose lid is printed ARDEN A1 3NM · 8-CORE, plus a modem, a shield can and a connector), battery (light grey metal, printed 3,890 mAh and Li-ion polymer · 3.87 V · 15.0 Wh, with two orange pull tabs), wireless coil (a ferrite plate with 12 turns of copper) and back glass (three lenses of 48px). Give each layer 1–7 copies stacked 2px apart behind it for edge thickness and lay an 800x1200px radial shadow under the phone at z=-300px. Closed, the seven layers sit at z 21, 14, 9, 4, 4, -6, -9px; open, at 420, 300, 180, 80, -20, -110, -210px. While open, the layers underneath carry a shade of 0.16–0.58 opacity, but only while layers above cover them. Timeline: fade in from black 0–0.9s; the layers start separating between 1.0s and 1.32s (cover glass 1.0, back glass 1.05, display 1.1, coil 1.14, frame 1.2, battery 1.26, board 1.32), each over 1.7s with expo.out. The camera tilt goes from 46° to 72° over 0.9–2.9s, the azimuth from -36° to -38° and the dolly back to -230px. Three SVG callouts with leader lines (a 1.6px amber line, a 4.5px solid dot with a 9px translucent halo, a 60px slanted kink and then a horizontal run): at 2.7s Cover glass (01 ceramic · 0.6 mm, pointing at the lower right corner of the glass, text on the right), at 3.0s Arden A1 chip (02 3 nm · 8-core CPU, pointing at the chip, text on the left) and at 3.3s 3,890 mAh battery (03 silicon-carbon · 15.0 Wh, pointing at the battery's right edge, text on the right). Each leader draws over 0.7s, the title is 32px 600 white, the subtitle 20px monospace and the number amber; re-project each leader's end to its part's current z every frame; fade all three out over 4.1–4.5s. At 4.35s, 4.45s and 4.55s the cover glass, display and frame fade out one after another (0.55s) and rise 100px, and the shade they cast on the layers below clears with them. From 4.6 to 5.4s the camera dives into the board: move the orbit pivot to the chip (x 93, y 93, z 80), tilt 50°, azimuth -24°, push the dolly to +1250px, reach +1400px at 5.9s (about 2.4x), hold on the board until 6.9s while the pivot drifts to (200, 213, -20), then pull out to -200px by 7.65s. The three top layers fade back and drop at 7.3s, 7.4s and 7.5s (0.5s). From 7.55s the seven layers close from the back glass to the cover glass, each over 1.05s with cubic in-out (starts 7.55, 7.63, 7.71, 7.79, 7.87, 7.97, 8.09), finished at 9.14s. Interpolate the camera values between keyframes with a monotone cubic so nothing overshoots. Slide the phone 420px right over 8.2–8.9s; from 8.4s the lockup comes in with expo.out: an 88px amber rounded-square mark, at 8.5s Arden One (156px, 600, -0.045em tracking) and at 8.75s the tagline Built from the inside out. (40px, #9b9ca4). A highlight sweeps the cover glass over 9.0–10.3s, the camera gives a 16px settle from 9.06s, the tilt eases to 16° and holds to the end. Finish with 7% grain re-rolled every 3 frames and a vignette.

## Often confused with

- [X-Ray Effect](https://motionboard.app/r/x-ray-effect.md): X-ray Dissolve cross-dissolves the inner structure into the outer shell from one camera position and the parts never leave their place; Exploded View Animation pulls the parts apart along one axis so each layer shows on its own, then puts them back together.
- [Macro Pull-out Reveal](https://motionboard.app/r/macro-pull-out-reveal.md): Macro Pull-out Reveal stays at extreme close range and ends on one pull-back to the whole device; here the device itself splits into seven layers, the camera dives into the board and pulls out, and the layers then close.

## Source files

Runnable HyperFrames project, 3 files.

- https://motionboard.app/source/exploded-view/hyperframes.json (318 B)
- https://motionboard.app/source/exploded-view/index.html (48.7 KB)
- https://motionboard.app/source/exploded-view/package.json (302 B)

Download all of them:

```sh
curl -fsSL --create-dirs -o "exploded-view/hyperframes.json" "https://motionboard.app/source/exploded-view/hyperframes.json"
curl -fsSL --create-dirs -o "exploded-view/index.html" "https://motionboard.app/source/exploded-view/index.html"
curl -fsSL --create-dirs -o "exploded-view/package.json" "https://motionboard.app/source/exploded-view/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: #ededf0;
        --sub: #9b9ca4;
        --mut: #64666e;
        --acc: #f5b04a;
        --acc-ink: #1a1205;
        --font-ui: "Inter", -apple-system, "SF Pro Text", "Helvetica Neue", sans-serif;
        --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
      }
      * { 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; }
      svg { display: block; flex: none; }

      /* ---------- studio ---------- */
      #bg {
        background:
          radial-gradient(ellipse 62% 74% at 58% 40%, #2a2d37 0%, #171920 46%, #0b0b0e 100%);
      }
      #glow {
        background: radial-gradient(ellipse 40% 46% at 30% 22%, rgba(245, 176, 74, 0.10) 0%, rgba(245, 176, 74, 0) 70%),
                    radial-gradient(ellipse 36% 40% at 78% 70%, rgba(120, 150, 255, 0.07) 0%, rgba(120, 150, 255, 0) 70%);
      }

      /* ---------- camera ---------- */
      #stage { perspective: 2400px; perspective-origin: 50% 50%; }
      #rig { position: absolute; left: 960px; top: 540px; width: 0; height: 0; transform-style: preserve-3d; }
      .ly { position: absolute; left: -180px; top: -378px; width: 360px; height: 756px; transform-style: preserve-3d; --o: 1; --sh: 0; }
      .ly > * { position: absolute; opacity: var(--o); }
      .f, .sl { left: 0; top: 0; width: 360px; height: 756px; }
      .bk { position: absolute; }
      #ground {
        position: absolute; left: -400px; top: -600px; width: 800px; height: 1200px;
        background: radial-gradient(closest-side, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.32) 55%, rgba(0, 0, 0, 0) 100%);
        transform: translateZ(-300px);
      }

      /* glass + display */
      .bz { position: absolute; left: 0; top: 0; width: 360px; height: 756px; border-radius: 52px; box-shadow: inset 0 0 0 13px #05060a; }
      .bz2 { position: absolute; left: 13px; top: 13px; width: 334px; height: 730px; border-radius: 39px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10); }
      #shn, #gln { position: absolute; left: 0; top: 0; width: 360px; height: 756px; border-radius: 52px; background-size: 300% 100%; }
      #shn { background-image: linear-gradient(112deg, rgba(255,255,255,0) 36%, rgba(255,255,255,0.13) 46%, rgba(255,255,255,0.03) 52%, rgba(255,255,255,0) 60%); }
      #gln { background-image: linear-gradient(104deg, rgba(255,255,255,0) 44%, rgba(255,240,215,0.34) 50%, rgba(255,255,255,0) 56%); opacity: 0; }
      .shd { position: absolute; left: 0; top: 0; width: 360px; height: 756px; border-radius: 52px; background: linear-gradient(135deg, rgba(0,0,0,0.30), rgba(0,0,0,0.82)); }
      #scr {
        position: absolute; left: 0; top: 0; width: 360px; height: 756px; border-radius: 52px; overflow: hidden;
        background:
          radial-gradient(120% 62% at 18% 92%, #f0a246 0%, rgba(240,162,70,0) 58%),
          radial-gradient(90% 70% at 96% 8%, #3a4bc2 0%, rgba(58,75,194,0) 62%),
          linear-gradient(180deg, #0c0e24 0%, #1c1233 100%);
      }
      #isl { position: absolute; left: 124px; top: 22px; width: 112px; height: 32px; border-radius: 16px; background: #000; }
      #dt { position: absolute; left: 0; width: 360px; top: 84px; text-align: center; font-size: 17px; font-weight: 500; letter-spacing: -0.005em; color: rgba(255,255,255,0.78); }
      #tm { position: absolute; left: 0; width: 360px; top: 100px; text-align: center; font-size: 124px; line-height: 132px; font-weight: 700; letter-spacing: -0.05em; color: rgba(255,255,255,0.94); }
      #nt { position: absolute; left: 26px; top: 520px; width: 308px; height: 74px; border-radius: 22px; background: rgba(255,255,255,0.16); padding: 14px 16px; }
      #nt b { display: block; font-size: 14px; font-weight: 600; color: #fff; }
      #nt span { display: block; margin-top: 3px; font-size: 14px; color: rgba(255,255,255,0.78); }
      #nt i { position: absolute; right: 16px; top: 14px; font-style: normal; font-size: 12px; color: rgba(255,255,255,0.6); }
      .qb { position: absolute; top: 676px; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,0.18); display: flex; align-items: center; justify-content: center; }
      #hi { position: absolute; left: 130px; top: 734px; width: 100px; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.72); }

      /* callouts */
      #cl { pointer-events: none; }
      .co { position: absolute; white-space: nowrap; opacity: 0; }
      .co .t { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; color: #ffffff; }
      .co .s { margin-top: 6px; font-size: 20px; font-weight: 500; letter-spacing: 0; color: rgba(255, 255, 255, 0.7); font-family: var(--mono); }
      .co .n { color: var(--acc); margin-right: 12px; }

      /* ---------- finish ---------- */
      #light {
        pointer-events: none;
        background: linear-gradient(118deg, rgba(220, 228, 255, 0.07) 0%, rgba(220, 228, 255, 0.02) 30%, rgba(0, 0, 0, 0) 52%, rgba(0, 0, 0, 0.2) 100%);
      }
      #grain {
        pointer-events: none; opacity: 0.07; background-size: 256px 256px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)'/%3E%3C/svg%3E");
      }
      #vig { pointer-events: none; background: radial-gradient(ellipse 78% 82% at 50% 50%, rgba(0,0,0,0) 52%, rgba(0,0,0,0.58) 100%); }
      #fade { background: #000; }
      #lock { position: absolute; left: 170px; top: 0; width: 900px; height: 1080px; display: flex; flex-direction: column; justify-content: center; }
      #mark { width: 88px; height: 88px; opacity: 0; }
      #wm { margin-top: 34px; font-size: 156px; line-height: 150px; font-weight: 600; letter-spacing: -0.045em; opacity: 0; }
      #tg { margin-top: 26px; font-size: 40px; line-height: 50px; font-weight: 500; letter-spacing: -0.02em; color: var(--sub); opacity: 0; }
    </style>
  </head>
  <body>
    <div id="root" data-composition-id="main" data-start="0" data-duration="11.8" data-width="1920" data-height="1080">
      <div id="bg" class="full"></div>
      <div id="glow" class="full"></div>

      <div id="stage" class="full" data-layout-ignore>
        <div id="rig" data-layout-ignore>
          <div id="ground" data-layout-ignore></div>
        </div>
      </div>

      <svg id="cl" class="full" viewBox="0 0 1920 1080" data-layout-ignore>
        <g id="cl0" opacity="0"><polyline pathLength="1" fill="none" stroke="#f5b04a" stroke-width="1.6" stroke-linejoin="round" stroke-dasharray="1 1" stroke-dashoffset="1" points="0,0 0,0"/><circle r="9" fill="rgba(245,176,74,0.22)"/><circle r="4.5" fill="#f5b04a"/></g>
        <g id="cl1" opacity="0"><polyline pathLength="1" fill="none" stroke="#f5b04a" stroke-width="1.6" stroke-linejoin="round" stroke-dasharray="1 1" stroke-dashoffset="1" points="0,0 0,0"/><circle r="9" fill="rgba(245,176,74,0.22)"/><circle r="4.5" fill="#f5b04a"/></g>
        <g id="cl2" opacity="0"><polyline pathLength="1" fill="none" stroke="#f5b04a" stroke-width="1.6" stroke-linejoin="round" stroke-dasharray="1 1" stroke-dashoffset="1" points="0,0 0,0"/><circle r="9" fill="rgba(245,176,74,0.22)"/><circle r="4.5" fill="#f5b04a"/></g>
      </svg>
      <div id="co0" class="co" data-layout-ignore><div class="t">Cover glass</div><div class="s"><span class="n">01</span>ceramic · 0.6 mm</div></div>
      <div id="co1" class="co" data-layout-ignore><div class="t">Arden A1 chip</div><div class="s"><span class="n">02</span>3 nm · 8-core CPU</div></div>
      <div id="co2" class="co" data-layout-ignore><div class="t">3,890 mAh battery</div><div class="s"><span class="n">03</span>silicon-carbon · 15.0 Wh</div></div>

      <div id="light" class="full"></div>
      <div id="grain" class="full"></div>
      <div id="vig" class="full"></div>

      <div id="lock">
        <svg id="mark" viewBox="0 0 48 48"><rect width="48" height="48" rx="12" fill="#f5b04a"/><path d="M24 11 38 18 24 25 10 18Z" fill="#1a1205"/><path d="M10 25 24 32 38 25" stroke="#1a1205" stroke-width="3.6" stroke-linecap="round" stroke-linejoin="round" fill="none"/><path d="M10 32 24 39 38 32" stroke="#1a1205" stroke-width="3.6" stroke-linecap="round" stroke-linejoin="round" fill="none"/></svg>
        <div id="wm">Arden One</div>
        <div id="tg">Built from the inside out.</div>
      </div>

      <div id="fade" class="full"></div>
    </div>

    <script>
      /* ---------- helpers ---------- */
      function mulberry32(a) {
        return function () {
          a |= 0; a = (a + 0x6d2b79f5) | 0;
          let t = Math.imul(a ^ (a >>> 15), 1 | a);
          t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
          return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
        };
      }
      const R = mulberry32(20261126);
      const rnd = (a, b) => a + (b - a) * R();
      const r1 = (v) => Math.round(v * 10) / 10;
      function hex2(h) { return [parseInt(h.slice(1, 3), 16), parseInt(h.slice(3, 5), 16), parseInt(h.slice(5, 7), 16)]; }
      function mix(a, b, k) {
        const A = hex2(a), B = hex2(b);
        return "rgb(" + A.map((v, i) => Math.round(v + (B[i] - v) * k)).join(",") + ")";
      }
      function rr(x, y, w, h, r) {
        return "M" + (x + r) + "," + y + "H" + (x + w - r) + "A" + r + "," + r + " 0 0 1 " + (x + w) + "," + (y + r) + "V" + (y + h - r) +
          "A" + r + "," + r + " 0 0 1 " + (x + w - r) + "," + (y + h) + "H" + (x + r) + "A" + r + "," + r + " 0 0 1 " + x + "," + (y + h - r) +
          "V" + (y + r) + "A" + r + "," + r + " 0 0 1 " + (x + r) + "," + y + "Z";
      }
      function rpoly(pts, r) {
        let d = "";
        const n = pts.length;
        for (let i = 0; i < n; i++) {
          const p0 = pts[(i + n - 1) % n], p1 = pts[i], p2 = pts[(i + 1) % n];
          const v1 = [p0[0] - p1[0], p0[1] - p1[1]], v2 = [p2[0] - p1[0], p2[1] - p1[1]];
          const l1 = Math.hypot(v1[0], v1[1]), l2 = Math.hypot(v2[0], v2[1]);
          const a = [p1[0] + (v1[0] / l1) * r, p1[1] + (v1[1] / l1) * r];
          const b = [p1[0] + (v2[0] / l2) * r, p1[1] + (v2[1] / l2) * r];
          d += (i ? "L" : "M") + a[0] + "," + a[1] + "Q" + p1[0] + "," + p1[1] + " " + b[0] + "," + b[1];
        }
        return d + "Z";
      }
      const GOLD = "#c9a24a", GOLD2 = "#e8cb78";
      const SVGO = '<svg width="360" height="756" viewBox="0 0 360 756" xmlns="http://www.w3.org/2000/svg" font-family="Inter, sans-serif">';

      function sliceSVG(d, n, c0, c1, eo) {
        let s = "";
        for (let i = 1; i <= n; i++) {
          const c = mix(c0, c1, n > 1 ? (i - 1) / (n - 1) : 0);
          s += '<div class="sl" style="transform:translateZ(' + -2 * i + 'px)">' + SVGO + '<path d="' + d + '" fill="' + c + '"' + (eo ? ' fill-rule="evenodd"' : "") + "/></svg></div>";
        }
        return s;
      }
      function sliceDiv(n, c0, c1, ring) {
        let s = "";
        for (let i = 1; i <= n; i++) {
          const c = mix(c0, c1, n > 1 ? (i - 1) / (n - 1) : 0);
          s += '<div class="sl" style="transform:translateZ(' + -2 * i + "px);border-radius:52px;" +
            (ring ? "box-shadow:inset 0 0 0 13px " + c : "background:" + c) + '"></div>';
        }
        return s;
      }
      /* raised block on a layer: slices zBase+1 .. zTop-1 and a top face at zTop */
      function block(x, y, w, h, r, zBase, zTop, edge, topHTML) {
        let s = "";
        for (let z = zBase + 1; z < zTop; z++) {
          s += '<div class="bk" style="left:' + x + "px;top:" + y + "px;width:" + w + "px;height:" + h + "px;border-radius:" + r + "px;background:" + edge + ";transform:translateZ(" + z + 'px)"></div>';
        }
        s += '<div class="bk" style="left:' + x + "px;top:" + y + "px;width:" + w + "px;height:" + h + "px;border-radius:" + r + "px;overflow:hidden;transform:translateZ(" + zTop + 'px)">' + topHTML + "</div>";
        return s;
      }
      function shadeDefs(id) {
        return '<linearGradient id="' + id + '" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#000" stop-opacity="0.30"/><stop offset="1" stop-color="#000" stop-opacity="0.82"/></linearGradient>';
      }

      /* ---------- layer 0: cover glass ---------- */
      function buildGlass() {
        return '<div class="f" style="border-radius:52px;box-shadow:inset 0 0 0 1.5px rgba(255,255,255,0.34);background:linear-gradient(160deg,rgba(255,255,255,0.045),rgba(255,255,255,0) 40%)">' +
          '<div class="bz"></div><div class="bz2"></div><div id="shn"></div><div id="gln"></div></div>' +
          sliceDiv(3, "#a9bccb", "#4c5c69", true);
      }

      /* ---------- layer 1: display panel ---------- */
      function buildDisplay() {
        const flash = '<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3h8v5l-2 3v10h-4V11L8 8z"/></svg>';
        const cam = '<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M4 8h3l2-3h6l2 3h3v11H4z"/><circle cx="12" cy="13" r="3.6"/></svg>';
        return '<div class="f" style="border-radius:52px;overflow:hidden;background:#000"><div id="scr">' +
          '<div id="isl"></div><div id="dt">Thursday, 26 November</div><div id="tm">9:41</div>' +
          '<div id="nt"><b>Arden Care</b><span>Battery health 100% · 3,890 mAh</span><i>now</i></div>' +
          '<div class="qb" style="left:40px">' + flash + '</div><div class="qb" style="left:272px">' + cam + '</div><div id="hi"></div></div>' +
          '<div class="shd" style="opacity:var(--sh)"></div></div>' +
          sliceDiv(2, "#2a2c33", "#101114", false);
      }

      /* ---------- layer 2: frame + midplate ---------- */
      const D_FRAME = rr(0, 0, 360, 756, 52) + rr(24, 24, 312, 258, 14) + rr(24, 298, 312, 352, 14) + rr(50, 666, 260, 52, 12);
      function buildFrame() {
        let s = SVGO + "<defs>" +
          '<linearGradient id="fm" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#7d8088"/><stop offset="0.5" stop-color="#585b62"/><stop offset="1" stop-color="#3f4247"/></linearGradient>' +
          '<pattern id="br" width="4" height="4" patternUnits="userSpaceOnUse" patternTransform="rotate(32)"><rect width="4" height="1" fill="rgba(255,255,255,0.05)"/><rect y="2" width="4" height="1" fill="rgba(0,0,0,0.07)"/></pattern>' +
          shadeDefs("sh2") + "</defs>";
        s += '<path d="' + D_FRAME + '" fill="url(#fm)" fill-rule="evenodd"/>';
        s += '<path d="' + D_FRAME + '" fill="url(#br)" fill-rule="evenodd"/>';
        s += '<path d="' + rr(2, 2, 356, 752, 50) + '" fill="none" stroke="rgba(255,255,255,0.28)" stroke-width="1.4"/>';
        s += '<path d="' + rr(23, 23, 314, 260, 15) + rr(23, 297, 314, 354, 15) + rr(49, 665, 262, 54, 13) + '" fill="none" stroke="rgba(0,0,0,0.5)" stroke-width="2" fill-rule="evenodd"/>';
        s += '<path d="' + rr(24, 24, 312, 258, 14) + rr(24, 298, 312, 352, 14) + rr(50, 666, 260, 52, 12) + '" fill="none" stroke="rgba(255,255,255,0.16)" stroke-width="1"/>';
        /* antenna breaks */
        [[58, 0], [296, 0], [58, 732], [296, 732]].forEach(function (p) {
          s += '<rect x="' + p[0] + '" y="' + p[1] + '" width="5" height="24" fill="#16171a"/>';
        });
        /* side button seams */
        s += '<rect x="354" y="150" width="6" height="76" rx="3" fill="rgba(0,0,0,0.45)"/><rect x="0" y="130" width="6" height="40" rx="3" fill="rgba(0,0,0,0.45)"/><rect x="0" y="186" width="6" height="40" rx="3" fill="rgba(0,0,0,0.45)"/>';
        /* screw bosses */
        [[12, 12], [348, 12], [12, 744], [348, 744], [180, 290], [30, 290], [330, 290], [30, 657], [330, 657]].forEach(function (p) {
          s += '<circle cx="' + p[0] + '" cy="' + p[1] + '" r="4.6" fill="#2d2f34"/><circle cx="' + p[0] + '" cy="' + p[1] + '" r="3.2" fill="#8b8e96"/><path d="M' + (p[0] - 2.2) + "," + p[1] + "H" + (p[0] + 2.2) + 'M' + p[0] + "," + (p[1] - 2.2) + "V" + (p[1] + 2.2) + '" stroke="#2d2f34" stroke-width="1"/>';
        });
        s += '<path d="' + D_FRAME + '" fill="url(#sh2)" fill-rule="evenodd" style="opacity:var(--sh)"/>';
        s += "</svg>";
        return '<div class="f">' + s + "</div>" + sliceSVG(D_FRAME, 7, "#9a9da5", "#3f4147", true);
      }

      /* ---------- layer 3: logic board ---------- */
      const BP = [[30, 30], [198, 30], [198, 182], [330, 182], [330, 274], [30, 274]];
      const D_BOARD = rpoly(BP, 9) + rr(56, 670, 248, 44, 10);
      function buildBoard() {
        const solid = [[44, 42, 100, 100], [40, 192, 76, 60], [174, 192, 66, 40], [264, 230, 56, 32]];
        const chips = [
          { x: 152, y: 42, w: 36, h: 56, l: "LPDDR6", s: "12GB", v: 1 },
          { x: 152, y: 106, w: 36, h: 60, l: "NAND", s: "512GB", v: 1 },
          { x: 44, y: 150, w: 46, h: 24, l: "PMIC", s: "AX7" },
          { x: 96, y: 150, w: 40, h: 24, l: "AUDIO", s: "CODEC" },
          { x: 122, y: 192, w: 46, h: 34, l: "RFIC", s: "T4" },
          { x: 122, y: 232, w: 60, h: 30, l: "WI-FI 7", s: "BT 6" },
          { x: 188, y: 238, w: 36, h: 24, l: "UWB", s: "" },
          { x: 230, y: 236, w: 28, h: 26, l: "NFC", s: "" },
          { x: 246, y: 192, w: 34, h: 28, l: "FEM", s: "B1" },
          { x: 286, y: 192, w: 34, h: 28, l: "FEM", s: "B2" },
          { x: 66, y: 676, w: 40, h: 22, l: "CHRG", s: "PD3" },
        ];
        const all = solid.map(function (a) { return { x: a[0], y: a[1], w: a[2], h: a[3] }; }).concat(chips);
        let s = SVGO + "<defs>" +
          '<linearGradient id="pcb" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#14402f"/><stop offset="0.55" stop-color="#0c2a1f"/><stop offset="1" stop-color="#091b14"/></linearGradient>' +
          '<linearGradient id="pk" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#26272c"/><stop offset="1" stop-color="#0f1013"/></linearGradient>' +
          '<radialGradient id="pcs" cx="0.3" cy="0.2" r="0.9"><stop offset="0" stop-color="#fff" stop-opacity="0.10"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></radialGradient>' +
          '<clipPath id="bcl"><path d="' + D_BOARD + '"/></clipPath>' + shadeDefs("sh3") + "</defs>";
        s += '<path d="' + D_BOARD + '" fill="url(#pcb)"/><path d="' + D_BOARD + '" fill="url(#pcs)"/>';
        s += '<path d="' + D_BOARD + '" fill="none" stroke="' + GOLD + '" stroke-opacity="0.55" stroke-width="1.2"/>';
        s += '<path d="' + rpoly([[35, 35], [193, 35], [193, 187], [325, 187], [325, 269], [35, 269]], 6) + '" fill="none" stroke="rgba(255,255,255,0.07)" stroke-width="0.8" stroke-dasharray="3 2"/>';

        /* buses and traces */
        let tr = "", vias = "";
        const O = [[0, -1], [1, 0], [0, 1], [-1, 0]];
        all.forEach(function (c) {
          if (c.y > 600) return;
          for (let dir = 0; dir < 4; dir++) {
            if (R() < 0.18) continue;
            const o = O[dir], t = [-o[1], o[0]];
            const len = dir % 2 === 0 ? c.w : c.h;
            const n = Math.max(3, Math.min(9, Math.floor((len - 8) / 2.6)));
            const g = 2.5, turn = R() < 0.5 ? 1 : -1;
            const off = rnd(0, Math.max(0, len - 8 - (n - 1) * g));
            let bx, by;
            if (dir === 0) { bx = c.x + 4 + off; by = c.y; }
            else if (dir === 1) { bx = c.x + c.w; by = c.y + 4 + off; }
            else if (dir === 2) { bx = c.x + c.w - 4 - off; by = c.y + c.h; }
            else { bx = c.x; by = c.y + c.h - 4 - off; }
            const L1 = rnd(3, 14), L2 = rnd(8, 30);
            for (let k = 0; k < n; k++) {
              const sx = bx + t[0] * k * g, sy = by + t[1] * k * g;
              const l1 = L1 + (turn > 0 ? n - 1 - k : k) * g;
              const p1 = [sx + o[0] * l1, sy + o[1] * l1];
              const p2 = [p1[0] + t[0] * turn * L2, p1[1] + t[1] * turn * L2];
              const p3 = [p2[0] + o[0] * 9, p2[1] + o[1] * 9];
              tr += "M" + r1(sx) + "," + r1(sy) + "L" + r1(p1[0]) + "," + r1(p1[1]) + "L" + r1(p2[0]) + "," + r1(p2[1]) + "L" + r1(p3[0]) + "," + r1(p3[1]);
              if (k % 2 === 0) vias += '<circle cx="' + r1(p3[0]) + '" cy="' + r1(p3[1]) + '" r="1.5"/>';
            }
          }
        });
        s += '<g clip-path="url(#bcl)"><path d="' + tr + '" fill="none" stroke="' + GOLD + '" stroke-opacity="0.62" stroke-width="0.9" stroke-linejoin="round"/>';
        s += '<g fill="' + GOLD2 + '" fill-opacity="0.85">' + vias + "</g>";
        /* long routed traces */
        let lt = "";
        for (let i = 0; i < 26; i++) {
          let x = rnd(34, 326), y = rnd(34, 270);
          lt += "M" + r1(x) + "," + r1(y);
          for (let k = 0; k < 3; k++) {
            if (k % 2 === 0) x += rnd(-40, 40); else y += rnd(-30, 30);
            lt += "L" + r1(x) + "," + r1(y);
          }
        }
        s += '<path d="' + lt + '" fill="none" stroke="' + GOLD + '" stroke-opacity="0.32" stroke-width="0.8"/></g>';

        /* passives */
        let ps = "";
        let placed = 0, guard = 0;
        while (placed < 110 && guard < 900) {
          guard++;
          const x = rnd(34, 326), y = rnd(34, 270);
          const inMain = (x < 196 && y < 180) || y > 184;
          if (!inMain) continue;
          if (x > 200 && y < 184) continue;
          let hit = false;
          for (let i = 0; i < all.length; i++) {
            const c = all[i];
            if (c.y < 600 && x > c.x - 5 && x < c.x + c.w + 5 && y > c.y - 5 && y < c.y + c.h + 5) { hit = true; break; }
          }
          if (hit) continue;
          const hor = R() < 0.5, w = hor ? 5 : 2.8, h = hor ? 2.8 : 5;
          ps += '<rect x="' + r1(x) + '" y="' + r1(y) + '" width="' + w + '" height="' + h + '" rx="0.5"/>';
          placed++;
        }
        s += '<g fill="#a98d4b" stroke="#151515" stroke-width="0.5">' + ps + "</g>";

        /* flat chips */
        chips.forEach(function (c) {
          s += '<rect x="' + (c.x + 1.5) + '" y="' + (c.y + 2.5) + '" width="' + c.w + '" height="' + c.h + '" rx="2" fill="rgba(0,0,0,0.5)"/>';
          s += '<rect x="' + c.x + '" y="' + c.y + '" width="' + c.w + '" height="' + c.h + '" rx="2" fill="url(#pk)" stroke="rgba(255,255,255,0.15)" stroke-width="0.8"/>';
          const cx = c.x + c.w / 2, cy = c.y + c.h / 2;
          const tf = c.v ? ' transform="rotate(-90 ' + cx + " " + cy + ')"' : "";
          s += '<g' + tf + '><text x="' + cx + '" y="' + (cy - (c.s ? 0.5 : -2)) + '" text-anchor="middle" font-size="6.6" font-weight="700" letter-spacing="0.5" fill="#c4c8d0">' + c.l + "</text>";
          if (c.s) s += '<text x="' + cx + '" y="' + (cy + 7) + '" text-anchor="middle" font-size="5.2" font-weight="500" letter-spacing="0.4" fill="#7b808a">' + c.s + "</text>";
          s += '</g><circle cx="' + (c.x + 3.5) + '" cy="' + (c.y + 3.5) + '" r="1" fill="#8d9199"/>';
        });

        /* display connector (flat) */
        s += '<rect x="46" y="257" width="70" height="13" rx="2" fill="#17181b" stroke="rgba(255,255,255,0.12)" stroke-width="0.6"/>';
        for (let i = 0; i < 20; i++) s += '<rect x="' + (49 + i * 3.4) + '" y="260" width="1.8" height="7" fill="' + GOLD2 + '"/>';

        /* screws */
        [[36, 36], [192, 174], [324, 268], [36, 268], [324, 188]].forEach(function (p) {
          s += '<circle cx="' + p[0] + '" cy="' + p[1] + '" r="5" fill="#0a0b0c" stroke="' + GOLD + '" stroke-width="1.6"/><path d="M' + (p[0] - 2.4) + "," + p[1] + "H" + (p[0] + 2.4) + '" stroke="#5b5d63" stroke-width="1"/>';
        });

        /* bottom module */
        s += '<rect x="148" y="679" width="64" height="26" rx="8" fill="#9ea2aa" stroke="#4f535a" stroke-width="1"/><rect x="152" y="683" width="56" height="18" rx="6" fill="#0a0b0d"/><rect x="158" y="690" width="44" height="3" rx="1.5" fill="#2b2d33"/>';
        for (let i = 0; i < 12; i++) s += '<rect x="' + (158 + i * 3.6) + '" y="686" width="1.5" height="2.6" fill="' + GOLD2 + '"/>';
        for (let i = 0; i < 12; i++) s += '<rect x="' + (158 + i * 3.6) + '" y="696" width="1.5" height="2.6" fill="' + GOLD2 + '"/>';
        for (let i = 0; i < 6; i++) { s += '<circle cx="' + (232 + i * 7) + '" cy="692" r="2" fill="#050607" stroke="' + GOLD + '" stroke-width="0.8"/>'; }
        s += '<rect x="112" y="680" width="26" height="14" rx="2" fill="url(#pk)" stroke="rgba(255,255,255,0.12)" stroke-width="0.6"/><text x="125" y="689.5" text-anchor="middle" font-size="5" font-weight="700" fill="#aeb2ba">USB-C</text>';
        s += '<path d="' + D_BOARD + '" fill="url(#sh3)" style="opacity:var(--sh)"/></svg>';

        const A = '<div class="f">' + s + "</div>";

        /* raised blocks */
        const lidSoC =
          '<svg width="86" height="86" viewBox="0 0 86 86" xmlns="http://www.w3.org/2000/svg" font-family="Inter, sans-serif">' +
          '<defs><linearGradient id="lid" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#a7abb2"/><stop offset="0.5" stop-color="#7f838b"/><stop offset="1" stop-color="#9a9ea6"/></linearGradient><pattern id="lb" width="3" height="3" patternUnits="userSpaceOnUse" patternTransform="rotate(20)"><rect width="3" height="0.8" fill="rgba(255,255,255,0.10)"/></pattern></defs>' +
          '<rect width="86" height="86" fill="url(#lid)"/><rect width="86" height="86" fill="url(#lb)"/>' +
          '<rect x="0.6" y="0.6" width="84.8" height="84.8" fill="none" stroke="rgba(255,255,255,0.4)" stroke-width="1.2"/>' +
          '<text x="9" y="17" font-size="7" font-weight="700" letter-spacing="1.6" fill="#4a4e55">ARDEN</text>' +
          '<text x="43" y="54.6" text-anchor="middle" font-size="36" font-weight="700" letter-spacing="-1.2" fill="#d5d8dd">A1</text>' +
          '<text x="43" y="53.4" text-anchor="middle" font-size="36" font-weight="700" letter-spacing="-1.2" fill="#3f434a">A1</text>' +
          '<text x="43" y="75" text-anchor="middle" font-size="6.2" font-weight="600" letter-spacing="1.2" fill="#4a4e55">3NM · 8-CORE</text>' +
          '<circle cx="76" cy="10" r="2.2" fill="#4a4e55"/></svg>';
        let pk = '<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="#1a1d20"/><rect x="1" y="1" width="98" height="98" fill="none" stroke="#2f343a" stroke-width="1"/>';
        for (let i = 0; i < 18; i++) {
          pk += '<circle cx="' + (6 + i * 5.2) + '" cy="3.2" r="1" fill="' + GOLD + '"/><circle cx="' + (6 + i * 5.2) + '" cy="96.8" r="1" fill="' + GOLD + '"/><circle cx="3.2" cy="' + (6 + i * 5.2) + '" r="1" fill="' + GOLD + '"/><circle cx="96.8" cy="' + (6 + i * 5.2) + '" r="1" fill="' + GOLD + '"/>';
        }
        pk += "</svg>";
        const modem =
          '<svg width="76" height="60" viewBox="0 0 76 60" xmlns="http://www.w3.org/2000/svg" font-family="Inter, sans-serif"><defs><linearGradient id="mg" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#2a2c32"/><stop offset="1" stop-color="#101114"/></linearGradient></defs><rect width="76" height="60" fill="url(#mg)"/><rect x="0.5" y="0.5" width="75" height="59" fill="none" stroke="rgba(255,255,255,0.16)"/>' +
          '<text x="7" y="14" font-size="5.6" font-weight="700" letter-spacing="1.2" fill="#8b909a">ARDEN M2</text><text x="38" y="35" text-anchor="middle" font-size="11" font-weight="700" letter-spacing="0.4" fill="#cdd1d8">5G MODEM</text>' +
          '<text x="38" y="46" text-anchor="middle" font-size="5.4" font-weight="500" letter-spacing="0.8" fill="#7b808a">mmWave · SUB-6</text><circle cx="68" cy="8" r="1.6" fill="#8d9199"/></svg>';
        let shield =
          '<svg width="66" height="40" viewBox="0 0 66 40" xmlns="http://www.w3.org/2000/svg" font-family="Inter, sans-serif"><defs><linearGradient id="sg" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#c3c6cc"/><stop offset="0.5" stop-color="#8d9199"/><stop offset="1" stop-color="#b0b3ba"/></linearGradient></defs><rect width="66" height="40" fill="url(#sg)"/><rect x="0.6" y="0.6" width="64.8" height="38.8" fill="none" stroke="rgba(255,255,255,0.5)" stroke-width="1"/>';
        for (let a = 0; a < 3; a++) for (let b = 0; b < 6; b++) shield += '<circle cx="' + (8 + b * 10) + '" cy="' + (8 + a * 12) + '" r="1.7" fill="#6e727a"/><circle cx="' + (8 + b * 10 - 0.5) + '" cy="' + (8 + a * 12 - 0.5) + '" r="0.8" fill="#d6d8dd"/>';
        shield += '<text x="33" y="22.6" text-anchor="middle" font-size="5.6" font-weight="700" letter-spacing="1.6" fill="#555a62">ARDEN</text></svg>';
        let j2 = '<svg width="56" height="32" viewBox="0 0 56 32" xmlns="http://www.w3.org/2000/svg"><rect width="56" height="32" fill="#17181b"/><rect x="0.5" y="0.5" width="55" height="31" fill="none" stroke="rgba(255,255,255,0.16)"/>';
        for (let i = 0; i < 12; i++) j2 += '<rect x="' + (4 + i * 4.2) + '" y="5" width="2.2" height="6" fill="' + GOLD2 + '"/><rect x="' + (4 + i * 4.2) + '" y="21" width="2.2" height="6" fill="' + GOLD2 + '"/>';
        j2 += '<rect x="3" y="14" width="50" height="4" fill="#0b0b0d"/></svg>';

        let B = "";
        B += block(44, 42, 100, 100, 5, 0, 2, "#12151a", pk);
        B += block(51, 49, 86, 86, 4, 2, 5, "#6f737b", lidSoC);
        B += block(40, 192, 76, 60, 3, 0, 2, "#15161a", modem);
        B += block(174, 192, 66, 40, 3, 0, 3, "#80848c", shield);
        B += block(264, 230, 56, 32, 2, 0, 3, "#0f1012", j2);
        return A + B + sliceSVG(D_BOARD, 2, "#8a7436", "#0b1a14", false);
      }

      /* ---------- layer 4: battery ---------- */
      const D_BAT = rr(30, 302, 300, 344, 16);
      function buildBattery() {
        let s = SVGO + "<defs>" +
          '<linearGradient id="bg1" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#dfe2e7"/><stop offset="0.55" stop-color="#bfc4cc"/><stop offset="1" stop-color="#a6abb4"/></linearGradient>' +
          '<linearGradient id="tb" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#f7c26a"/><stop offset="1" stop-color="#d58f2c"/></linearGradient>' + shadeDefs("sh4") + "</defs>";
        /* pull tabs */
        s += '<path d="' + rr(76, 630, 28, 70, 9) + '" fill="url(#tb)" stroke="#a96f1c" stroke-width="1"/><path d="' + rr(256, 630, 28, 70, 9) + '" fill="url(#tb)" stroke="#a96f1c" stroke-width="1"/>';
        s += '<text x="90" y="690" text-anchor="middle" font-size="6" font-weight="700" letter-spacing="1" fill="#6b430c" transform="rotate(-90 90 674)">PULL</text><text x="270" y="690" text-anchor="middle" font-size="6" font-weight="700" letter-spacing="1" fill="#6b430c" transform="rotate(-90 270 674)">PULL</text>';
        /* flex connector */
        s += '<rect x="150" y="286" width="60" height="18" rx="3" fill="#17181b" stroke="' + GOLD + '" stroke-width="1"/>';
        for (let i = 0; i < 9; i++) s += '<rect x="' + (155 + i * 5.6) + '" y="290" width="2.4" height="9" fill="' + GOLD2 + '"/>';
        /* body */
        s += '<path d="' + D_BAT + '" fill="url(#bg1)" stroke="#7d828b" stroke-width="1.4"/>';
        s += '<path d="' + rr(36, 308, 288, 332, 12) + '" fill="none" stroke="rgba(255,255,255,0.55)" stroke-width="1"/>';
        s += '<text x="50" y="340" font-size="15" font-weight="800" letter-spacing="3" fill="#1b1f26">ARDEN ONE</text>';
        s += '<text x="310" y="340" text-anchor="end" font-size="10.5" font-weight="700" letter-spacing="1.2" fill="#4a4f58">A1-3890</text>';
        s += '<text x="48" y="396" font-size="42" font-weight="700" letter-spacing="-1.2" fill="#12151a">3,890 mAh</text>';
        s += '<text x="50" y="422" font-size="13" font-weight="500" letter-spacing="0.2" fill="#363b43">Li-ion polymer · 3.87 V · 15.0 Wh</text>';
        s += '<rect x="48" y="440" width="264" height="1.2" fill="rgba(0,0,0,0.28)"/>';
        s += '<path d="M62 478 76 452 90 478Z" fill="none" stroke="#1b1f26" stroke-width="2.4" stroke-linejoin="round"/><rect x="75" y="462" width="2" height="8" fill="#1b1f26"/><rect x="75" y="472" width="2" height="2.4" fill="#1b1f26"/>';
        s += '<text x="102" y="462" font-size="10.5" font-weight="600" fill="#1b1f26">Do not puncture, crush or heat above 60 °C</text>';
        s += '<text x="102" y="478" font-size="10.5" font-weight="500" fill="#3f444c">Charge 0 – 45 °C · max 4.45 V · replace only with Arden parts</text>';
        s += '<rect x="48" y="496" width="264" height="1.2" fill="rgba(0,0,0,0.28)"/>';
        /* barcode */
        let bx = 50;
        while (bx < 214) {
          const w = R() < 0.5 ? 1.6 : 3.2;
          s += '<rect x="' + r1(bx) + '" y="520" width="' + w + '" height="52" fill="#14171c"/>';
          bx += w + (R() < 0.5 ? 1.6 : 3.2);
        }
        s += '<text x="50" y="590" font-size="10" font-weight="500" fill="#2c3037" font-family="JetBrains Mono, ui-monospace, monospace">SN F4K9-2Q7L-0031 · LOT 24W47-B3</text>';
        /* qr-like */
        s += '<rect x="240" y="516" width="68" height="68" fill="#e9ebef"/>';
        for (let a = 0; a < 11; a++) for (let b = 0; b < 11; b++) {
          const corner = (a < 3 && b < 3) || (a < 3 && b > 7) || (a > 7 && b < 3);
          if (corner ? !((a % 2 === 1 && b % 2 === 1) && false) : R() < 0.48) s += '<rect x="' + (243 + b * 5.8) + '" y="' + (519 + a * 5.8) + '" width="5.8" height="5.8" fill="#14171c"/>';
        }
        s += '<text x="50" y="622" font-size="9" font-weight="600" letter-spacing="1" fill="#4a4f58">MADE IN VIETNAM</text><text x="310" y="622" text-anchor="end" font-size="9" font-weight="600" letter-spacing="1" fill="#4a4f58">UN 38.3 · IEC 62133</text>';
        s += '<path d="' + D_BAT + '" fill="url(#sh4)" style="opacity:var(--sh)"/></svg>';
        return '<div class="f">' + s + "</div>" + sliceSVG(D_BAT, 4, "#8b9099", "#555a63", false);
      }

      /* ---------- layer 5: wireless coil ---------- */
      const D_FER = rr(14, 290, 332, 376, 30);
      function buildCoil() {
        let sp = "";
        const cx = 180, cy = 478, turns = 12, steps = Math.round(turns * 2 * Math.PI / 0.12);
        for (let i = 0; i <= steps; i++) {
          const th = i * 0.12, r = 34 + (96 * th) / (turns * 2 * Math.PI);
          sp += (i ? "L" : "M") + r1(cx + r * Math.cos(th)) + "," + r1(cy + r * Math.sin(th) * 0.99);
        }
        let s = SVGO + "<defs>" +
          '<linearGradient id="cu" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#f0a460"/><stop offset="0.5" stop-color="#c86f32"/><stop offset="1" stop-color="#e08a46"/></linearGradient>' +
          '<linearGradient id="fe" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#34302b"/><stop offset="1" stop-color="#1c1a17"/></linearGradient>' + shadeDefs("sh5") + "</defs>";
        s += '<path d="' + D_FER + '" fill="url(#fe)" stroke="#4a443c" stroke-width="1.4"/>';
        s += '<path d="' + rr(22, 298, 316, 360, 24) + '" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/>';
        s += '<path d="' + sp + '" fill="none" stroke="rgba(0,0,0,0.55)" stroke-width="6.4" stroke-linejoin="round" transform="translate(1.2 1.8)"/>';
        s += '<path d="' + sp + '" fill="none" stroke="url(#cu)" stroke-width="5" stroke-linejoin="round"/>';
        s += '<path d="' + sp + '" fill="none" stroke="rgba(255,235,200,0.28)" stroke-width="1.1" stroke-linejoin="round" transform="translate(-0.8 -1)"/>';
        s += '<circle cx="' + cx + '" cy="' + cy + '" r="26" fill="#14130f" stroke="#3a352d" stroke-width="1.2"/>';
        s += '<path d="M214 478H238V318" fill="none" stroke="url(#cu)" stroke-width="3.2" stroke-linejoin="round"/><path d="M' + (cx + 130) + ' 470 L318 470 V318" fill="none" stroke="url(#cu)" stroke-width="3.2" stroke-linejoin="round"/>';
        s += '<rect x="226" y="304" width="104" height="18" rx="3" fill="#17181b" stroke="' + GOLD + '" stroke-width="1"/>';
        for (let i = 0; i < 6; i++) s += '<rect x="' + (232 + i * 16) + '" y="308" width="9" height="10" fill="' + GOLD2 + '"/>';
        s += '<rect x="34" y="620" width="68" height="24" rx="4" fill="#0f0f10" stroke="rgba(255,255,255,0.1)"/><text x="68" y="636" text-anchor="middle" font-size="9" font-weight="700" letter-spacing="1.4" fill="#8b909a">Qi2 · 25 W</text>';
        s += '<path d="' + D_FER + '" fill="url(#sh5)" style="opacity:var(--sh)"/></svg>';
        return '<div class="f">' + s + "</div>" + sliceSVG(D_FER, 1, "#2a2723", "#2a2723", false);
      }

      /* ---------- layer 6: back glass with camera plateau ---------- */
      function lens(cx, cy, r) {
        const d = r * 2;
        const art =
          '<svg width="' + d + '" height="' + d + '" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><defs>' +
          '<radialGradient id="lo" cx="0.35" cy="0.3" r="0.9"><stop offset="0" stop-color="#b8bcc4"/><stop offset="1" stop-color="#4b4f57"/></radialGradient>' +
          '<radialGradient id="lg" cx="0.35" cy="0.3" r="0.8"><stop offset="0" stop-color="#31446b"/><stop offset="0.6" stop-color="#0d1119"/><stop offset="1" stop-color="#05070b"/></radialGradient></defs>' +
          '<circle cx="24" cy="24" r="24" fill="url(#lo)"/><circle cx="24" cy="24" r="19.5" fill="#08090b"/><circle cx="24" cy="24" r="16" fill="#1a1c21"/><circle cx="24" cy="24" r="13" fill="url(#lg)"/>' +
          '<circle cx="24" cy="24" r="7" fill="#04050a" stroke="rgba(120,150,255,0.35)" stroke-width="0.8"/><ellipse cx="18" cy="16.5" rx="5" ry="3" fill="rgba(255,255,255,0.28)" transform="rotate(-35 18 16.5)"/><circle cx="30" cy="31" r="1.6" fill="rgba(160,120,255,0.55)"/></svg>';
        let s = "";
        for (let z = 1; z <= 9; z += 2) {
          s += '<div class="bk" style="left:' + (cx - r) + "px;top:" + (cy - r) + "px;width:" + d + "px;height:" + d + "px;border-radius:50%;background:" + mix("#24262b", "#555961", z / 9) + ";transform:translateZ(" + z + 'px)"></div>';
        }
        s += '<div class="bk" style="left:' + (cx - r) + "px;top:" + (cy - r) + "px;width:" + d + "px;height:" + d + "px;border-radius:50%;transform:translateZ(11px)\">" + art + "</div>";
        return s;
      }
      function buildBack() {
        let s = SVGO + "<defs>" +
          '<linearGradient id="bk1" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#26282e"/><stop offset="1" stop-color="#121316"/></linearGradient>' + shadeDefs("sh6") + "</defs>";
        s += '<path d="' + rr(0, 0, 360, 756, 52) + '" fill="url(#bk1)"/><path d="' + rr(1, 1, 358, 754, 51) + '" fill="none" stroke="rgba(255,255,255,0.22)" stroke-width="1.4"/>';
        s += '<path d="' + rr(16, 16, 328, 724, 40) + '" fill="none" stroke="#2c2e35" stroke-width="5"/><path d="' + rr(22, 22, 316, 712, 34) + '" fill="none" stroke="rgba(255,255,255,0.06)" stroke-width="1" stroke-dasharray="4 3"/>';
        s += '<circle cx="180" cy="478" r="122" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1.2" stroke-dasharray="2 4"/>';
        s += '<path d="' + rr(194, 22, 144, 144, 36) + '" fill="#1c1e23" stroke="#454850" stroke-width="5"/><path d="' + rr(202, 30, 128, 128, 30) + '" fill="#14151a" stroke="rgba(255,255,255,0.08)" stroke-width="1.2"/>';
        s += '<circle cx="306" cy="40" r="7" fill="#e9e4d6" stroke="#8f8a7d" stroke-width="1.4"/><circle cx="306" cy="150" r="3" fill="#050506" stroke="#454850" stroke-width="1"/>';
        s += '<text x="180" y="704" text-anchor="middle" font-size="8.5" font-weight="600" letter-spacing="1.4" fill="#6a6d76">ARDEN ONE · MODEL A1 · ASSEMBLED IN VIETNAM</text>';
        s += '<path d="' + rr(0, 0, 360, 756, 52) + '" fill="url(#sh6)" style="opacity:var(--sh)"/></svg>';
        return '<div class="f">' + s + "</div>" + sliceSVG(rr(0, 0, 360, 756, 52), 3, "#3a3c44", "#15161a", false) +
          lens(234, 60, 24) + lens(234, 128, 24) + lens(298, 94, 24);
      }

      /* ---------- assemble ---------- */
      const BUILD = [buildGlass, buildDisplay, buildFrame, buildBoard, buildBattery, buildCoil, buildBack];
      let rigHTML = "";
      BUILD.forEach(function (fn, i) { rigHTML += '<div class="ly" id="L' + i + '" data-layout-ignore>' + fn() + "</div>"; });
      document.getElementById("rig").insertAdjacentHTML("beforeend", rigHTML);

      /* ---------- motion model ---------- */
      window.__timelines = window.__timelines || {};
      const tl = gsap.timeline({ paused: true });
      const DUR = 11.8;
      const PER = 2400;

      function mono(keys) {
        const n = keys.length, xs = keys.map((k) => k[0]), ys = keys.map((k) => k[1]);
        const d = [], m = [];
        for (let i = 0; i < n - 1; i++) d.push((ys[i + 1] - ys[i]) / (xs[i + 1] - xs[i]));
        m[0] = d[0]; m[n - 1] = d[n - 2];
        for (let i = 1; i < n - 1; i++) {
          if (d[i - 1] * d[i] <= 0) m[i] = 0;
          else {
            const w1 = 2 * (xs[i + 1] - xs[i]) + (xs[i] - xs[i - 1]), w2 = (xs[i + 1] - xs[i]) + 2 * (xs[i] - xs[i - 1]);
            m[i] = (w1 + w2) / (w1 / d[i - 1] + w2 / d[i]);
          }
        }
        return function (t) {
          if (t <= xs[0]) return ys[0];
          if (t >= xs[n - 1]) return ys[n - 1];
          let i = 0;
          while (xs[i + 1] < t) i++;
          const h = xs[i + 1] - xs[i], s = (t - xs[i]) / h;
          const s2 = s * s, s3 = s2 * s;
          return (2 * s3 - 3 * s2 + 1) * ys[i] + (s3 - 2 * s2 + s) * h * m[i] + (-2 * s3 + 3 * s2) * ys[i + 1] + (s3 - s2) * h * m[i + 1];
        };
      }
      const clamp = (v, a, b) => Math.min(b, Math.max(a, v));
      const ss = (a, b, t) => { const x = clamp((t - a) / (b - a), 0, 1); return x * x * (3 - 2 * x); };
      const expoOut = (p) => { p = clamp(p, 0, 1); return (1 - Math.pow(2, -10 * p)) / (1 - Math.pow(2, -10)); };
      const inOut3 = (p) => { p = clamp(p, 0, 1); return p < 0.5 ? 4 * p * p * p : 1 - Math.pow(-2 * p + 2, 3) / 2; };

      /* camera keys: tilt (deg from face-on), azimuth (deg), dolly, screen shift, pivot on the board */
      const F = {
        th: mono([[0, 46], [0.9, 46], [2.9, 72], [4.6, 70], [5.2, 50], [5.8, 46], [6.9, 42], [7.4, 54], [8.4, 48], [9.0, 36], [10.2, 16], [11.8, 15]]),
        ph: mono([[0, -36], [0.9, -34], [2.9, -38], [4.6, -62], [5.4, -24], [6.0, -10], [6.9, 5], [7.4, -14], [8.4, -26], [9.0, -24], [10.2, -8], [11.8, -8]]),
        tz: mono([[0, 0], [0.9, 0], [2.9, -230], [4.6, -120], [5.4, 1250], [5.9, 1400], [6.9, 1000], [7.25, 250], [7.65, -200], [8.2, -150], [9.0, -100], [10.2, 0], [11.8, 0]]),
        tx: mono([[0, 0], [1.0, 0], [2.9, -34], [3.7, -38], [4.6, -20], [5.4, 0], [7.2, 0], [8.2, 380], [8.9, 420], [11.8, 420]]),
        ty: mono([[0, 0], [2.9, -30], [4.6, -30], [5.4, 0], [6.9, 0], [7.25, -120], [7.7, -40], [8.4, 0], [11.8, 0]]),
        zf: mono([[4.6, 80], [6.9, 80], [7.25, -20], [8.1, -20]]),
        px: mono([[4.6, -87], [5.6, -87], [6.9, 20]]),
        py: mono([[4.6, -285], [5.6, -285], [6.9, -165]]),
      };
      /* layers, top to bottom: closed top-face z, open top-face z */
      const LZ = [[21, 420], [14, 300], [9, 180], [4, 80], [4, -20], [-6, -110], [-9, -210]];
      const OPEN_AT = [0.0, 0.1, 0.2, 0.32, 0.26, 0.14, 0.05];
      const CLOSE_AT = [8.09, 7.97, 7.87, 7.79, 7.71, 7.63, 7.55];
      const FADE_A = [4.35, 4.45, 4.55];
      const FADE_B = [7.3, 7.4, 7.5];
      const SHADE = [0, 0.16, 0.5, 0.5, 0.5, 0.5, 0.58];

      function state(t) {
        const lz = [], base = [];
        const ops = [1, 1, 1];
        for (let i = 0; i < 7; i++) {
          const s = clamp(expoOut((t - 1.0 - OPEN_AT[i]) / 1.7) - inOut3((t - CLOSE_AT[i]) / 1.05), 0, 1);
          const z = LZ[i][0] + (LZ[i][1] - LZ[i][0]) * s;
          base.push(z);
          let lift = 0, op = 1;
          if (i < 3) {
            const a = FADE_A[i], b = FADE_B[i];
            lift = 100 * ss(a, a + 0.7, t) * (1 - ss(b, b + 0.6, t));
            op = clamp(1 - (ss(a, a + 0.55, t) - ss(b, b + 0.5, t)), 0, 1);
            ops[i] = op;
          }
          lz.push({ z: z + lift, o: op, s: s });
        }
        const above = Math.min(ops[0], ops[1], ops[2]);
        for (let i = 0; i < 7; i++) {
          let sh = SHADE[i] * lz[i].s;
          if (i >= 3 && i <= 5) sh *= above;
          else if (i === 6) sh *= 0.5 + 0.5 * above;
          else if (i === 1) sh *= ops[0];
          else if (i === 2) sh *= Math.min(ops[0], ops[1]);
          lz[i].sh = sh;
        }
        const zt = base.reduce((a, b) => a + b, 0) / 7;
        const w = ss(4.6, 5.4, t) * (1 - ss(6.9, 7.3, t));
        const wz = ss(4.6, 5.4, t) * (1 - ss(7.5, 8.1, t));
        let tz = F.tz(t);
        const k = t - 9.06;
        if (k > 0) tz += 16 * Math.exp(-k * 6) * Math.sin(k * 20);
        return {
          th: F.th(t), ph: F.ph(t), tz: tz, tx: F.tx(t), ty: F.ty(t),
          px: F.px(t) * w, py: F.py(t) * w, zc: zt * (1 - wz) + F.zf(t) * wz, lz: lz,
        };
      }
      function project(c, x, y, z) {
        let X = x - 180 - c.px, Y = y - 378 - c.py, Z = z - c.zc;
        const a = (c.ph * Math.PI) / 180, b = (c.th * Math.PI) / 180;
        let x1 = X * Math.cos(a) - Y * Math.sin(a), y1 = X * Math.sin(a) + Y * Math.cos(a);
        let y2 = y1 * Math.cos(b) - Z * Math.sin(b), z2 = y1 * Math.sin(b) + Z * Math.cos(b);
        x1 += c.tx; y2 += c.ty; z2 += c.tz;
        const w = 1 - z2 / PER;
        return [960 + x1 / w, 540 + y2 / w];
      }

      const elRig = document.getElementById("rig");
      const elL = [];
      for (let i = 0; i < 7; i++) elL.push(document.getElementById("L" + i));
      const elShn = document.getElementById("shn"), elGln = document.getElementById("gln"), elGlow = document.getElementById("glow");
      const CO = [
        { li: 0, x: 330, y: 700, side: 1, dx: 190, dy: -80, a: 2.7, b: 4.1 },
        { li: 3, x: 93, y: 140, side: -1, dx: 190, dy: 90, a: 3.0, b: 4.15 },
        { li: 4, x: 322, y: 560, side: 1, dx: 215, dy: 90, a: 3.3, b: 4.15 },
      ];
      CO.forEach(function (c, i) {
        c.g = document.getElementById("cl" + i); c.pl = c.g.querySelector("polyline"); c.dots = c.g.querySelectorAll("circle"); c.el = document.getElementById("co" + i);
      });

      function render(t) {
        const c = state(t);
        elRig.style.transform = "translate3d(" + r1(c.tx) + "px," + r1(c.ty) + "px," + r1(c.tz) + "px) rotateX(" + c.th.toFixed(3) + "deg) rotateZ(" + c.ph.toFixed(3) + "deg) translate3d(" + r1(-c.px) + "px," + r1(-c.py) + "px," + r1(-c.zc) + "px)";
        for (let i = 0; i < 7; i++) {
          const L = c.lz[i], e = elL[i];
          e.style.transform = "translateZ(" + L.z.toFixed(2) + "px)";
          e.style.setProperty("--o", L.o.toFixed(3));
          e.style.setProperty("--sh", L.sh.toFixed(3));
        }
        /* glass sheen follows the azimuth; a single glint crosses the finished phone */
        elShn.style.backgroundPosition = clamp(48 + (c.ph + 36) * 0.55, 5, 95).toFixed(1) + "% 0";
        const gp = ss(9.0, 10.3, t);
        elGln.style.opacity = (Math.sin(Math.PI * gp) * 0.9).toFixed(3);
        elGln.style.backgroundPosition = (90 - gp * 85).toFixed(1) + "% 0";
        elGlow.style.transform = "translate(" + r1((c.ph + 36) * -3) + "px,0)";

        /* callouts */
        CO.forEach(function (o) {
          const p = project(c, o.x, o.y, c.lz[o.li].z);
          const a = ss(o.a, o.a + 0.55, t) * (1 - ss(o.b, o.b + 0.35, t));
          const dr = ss(o.a, o.a + 0.7, t);
          o.g.setAttribute("opacity", a.toFixed(3));
          const lx = p[0] + o.side * o.dx, ly = p[1] + o.dy;
          const ex = lx - o.side * 18;
          const kx = p[0] + o.side * 60;
          o.pl.setAttribute("points", r1(p[0]) + "," + r1(p[1]) + " " + r1(kx) + "," + r1(ly) + " " + r1(ex) + "," + r1(ly));
          o.pl.setAttribute("stroke-dashoffset", (1 - dr).toFixed(3));
          o.dots[0].setAttribute("cx", r1(p[0])); o.dots[0].setAttribute("cy", r1(p[1]));
          o.dots[1].setAttribute("cx", r1(p[0])); o.dots[1].setAttribute("cy", r1(p[1]));
          o.el.style.opacity = (ss(o.a + 0.25, o.a + 0.8, t) * (1 - ss(o.b, o.b + 0.35, t))).toFixed(3);
          o.el.style.left = r1(lx) + "px";
          o.el.style.top = r1(ly) + "px";
          o.el.style.transform = "translate(" + (o.side > 0 ? "0" : "-100%") + ",-50%) translateX(" + r1(o.side * (1 - ss(o.a + 0.25, o.a + 0.9, t)) * 18) + "px)";
          o.el.style.textAlign = o.side > 0 ? "left" : "right";
        });
      }
      tl.to({ v: 0 }, { v: 1, duration: DUR, ease: "none", onUpdate: () => render(tl.time()) }, 0);

      /* grain re-rolled every 3 frames */
      for (let f = 0; f < 354; f += 3) {
        tl.set("#grain", { backgroundPosition: ((f * 97) % 256) + "px " + ((f * 61 + 37 * (f % 5)) % 256) + "px" }, f / 30);
      }

      // black to picture
      tl.to("#fade", { opacity: 0, duration: 0.9, ease: "power1.out" }, 0);

      // lockup: after the phone has closed and settled
      tl.fromTo("#mark", { opacity: 0, y: 14 }, { opacity: 1, y: 0, duration: 0.8, ease: "expo.out" }, 8.4);
      tl.fromTo("#wm", { opacity: 0, y: 22 }, { opacity: 1, y: 0, duration: 0.9, ease: "expo.out" }, 8.5);
      tl.fromTo("#tg", { opacity: 0, y: 16 }, { opacity: 1, y: 0, duration: 0.8, ease: "expo.out" }, 8.75);

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