Exactly that combination of "you care deeply about the area you are working in" and "hard to turn off" (even with less of "very ambitious company") - will eventually bring you back to the same situation, unless you change habits/approach/etc.
Instead of focusing/pushing for "not tying so much of myself to my work/current company" and "motivation" - perhaps it's better to focus on training yourself when and "how to turn off" and not slowly drift towards old habits?
And I think I know what you mean by "depression hits pretty hard and you stop doing things for yourself due to lack of joy/seeing the point in doing anything". Though in my case I realized that it originally started from myself feeling guilt where I was nagging to myself how I can't do whatever fun thing while there was some other work thing/project where I thought I'm behind.
So slowly over time that guilt made fun things less fun, and combined with stress started to skew perception of how productive I am, and how long something will/should take ...etc. Eventually that skewed perception spilled from work to personal life - so for those things/projects that were still at least somewhat fun/enjoyable I also started to be annoyed by them taking longer than what I thought they should take.