how long is too long to be unemployed?

If your story makes sense, I would not judge time off as a huge issue. Often times people need to take time off to help out with personal/family issues and that’s fine.

Likewise you can always tell people you were “freelancing” if your actual story had to do more with just inability or lack of desire to work.

If your portfolio and skills are still up to date and relevant that will be important. Do a couple projects on your own to keep your skills and material up to date and weave that into your story when you start to interview. IE “I took time off to recover from being a heroin addict, but I designed this great thing while I had that free time”