# KITCHEN — 3:07 AM

A single-file Three.js scene of a PS1-era survival-horror kitchen at night. Open `index.html` through any static server, e.g. `python3 -m http.server`, then visit `http://localhost:8000/`. Three.js loads from the unpkg CDN. All geometry, textures and sound are generated in code, and there are no asset files.

## Controls

| Input | Action |
|---|---|
| Click | Take control (locks the mouse pointer, starts audio) |
| W A S D / arrow keys | Walk |
| Mouse | Look (or drag with the left button if pointer lock isn't available) |
| Shift | Run |
| F | Flashlight on/off |
| E | Open/close the fridge or the pantry door you're facing |
| P | Toggle idle auto-play |
| 1 / 2 / 3 | Toggle vertex jitter / affine texture warping / dithering |
| M | Mute |
| H | Hide the HUD |
| Esc | Release the mouse |

## Idle auto-play

The page starts in auto-play. The camera walks a slow scripted loop through the room, stopping to look at the fridge, the window, the pantry door, the calendar and the dark hallway. If you take control and then stop touching the keyboard and mouse for 25 seconds, auto-play resumes from the nearest waypoint.

While an object is out of view, something about it may change. The pantry door can drift open, the clock can jump, the calendar can change, a chair can move, the knife can relocate, a face can appear behind the blinds, and a tall figure can get closer each time you look away. If you look straight at the figure for too long, the lights cut out.

## Rendering notes

- Renders to a 320×240 target, then upscales with nearest-neighbour filtering. The upscale pass applies a 4×4 Bayer dither and 5-bit-per-channel colour quantisation.
- Vertices snap to a coarse screen-space grid, which produces the polygon jitter.
- Texture coordinates are interpolated affinely (UV·w / w), so textures swim and warp.
- Most lighting is per-vertex (Gouraud): the flickering fluorescent tube, the fridge's interior light and the ambient light. The flashlight cone and the moonlight through the blinds are computed per pixel.
- Fog is per-vertex distance fog.
- The audio is synthesised with WebAudio and positioned in 3D: fridge hum, door creaks, the tube's buzz, the clock tick, the dripping tap and footsteps.

Debug URL parameters: `?t=SECONDS` fast-forwards the simulation, `?hud=0` hides the HUD, and `?cam=x,z,yawDeg,pitchDeg` places the camera at a fixed pose.
