BUILD REQUEST - PL-173 Rainy Study Nook - please build this now I'm sending you this as my request: please build the one-file HTML app described below. Start now and do the whole build in your answer to this message. - This is a build job, not a document to summarize, review or discuss. Don't ask me anything first: if a detail is unclear, pick the most sensible option and keep going. - The spec is everything between the BEGIN SPEC and END SPEC lines. Follow all of it exactly. - If your tool can create files, also save the finished file as PL-173-rainy-study-nook.html. ===== BEGIN SPEC ===== RAINY STUDY NOOK: Isometric Desk by the Window HOOK OBJECT: window.__nook Build "RAINY STUDY NOOK": a cozy isometric corner of a study in pure SVG and CSS (no canvas, no libraries): a small wooden desk, a lamp, a mug with steam, an open book, a plant, and a big window with rain running down the glass and the night outside. The warm lamp against the cold blue rain is the whole charm. LOOK - Style: soft isometric vector illustration, rounded shapes, no outlines, gentle shadows. Room walls #2B2F55 (left) and #353A66 (right), floor #5A4638, desk top #B98A5A with front #8E6540, lamp glow #FFC76B, mug #E8E1D4, book cover #3F7F7A, plant leaves #5FAE6B in a pot #C86F4B. Night outside the window: gradient #101A3C to #24336B, with 3 soft blurred city lights (#FFD9A0). - The window is on the left wall, about 40% of the screen height tall, with a thin frame #D9D3C6 and a sill. The desk sits in the corner under it, with the lamp, the mug (steam), the book and the plant on it. - Rain drops on the glass: exactly 14 drops, each a small rounded shape 6–16 px tall with a lighter highlight, #BFD8FF at 70% opacity. - FIRST FRAME (t = 0, no input): the whole nook, centered, fills at least 70% of the screen height; the lamp is on and warm; the window shows night and rain; 6 drops are already partway down the glass; steam is rising from the mug. A small title "RAINY STUDY NOOK" sits at the top-left, never over the nook. MOTION / PLAY - Rain drops run down the window glass in a stop-and-go way: each drop waits 0.3–1.2 s, then slides about 20–50 px over 0.4 s, and repeats. When a drop reaches the sill it splashes (3 tiny droplets for 0.4 s) and a new drop starts again from a random spot at the top of the glass. - Steam: three soft curls rise from the mug and fade over 2 s, each puff 0.7 s after the one before. - Lightning: every 9 s the whole window flashes white-blue for 0.25 s and the room brightens, then a deep rumble follows 1.2 s later. - Controls: tap or click the lamp (or press L) to switch it on or off: the warm glow fades over 0.3 s and the room goes dim blue. Tap the window to add 3 extra drops at once. Drag sideways to look around: setView(panX) shifts the picture by up to 40 px with a slight depth shift between the room and the window. - All animation must be driven by one JavaScript time loop (not CSS animation alone), so advance(seconds) gives exactly the same result as real time. - ATTRACT MODE: with no input, a hands-free demo starts on load and loops every 25–30 s, showing every main feature (rain, steam, 3 lightning flashes, and the lamp switching off at 12 s and back on at 17 s). Any input takes over; the demo resumes after 8 s with no input. SOUND - Steady soft rain (filtered noise) that gets a little louder when the lightning flashes. - A tiny "plip" for each drop that lands on the sill (pitch varies). - A low rumble 1.2 s after each lightning flash. - A soft switch "click" when the lamp toggles. COUNTERS stats() returns { fps, dropsLanded, flashes, lampToggles }. - dropsLanded: +1 exactly when a drop reaches the sill and its splash begins. - flashes: +1 exactly when a lightning flash starts and the window turns bright. - lampToggles: +1 exactly when the lamp changes state (by tap, key or attract mode). - On screen: the three counters in a small row at the bottom-left, readable in a paused frame and never over the nook. CHECKS for ?test=1 With ?test=1, run an accelerated self-test that measures real positions and real events (not self-set flags) and logs "TEST n PASS" or "TEST n FAIL: reason" to the console and to window.__testResults: Each check starts from a fresh load; advance() steps in 1/60 s increments. 1. The page has no canvas element and no external image, has exactly 14 rain drops on the glass, and the nook fills at least 70% of the screen height at t = 0. 2. Over advance(20), every drop's y position never decreases except when it is placed back at the top after landing, and dropsLanded equals the number of drops that reached the sill. 3. Exactly 1 lightning flash starts every 9 s (within 0.1 s): after advance(27.2), flashes is 3, and the window's brightness peaks during each flash. 4. Toggling the lamp changes the lamp glow opacity from at least 0.8 to at most 0.1 within 0.5 s and back, and lampToggles goes up by exactly 1 each time. 5. advance(28) of attract mode shows at least 10 drops landed, 3 flashes, 2 lamp toggles, and the run has zero console errors. KEEP IT SHORT - Keep the whole file under about 1,500 lines (soft target) so you can write it in one pass and finish well inside 15 minutes. - Save lines with helpers, loops and instancing, not by dropping features. Everything above must really work: no placeholders, no TODOs. BUILD RULES (all required): - Deliver ONE self-contained HTML file: inline CSS and JS, no build step, no local assets. Libraries only from a CDN. If you use Three.js, use exactly this import map: {"imports":{"three":"https://cdn.jsdelivr.net/npm/three@0.160.0/build/three.module.js","three/addons/":"https://cdn.jsdelivr.net/npm/three@0.160.0/examples/jsm/"}} - It must open straight from disk in desktop Chrome and on an iPhone (Safari), fill the full screen, handle resize and touch, and stay smooth (target 60 fps). - It must look stunning in the very FIRST frame: no black screen, no loading wait, no tiny subject. The main subject fills at least 50% of the screen height. - SOUND (required): all sound is made in code with Web Audio (no audio files). Show a small "🔊 TAP FOR SOUND" chip; on the first tap create ONE AudioContext, route everything through a master gain of 0.6 into a DynamicsCompressor, and hide the chip. Also expose enableAudio() on the hook object named at the top. - Expose the hook object named at the top with: setCameraOrbit(azimuthDeg, elevationDeg, distance) (or an equivalent camera setter), advance(seconds) that steps the simulation exactly that much for still captures, enableAudio(), and stats() returning {fps, ...the counters named above}. Use a fixed random seed of 360 so every run is the same. - Every on-screen counter must count a real event you can see happen. No fake numbers. - No text overlapping the subject; any label must be readable in a paused frame. - No brand logos, no real people, no copyrighted characters, brand names or logos. FAILURE MODES TO AVOID - A blank page, or only the title on a blank page, because one script error stopped the scene. - A room far too dark to read, especially with the lamp off. - Rain that falls straight down in a smooth line instead of the stop-and-go run of real drops on glass. - Drops that run outside the window glass, or never reach the sill. - Using a canvas, an image file or a library instead of plain SVG and CSS. - Steam, drops or the lamp glow that never move, so the scene looks like a still picture. - Counters that tick on a timer instead of when a drop lands, a flash starts or the lamp toggles. - The same variable declared twice, or methods called on objects that don't exist yet. SELF-TEST LOOP - If you can run code: build the file, open it, read the console, run ?test=1, and take screenshots at 3 s, 10 s and 30 s at 1280x720 and 390x844. Look at the screenshots and fix what looks wrong. Fix and retest until all 5 checks pass with zero console errors. Mark anything you could not run as UNMEASURED; never invent results. - If you are chat-only: go through this prompt line by line, check your code against each line, and fix anything that would fail. Then write one corrected, complete file. - Final answer: ONE complete HTML file in ONE code block, then the 5 checks marked PASS, FAIL or UNMEASURED. No snippets, no "rest unchanged". ===== END SPEC ===== Now build it. Reply with ONE complete HTML file in ONE code block, then the 5 checks marked PASS, FAIL or UNMEASURED.