FANS of Japanese anime had much to rejoice this week. First, there was the announcement that Hayao Miyazaki had come out of retirement. The 75-year-old co-founder of Studio Ghibli, and the director of such beloved masterpieces as “Spirited Away”, said that he couldn’t resist making one more feature film, even if he will be 80 before he completes “Boro the Caterpillar”. But that wasn’t the only good news for anime aficionados. Coincidentally, Mr Miyazaki’s statement came just before the British release of “Your Name”, a film so exquisite and unpredictable that its director, Makoto Shinkai, has been called, yes, “the new Hayao Miyazaki”.

Mr Shinkai is no imitator, though. His originality is obvious within the opening minutes of “Your Name”, with their zooming “camera” movement, their snappy editing, their unusual angles, their richly-detailed cityscapes and rural vistas, and, most of all, their variety of gorgeous lighting effects. A distinctive blend of conventional hand-drawn animation techniques and digital flair, “Your Name” is worth seeing for the shafts of sunshine in a dusty room, and the coruscating purple trail of a comet across the night sky.

It’s so disorientating in its rhythms—and so lovely to behold—that it’s a while before the film reveals itself to be a fast, well-observed, “Freaky Friday”-style body-swap comedy. Its teenage heroine, Mitsuha (voiced by Mone Kamishiraishi), is a schoolgirl who is bored of life in her lakeside mountain town. Never mind its idyllic views and its ancient rituals, there are no cafes for her to go to, so she dreams of living as a boy in the hustle and bustle of Tokyo. And, somehow, her dream comes true. One morning, she can’t understand why everyone keeps telling her that she behaved weirdly the previous day, but she eventually figures it out: two or three times a week, she wakes up to find that her mind has switched places with that of Taki (Ryunosuke Kamiki), a Tokyo resident of her own age.

At first, this bizarre phenomenon works out well for both of them. When Taki is in Mitsuha’s body, his basketball skills turn her into a school champion, and when Mitsuha is in Taki’s body, her feminine sensitivity impresses the girl he has a crush on. Not that the youngsters are always so intent on helping each other. Obsessed as she is by metropolitan cafes, Mitsuha can’t stop ordering expensive desserts whenever she takes over Taki’s identity. Taki, meanwhile, can’t stop fondling Mitsuha’s breasts whenever he takes over hers—much to the bemusement of her younger sister.

A further twist is that, once they return to their own selves, Mitsuha and Taki soon forget what they did during the switch. This fairy-tale logic is something of a narrative cheat, but the amnesia is ultimately what gives the film its considerable poignancy. Like “Eternal Sunshine of the Spotless Mind”, “Your Name” forces us to ask how much of ourselves we lose whenever a memory slips away, and why crises which once felt monumental can come to seem trivial just a few years later.

And that is just half of the film. “Your Name” would have been a quirky delight if it had stuck to the romantic high-school mix-ups, but it races past them on its way to a bigger, stranger and more momentous story. It would be wrong to reveal how exactly it leaps to a thrilling new genre while retaining its initial nuanced charm and humanity. But it is fair to say that, as innovative as Mr Shinkai undoubtedly is, he sticks to the anime tradition of making everything go spectacularly psychedelic and apocalyptic towards the end of the film. Anyone who came out of “Arrival” with a hunger for more expansive, heart-rending science-fiction will tuck into “Your Name” as greedily as Mitsuha/Taki tucks into her/his delicious desserts.