Motion as code with an agent|INEMA.CLUB-PRO

Lesson 4 · 15 min

Brand system and motion philosophy: the DESIGN.md for your video

Without a written rule, every request to the agent brings a new color and a different motion, and the pieces don't look like they're from the same brand. DESIGN.md is the file the agent reads before composing: colors, fonts, how things move, and what's forbidden. In this lesson you write yours and fail any off-brand color with one command.

Start the lesson
Color swatch cards (black, gray, white, and a yellow) and a metal type gauge on a dark table.

In this lesson you will

  1. 1The four sections: Colors, Typography, Motion, and Forbidden
  2. 2Tokens: the color is born in DESIGN.md and becomes a CSS variable
  3. 3Motion philosophy written as a rule with a number
  4. 4The checker that catches the color the agent made up

Goal: write your video's DESIGN.md and prove the composition uses only its colors and rules.

01From DESIGN.md to the composition

Tap each section of the file.

Click each block in the diagram to see what it does.

Principles that hold for any brand: one idea at a time, light instead of lots of color, the main frame holds before it leaves.

02An example DESIGN.md and the composition that obeys it

The example uses INEMA's dark palette. Swap in your brand's colors, keeping the four sections.

File · kit/exemplos/a4-marca/DESIGN.md
# DESIGN.md — example video (Motion by code course, INEMA.CLUB)

One sentence: calm dark background, one idea at a time, light instead of color; yellow appears only as a detail.

## Cores
- fundo: #0c0c10
- superfície: #1c1c22
- linha: #3f3f47
- texto: #f4f4f5
- texto secundário: #a1a1aa
- destaque (só detalhe: um filete, um ponto, a cabeça de leitura): #e9b949

## Tipografia
- Títulos: sem serifa do sistema, peso 700, altura de linha 1,1, no máximo 6 palavras.
- Apoio: sem serifa do sistema, peso 400, 48 px em 1920x1080.
- Nenhuma palavra sozinha na última linha.

## Movimento
- Entrada de 0,5 a 0,8 s com power2.out ou power3.out; saída mais curta que a entrada, com power2.in.
- Uma coisa se move por vez; a próxima começa quando a anterior já assentou.
- Todo texto fica pelo menos 1,2 s parado e legível.
- Nada em velocidade constante (ease "none" só em barra de progresso).
- O quadro principal (título ou marca) segura pelo menos 1,5 s no fim.

