As the late-summer sun began to set on Bocas del Toro, Panama, Marah Hardt slipped into a mask and a pair of flippers and swam out to sea. When she spotted a coral reef below, she bobbed at the surface and waited. Then it happened: Thousands of tiny pink balls shot up from the bare, bony colony, an undersea garden blossoming all at once. Bound to the coral by long strands of goo, the packets stretched and swayed toward Hardt’s snorkel, finally snapping free and surging forth—“like a blizzard underwater,” Hardt says. Once the pods hit the surface, they broke open in a hazy cloud of eggs and sperm.

Back on shore, Hardt peeled off her mask and inhaled the ocean breeze. “It smells like sex!” she thought, a little giddily. So began Hardt’s quest to investigate the elaborate mating rituals of life in the deep, from polyamorous whales and swinger parties hosted by groupers to sex-changing ribbon eels whose genitals are tucked into their butts. She started a blog and eventually developed a reputation as a fish-sex expert. Not her dream title, per se, but she’d take it. Now, after three years of seaside voyeurism, she’s releasing her collection of underwater erotica in a book called Sex in the Sea.

To help the uninitiated ease into the science of marine reproduction, the book’s structure mimics the phases of courtship, from foreplay to postcoitus. Of course, more confident readers can opt for a kind of literary roulette by opening the book to any page at random. You might get the section on blue whales serenading their female partners, complete with a cartoon Barry White whale with heart-shaped bubbles emanating from its blowhole. Or you might land in “The Penis Chapter” and learn about the argonaut, an octopus that can detach its own phallus and shoot it, projectile-style, into the gills of an unsuspecting female. Also, did you know a whale’s vagina can be big enough to crawl through?

As much as Hardt revels in these lurid details, her true motivation is to keep her subjects safe from human threats so they can keep reproducing for generations to come. Today, as a research director at the nonprofit Future of Fish, Hardt spends her weeks helping nonprofits and fishing companies adopt technologies that can reduce threats like overfishing. By using satellite images, for instance, government agencies can monitor barges to ensure fishers aren’t dropping their nets during spawning season.

Hardt points to other innovations that promote sustainability. There’s a sushi chef in San Diego who’s attaching edible QR codes to his rolls so customers can verify that the contents were responsibly caught. Researchers are also working on new ways of reading fish DNA to trace sales of delicacies, like shark fins, that come from endangered animals. Then there’s the growing availability of tools that help scientists get a deeper look into the private lives of deep-sea animals. Something like a handheld ultrasound wand, for example, is especially useful for studying the reproductive organs of great whites and other briny fauna.

As for Hardt’s new book of underwater sexcapades, that’s part of the plan too. “Everybody loves to talk about sex,” Hardt says. “But most people don’t ever get to see what happens beneath the ocean’s surface.” Sex in the Sea lifts the curtain on the ocean’s bedroom secrets—along with the environmental hazards that are causing some major coitus interruptus.

“It all comes back to respecting the love lives of these fish,” she says. “I want to bring these stories to a much more popular audience so they can experience it from their living rooms.”

In other words, from a safe distance away.