DOOM runs inside a CSS file, but loading a level takes three months
CSS is not a programming language, and there is no reason to expect it to become one. Yet, Ahmed Amer has used a single stylesheet to build an entire IBM-compatible PC capable of booting MS-DOS, Windows 1.0, and even DOOM. The file, dubbed CSS-DOS, weighs 300 MB.
Inside that sheet, it is not a port of the game that has been inserted: there is a complete machine, simulated from scratch. An 8086 processor, 640 kB of RAM, a VGA controller, and one for the floppy, all described in style rules.
CSS now has functions and conditional instructions, but it does not execute programs in the current sense of the term, meaning sequences of instructions that feed into one another. Modifying the value of a variable requires gymnastics. And it is this static behavior, Amer notes, that fits the architecture of a hardware component better than it does that of software: it is the intuition upon which the entire work is based.
Two instructions per second
The slowness is part of a stylistic exercise that from one perspective is also an irony: the emulator does not even come close to real-time; it progresses at two instructions per second, measured at the CPU level and not in frames. At this pace, completing the boot of MS-DOS takes about three weeks, and loading a level of DOOM takes three months. The game, on paper, would run at 0.0001 frames per second.
Moreover, to speak of a "playable" DOOM is already an exaggeration: even if the stylesheet emulated an IBM AT at full speed, that hardware would still not support the game at a practicable pace. Playability, in this project, was never the point.
Amer accompanies the whole thing with a detailed account of how he created the emulator and with an interactive guide that allows exploring the CSS file in all its stratification. It is the kind of exercise that comes from a self-imposed constraint rather than a necessity: by unwritten convention, everything must one day be able to run DOOM. However, no one has ever demanded that it does so well.