## Proibido
- Cor que não está em "Cores", neon, brilho forte, gradiente colorido.
- Logo desenhado de memória: logo só do arquivo da marca.
- Math.random e Date.now na composição.
File · kit/exemplos/a4-marca/index.html
<!doctype html>
<html lang="pt-BR">
  <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>
      /* tokens copied from DESIGN.md: the composition only uses these colors */
      :root { --fundo: #0c0c10; --superficie: #1c1c22; --linha: #3f3f47; --texto: #f4f4f5; --texto2: #a1a1aa; --destaque: #e9b949; }
      * { margin: 0; padding: 0; box-sizing: border-box; }
      html, body { width: 1920px; height: 1080px; overflow: hidden; background: var(--fundo); }
      #root { width: 100%; height: 100%; position: relative; font-family: ui-sans-serif, system-ui, sans-serif; }
      #luz { position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 45%, var(--superficie) 0%, var(--fundo) 65%); }
      #bloco { position: absolute; left: 220px; top: 340px; }
      #rotulo { color: var(--texto2); font-size: 40px; letter-spacing: 0.2em; text-transform: uppercase; }
      #filete { width: 120px; height: 6px; margin: 28px 0 32px; background: var(--destaque); transform-origin: left center; }
      #titulo { color: var(--texto); font-size: 128px; font-weight: 700; line-height: 1.1; }
      #base { position: absolute; left: 220px; right: 220px; top: 900px; height: 2px; background: var(--linha); transform-origin: left center; }
    </style>
  </head>
  <body>
    <div id="root" data-composition-id="main" data-start="0" data-duration="5" data-width="1920" data-height="1080">
      <div id="luz"></div>
      <div id="bloco">
        <p id="rotulo">Capítulo 2</p>
        <div id="filete"></div>
        <h1 id="titulo">A luz decide o tom</h1>
      </div>
      <div id="base"></div>
    </div>
    <script>
      // regras do DESIGN.md: uma coisa por vez, entrada 0,5–0,8 s com power2/3.out, título segura até o fim
      const tl = gsap.timeline({ paused: true });
      tl.fromTo("#base", { scaleX: 0 }, { scaleX: 1, duration: 0.8, ease: "power2.out" }, 0.2);
      tl.fromTo("#rotulo", { y: 20, opacity: 0 }, { y: 0, opacity: 1, duration: 0.5, ease: "power2.out" }, 0.8);
      tl.fromTo("#filete", { scaleX: 0 }, { scaleX: 1, duration: 0.5, ease: "power3.out" }, 1.2);
      tl.fromTo("#titulo", { y: 40, opacity: 0 }, { y: 0, opacity: 1, duration: 0.8, ease: "power3.out" }, 1.6);
      window.__timelines["main"] = tl;
    </script>
  </body>
</html>

03Check the brand with one command

The conferir-design.py reads the four sections and looks in the composition for every hex color that is not in Cores.

Terminal · check DESIGN.md and the check
K=~/projetos/formacao-cinema-ia-motion-v72/kit
export HYPERFRAMES_NO_TELEMETRY=1 NO_COLOR=1
E=${TMPDIR:-/tmp}/ensaio-motion/a4; rm -rf "$E"; mkdir -p "$E"
cp -r "$K/exemplos/a4-marca" "$E/marca"; cd "$E/marca"
python3 "$K/conferir-design.py" DESIGN.md index.html; echo "saída: $?"
npx -y hyperframes@0.8.176 check 2>&1 | grep -E "Check passed|✗|WCAG"
Terminal · the error: the agent "improved" the highlight
K=~/projetos/formacao-cinema-ia-motion-v72/kit
cd ${TMPDIR:-/tmp}/ensaio-motion/a4/marca
sed -i 's/--destaque: #e9b949/--destaque: #ff3366/' index.html   # the agent "improved" the highlight
python3 "$K/conferir-design.py" DESIGN.md index.html; echo "saída: $?"
Example from the repository
OK: 4 seções · 6 cores · 5 regras de movimento · a composição usa só cores do DESIGN.md
saída: 0
  ◇ 7/7 text checks pass WCAG AA
◇  Check passed

The HyperFrames check verifies contrast (WCAG AA); the kit's checker verifies the brand. They are different gates.

04How the agent uses the file

Three habits that make DESIGN.md worth it.

1. Cite it in the R

The RISE request starts with "read the DESIGN.md in this folder" (lesson 3).

Without that, the agent only reads it if it remembers.

05Practice

The rehearsal, the error, and the DESIGN.md for your brand.

E1 · Brand checked

5 min

Run the "check DESIGN.md and the check" block.

Done when: OK: 4 seções · 6 cores · 5 regras de movimento · a composição usa só cores do DESIGN.md, saída: 0 and ◇ Check passed.

E2 · Color out of bounds

5 min

Run the error block.

Done when: FORA DA MARCA: #ff3366 (linha 9) and saída: 1.

E3 · The DESIGN.md for your brand

20 min

Copy the example into your project from lesson 2, swap the colors and rules for your brand's, and change the colors in the :root of index.html to the same ones.

Done when: python3 ~/projetos/formacao-cinema-ia-motion-v72/kit/conferir-design.py DESIGN.md index.html; echo "saída: $?" → starts with OK: 4 seções and saída: 0.

06Lesson quiz

The explanation appears after you answer.

Question 1 of 3

Which motion rule can the agent follow without guessing?

07In three sentences

Four sectionsColors, Typography, Motion, and Forbidden, with numbers and not adjectives.
TokensThe color is born in DESIGN.md and enters the composition as a CSS variable.
Brand gateconferir-design.py next to the check, before every render.

Going further

Previous lessonNext lesson