I want you to build me a single, self-contained HTML file called `ising_explorer.html`: an interactive 2D Ising model simulator that a physics student could explore for twenty minutes and come away understanding phase transitions. Work in stages, use subagents for building and reviewing, and don't show me anything until your reviewer has signed off.
## Physics requirements
- 2D Ising model on a square lattice, Metropolis-Hastings dynamics, J = 1, kB = 1.
- State the convention you use for the Hamiltonian and the inverse temperature clearly in the UI, and place the critical point correctly for that convention. Print the theoretical value on screen.
- Overlay Onsager's exact magnetization curve wherever you plot M vs temperature, so simulation and theory can be compared at a glance.
- Include an external field H slider (small range, default 0) so students can see the transition wash out and try a simple hysteresis experiment.
- Offer both single-spin Metropolis and the Wolff cluster algorithm, with a toggle. Near the critical point, let students see for themselves that Metropolis slows down and Wolff doesn't. If you cannot verify your Wolff implementation is correct, leave it out and say so rather than shipping something wrong.
## Features I want (more than a basic demo)
1. **Live lattice view** on a canvas, at least 100x100, with adjustable lattice size (e.g., 50 / 100 / 200). Smooth animation, responsive controls while running.
2. **Temperature control** as a slider, plus preset buttons for hot, critical, and cold, plus an **Anneal** button that ramps the temperature slowly so the lattice orders without quench artifacts.
3. **Real-time charts** updating as the simulation runs: magnetization |M| and energy per spin vs time, and a running M vs T diagram that accumulates measured points against the Onsager curve.
4. **Measured observables panel**: |M|, energy per spin, and estimates of susceptibility and specific heat from fluctuations, with a short note explaining how each is computed.
5. **A guided experiments strip**: three or four one-line challenges (find the critical temperature, measure the hysteresis loop, compare Metropolis vs Wolff near Tc) that set the controls appropriately when clicked.
6. **Short embedded explanations**: a few sentences per concept, collapsible so they don't crowd the interface. Intermediate level, no fluff.
## Engineering constraints
- One HTML file, zero external dependencies, works offline when double-clicked. No CDN links, no build step.
- Must stay responsive on a mid-range laptop. Budget the simulation work per animation frame instead of running a fixed number of sweeps.
- Clean, restrained design: one accent color, readable typography, no visual clutter. It should look like a teaching tool, not a dashboard.
## How I want you to work
1. **Plan first.** Before writing code, produce a short plan: layout sketch, what runs in the main loop, how the physics maps to code, what could go wrong (metastable stripe states after a quench, critical slowing down, finite-size effects). Tell me the plan in one paragraph, then proceed. Don't wait for my approval.
2. **Build with one agent, review with others.** After the builder agent produces the file, launch two reviewer subagents with fresh eyes:
- a **physics reviewer** that checks the acceptance rule, the boundary conditions, the placement of the critical point, the Onsager formula, and the observable estimators, by running the simulation logic headless (extract the JS and run it in Node with a DOM stub) and comparing measured values against known results;
- a **UX and code reviewer** that checks for layout problems, unresponsive controls, misleading labels, and dead code.
3. **Fix everything they find, then re-run the physics checks.** Iterate until both reviewers pass. Only then give me the file.
4. **Show me the evidence.** In your final message, include the reviewers' key findings and the numbers from the physics validation (e.g., measured |M| at a temperature well below Tc vs the Onsager value, and measured Tc from the susceptibility peak vs theory). One short table is enough.
## Acceptance criteria (your reviewers should check every one)
- [ ] Hot lattice: |M| fluctuates near 0. Cold lattice: |M| reaches ~1 within a few seconds of annealing.
- [ ] The susceptibility peak lands within a few percent of the theoretical critical temperature for the stated convention.
- [ ] The measured M vs T points track the Onsager curve away from Tc.
- [ ] Wolff and Metropolis agree on equilibrium observables; Wolff visibly decorrelates faster near Tc.
- [ ] All controls work while the simulation runs; nothing freezes the page.
- [ ] The file opens correctly from a local double-click with no network access.
If any criterion cannot be met, tell me plainly which one and why instead of quietly shipping a weaker version.