Follow all the fox past the ghosts. Enter the building, jump onto the ledge, turn around and jump to the other side. Run down the stairs and dive into the water. Swim ahead a bit and resurface outside of a small temple. You are trapped and you cannot return to the mainland, because there is no roof there that would save you from the beast.
Obtain the first of the keys.
You must try another method - jump into the sea and dive. In the water you are safe, so you can occasionally dive and make the beast lose interest in you. Swim towards the islet and dive - swim into the building shown in the above screenshot. Eventually, you will reach a crack, thanks to which you will be able to resurface. Now you will have to do some climbing and jump over the remains of the building. Obtain the key and get out of that building.
This time around, swim into the structure underneath the reef which has been presented in the above screenshot, and reach the chamber with the figurine. Give it a turn, so as to create a bridge thanks to which you will get to the other side and obtain the other key.
You can take the keys to the main gate underwater - swim inside and resurface through their crack. Go up to the wall know and use the keys that you have obtained, thanks to which the passage ahead will be revealed. Follow the path to reach a chamber with another puzzle, which is based on shadowplay.
The puzzle is about moving the stone block so that the shadow it casts falls on to sun symbols. The solution has been presented in the above screenshot. After that, approach the orb in the centre, activate it and run quickly towards the third symbol, so as to cast your own shadow and reveal the figurine.
As a result of that, the chamber will be flooded with water. Resurface, go left and pull the white stone to move it to the centre of the chamber. Place it on the appropriate field and approach the pedestal - using it you will have to copy the symbol onto the stone and move it to the right so that it casts its shadow and reveals a figurine.
Use the figurine, as a result of which the water level will rise again. Swim up, climb onto the structure and pull out the first of the blocks, which will release black smoke. Go right, jump into the water, take the stairs and pull out the second of the stones. Thanks to this a storm will start above the second mill, which will chase the beast away.