For the synchronous firefly, what appears as a dazzling spring and summertime spectacle is largely a courtship ritual.