# Build: first-person spaceship interior demo (Three.js), self-evaluating loop

You are building a small first-person demo where the player walks around the interior of a medium, Star Wars style spaceship in flight. Gameplay is intentionally tiny. The entire point of this project is how good it looks. You will work in an autonomous loop: build, screenshot, judge against the rubric, fix, repeat. Do not stop until the stopping condition fires.

## Stack and rules
- Vite + latest three from npm. Split code into modules: player.js, ship.js, space.js, interact.js, post.js, main.js.
- No downloaded models or textures. Everything procedural: canvas-generated albedo/roughness/normal maps, noise-based grime, kit-bashed geometry built from primitives. Sprites and billboards are fine for distant space objects.
- Target 60fps on a mid-range laptop GPU. If something tanks frames, optimize it, do not delete the look.
- Keep a PROGRESS.md log. Commit after every iteration.

## The demo (do not expand this scope)
- First person, pointer lock. WASD plus mouse look, eye height 1.7m, subtle head bob, capsule-vs-box collision so the player cannot walk through walls or furniture.
- Ship interior, used-future Star Wars feel: one main corridor connecting a cockpit with a large viewport, crew quarters with a bed, a small galley, a tiny bathroom. Worn metal, painted panels, pipes, conduits, floor grates, greebles. No large bare surfaces anywhere.
- Three interactions via raycast from screen center, with a hover highlight and a prompt like "E: Sleep":
  - Bed: fade to black, "8 hours pass", interior lighting shifts to a rest cycle and back.
  - Galley: "You eat. Energy restored."
  - Bathroom: fade to black, "Refreshed."
- A one-line HUD status readout is enough. No inventory, no enemies, no other systems.
- Windows: the cockpit viewport plus one or two corridor portholes. Outside: a parallax starfield that visibly drifts, at least one large planet with an atmosphere rim glow sliding past over roughly 60 to 90 seconds, occasional distant nebula billboards. Standing at a window must read as "flying through space" within 5 seconds.

## The look (this is the actual goal)
Stylized-realistic, the No Man's Sky / Starfield neighborhood. Clean, slightly cartoonish shapes are fine. Flat, lifeless rendering is not.
- Lighting: deliberate key/fill/accent per room. Warm practical lights inside, cool space light through the windows. Emissive strips and panels that genuinely glow.
- Post-processing: ACES tone mapping, bloom tuned so emissives glow without blowing out, ambient occlusion (N8AO or SSAO), subtle vignette and film grain, light fog down the corridor for depth.
- Materials: at least three distinct PBR families (worn metal, painted panel, fabric/rubber), visible roughness variation, and a PMREM environment so metals reflect something real.
- One cohesive palette, for example off-white hull, orange accents, teal practicals. Nothing default-gray, nothing random.

## Self-evaluation loop
[Reconstructed: the source screenshot of this prompt was cut off below the palette line; the loop and rubric it references at the top are restated here in the same spirit.]
Each iteration: `npm run build`, serve dist, take playwright screenshots from fixed vantage points (cockpit facing the viewport, corridor down its length, crew quarters, galley, standing at a porthole), then READ the screenshots and score 1-10 against:
1. **Lighting** — deliberate key/fill/accent, warm/cool contrast, emissives genuinely glowing (not flat)
2. **Materials** — visible wear and roughness variation, metals reflecting something real (not default-gray)
3. **Density** — pipes, conduits, grates, greebles everywhere; no large bare surfaces in any shot
4. **Space** — the window view reads as "flying through space" in one glance
5. **Composition** — each room reads as a place someone lives and works
Log the scores in PROGRESS.md every iteration and fix the lowest-scoring item first.

## Stopping condition
Ship when every rubric item scores 8+ on an honest read of FRESH screenshots AND the build is green AND it holds 60fps. Hard cap: 50 turns — if the cap fires first, ship the best green build with the final rubric scores logged in PROGRESS.md.
