Grazing and Border-Collision in Piecewise-Smooth Systems: A Unified Analytical Framework | Synapse