Original prompt
Write a complete, playable single-file HTML document implementing a 3D voxel terrain flyover using RAW WebGL 1.0 - NO libraries, NO three.js, NO framework (write your own shaders, matrices and buffers with the WebGL API directly). Create an 800x600 canvas with a WebGL context, write vertex + fragment shaders, implement your own perspective projection matrix and camera, and build a procedurally generated terrain grid (e.g. a 32x32 or 64x64 grid of blocks/columns whose heights come from a simple height function such as sine waves or value noise). Color the blocks by height (low = water/blue, mid = green, high = grey/white). Animate a camera that slowly flies over and orbits the terrain in a requestAnimationFrame loop. Add arrow/WASD camera controls. Use only primitive geometry (boxes drawn as 12 triangles each or single triangles) - no external models or textures.
Design note (interpret freely): this is a from-scratch-3D test - correct perspective math, depth handling, and a working render loop matter far more than prettiness. Prove you can build 3D graphics without any engine.
SUCCESS CRITERIA: the page must (1) obtain a real WebGL context and render procedurally generated 3D terrain with height-based coloring, (2) implement perspective projection and camera transforms by hand (no matrix library), (3) animate the camera in a requestAnimationFrame loop, (4) auto-start rendering without a user gesture so the headless renderer captures a non-blank 3D frame. OUTPUT FORMAT: Respond with the COMPLETE, self-contained HTML document in ONE single ```html code block. Do NOT split the code across multiple blocks, do NOT include a thinking summary inside the block, and do NOT place any prose, explanation, or comments between the opening and closing of the code block. The entire document (doctype through </html>) must be inside one fenced code block so it can be extracted and rendered verbatim. OUTPUT REQUIREMENT: Respond with ONLY the raw, runnable source code in a single fenced code block, with the first line starting at column 0 (no leading indentation). Do not include any thinking, explanation, summary, or prose before or after the code, and keep comments inside the code minimal.