Ingmar Bergman once suggested, I do not know how seriously, that his choice in the early summer of 1955 was between two things: making a lightweight comedy for Svensk Filmindustri, or killing himself. Now, I shouldn't think that his professional situation was as bad as all that - his position with Malmö City Theatre was secure, and growing increasingly productive, artistically - but let us take the spirit of his words at face value, at least. His movie career was flatlined, his personal life was a wreck, and it was in the state of miserable, abject depression that he took a crack at writing his own version of an elegantly smutty sex comedy of the sort that European theater has thrived on since the 18th Century. As one will.

To call the film that resulted "successful" would hardly be doing it justice. Smiles of a Summer Night - that was the sex comedy's name, adjusted for the grammatical differences between Swedish and English - wasn't just a big hit at home, it was a big hit abroad, competing for the Palme d'Or at the 1956 Cannes International Film Festival, and winning a special prize for "Best Poetic Humor". After nine years and fifteen prior features, Bergman finally found international recognition (give or take the minor success his films had met with in South America), and the rest really is history: he would not, after this film, cease to be "major world cinema director Ingmar Bergman" until his death in 2007.

A professional breakthrough, then, and also an artistic one: Smiles of a Summer Night is the best feature of Bergman's career up to that point. It's often cited as being one of his most uncharacteristic films, and given that it is expressly trying to improve your mood, I suppose that's fair, but let's not chase the rabbit of "this is such a bizarre swerve for such a dour filmmaker" too far. The film has plenty of thoroughly in-character strengths, and its visual style is largely the one he'd been using throughout the '50s. It is, maybe, ever so slightly lighter than his last handful of movies, though that's as much thanks to the of topic as anything: this is, as the title suggests, a film about the mentally destabilising effects of Scandinavia's twilit midsummer, when it only gets dark dark for a couple of hours, or even less. The second part of the film, somewhat less than half the 109-minute running time, is set at a Midsommar party, and it seems like the sky's refusal to get darker than an overcast afternoon is very much part of what drives the characters to unravel in the ways that makes the farcical complications work. The absence of strong, hard blacks in this second half of the film is, in this sense, just as atmospheric and evocative as unsparing film noir chiaroscuro might be in another context. Gunnar Fischer's cinematography here obliged to paint in shades of grey, and while I confess to preferring his more floridly expressive work in the likes of Sawdust and Tinsel or The Seventh Seal, there's no gainsaying the degree of difficulty of this project. Nor its effectiveness: the hazy, dreamlike gloom of the visuals fits the character drama beautifully.

The film was built, consciously, as a puzzle to solve: start with zero appropriate couplings, end with four appropriate couplings. The situation at the beginning is that lawyer Fredrik Egerman (Gunnar Björnstrand), on the declining side of middle age, is in his second year of marriage to 19-year-old Anne (Ulla Jacobson), whom he relates to more as a father than a husband - they have still not had sex, even. They live with his son Henrik (Björn Bjelfvenstam), a seminary student only a little bit older than Anne, who is crushingly shy and sexually unconfident; he has an enormous crush on his stepmother that he sublimates by flirting, very badly, with the family's maid Petra (Harriet Andersson), and fumbling through his attempts to sleep with her. And so it might go on for years, except that Fredrik has picked up tickets for Anne and himself to see the much-loved actress Desiree Armfeldt (Eva Dahlbeck) in a play one evening; she just so happens to be his ex-lover from the window between his wife's death and his second marriage. Anne first learns of his because, while sleepily pawing at her as the couple naps before the play, Fredrik refers to her by Desiree's name. Desiree, meanwhile, is growing tired of her current lover, Count Carl-Magnus Malcolm (Jarl Kulle), a humorless military man who is married to Charlotte (Margit Carlqvist), a friend of Anne's. The fuse on this situation is lit when Fredrik visits Desiree after her performance, and is caught by Malcolm while wearing the latter man's robe; Desiree makes sure that it explodes where she wants by encouraging her mother (Naima Wifstrand) to invite everybody thus far named to her palatial estate for Midsommar celebrations.

How, exactly, this all shakes out is the fun of it, though the final arrangement of partners isn't surprising and isn't trying to be (if you counted and got four women to three men: Petra fools around with the Armfeldt groom, Frid, played by Åke Fridell). This is, again, Bergman's version of a traditional stage farce, a fact openly telegraphed by the scene of Desiree's play, which itself is some sort of old 18th Century-looking thing (I do not know if this is an actual play, or if Bergman wrote a few lines in an archaic stage idiom just to put the point across; I suspect the latter), and even by the setting of the film, sometime between the invention of the automobile and the beginning of the First World War. It is deliberately fussy in the manner of an arch play, including the very blunt scene of exposition that starts things off (echoed in the blunt scene of exposition that opens the play-within-the-film).

