More JS refactoring, improving page resize responsiveness with CSS