A deep-seated attachment to San Francisco runs throughout director Joe Talbot’s debut feature, but this adoration is honest, raw, and not without its critical caveats, especially when it comes to the city’s history of gentrification. The Last Black Man in San Francisco is both a gentle love letter and a scathing elegy. As it examines the city’s dying spirit, it both celebrates the beauty of home and prophetically cries out for the renewal and restoration of what home really should be.

Shot in disarmingly gorgeous and rich colors and accompanied by a score that often sends scenes into epic heights of emotion, the film follows Jimmie Fails (actor Jimmie Fails playing a fictionalized version of himself) as he attempts to gain back ownership of the Victorian mansion his grandfather built.

Jimmie’s grandfather is rumored to have been the first black man in San Francisco, and Jimmie bears this family history with pride. He desperately wants to find his way back into the house, though his father (Rob Morgan) lost it in the ‘90s, so he regularly treks from the outskirts of the city with his quiet playwright friend Montgomery (Jonathan Majors) to do repairs on the property, giving the home the care he thinks the current dwellers, a middle-aged white couple, won’t.

The film is not only a love story between Jimmie and the house, but also between Jimmie and Montgomery, whose disparate personalities create a quirky kind of harmony, as they encourage one another’s vision for the future. While Jimmie fixates on his family’s history and his own destiny, and while Montgomery attempts to craft stories and images from the complicated world around them, other young men in their neighborhood dabble in a masculinity that Jimmie and Montgomery just can’t master, taunting and threatening the two dreamers with a bravado and violence foreign to the cocoon of nostalgia and creativity they have built.

Eventually, the flux of San Francisco’s real estate realities hits the white occupiers of the Victorian house, and when its current owner dies and an estate dispute erupts among the heirs, Jimmie sees an opportunity. While the house sits in limbo, Jimmie moves in, pushing the place back into a vision of what it was in the memories he’s been cobbling through bits of family mythology. With the help of Montgomery, he relocates all the family’s old furniture (which has been kept in perfect condition offsite) back into the house and builds the home he’s always wanted it to be.

But there’s a shadow side to the Jimmie’s sunny giddy recreation of the history to which he’s devoted his life. As he disappears inside the walls of this fantasy life, he cuts himself off from the changes happening outside, and it’s clear this reverie can’t last. Even as the film fervently decries the invasion of white upper-middle-class privilege, it also interrogates Jimmie’s refusal to see the larger picture around him, with its complex community dynamics and shifting tides. This balance gives every scene multiple varied layers that dig far deeper than simple heartbreak or triumph, delusion or liberation; there’s a bit of it all in every moment. Jimmie and Montgomery are on their way to a future, but the future might not be the one they’ve crafted in their enormous imaginations.

Even with its agile excavation of San Francisco’s beauty and rot, this is at heart a story of hard-won personal transformation, and as Jimmie and Montgomery grow, both together and on separate tracks, the film fills their orbits with examples of others who have lost and won in their own ways. Alternately troubling and moving encounters with Jimmie’s father and aunt (Tichina Arnold), with Montgomery’s grandfather (Danny Glover), and with the young men of the block (all of whom are far more complicated than they first appear) add shades and details to the story, giving it the feeling of a fugue, multiple voices telling variations of the same personal and communal tales, and adding up to a complex stew of regret, hope, and resilient spirit.

The Last Black Man in San Francisco is a singular experience, blending stark realities of our country’s troubled history and tricky current moment with awe-inspiring imagery and poetic dialogue, ultimately creating something as freshly hopeful and deeply scarred as its characters. It joins an already active and necessary conversation about economic disparity and racial injustice in the United States, while also adding new insights and spiritual complexity to that conversation’s enduring questions. It is a film that haunts the heart long after viewing, one that will last and continue to add passionate nuance to the common quest for belonging and a place to call home.