Detect viewport sizes through CSS media queries and JavaScript