Is it ironic that the site is not mobile friendly?
Sure is. Sorry about that, the overflow has been fixed now.
Literally yesterday I wrote some css with calc(min(upper bound, max(lower bound, X))) in it and now I feel slightly silly.
calc(min(upper bound, max(lower bound, X)))
Yours works in IE back to 9 though! Much better.