The math of CSS locks