Actually LEGO was not doing fine before. In 2003-ish it was on the verge of bankruptcy. They did a massive reinvention which included gender-branding and licensing of pop culture. Which in just a few years has turned them back into a juggernaut.
Here's an article but its not the one I'm thinking of. There was a print article in Forbes or something about 2-3 years ago.