In the kingdom of Inkasisa, two peoples have long been in conflict. The Illustrians, pale-skinned descendants of foreign colonizers, ruled for four hundred years, oppressing the indigenous Llacsans and forcing them into hard labor. Ten years before the story begins, the Llacsan king Atoc led a revolt, using his Pacha magic, an earth-based power capable of causing earthquakes, and a relic called the Estrella, a gem that summons a ghost army, to overthrow the Illustrian queen. Thousands of Illustrians died, and the survivors fled to a mountain fortress. Ximena Rojas, an Illustrian orphan, has spent the last decade secretly posing as Condesa Catalina, the rightful Illustrian heir, to protect Catalina from assassination.
As the novel opens, Ximena distributes dwindling rations at the Illustrian keep while General Ana, whose shadow magic keeps the bridge to the fortress invisible, is overdue from a mission to La Ciudad, the Llacsan-controlled capital. Ximena possesses her own Illustrian magic: She can spin moonlight into thread and weave tapestries carrying hidden messages only Illustrians can read. When a messenger arrives demanding the condesa come to the castillo, Atoc's fortified palace, to marry the king, or else Illustrian prisoners will be executed, Ximena impulsively orders the messenger and his companions killed. Catalina criticizes the decision but recognizes the opportunity: Ximena will travel to the castillo as the condesa, serving as a spy to locate the Estrella.
At the castillo gates, the priest Sajra meets Ximena, and an archer kills her companion Sofía, Ana's daughter, because Ximena was ordered to come alone. In her grief, Ximena fights the guards with combat skills the sheltered condesa would never possess, potentially exposing her deception. Sajra uses blood magic, the ability to manipulate blood in another person's body, to stop the fight. Rumi, Atoc's cousin by marriage and the castillo's healer, escorts Ximena to the throne room. Atoc announces the wedding will take place during Carnaval, a festival only six weeks away. Ximena negotiates to delay granting Atoc access to the Illustrian fortress until after the wedding, buying time.
During a procession through La Ciudad, Atoc retaliates for the killing of the messenger, who was his cousin, by bringing Ana and other Illustrians to a public platform. El Lobo, a masked vigilante, appears and frees two prisoners, but Atoc triggers earthquakes and shoves Ana into a fissure, killing her. With Ana's death, the shadow magic protecting the fortress vanishes, leaving the Illustrians exposed. Ximena is thrown into the dungeon, where she bargains with Rumi: She will let him treat her infected wrists if he brings her a loom.
Returned to her room with the loom, Ximena weaves her first coded message into a tapestry and gives it to a market vendor at court, ensuring it reaches Illustrian spies. She sneaks into Atoc's study and discovers a map marking locations where the Estrella might be hidden. She also finds that combining moon thread with Llacsan wool brings her woven creatures to life. She sends a woven parrot carrying a message about the marked locations toward the fortress.
Life in the castillo challenges Ximena's assumptions. Rumi explains that under Illustrian rule, Llacsans were denied education, fair wages, and institutional power. Her maid, Suyana, shows quiet kindness. When a guard asks to leave his post to get medicine for his sick son, Ximena lets him go without hesitation. Meanwhile, Atoc physically assaults Ximena during a dress fitting and threatens her with the fate of his first wife, whom he implies he killed, intensifying her urgency to escape.
Sajra captures Ximena during a nighttime excursion; he knows she has been sneaking around the castillo in disguise. Using blood magic, he nearly kills her and demands she uncover El Lobo's identity within two weeks or he will massacre every Illustrian at the keep. Ximena resolves that if she cannot find the Estrella, she may have to betray the vigilante.
Ximena weaves an elaborate cape as a wedding gift for Atoc, and Llacsan custom obliges him to grant a gift in return. She asks to meet Princesa Tamaya, Atoc's younger sister, who is imprisoned in the watchtower and sentenced to be sacrificed to the sun god Inti during Carnaval. Ximena finds a sharp, perceptive young woman who possesses her own weaving magic and can read a person's desires through tapestries. Tamaya reveals the ghosts in the Estrella are the souls of Llacsan miners who died over centuries of forced labor in Illustrian silver mines. She wants the Estrella destroyed, not wielded, and proposes a bloodless revolt uniting both peoples under her rule.
During a weaving contest, Tamaya subtly embeds a clue in her tapestry: The Estrella is hidden at the bottom of Lago Yaku. Ximena weaves an owl carrying this information but decides not to send it to Catalina. Instead, she meets Catalina in secret and argues that Inkasisa needs a unifying leader like Tamaya rather than another war. Catalina is devastated, calls Ximena a traitor, and refuses.
El Lobo visits Ximena, and she shares her living woven animals as a gesture of trust. He removes his mask, revealing himself as Rumi, and confesses his feelings. At a rebel tavern, Ximena learns that Sajra, whose real name is Umaq, is part of the rebellion. She tells the rebels the Estrella's location, and the plan is set: Rumi will destroy it while rebels throughout the castillo depose Atoc.
Walking back, Ximena reveals the truth: She is not the condesa but a decoy named Ximena Rojas. Rumi is furious, holding his sword to her chest. She insists she gave him the location rather than Catalina, proving her loyalty. He lets her go but warns her not to make him regret it.
On the morning of the wedding, Ximena learns Rumi traveled to Lago Yaku but found nothing. She realizes the unsent owl was inadvertently tidied from her room and delivered to Catalina, who now possesses the Estrella. At the temple, with Tamaya bound nearby awaiting sacrifice, Ximena publicly reveals she is a decoy and that Catalina marches toward the city with the ghost army. Rumi reveals himself as El Lobo, and rebel fighters flood the temple. In the battle that follows, Ximena's woven animals protect Tamaya, and Ximena kills Atoc.
Catalina arrives commanding the ghost army, which slaughters Llacsans and Illustrians alike. Juan Carlos, Rumi's cousin and a guard loyal to the rebellion, is killed. Ximena duels Catalina and disarms her. The Estrella, a silver bracelet with an ametrine gem, rolls free. Ximena seizes it and drops it into a fissure in the earth, where it is destroyed in a burst of light and the ghosts vanish. The magical rebound launches Ximena against the temple steps, and she loses consciousness.
Ximena wakes thirty-six hours later with Rumi at her bedside; he used all his healing magic to save her and tells her he loves her. Tamaya is crowned queen. Catalina refuses to accept Tamaya's rule, and Tamaya threatens execution by lethal koka tea. Ximena begs for Catalina's life, and Tamaya commutes the sentence to banishment in the Yanu Jungle. Catalina departs without a word. Tamaya offers Ximena a seat on her council, but Ximena declines, choosing instead to open a weaving shop in La Ciudad. Surrounded by her surviving woven animals and standing beside Rumi, she embraces her true identity for the first time, no longer anyone's decoy.