We replaced LibDOM with a custom Zig implementation for better cohesion across events, Custom Elements, and ShadowDOM. Here's how we built it and what we learned along the way.