What is the CSS calc() function, and how is it used for dynamic layouts?

calc() performs calculations within CSS, allowing for responsive adjustments like width: calc(100% - 50px);.