Build this interactive 3D experience as a single self-contained index.html that works offline. Keep the HTML, CSS, JavaScript, procedural geometry, textures, and shaders inline, with no external dependencies or downloaded assets. Use browser-native WebGL with a graceful fallback if unavailable. Support desktop and mobile, keyboard-accessible controls, pause/resume, and reduced motion. Keep animation smooth and rendering performance bounded.
Construct an original cinematic impossible observatory inspired by historical fantastical prison etchings and precise astronomical instruments, without copying any source image. Build a cavernous architectural volume from marble, aged brass, carved stone, and deep shadow, populated with recursive staircases, elevated bridges, suspended orreries, giant interlocking gears, archways, and portal-like apertures. Make the world mechanically reconfigure in a continuous staged sequence: stairs fold and rotate, bridges extend, concentric armillary rings turn, counterweights descend, and architectural segments align into a fleeting impossible loop before separating again. Use convincing procedural bevel or edge treatment, ambient occlusion approximations, dust motes, warm practical light against cool moonlight, and a strong deliberate camera composition. Include orbit/zoom, a metamorphosis progress slider, mechanism speed, pause/resume, and click-to-follow portal or camera transitions. The geometry should communicate elegant impossible spatial relationships rather than becoming a random pile of boxes and cylinders.