--- description: Conventions for building and editing the Next.js + Tailwind CSS marketing landing page (App Router, TypeScript) globs: app/**/*.tsx, app/**/*.ts, components/**/*.tsx, app/globals.css, tailwind.config.* alwaysApply: false --- # Next.js + Tailwind landing page rules You are working on a single marketing landing page built with Next.js (App Router), TypeScript and Tailwind CSS. The goal is a fast, accessible, mobile-first page that converts visitors into sign-ups. Keep it simple. ## Project facts (edit these) - Product: [PRODUCT NAME] — [ONE-SENTENCE VALUE PROPOSITION] - Primary call to action: [e.g. "Join the waitlist"] -> [form endpoint or URL] - Brand colors: [primary hex], [accent hex], [background hex] - Font: [font name, loaded with next/font] - Package manager: [npm | pnpm | yarn | bun] - Before you change versions or config, read package.json and the existing Tailwind setup to see which Next.js and Tailwind versions this project uses, and follow the conventions of those versions. ## Structure - The page lives in `app/page.tsx`. Each section is its own component in `components/sections/` (Hero, Features, HowItWorks, Pricing or Social proof, FAQ, FinalCTA, Footer). - Shared UI pieces (Button, Container, Section heading) live in `components/ui/`. - Put all page copy in one file, `content/site.ts`, as typed constants. Components import copy from there, so text can be edited without touching layout. - Use Server Components by default. Add `"use client"` only to components that need state, effects or browser APIs (for example a mobile menu or an FAQ accordion), and keep those components small. - Do not add new dependencies without asking first. Prefer plain Tailwind and native HTML elements (for example `
` for an FAQ). ## Styling - Use Tailwind utility classes only. Do not create CSS modules or inline `style` attributes unless a value cannot be expressed in Tailwind. - Mobile first: write base classes for small screens, then add `sm:`, `md:` and `lg:` overrides. - Use one consistent spacing scale for sections (for example `py-16 md:py-24`) and one container width (for example `max-w-6xl mx-auto px-4`). - Keep colors in the Tailwind theme (or CSS variables) instead of repeating raw hex values in components. - When classes conflict or get long, extract a component instead of building long conditional class strings. ## Performance - Use `next/image` for every image, with explicit `width` and `height` (or `fill` plus a sized parent) and a meaningful `alt`. Mark only the hero image as `priority`. - Load fonts with `next/font`. Do not link to external font stylesheets. - No client-side data fetching for static content. The landing page should render fully on the server. - Avoid heavy animation libraries. Prefer CSS transitions, and respect `prefers-reduced-motion` (use the `motion-safe:` and `motion-reduce:` variants). ## Accessibility - One `

` per page (in the Hero). Section headings use `

`, in order. - Use semantic landmarks: `
`, `
`, `
`, `