Kat Panchal had not yet learned how to use her sewing machine when the pandemic started. But in March, on leave from her job as a flight attendant with American Airlines and cooped up alone in her Philadelphia apartment, the 34-year-old taught herself to sew. Soon she was stitching masks and donating them to health care workers.

With no sign of her job coming back anytime soon, Panchal — now furloughed — put her masks on Etsy, the online marketplace where crafters and artists around the globe sell handmade and vintage goods. Since April, she has sold more than 400 masks, raking in more than $4,500. Sometimes, she sews until 4 in the morning to keep up with demand.

"It was a really big blessing," Panchal said. "It gave me something else to focus on instead of thinking about losing my job."

Tens of millions of masks have been sold on Etsy this year. The demand has created business opportunities for the likes of Panchal but has also turned Etsy into something unexpected: a Wall Street darling.

Along with a cluster of "stay at home" stocks such as Zoom Video, Peloton and Shopify — so called because their businesses took off during the pandemic as people's shopping and work habits changed — Etsy has seen its share price soar.

More than 90% of Wall Street analysts rate the stock a "buy." Individual investors, mutual fund managers and hedge fund traders alike have been scooping up its shares, which have risen more than 250% this year.

That makes Etsy by far the best-performing stock in the S&P 500 stock index, to which it was added in September — a sign that it was now in the corporate big leagues.

Such blue-chip status would have seemed like a long shot just a couple of years ago for a company that began in 2005 as a site for a founder to sell handmade wood-clad computers, only to become a punchline for an emergent twee culture that values idealism, niceness and sincerity.

By 2015, when Etsy went public, it had morphed into a crusader for socially conscious capitalism. In its offering documents to investors, Etsy promoted its do-gooder credentials almost as much as its business prospects.

And while it treated investors to an unusual level of disclosure on even its corporate composting practices, Etsy's chief executive at the time, Chad Dickerson, flatly declared that the company wouldn't issue guidance on expected quarterly profits. The practice "is misaligned with Etsy's mission," which was to create a new kind of company that wouldn't follow the conventional corporate path of "valuing products and profits over community," Dickerson wrote.

Wall Street was having none of it.

After Etsy produced a series of ugly losses over the next year, its share price plummeted almost 80%. Buyout firms and activist hedge funds began to circle, snapping up shares and pushing the company to explore "strategic alternatives" — such as selling itself.

Etsy eventually bowed to Wall Street. In May 2017, the board ousted Dickerson, and the company axed 8% of its workforce and committed to a change in strategy. A board member, Josh Silverman — a former executive at eBay and Skype — was named chief executive, and the company issued a statement saying it was "focused on maximizing value for all shareholders."

In other words, it was ready to play by at least some of Wall Street's rules.

More changes were to come, including bigger layoffs. Projects that had been in the works for months were shuttered. The Values-Aligned Business division, which was tasked with ensuring that the company's socially conscious ethics were ingrained into every aspect of the company, was broken up and reorganized.

In 2017, it ceased being a B Corp — a certification given by a private nonprofit organization to companies with high social and environmental consciousness — which it had promoted as being critical to its brand just two years earlier.

While the changes weren't without controversy, especially internally, Etsy officials say the company has significantly amplified its focus on corporate values since the management change. Silverman has brought an MBA-style approach, refocusing the company on a few key issues — economic empowerment, gender and racial diversity and carbon neutrality — where, he argues, Etsy can make real progress.

"I am more proud of what we've done on social impact than I am of the share price," Silverman said in an interview. "Now, I'm nervous about that quote because that implies that they're somehow not related. And I very much believe that the great performance that we have is in no small measure because we have focused so much on citizenship" — a term that Silverman used to describe the company's efforts around social and cultural goals.

Analysts and investors said Etsy's progress on operational challenges, from payments to search and shipping, has been more important to their changing views on the stock than management's efforts around corporate culture.

"You had these buyers come, but they couldn't find what they needed, or they didn't know what they were looking for," said Chris Mack, a stock portfolio manager at investment adviser Harding Loevner in Bridgewater, N.J., who owned a roughly $17 million stake in Etsy for his funds, according to the most recent public filings.

When they did buy, Etsy customers were often annoyed by high shipping costs and long waits for the products to arrive. Some delays were unavoidable. Unlike Amazon, Etsy doesn't own warehouses stocked with inventory. Most of the items sold on the site are made to order for individual buyers, a process that defies the kind of next-day delivery that many online consumers have come to expect. (Etsy takes a 5% cut of sales.)

As Etsy began to find its financial footing, sales grew faster, and its overhead costs fell. It migrated back-end operations to Google's cloud-services unit, tapping into the bigger company's search expertise and increasing processing speed.

Etsy ended 2017 with a more than 70% jump in its stock price as it turned profits, and shares continued to climb the next year. However, Wall Street remained uncertain, and the company's shares traded wildly through 2019 as it posted disappointing financial results.

Since the start of April, the site has sold nearly 54 million masks, worth $600 million, and the boom has proved surprisingly durable, helping to supercharge key profit and sales metrics at the company. In the third quarter, the total value of goods sold on the site, excluding masks, was also up 93%, as housebound Americans bought home furnishings, craft supplies, jewelry and accessories.

Wall Street was impressed with Etsy's ability to handle the surge of mask orders — which required flexible computing power, on-the-fly-tweaking of search abilities and a demanding pace for shipping — and it shone a spotlight on the strides the company had made.

"What they've been able to use COVID for is to bring either new customers to the platform or old customers back to a better experience," said Jason Helfstein, an analyst at Oppenheimer & Co., who covers Etsy. "When you searched something, you actually found it. Or when you bought something, it actually came, like, pretty quickly, not weeks later, which was some of the issues with what we'll call the old Etsy."