# Discovery Report Generation Task

You are generating a beautiful, data-driven HTML report from Discovery phase artifacts.

## Your Task

1. Read ALL discovery artifacts in the provided directory:
   - `brief.md` — Product brief and opportunity overview
   - `competitors.md` — Competitor analysis
   - `target-market.md` — Market sizing and personas
   - `prd.md` — Product requirements document
   - `user-stories.md` — User stories and features
   - `opportunity-score.md` — Scoring breakdown (if exists)

2. Analyze and extract:
   - Product name and description
   - Opportunity score and breakdown
   - Market size (TAM/SAM/SOM)
   - Number of competitors analyzed
   - Key competitor names and their weaknesses
   - Target personas (names, roles, pain points)
   - Number of user stories by priority
   - Key features (P0 features)
   - Success metrics
   - Risks and open questions

3. Generate `discovery-report.html` with the extracted insights

## HTML Report Requirements

### Structure
```html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>{Product Name} - Discovery Report</title>
  <style>
    /* All CSS inline - no external dependencies */
  </style>
</head>
<body>
  <!-- Report content -->
</body>
</html>
```

### Required Sections

1. **Header**
   - Product name (large)
   - "Discovery Report" subtitle
   - Generation date
   - Opportunity score badge (colored based on score)

2. **Executive Summary Card**
   - 2-3 sentence overview of the opportunity
   - Pull from brief.md "The Opportunity" section

3. **Metrics Dashboard** (grid of stat cards)
   - Opportunity Score: X.X/5.0 (with visual indicator)
   - Market Size: $XXM TAM
   - Competitors: X analyzed
   - User Stories: X total
   - P0 Features: X must-have

4. **Score Breakdown** (if opportunity-score.md exists)
   - Visual bars or progress indicators for each factor:
     - Market Size
     - Growth Trend
     - Problem Clarity
     - Competition Gap
     - Symph Fit
   - Color code: green (4+), yellow (3-4), red (<3)

5. **Market Opportunity**
   - TAM/SAM/SOM with visual representation
   - Geographic focus
   - Growth trend indicator

6. **Competitive Landscape**
   - Cards for top 3-5 competitors
   - Each card shows: Name, Strengths (green), Weaknesses (red), Our Advantage (accent)

7. **Target Personas**
   - Visual cards for each persona
   - Include: Name, Role, Key Pain Point, Quote (if available)
   - Use avatar placeholder with initials

8. **Feature Priorities**
   - P0 features in accent color
   - P1 features in muted style
   - Show count for each priority

9. **Key Insights** (bullet list with icons)
   - 5-7 most important takeaways
   - Use ✓ for opportunities, ⚠ for risks, 💡 for insights

10. **Recommendations**
    - Clear next steps
    - Numbered list with priority

11. **Risks & Open Questions**
    - Risk items with severity indicator
    - Open questions that need answers

### Design Specifications

```css
:root {
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --border: #262626;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --accent: #d4ff00;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --blue: #3b82f6;
  --purple: #a855f7;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 2rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.score-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.badge-green { background: rgba(34, 197, 94, 0.2); color: var(--green); }
.badge-yellow { background: rgba(234, 179, 8, 0.2); color: var(--yellow); }
.badge-red { background: rgba(239, 68, 68, 0.2); color: var(--red); }
.badge-accent { background: rgba(212, 255, 0, 0.2); color: var(--accent); }

h1, h2, h3 { margin: 0 0 1rem 0; }
h1 { font-size: 2.5rem; }
h2 { font-size: 1.5rem; color: var(--text-muted); border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }

.persona-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.persona-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.competitor-card {
  border-left: 3px solid var(--border);
  padding-left: 1rem;
}

.insight-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.insight-icon {
  font-size: 1.25rem;
  line-height: 1.5;
}

@media print {
  body { background: white; color: black; }
  .card { border: 1px solid #ddd; }
}
```

## Output

Write the complete HTML file to: `discovery-report.html` in the same directory as the artifacts.

## Quality Checklist

Before finalizing:
- [ ] All data is extracted from actual artifacts (no placeholders)
- [ ] Numbers are accurate (market size, counts, scores)
- [ ] Design matches the dark theme specification
- [ ] HTML is valid and self-contained
- [ ] Responsive on mobile
- [ ] Print-friendly
