> what is the process of making a browser engine? what does the requirements look like
I second https://browser.engineering as a resource on that. Also consider dropping into the Servo Zulip.
> how is an actual html, css and javascript specification implemented at the code level? are we painting an empty canvas or is it more complicated
It's more complicated, but conceptually it's painting into an empty canvas
> how is backward compatibility implemented?
> what test cases do you consider for making something like this? how do you determine if you have handled all the outliers or not?
The ~2 million Web Platform Tests https://github.com/web-platform-tests/wpt. They also handle most of the backwards compatibility. The rest is engine developers manually comparing against each other's engines.
> is all the code written in c++ or is it rust these days?
There's still a lot of C++, but new code is increasingly Rust. To what degree varies by engine: Servo (and Blitz) are almost entirely Rust. Ladybird was 100% C++ in February, but is now 25% Rust. Firefox has significant and actively developed core components in Rust, but isn't actively converting more core modules. Chromium doesn't have any core components in Rust yet, but has invested heavily in converting foundational dependencies like FreeType and HarfBuzz to Rust. Safari is the outlier, I believe it doesn't use any Rust yet.
> how many people in a team do you need and how long would it take to write a browser engine from scratch
I've heard estimates that Chrome has a team of >1000, Firefox 500-800, Safari 100-200, Servo / Ladybird are more like 5-10. I've been building Blitz by myself for ~3 years. Something like 3-5 years is probably a minimum if you're truly building from scratch unless you have a really large team backing it, and depending on your success criteria.
> how is mobile vs desktop handled at the browser engine code level?
There are actually surprisingly few differences beyond touch input and screen size handling.