What this is, and why it exists
A ground-up rebuild of the game's presentation layer under one thesis: the UI is not a website about a magical manuscript — the UI is the manuscript, and the app is the desk it rests on. The prior contrast pass on this branch had made thirty-four individually-correct fixes and played worse; the diagnosis (committed as docs/design/illuminated-codex-problem-book.md) traced the failure to the design system itself — a hairlines-only "Spine Console" manifesto that outlawed the material tools the codex fiction needs.
The replacement language was designed before it was coded: full-fidelity HTML mockups (committed under docs/design/atelier/), two competing art directions blind-judged by four panels, a synthesis spec (docs/design/illuminated-codex-language.md), a twelve-surface rebuild, and a five-persona playtest round whose twenty-three adjudicated fixes are all in. No store, server, or mechanics code changed; every test-id and aria contract survived. lint 0 errors · vitest 1430/1430 · typecheck clean · e2e 38/38.
Materials and inks — the token system
main.css opens with the manifesto's replacement and the material system: paper (three tones + rules), ink (five voices: reading ink, quiet, faint, rubrication, ceremonial gold), wax, and the desk. Dark mode is a re-lighting — lamplit vellum, ember rubric, near-black desk — expressed entirely through the same tokens. Legacy --ew-* names alias onto the new materials so the legal/settings/steward surfaces keep working untouched.
Materials, inks, and the aliases; then the candlelit dark block.
assets/css/main.css · 968 lines
⋯ 25 lines hidden (lines 1–25)
⋯ 1 line hidden (lines 104–104)
⋯ 828 lines hidden (lines 141–968)
The five dialects
Every component idiom in the game now descends from five voices: rubric caps (running heads, kickers, table titles), margin glosses (every secondary read — italic serif, mark-opened), inked actions (every interactive that is not the seal), engraved instruments (quantities as drawn scales with an index), and disclosed tables. The player's writing itself is .cx-writing: a real textarea whose chrome is ruled feints drawn on the paper, with a rubric caret.
Rubric caps, glosses, inked actions; then the ruled writing surface.
assets/css/main.css · 968 lines
⋯ 199 lines hidden (lines 1–199)
⋯ 79 lines hidden (lines 286–364)
⋯ 568 lines hidden (lines 401–968)
The marks — no glyph the OS rendered for us
Twenty-three drawn marks — manicule, paraph, hourglass, lens, quill, die, leaf-corner, bookmark, candle, daggers, fleuron, laurel, jewel and kin — one hand, one stroke weight, currentColor. Every emoji and dingbat on a game surface died in this PR; objective icons became engraved roundels drawn in the mission index.
The registry's head: the pointing hand, the paraph, the hourglass.
components/codex/CodexMark.vue · 191 lines
⋯ 21 lines hidden (lines 1–21)
⋯ 131 lines hidden (lines 61–191)
The shell — desk, leaf, ribbon, turnline
pages/play.vue renders the environment: the desk (radial pool of light, leather grain), the leaf (laid-paper texture, fibrous mottle, stacked under-pages, candle glow at night), the running head band with the app's utilities as quiet margin marks, the wax ribbon bookmark that carries the run's five pips and its timeline figure, and the turnline whose primary verb is now "Turn the leaf ›" beside the page's own curling corner. All conductor, soundscape, coaching, and overlay logic is untouched.
The folio's materials; the ribbon instrument.
pages/play.vue · 1231 lines
⋯ 733 lines hidden (lines 1–733)
⋯ 89 lines hidden (lines 787–875)
⋯ 299 lines hidden (lines 933–1231)
The dispatch — a letter with a scholarly margin
The compose screen is letter anatomy: an ordinal salute, the addressee in rubric with dagger footnote marks that tie to the wager and chain glosses in a true margin column, writing on ruled lines, and a letterfoot where a matte pressed-wax seal sits on its pressed ring. The address fold keeps its auto-collapse mechanics; the ink instrument in the margin drains as the player writes (character-counter still lives there for the tests). The stake, when offered, is an ember gloss whose arming lights the seal's staked ring.
The letterhead fold and the seal station.
components/codex/LeafDispatch.vue · 1100 lines
⋯ 5 lines hidden (lines 1–5)
⋯ 21 lines hidden (lines 61–81)
⋯ 1000 lines hidden (lines 101–1100)
History bends — the proclamation and the gauge
The climax leaf composes as one document: rubric kicker, drop-cap display headline, a rotated SEALED-AT stamp-mark, then the instruments. The swing gauge is the panel-endorsed steal from the competing 'bureau' direction, redrawn in page inks: loss and gain arcs with fine ticks, a rubric needle that sweeps from zero on a 900ms beat with an overshoot curve, a dotted trail, and the signed figure at display scale in valence ink. Beneath it, a hundred-mark ledger ruler carries the run's cumulative state, and the swing equation prints as a dagger footnote that reconciles (+18 · sharp ×1.2 → +22%) — or collapses to a plain statement when nothing scaled the turn.
The engraved dial: bands, ticks, needle, trail, and the valence figure.
components/codex/LeafRipple.vue · 953 lines
⋯ 27 lines hidden (lines 1–27)
⋯ 851 lines hidden (lines 103–953)
The dice of fate — instrument and rubric
The die is an engraved icosahedron (paper-tinted facets, ink strokes, serif numeral) that tumbles, hangs, and strikes; crits burst in radiating ink strokes rather than neon glow. Beneath it, the Table of Fates is a disclosed .cx-table whose struck band lights in its outcome ink with a marginal manicule — the gambler's rubric the diagnosis asked for. The verdict line self-reconciles the natural face with the craft tilt.
The fates table with its struck-band logic.
components/codex/LeafDice.vue · 270 lines
⋯ 25 lines hidden (lines 1–25)
⋯ 210 lines hidden (lines 61–270)
The record and the colophons
The record opens as an inserted quire — a second sheet with its own paper and shadow laid over the leaf, not a scrim ghost — carrying the Spine (an inked timeline with wax nodes in valence ink), the Chronicle, and the Thread. The end screens are the game's colophons: victory strikes the brand seal in gold-warmed wax between laurel marks over the epilogue and a printed table of the run's figures in serif numerals; defeat is the same page with dry wax, unlit, a step dimmer.
The quire's structure — Spine, Chronicle, Thread.
components/codex/RecordOverlay.vue · 338 lines
⋯ 283 lines hidden (lines 56–338)
What broke on the way, and what it taught
Three engineering finds worth keeping: the html.dark root-blend compile trap and the color-mix-in-shadow rasterizer poison (both now documented at their fixes in main.css), and a Vue transition subtlety — the page-turn's leave phase is timed by the leaf's entrance animation end event, so silencing that animation on leaving leaves stalls the turn forever. The e2e reveal-walk was instead hardened test-side: a settled-composer guard that treats any *-leave-active class as "the page is still turning".
The hardened walk: settle guard + an iteration budget sized to the turn.
tests/e2e/support/game.ts · 451 lines
⋯ 370 lines hidden (lines 1–370)
⋯ 46 lines hidden (lines 406–451)
Verification and artifacts
Full battery on the production build: lint 0 errors, vitest 1430/1430 (specs updated faithfully where presentation moved — each noted in agent reports), typecheck clean, e2e 38/38 with all routes mocked. Eighty-eight screenshots per round across five viewport/theme configs drove three critique rounds; the before/after comparison page linked from the PR pairs the original build against the shipped codex. The process artifacts — problem book, design language, atelier mockups — are committed under docs/design/ so future surfaces can be built to the same hand.