Hallam Foe lives in in the Scottish countryside in a house with his father and his new stepmother, Verity. Hallam's mother died some time ago, and Hallam hasn't recovered. He spends his days mostly secluded in a tree house and spying on his surroundings. When Hallam's sister leaves home, their father suggests Hallam should find work and start a life on his own. Hallam refuses, and when he discovers a boat on the bottom of the lake he instead becomes obsessed with the details of his mother's death. His father reveals that she took her own life, but Hallam becomes convinced that Verity had something to do with it. In a pivotal scene, Verity discovers Hallam's diaries and uses them to pressure him into leaving, but only after she has sex with him in the tree house.
Hallam leaves for Edinburgh without leaving word. He has no money and nowhere to stay, but on his second day he sees a woman in the street, Kate, whose resemblance to his mother makes him follow her to her work in the office of a large hotel. He persuades her to give him a job as a kitchen porter, and so he has a start. He also keeps following Kate, and echoing his experiences from the woods at home, starts to spy on her through her windows from the roof, or with binoculars from the clock tower of the hotel, and even breaks into her flat. He witnesses her sexual relationship with Alasdair, a senior employee at the hotel. By coincidence, Alasdair also discovers Hallam's spying activities and tries to fire him, but Hallam threatens to expose Alasdair's affair; he is, after all, a married man.
Instead, Kate helps Hallam win the position of front-of-house porter, and after drinks on his birthday she even asks him home with her, and they seem to be starting a romantic relationship. However, the next day, when he sees Alasdair harassing Kate on her way into her flat, Hallam comes in through the window to fight him off, thereby revealing his habit of spying on her. She throws him out, of course, but she eventually lets him explain his whole situation, and they find common sympathy.
Hallam's father and his wife have tracked Hallam down and come to the hotel to meet him. They want to sell off land and need Hallam's approval. He still insists Verity is responsible for his mother's death, and has even reported her to the police to no avail. Soon after, strongly affected by grief and pain, he goes back to his childhood home to seek out Verity, gags and ties her, carries her to the lake and throws her in the water. At the last minute he regrets his action and pulls her back out. Hallam's father, sickly and unable to defend his wife, finally tells Hallam the truth and asks him to blame him rather than Verity: Hallam's mother had been suicidal for a long time and on the day she died, it was because he had simply given up trying to stop her.
Knowing the truth, Hallam can finally hope to find peace. Back in Edinburgh, he goes to see Kate. They talk, but she turns him away, saying she hopes to meet him again later in life. Hallam walks away, smiling.