Sometimes the seeds for a new startup idea get sewn following a good night's sleep. In the case of Casper, they sprouted after just the opposite.

When the company's five co-founders met last year at a coworking space, where some of them worked for different ventures, they chatted about how few people in the startup world seemed to get enough shuteye. They also shared their observations about what worked – and what didn't – for falling asleep, and how buying a new mattress upon moving to a new city was typically an awful experience.

Then they decided to team up to shake up the $7.6 billion mattress manufacturing industry.

"We wanted to create a new brand in the mattress space that really resonated with people – that was exciting – and leverage the direct-to-consumer model, so sell through our own website and manage the experience with customers," says Philip Krim, Casper's CEO.

Related: A Device to Help You Sleep Better Raises Almost $500K in Two Days on Kickstarter

Make mattress buying exciting? As improbable as it seems, that's exactly what Casper managed to do, though admittedly with a lumpy start. In February, the company announced that it had raised $1.6 million and by April, the startup was abuzz with positive press coverage and social media messages from consumers eager to order its mattress. Come launch day, on April 22, all of the mattresses sold out – in just a few hours – even though Casper's team expected its supply to last a few months.

"The biggest challenge for us has been having inventory and getting our supply chain in [order]," says Krim. "That's a good problem to have; nonetheless it's a problem, especially when you hear from customers sleeping on the floor or couch."

Related: Work, Eat, Sleep: How These Products Are Trying to Improve Your Daily Grind

At the peak of shipping delays, consumers were stuck waiting three to four weeks for their mattress. And while Casper's sales topped $1 million in the first month of business, the company had to scramble to buyback customer goodwill through complimentary airbeds that it sent to act as temporary stopgaps. All told, it took just over three months to work through the supply chain issues before Casper finally caught up with the right amount of inventory.

Even so, some dedicated Casper fans have uploaded videos on YouTube showing how their mattress comes to life. (It arrives compressed in a small box about the size of a mini fridge then slowly expands as it gets exposed to air.) Others have taken to Twitter to praise the product's material – a mix of latex and memory foam that costs upwards of $1,500 in traditional retailers but sells for $500 to $950 depending on the size. And those consumers sick of choice overload every time they walk into a mattress store may appreciate that Casper's model relies on just one design, with six size options, which helps keep the retail cost lower than competitors.

"It is very much in the manufacturer's best interest to come out with many models, because [in] a retailer they want to occupy as much floor space as possible," explains Krim. "We don't need to worry about floor space, positioning and point of sales – we could boil [the design] down to one perfect mattress."

Mattress sales tend to grow (and shrink) in tandem with the ups and downs of the real estate market. This could play in Casper's favor, as mattress sales are expected to rise this year – by 1.6 percent – on the back of residential construction values, according to market research from IBISWorld. However, furniture stores are also a crucial retail channel for this sector, and since Casper sells directly to consumers, they're missing out entirely on this segment of the market.

Related: British Airways Testing 'Happiness Blanket' to Make First-Class More Comfortable

But Krim says courting a younger demographic – those between 20 and 40 years old – could help boost his online sales since well-known brands such Serta, Simmons and Sleep Number often miss this "sweet spot" and focus their marketing budgets on "going after baby boomers with back problems." That's why Casper offers free shipping anywhere within the U.S. and gives customers up to 40 days to return a mattress. All they have to do is call the company and someone will come pack it up and return it.

"Lying on a bed for a few seconds or minutes is not indicative to whether that's the right bed for you," says Krim. "If it's not the best for you, we want to make the return process easier – even easier than Zappos."