Every grid item gets a bottom-right and top-left corner with before and after pseudo elements. All the edges get their extra corners by adding pseudo elements on second nested div.