def calculate_quality_score(site_copy: dict, brand: dict, hero_image_url: str = None, augment_count: int = 0) -> float:
    score = 0.0
    max_score = 100.0

    if site_copy.get("headline"):
        score += 5
    if site_copy.get("subheadline"):
        score += 5
    if site_copy.get("about"):
        score += 8

    features = site_copy.get("features", [])
    if isinstance(features, list) and len(features) > 0:
        score += min(len(features) * 2, 12)

    faq = site_copy.get("faq_items", site_copy.get("faq", []))
    if isinstance(faq, list) and len(faq) > 0:
        score += min(len(faq) * 1.5, 9)

    testimonials = site_copy.get("testimonials", [])
    if isinstance(testimonials, list) and len(testimonials) > 0:
        score += min(len(testimonials) * 2, 8)

    pricing = site_copy.get("pricing_tiers", site_copy.get("pricing_plans", []))
    if isinstance(pricing, list) and len(pricing) > 0:
        score += 10

    hiw = site_copy.get("how_it_works_steps", [])
    if isinstance(hiw, list) and len(hiw) > 0:
        score += 8

    comp = site_copy.get("comparison_table", {})
    if isinstance(comp, dict) and comp.get("headers"):
        score += 7

    if hero_image_url:
        score += 10

    options = brand.get("options", [])
    if options:
        score += 5
    if brand.get("color_primary"):
        score += 3

    if augment_count > 0:
        score += min(augment_count * 2.5, 10)

    return min(score, max_score)


def quality_badge_tier(score: float) -> str:
    if score >= 90:
        return "legendary"
    elif score >= 65:
        return "premium"
    elif score >= 40:
        return "standard"
    else:
        return "basic"
