This is very cool. I have no idea how this one work. I'm guessing most of the magic is in the box shadow?
As an aside but still relevant question, why is CSS preferred over JS when these days it can do lots of things like JavaScript and probably uses similar resources.
Man, CSS looks absolutely nothing like it did when I started out. lol
Author also has a blog post describing why he created this project and a high overview of what's happening behind the scenes
https://yuanchuan.dev/an-introduction-to-css-doodle