import type { BusinessModel, MetricDefinition } from "@/content/types";

export const metricsSection = {
  title: "Clicks aren't the objective. Economics are.",
  intro:
    "Ad platforms report what's easy to count. Businesses run on what they can bank. We connect channel performance to the metrics that decide whether growth is worth paying for.",
  footnote: "Illustrative data for explanation only. Not client results or benchmarks.",
};

export const metricsByModel: Record<BusinessModel, MetricDefinition[]> = {
  saas: [
    {
      code: "CAC",
      name: "Customer acquisition cost",
      definition: "What it costs to win one customer, fully loaded the way you choose.",
      decision: "How far each channel can scale before payback breaks.",
    },
    {
      code: "SQLs",
      name: "Sales-qualified leads",
      definition: "Leads your sales team accepts as worth working.",
      decision: "Which campaigns earn budget, beyond raw form fills.",
    },
    {
      code: "Pipeline",
      name: "Pipeline created",
      definition: "Opportunity value sourced or influenced by marketing.",
      decision: "Where to shift spend by segment, offer, and channel.",
    },
    {
      code: "Demo→Opp",
      name: "Demo-to-opportunity rate",
      definition: "The share of booked demos that become real opportunities.",
      decision: "Whether targeting and messaging attract buyers or browsers.",
    },
    {
      code: "Trial→Paid",
      name: "Trial-to-paid rate",
      definition: "The share of trials that convert to paying accounts.",
      decision: "Whether acquisition should push trials, demos, or both.",
    },
    {
      code: "LTV:CAC",
      name: "LTV to CAC ratio",
      definition: "Customer lifetime value compared with the cost to acquire.",
      decision: "How hard to invest in growth, and in which segments.",
    },
    {
      code: "Velocity",
      name: "Pipeline velocity",
      definition: "How quickly pipeline turns into revenue.",
      decision: "Where deals stall, and which sources bring faster-closing buyers.",
    },
  ],
  ecommerce: [
    {
      code: "MER",
      name: "Marketing efficiency ratio",
      definition: "Total revenue divided by total marketing spend.",
      decision: "Whether overall spend is working, whatever each platform claims.",
    },
    {
      code: "ROAS",
      name: "Return on ad spend",
      definition: "Attributed revenue per unit of ad spend, by platform or campaign.",
      decision: "How to allocate budget within a channel.",
    },
    {
      code: "CAC",
      name: "Customer acquisition cost",
      definition: "What it costs to acquire one new customer.",
      decision: "What a first order needs to earn back.",
    },
    {
      code: "AOV",
      name: "Average order value",
      definition: "Average revenue per order.",
      decision: "Which bundles, thresholds, and offers to test.",
    },
    {
      code: "CVR",
      name: "Conversion rate",
      definition: "The share of sessions that end in an order.",
      decision: "Where the site loses buyers, by device and page type.",
    },
    {
      code: "RPR",
      name: "Repeat purchase rate",
      definition: "The share of customers who order again.",
      decision: "How much retention can lift lifetime value.",
    },
    {
      code: "LTV",
      name: "Customer lifetime value",
      definition: "Gross margin a customer generates over time.",
      decision: "The acquisition cost you can afford to pay.",
    },
    {
      code: "CM",
      name: "Contribution margin",
      definition: "Revenue left after COGS, shipping, fees, returns, and marketing.",
      decision: "Whether growth is profitable, not just bigger.",
    },
  ],
};

export const metricCharts = {
  saas: {
    title: "Cheap leads vs. real pipeline",
    caption: "Campaign A wins on cost per lead. Campaign B wins on pipeline. We optimize for B.",
    stages: ["Leads", "SQLs", "Opportunities", "Closed-won"],
    series: [
      { name: "Campaign A", values: [1, 0.34, 0.16, 0.05] },
      { name: "Campaign B", values: [0.62, 0.42, 0.29, 0.12] },
    ],
  },
  ecommerce: {
    title: "Platform ROAS vs. blended MER",
    caption: "Platform ROAS can climb while blended efficiency stays flat. The gap is where budget decisions go wrong.",
    platformRoas: [0.42, 0.45, 0.47, 0.5, 0.53, 0.55, 0.59, 0.62, 0.64, 0.68, 0.71, 0.74],
    blendedMer: [0.4, 0.41, 0.4, 0.41, 0.4, 0.39, 0.4, 0.39, 0.38, 0.39, 0.38, 0.37],
    contributionMargin: [0.62, 0.6, 0.61, 0.58, 0.57, 0.55, 0.53, 0.52, 0.5, 0.47, 0.46, 0.44],
  },
};
