Task: Add "Slogan Generator" (Phase 1) connected to Nova (GPT-4) via backend proxy

Context
- We’re keeping Phase 1 focused on the Business Development Kit.
- Add a new Slogan Generator (Lite free, Pro paid).
- Connect to Nova (GPT-4) via our backend proxy. We cannot connect to the assistant directly.

Frontend
1) Routing & Nav
- Add a new page at route: /brand/slogan
- Sidebar: under “Brand Kit”, insert “Slogan Generator” between “Business Name” and “Colors”
- Feature flag: SHOW_SLOGAN_GENERATOR = true (env-driven). If false, hide nav + route.

2) Page: src/pages/Slogan/SloganPage.tsx
- Layout:
  - H1 “Slogan Generator”
  - Description text: “Craft a memorable tagline that fits your brand’s voice.”
  - Form controls:
    - Brand Name (text, required)
    - Brief Description (textarea, optional; ~200 chars max)
    - Tone (select: Professional, Playful, Bold, Minimal, Luxury, Friendly)
    - Industry (text, optional, free-form)
    - Audience (text, optional, free-form)
  - Buttons:
    - Generate (primary)
    - Clear (secondary)
  - Results area:
    - For free users: show exactly 1 result + watermark “Free preview”
    - For paid users: show 8 results (deduplicate similar lines).
    - Each result row: text + “Copy” button + tiny “👍/👎” feedback icons
  - Upgrade CTA (only for free users): “Unlock more taglines, tones, and export options—Upgrade”
    - Clicking CTA opens PaywallModal.

- Behavior:
  - On Generate:
    - Disable inputs, show loading shimmer.
    - Call sloganService.generate({ brandName, description, tone, industry, audience })
    - If not subscribed and results >1 are requested, clamp to 1 and show CTA.
  - On Clear: reset form + results.
  - Keyboard: Enter triggers Generate when focus is in the form.

- Empty states & errors:
  - If brand name is empty, show inline validation: “Brand name is required”.
  - If API error, show inline alert: “Couldn’t reach Nova right now. Please try again.”

- Styling:
  - Match existing Brand Kit pages.
  - Ensure mobile-friendly layout with stacked fields.

3) Service: src/services/ai/slogan.ts
- Export type:
  export type SloganRequest = {
    brandName: string;
    description?: string;
    tone?: "Professional"|"Playful"|"Bold"|"Minimal"|"Luxury"|"Friendly";
    industry?: string;
    audience?: string;
    maxResults?: number; // default 8 for paid; 1 for free
  };
  export type SloganResponse = { suggestions: string[] };

- Export function:
  export async function generate(req: SloganRequest): Promise<SloganResponse> {
    POST /api/ai/slogan with JSON body = req
  }

4) Paywall integration
- Use existing paywall gate:
  - If user is free: pass maxResults=1 and display CTA beneath the single result.
  - If user is paid: maxResults=8.
  - Add guard in UI: a “Generate more” button (visible only for free users) opens PaywallModal.

Backend
1) Endpoint: /api/ai/slogan  (Node/Express or our existing API pattern)
- File: server/routes/ai/slogan.ts (or equivalent)
- Accept JSON body:
  {
    brandName: string,
    description?: string,
    tone?: string,
    industry?: string,
    audience?: string,
    maxResults?: number
  }

- Validate:
  - 400 if brandName missing/blank.
  - maxResults clamp: [1..12], default 8.

- Compose prompt (system + user):
  - system: “You are Nova, an expert brand strategist. Generate short, memorable taglines with punch. Avoid clichés and trademarked phrases.”
  - user (template):
    ```
    Brand name: {{brandName}}
    Brief description: {{description || "N/A"}}
    Tone: {{tone || "Professional"}}
    Industry: {{industry || "General"}}
    Audience: {{audience || "General"}}

    Produce {{maxResults}} distinct slogan/tagline options.
    Constraints:
    - Max 7 words each (prefer 3–6).
    - Avoid rhymes unless tone=Playful.
    - No placeholder words.
    - No quotes, no numbering, return as a JSON array of strings ONLY.
    ```

- Call Nova (GPT-4) via OpenAI SDK or our proxy client:
  - Model: gpt-4o-mini or gpt-4 (as configured for Nova).
  - Temperature: 0.8
  - Top_p: 0.9
  - Max tokens: sized for output.
  - Parse model response as JSON array of strings. If parsing fails, retry once with “Return valid JSON array only.”

- Response:
  { suggestions: string[] } (deduplicate similar options server-side via case-insensitive compare + Levenshtein ~0.85 cutoff if available; else simple uniqueness).

- Safety:
  - Trim whitespace, remove trailing punctuation-only lines.
  - Rate-limit: 30 req/min/IP (env-configurable).
  - Log events: ai.slogan.requested, ai.slogan.succeeded, ai.slogan.failed (no PII).

2) Config / Env
- Use OPENAI_API_KEY or NOVA_API_KEY from process.env.
- Fail fast if key missing; return 503 with message “AI temporarily unavailable”.

3) Tests (basic)
- Unit test: missing brandName → 400
- Valid request → array with length=maxResults
- Free clamp to 1 (simulate via mock isPaid=false)

Auth & Paywall
- Reuse existing isPaid flag from user session/profile.
- Backend should accept maxResults but also enforce server-side cap:
  - if !isPaid → maxResults=1
  - if isPaid → maxResults=min(requested, 8)

Analytics
- On Generate click → track("slogan_generate_clicked", { isPaid, tone })
- On Success → track("slogan_generate_success", { count: suggestions.length })
- On Copy → track("slogan_copy", { index })
- On Feedback → track("slogan_feedback", { index, upvote: true|false })
- On Upgrade CTA → track("paywall_opened", { source: "slogan" })

Copy (UX)
- Title: “Slogan Generator”
- Subtitle: “Craft a memorable tagline that fits your brand’s voice.”
- Free CTA: “Unlock 7 more options, advanced tones, and export—Upgrade”
- Empty state: “Describe your brand and tone to generate a punchy tagline.”
- Error: “Couldn’t reach Nova. Please try again.”

Acceptance Criteria
- “Slogan Generator” visible in sidebar and reachable at /brand/slogan when SHOW_SLOGAN_GENERATOR=true.
- Free users receive exactly 1 slogan with an upgrade CTA.
- Paid users receive 8 distinct slogans.
- Copy-to-clipboard works on each suggestion.
- Thumbs up/down events are recorded.
- Backend enforces caps server-side and returns JSON { suggestions }.
- Graceful error states and loading shimmer are present.
- No references to hidden Phase 2 items (website, hosting, social kits).

Nice-to-haves (if quick)
- “Regenerate” button re-calls with same inputs.
- “Refine” field that appends a short tweak instruction and regenerates.
- Simple dedupe to avoid near-identical lines.

Please implement end-to-end and open a PR titled:
“feat(slogan): Phase 1 Slogan Generator (Nova GPT-4, paywall aware)”
