Metamorphism is the change of minerals or geologic texture (distinct arrangement of minerals) in pre-existing rocks (protoliths), without the protolith melting into liquid magma (a solid-state change). The change occurs primarily due to heat, pressure, and the introduction of chemically active fluids. The chemical components and crystal structures of the minerals making up the rock may change even though the rock remains a solid. Changes at or just beneath Earth's surface due to weathering or diagenesis are not classified as metamorphism. Metamorphism typically occurs between diagenesis (maximum 200°C), and melting (~850°C).