Yet, for all that this is unmistakably the work of a lifelong theater artist - one who had just put on a very successful production of Franz Lehár's The Merry Widow when he started writing the Smiles of a Summer Night script, which feels like no coincidence at all - this is a movie, through and through. It is a movie that certainly could work on stage, and has done so to great effect in the form of the Stephen Sondheim/Hugh Wheeler musical A Little Night Music, which premiered in 1973 (and was turned into a dreadful disaster of a motion picture in 1977). But the film itself never once feels like a compromise with the medium. Fischer's glowing lighting is part of that; even more so is the film's extensive reliance on reaction shots, sometimes even reaction two-shots. By this point, Bergman had assembled quite a stock company for himself, aided considerably by having the Malmö City Theatre and its workshops right at his fingertips, and Smiles of a Summer Night is arguably the first of films to take full advantage of that. Of the nine main actors, Jacobson is the only one who hadn't worked in a Bergman film yet (Björnstrand and Bjelfvenstam had even played characters named Fredrik and Henrik before, in Waiting Women), and there's a level of comfort between the cast and the camera that results in some exceptionally small moments of character creation. That, more than anything, is what keeps this from feeling like canned theater: the care with which we're positioned in the rooms with characters, moving in close to share secret moments with them. This results in several splendidly intimate moments, and some of the best jokes: in particular, the combination of well-timed shifts to close-ups of Andersson and her flawlessly amused facial expressions are a reliable source of humor and psychological acuity (the motif of cutting to Andersson gets a great punchline near the end, when she wears a dazed, empty expression that immediately lets us know that she has just had the most high-energy screwing she's enjoyed in quite some time). Another terrific gag comes in the form of a simple pan to the left as Malcolm walks towards the camera, revealing the depth to which he's a fatuous asshole in his marriage in a perfect bit of visual sarcasm as Charlotte's flat, unreactive face is revealed.

In fact, one of the most impressive elements of Smiles of a Summer night is that it  is, in fact, extremely funny - not by any means a gimme, especially given that Bergman's previous dalliances with comedy couldn't make the same claim. Perfectly-timed editing and camera movement explains that a bit, but so does the well-honed acting from all corners: I am perhaps most especially amused by how well Björnstrand shows Fredrik's fussy middle-class primness deflate; the film is decisively on the side of its women, and the men are all in their own ways egotists who need to be cut down (though the film obviously finds Frid more authentically charming than the other male characters, even letting him and Petra have the last word - an unusual and well-chosen bit of class subversion from this emphatically bourgeois director), and Björnstrand has a way of letting his face sag while holding the rest of his body steady that persistently sells that idea, to reliable comic effect. But even this is maybe trying to make things too complicated: a big part of why this works is that the characters are so distinct and authentic, etched with the same precision that would show up in Bergman's more austere and draining psychological dramas that would make up the basis of his international reputation just a few years down the line. Every character but the puffed-up Malcolm gets at least one if not several chances to show us their side of things, lapping up all our sympathy for their hopes, their real emotional yearning as much as their needy lust. If the net effect is comedy rather than tragedy, that's maybe because everyone involved in making this has the wisdom to recognise that sex is too ridiculous and farcical to treat otherwise; and maybe it's because Dahlbeck makes for such a confident ringmaster to this particular circus, starting with the gifted comic timing she had already shown off with Bergman in Waiting Women and A Lesson in Love, and adding the melancholy of a middle aged woman tainted by a conviction that she's made the wrong choices. (If I were compelled to pick a favorite member of an excellent cast, I don't see how I could possibly choose between Dahlbeck and Andersson, after having painfully whittled away everyone else; it's a contrast between bittersweet elegance and energetic, messy sexuality, the two actors' most characteristic modes, at their most refined.

The film is, basically, immaculate: the story and screenplay are a remarkable machine, but not so tight that there's not room for shaggy moments where we basically just hang out watching the characters fumble. The precision with which camera angles are cut between never ceases to impress, even after reaching its apparent apotheosis in a remarkably clever dinner scene, where every character makes a choice in front of our eyes, and we see how each of them goes about it differently; later on, one of the film's best jokes is a perfectly-timed reveal of Fredrik's state after his ultimate confrontation with Malcolm (it's Björnstrand's best scene, not for a lack of options). The camera moves rarely enough for it to always feel measured and purposeful when it does. Yet, for all that it's a frightfully well-made object, it's breathtakingly light, a breezy whirlwind of human foibles that has just enough moments of piercing insight (nearly all of them delivered by or through Frid or Desiree's mother) that there's always a core of wistful human feeling driving it. It's true enough that the tone is unlike virtually all of Bergman's subsequent masterpieces; but that insightful, uncomfortable pebble of emotional truth is right in keeping with everything he'd do going forward, now firmly established as a mature cinematic artist.