The best video I've found for explaining the magic system is
this one (with most of it covered in the first 10 minutes).
Basically you can collect 8 different "essences" and 5 different "stones". Via "alchemy" you can combine 1 essence and 1 stone to create a "material". Essences and stones have 5 levels ("grades" A through F, A being highest), and materials have 5 levels as well (which depends on the levels of the essence and stone used to make the material). Each material provides one or more effects, with higher level materials providing greater effect. You can also find materials, and (I think - it wasn't in the video but is described
here) use alchemy to break materials apart into essence + stone so you make different materials.
You can then apply up to 3 materials each to four places (to combine their effects): Robe, spell #1, spell #2, wand. (These are not all unlocked at the start. Wand doesn't consume mana like spells, but is weaker than spells. If you "level up" these things they can use 4 materials each instead of 3. Don't know if it can go to 5.) Effects seem to be of the same type for wand and spells, but different (yet related) for robes. (This difference seems to primarily be because wands and spells are "when used" type items while robes are a "when worn" item.) Multiple instances of the same material can be stacked if you want to (somewhat) increase that effect rather than adding different effects.
Some effects may not play nice together (at least, may not do what you would think before combining them - in the video one of the combinations he tried resulted in one effect seemingly cancelled out entirely).
There is also an "enchant" option (that you can toggle on/off) on robes/spells/wand that takes away damage capability but improves other aspects.
(There are also artifacts that provide other abilities, but AFAICT you can't apply materials/effects to artifacts - you just use them as you find them.)
You can't change any of this stuff while actually fighting in a level, but can change it at-will otherwise.