# Trymito.io Cursor Rules

## Engineering Principles

### Mobile First
The structure of the codebase is mobile first! Specifically, if you removed all of the css code inside of the media queries, you'd be left with a mobile-only website. This approach worked well because basic, non-formatted HTML is mobile friendly, so if we designed the desktop version first, actually, we are adding css that makes the website non-mobile friendly, and then in the media queries, we're remaking it mobile friendly. Its a waste of code. 

When using media queries to add desktop-specific styling, you should use the desktop cutoff at 50em.

### Media layouts 

For any section with images, video, or a card grid, set aspect-ratio on media containers and max-width on the section container from the start. Relying only on max-height or flexible rows tends to cause stretched or distorted media and extra fix iterations.

### Grids / Card layouts

- When creating grids, unless there is a good reason, prefer flex + wrap over fixed grid columns. Cards will then wrap by space; fewer per row on small screens, more on wide. Tune `min-width` at 40em / 50em if needed.
- Make sure to use flex-grow and flex-shrink to make sure the cards are consistent sizes.

### Visibility (show/hide by viewport)

Instead of using js to check the viewport size (e.g. `useIsMobile`), we use css media queries to show and hide elements based on the viewport size.

- **Hide on mobile:** `className="only-on-desktop"` (or `only-on-desktop-inline-block`). See `styles/globals.css`: hidden by default, visible at 50em.
- **Show only on mobile:** `only-on-mobile`, `only-on-mobile-block`, `only-on-mobile-inline-block`.

### Assets 
- All icons should be stored in the public folder. Do not use a src from another website like 'https://openrouter.ai/images/icons/DeepSeek.png'. Instead, download the icon and store it in the public folder.

## Validating website changes
- Check wide desktop, medium, small, and mobile. Confirm nothing overlaps and visibility matches intent at each size.


