Cursor prompt

Add Dark Mode with CSS Variables

Implement theme switching with CSS custom properties, localStorage persistence, system preference detection, and flash-free loading.

Add dark mode to {{project_name}} using CSS custom properties.

## Framework: {{framework}}
## Current Styling: {{styling}}

### Theme Token System
Define all colors as CSS variables in :root (light) and [data-theme="dark"]:
```css
:root {
  --color-bg: #ffffff;
  --color-surface: #f9fafb;
  --color-text: #111827;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
}
[data-theme="dark"] {
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-text: #f8fafc;
  --color-text-muted: #94a3b8;
  --color-border: #334155;
  --color-primary: #818cf8;
  --color-primary-hover: #6366f1;
}
```

### Theme Provider
- Read from localStorage on mount; detect system preference as fallback
- Apply by setting data-theme on <html> element
- Listen for system preference changes via matchMedia
- Expose: { theme, setTheme, toggleTheme }

### Flash Prevention (Critical — inline in <head>)
```html
<script>
  const t = localStorage.getItem('theme') ||
    (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
  document.documentElement.setAttribute('data-theme', t);
</script>
```

### Theme Toggle Component
Animated sun/moon icon with smooth transition, proper aria-label.

### Transition (no jarring switches)
```css
* { transition: background-color 200ms, color 200ms, border-color 200ms; }
```

### Output
CSS token file, ThemeProvider, toggle component, flash-prevention script, Tailwind config update.

Fill in: {{project_name}}, {{framework}}, {{styling}}. In Loopy you fill these in a form and copy the finished prompt in one click.