When I read Genesis from a strictly secular historical perspective, I can’t see that it was intended to be taken literally. It certainly has layers of meaning, some of which aren’t obvious without historical context. I’ll give some examples. First, there is Tehōm in Genesis 1:2. Usually translated as “the deep”, this is the primordial sea, associated in Canaanite mythology with Yām, the god of the sea, who battles Baᶜal Hadād, the head of the Canaanite pantheon. Likewise, Tehōm is Tiāmat in Akkadian, who is defeated by Marduk in the Babylonian creation myth. Again, Marduk being the head of the respective pantheon. In Genesis, Tehōm is neither a deity nor a threat to ᵓĚlōhīm (God). Rather, it is simply a thing that is easily reshaped according to God’s will. In Genesis 1:16, two more Semitic deities are similarly demythologized. For this message to come across, the text depends upon an audience being familiar with the Canaanite and/or Mesopotamian myths.
From there it goes though the six days or creation that are arranged in a poetic/symbolic form that employs structural symmetry: the light is paired with the sun, the moon, and the stars; the sea and sky are paired with the fish and the birds; the land and plants are paired with animals and humans. Literally word for word in this section: “God created man in his image. In the image of God, he created him – male and female he created them”.
Though most believers of the Abrahamic religions consider God to have created the Universe, creation of matter is not actually addressed in the text, only the arrangement of matter. It also doesn’t say “In the beginning”. The definite article is missing from the Hebrew text, but that makes it hard to translate. Maybe it could be something like “when beginning” or very literally “in beginning”.