Dreamt the night ending 2025-02-02
I was in a bedroom with blue carpet and sun coming in through the window, making the whole room fairly bright. It had a mostly-empty closet along one side that you could walk into, and in this closet was a ghost, who looked like a normal person, standing on the floor, except semi-transparent. This ghost was the result of a spell that I knew about, which let people make a ghost duplicate of themselves and talk to other people as this ghost. (If you're familiar with El Goonish Shive, think of the fairy doll spell from that, except ghost instead of fairy.)
Ghosts made this way had limited shapeshifting abilities, in that they couldn't look like someone else, but they could briefly change shape or do normally–physically-impossible things as a way of showing emotions or acting stuff out, although they looked sort of like a computer program glitching when they did this.
The ghost spell could be (and often was) used by people who were alive, but it could also be cast from the afterlife to talk to people who were still living. When people got to the afterlife, there were people leading them where they needed to go and giving them some sort of orientation, and one of the things they did was teach people this spell, so it was a bit more common to see ghosts made by people who had died, hence the connection between ghosts and death. However, people could only cast it for a few years after they died; after they'd been dead long enough, they'd go deeper underground where the spell would no longer work.
At the end of the dream, the spell stopped being real, and instead was a story idea I'd come up with, and I was trying to work out how things could work.