> ## Documentation Index
> Fetch the complete documentation index at: https://docs.khanhng.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Scene spec format (scenes.yaml)

> scenes.yaml defines the 3D UI planes, highlights, headlines and timing of a Demo Studio video, with times tied to narration words and music bars.

`scenes.yaml` describes everything on screen in a Demo Studio video. Every time in it is a **time expression** tied to a narration word or a music bar, so scenes follow the voice and the beat automatically when the timing changes.

## Time expressions

| Expression | Meaning |
| - | - |
| `12.5` | Seconds |
| `w:V4.evidence` | Start of the word "evidence" in sentence V4 (lowercase, punctuation removed, apostrophes dropped: `V3.im` for "I'm") |
| `we:V8.reason` | End of that word |
| `s:V4` / `se:V4` | Speech start / end of sentence V4 |
| `b:9` | Master bar 9 (bar 0 is the video start, a music downbeat) |
| `hit` / `end` | The music's final hit / the video end |
| Offsets | `+0.2` / `-0.1` seconds, `+1.5b` beats: `b:8+3.5b`, `w:V3.damaged-0.15` |

The word keys are listed in `timeline.json` under `K`, and `ds.py plan` prints them.

## Top-level keys

* `brand`: colour tokens (`coral`, `coral_dark`, `bg`, `surface`, `ink`, `muted`, `line`, `pink`, `shadow`, optional `font`).
* `logo: {file, width}` and `end_line`: the exact closing line, shown on the end card.
* `lane.steps`: 3 to 6 steps `{label, icon}`. Icons: `doc search ai person next check chart mail card calendar photo policy`.
* `timing`: named times for the hook (`sweep`, `snap`, `threadOut`), brand lane (`logoA`, `laneA`, `aiOn`, `humanOn`), closing lane (`laneB`, `laneOut`, `humanOn2`, `logoC`) and end card (`logoB`, `fade`).
* `cards`: hook cards on the thread.
* `types`: headlines. Mark the accent word with `*` (`"You *decide."`).
* `chips`, `moments`, `clicks`.
* `time_compressed`: `[[from, to, "why"]]` for any part that shows the product faster than real time.

## Scenes

```yaml scenes.yaml theme={null}
- t0: b:12            # plane swings in
  t1: b:14+1b         # plane leaves
  region: [520, 400, 1050, 735]          # crop of the capture, page CSS px
  states: [[b:12, as0], [w:V8.accepting, as_sel]]
  camera: [[t, dx, dy, dz, rotX, rotY, rotZ, scale], ...]
  lifts:
    - {box: as0.refund, tin: w:V5.ninety-four, z: 210, scale: 1.45, ring: true, back: true,
       moment: {id: refund_amount, label: Proposed refund CAD 94.92, spoken: V5.ninety-four}}
  cursor: {show: [t, t], move: [t, t], from: [x, y], to: as_files.submit, click: b:22}
  spin: {lift: {nc_s0: 1}}
```

Lift options: `tout` (drop back down), `snap` (show another state inside the lift), `from` (slide in), `ringT: [a, b]` (the ring follows the voice), `radius`. A `moment` on a lift, headline or chip adds it to the inventory the acceptance gate checks: `spoken: <word key>` when the voice says it, `shown: true` when it's only shown.

## House style

* **Camera:** a scene swings in over about 0.55 s, then settles at rotY ±6 to 20° and rotX 12 to 16° with a slow drift. Scale is 1.08 to 1.2 for full screens and 1.6 to 1.9 for close-ups.
* **Lifts:** higher z for more important items. The ring marks the one thing being talked about. Lift on the spoken word (−0.3/+0.5 s) or the nearest half-beat.
* **One idea per scene:** submit, processing montage, result, quality signals close-up, evidence, decision, outcome.
* **Headlines:** top-left at 76 px, repeating the key words of the narration. Numbers that aren't spoken go in the headline.
* **Beat sync:** the brand name on a hit, the submit click, the key number on a downbeat, and the end-card logo on the final hit. Everything else follows the voice.

## Safe zones

| Zone | Area |
| - | - |
| Caption band | y 875 to 1007 (2 lines). Keep lifted UI above y about 860 while a caption is on. |
| Headline zone | y 64 to 150, left side |
| Size | Highlighted UI renders at 1.0x its native size or larger |

The layout check measures these every 0.25 s on every `compile`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.