Kina.ai

Design · Space

Space

The default card layout is an equal-track CSS grid (.tiles). Masonry is opt-in for uneven collections — the examples index, not maps, catalogs, or featured rows.

Rhythm

Spacing steps

Use these tokens instead of raw rem. Steps 7 and 8 clamp with the viewport.

  1. --space-10.25remTight inset
  2. --space-20.5remChip / tile gap inside a card
  3. --space-30.75remCluster gap
  4. --space-41remTile padding and grid gap
  5. --space-51.5remSection padding
  6. --space-62.25remStack gap
  7. --space-7clamp(2.5rem, 5vw, 4.5rem)Page / band start
  8. --space-8clamp(3.25rem, 8vw, 6.5rem)Page end / hero

Frame

Page, gutter, measure

.frame centers the column. Interior pages add .page for block padding. Body copy stays inside --measure. Page shells and recipes are on the Structure page.

Viewport inset

--gutter

clamp(1.25rem, 4vw, 2.25rem)

Centered column

--frame

min(68rem, 100% − 2×gutter)

Reading width

--measure

66ch

Measure · 66ch

Kina is a research language for typed tensor programs. The bootstrap compiler is written in OCaml and lowers typed programs to textual MLIR. This column is the reading width, not the frame.

Default

Tile grid

.tiles is the default. Columns are equal. Cards in a row share height. Use it for maps, catalogs, and featured examples.

Status

What the compiler actually does today.

Learn

Companions beside the spec. They are tutorials, not the language contract.

Specification

Phase 0 calculus and later-phase contracts.

Examples

Accepted .kina files with MLIR goldens. Variable-height previews belong on masonry, not here.

Opt-in

Masonry

.masonry packs uneven cards so short ones do not stretch to match a tall neighbor. It is for the examples index, where source previews vary. Do not use it as the site-wide card layout. These snippets are illustrative; they are not live source metadata.

Tensor literal

[[1.0, 2.0],
 [3.0, 4.0]]

Decoder sketch

let x = token_embedding.gather(token_ids) in
let q = x @ wq.broadcast([1, 4, 4]) in
q

MLP expression

relu(x @ w1) @ w2

Attention sketch

let q = x @ wq in
let k = x @ wk in
let v = x @ wv in
let attn = softmax(q @ k.T) @ v in
attn @ wo

Radius

Box and pill

Box

--radius-box

0.9rem. Tiles, fences, panels, and figures.

Pill

--radius-pill

999px. Actions, chips, and the skip link.