/* OpSpot — shared data: crew roster, leak ledger, ROI math, pricing, scripts.
   Everything illustrative (example numbers), exported to window for other babel scripts. */

const CAL = 'https://calendly.com/colton-opspot/30min';

/* ---------- The crew ---------- */
/* The named AI employees that handle inbound, end to end. */
const CREW = [
  {
    id: 'courier', name: 'Courier', role: 'The front door',
    c1: 'oklch(0.62 0.20 295)', c2: 'oklch(0.52 0.22 285)', c: 'oklch(0.55 0.22 295)',
    job: 'Answers your calls, chats, and web forms the second they come in. Greets the customer, captures the details, asks the right questions, and replies once it clears review.',
    verbs: ['Answers inbound', 'Captures context', 'Sends approved replies'],
  },
  {
    id: 'recon', name: 'Recon', role: 'The auditor',
    c1: 'oklch(0.60 0.18 245)', c2: 'oklch(0.50 0.20 250)', c: 'oklch(0.55 0.20 245)',
    job: 'Reads your business, your website, and how you actually work — then finds where money is leaking and what each job is really worth.',
    verbs: ['Runs the audit', 'Finds the leak', 'Prices the opportunity'],
  },
  {
    id: 'comms', name: 'Comms', role: 'The writer',
    c1: 'oklch(0.64 0.14 200)', c2: 'oklch(0.54 0.15 210)', c: 'oklch(0.60 0.14 200)',
    job: 'Writes your replies, follow-ups, audit summaries, and proposals in plain language your customers actually read — never robot-speak.',
    verbs: ['Drafts replies', 'Writes follow-ups', 'Plain English'],
  },
  {
    id: 'redpen', name: 'Redpen', role: 'The quality gate',
    c1: 'oklch(0.62 0.20 25)', c2: 'oklch(0.52 0.21 20)', c: 'oklch(0.58 0.20 25)',
    job: 'Checks every message before it reaches your customer — truth, risk, overpromising, privacy, and whether it sounds like you. Nothing important ships without a pass.',
    verbs: ['Checks the facts', 'Kills overpromises', 'Guards your name'],
  },
  {
    id: 'marshal', name: 'Marshal', role: 'The scheduler',
    c1: 'oklch(0.58 0.16 155)', c2: 'oklch(0.50 0.17 150)', c: 'oklch(0.56 0.16 155)',
    job: 'Runs your calendar. Books the job, times the prep, sends the reminders, and chases the no-show until it rebooks.',
    verbs: ['Books the job', 'Sends reminders', 'Rebooks no-shows'],
  },
  {
    id: 'dealdesk', name: 'Deal Desk', role: 'The pricer',
    c1: 'oklch(0.72 0.16 65)', c2: 'oklch(0.64 0.19 48)', c: 'oklch(0.68 0.18 55)',
    job: 'Right-sizes the package. Takes Recon\u2019s value, Teller\u2019s margin math, and Orbit\u2019s strategy and recommends what actually fits the business.',
    verbs: ['Sizes the package', 'Shows the math', 'No overselling'],
  },
  {
    id: 'teller', name: 'Teller', role: 'The numbers',
    c1: 'oklch(0.74 0.13 90)', c2: 'oklch(0.66 0.15 78)', c: 'oklch(0.70 0.14 84)',
    job: 'Runs affordability and margin. What it costs, what it saves, what\u2019s left — so the package pays for itself, on paper, before you sign.',
    verbs: ['Affordability math', 'Margin check', 'Payback in days'],
  },
  {
    id: 'orbit', name: 'Orbit', role: 'The strategist',
    c1: 'oklch(0.54 0.17 275)', c2: 'oklch(0.46 0.18 280)', c: 'oklch(0.52 0.18 275)',
    job: 'Keeps the long view. Which workflow to automate first, what to leave alone, and where the next dollar of operational ROI is hiding.',
    verbs: ['Sequences the work', 'Picks the wedge', 'Plays the long game'],
  },
];

/* ---------- The leak ledger (illustrative) ---------- */
/* Where operational money quietly leaks out of a business. */
const LEAKS = [
  { k: 'missed-calls', label: 'Missed & after-hours calls', detail: 'rings out \u2192 caller dials the next guy', monthly: 4200, fixedBy: 'Courier', recover: 0.78 },
  { k: 'web-forms', label: 'Unanswered web forms', detail: '11 inbound \u00b7 first reply > 6 hrs', monthly: 2600, fixedBy: 'Courier', recover: 0.82 },
  { k: 'quote-followup', label: 'Slow quote follow-up', detail: 'quote sent \u00b7 no second touch', monthly: 5100, fixedBy: 'Comms', recover: 0.7 },
  { k: 'no-shows', label: 'No-shows & rebooking gaps', detail: 'open slot \u00b7 nobody chased it', monthly: 1800, fixedBy: 'Marshal', recover: 0.65 },
  { k: 'stale-estimates', label: 'Stale estimates', detail: 'aging > 14 days \u00b7 going cold', monthly: 3400, fixedBy: 'Comms', recover: 0.6 },
  { k: 'reviews', label: 'Uncollected reviews', detail: 'happy job \u00b7 no ask sent', monthly: 900, fixedBy: 'Comms', recover: 0.55 },
  { k: 'unbilled', label: 'Unbilled completed work', detail: 'job done \u00b7 invoice never raised', monthly: 2900, fixedBy: 'Marshal', recover: 0.85 },
  { k: 'invoice-followup', label: 'Forgotten invoice follow-up', detail: '30+ days \u00b7 no nudge', monthly: 2100, fixedBy: 'Comms', recover: 0.72 },
];

/* ---------- ROI math (illustrative monthly example) ---------- */
const ROI = {
  laborHours: 92,           // hours/mo of admin + inbox + chasing handled
  laborRate: 35,            // $/hr a part-time helper / owner's time
  leakageRecovered: 14800,  // sum of recovered leaks, rounded
  fee: 2500,                // example Growth Ops Employee fee
};

/* ---------- Pricing tiers (placeholders) ---------- */
const TIERS = [
  {
    id: 'starter', name: 'Starter Workflow', price: '$750\u2013$1,500', per: '/mo',
    line: 'One narrow workflow, done right.',
    fit: 'Pick the one leak that hurts most.',
    crew: ['Courier', 'Comms'],
    features: ['1 inbound workflow (calls, forms, or follow-up)', '1\u20132 channels connected', 'Redpen quality gate on every send', 'Receipts on every action', 'Monthly ROI summary'],
  },
  {
    id: 'growth', name: 'Growth Ops Employee', price: '$2,000\u2013$3,500', per: '/mo', popular: true,
    line: '2\u20133 connected workflows working together.',
    fit: 'Where most owners land.',
    crew: ['Courier', 'Recon', 'Comms', 'Redpen', 'Marshal'],
    features: ['Inbound + follow-up + booking, connected', 'Up to 4 channels & tools', 'Recon audits running monthly', 'Marshal owns the calendar', 'Approval gates on anything that matters', 'Weekly receipts + ROI ledger'],
  },
  {
    id: 'managed', name: 'Full Managed AI Employee', price: '$5,000+', per: '/mo',
    line: 'Full operational coverage.',
    fit: 'The work disappears off your plate.',
    crew: ['Courier', 'Recon', 'Comms', 'Redpen', 'Marshal', 'Deal Desk', 'Teller', 'Orbit'],
    features: ['The whole crew, end to end', 'Unlimited connected workflows', 'Custom software where no tool fits', 'Founder on your bridge', 'Quarterly strategy with Orbit', 'Full audit trail, exportable'],
  },
];

/* ---------- Live console feed (hero) ---------- */
const FEED = [
  { who: 'Courier', tag: 'Call', msg: 'After-hours call answered \u00b7 leak inspection booked', cls: 'ok', recovered: 380, c: 'oklch(0.55 0.22 295)' },
  { who: 'Recon', tag: 'Audit', msg: '14 stale estimates found \u00b7 $4.1k at risk flagged', cls: 'live', recovered: 0, c: 'oklch(0.55 0.20 245)' },
  { who: 'Comms', tag: 'SMS', msg: '9 quote follow-ups sent \u00b7 3 replies, 2 booked', cls: 'ok', recovered: 1240, c: 'oklch(0.60 0.14 200)' },
  { who: 'Redpen', tag: 'Review', msg: 'Held $8.4k proposal \u00b7 price claim needs owner sign-off', cls: 'hold', recovered: 0, c: 'oklch(0.58 0.20 25)' },
  { who: 'Marshal', tag: 'Book', msg: 'Rebooked 2 no-shows \u00b7 Tue 9:30, Thu 2:00', cls: 'ok', recovered: 620, c: 'oklch(0.56 0.16 155)' },
  { who: 'Comms', tag: 'Email', msg: '6 invoice nudges sent \u00b7 $2.1k aging recovered', cls: 'ok', recovered: 2100, c: 'oklch(0.60 0.14 200)' },
  { who: 'Courier', tag: 'Form', msg: 'Web form caught in 40s \u00b7 routed to Recon', cls: 'live', recovered: 0, c: 'oklch(0.55 0.22 295)' },
  { who: 'Marshal', tag: 'Bill', msg: 'Flagged 3 completed jobs unbilled \u00b7 invoices raised', cls: 'ok', recovered: 1850, c: 'oklch(0.56 0.16 155)' },
];

/* ---------- Inbound pipeline stops ---------- */
const PIPELINE = [
  { id: 'in', name: 'Inbound', sub: 'call \u00b7 form \u00b7 chat', kind: 'src' },
  { id: 'courier', name: 'Courier', sub: 'catches & captures', crew: 'courier' },
  { id: 'recon', name: 'Recon', sub: 'audits & values', crew: 'recon' },
  { id: 'comms', name: 'Comms', sub: 'writes the reply', crew: 'comms' },
  { id: 'redpen', name: 'Redpen', sub: 'checks & clears', crew: 'redpen' },
  { id: 'marshal', name: 'Marshal', sub: 'books & reminds', crew: 'marshal' },
  { id: 'out', name: 'Receipt', sub: 'booked \u00b7 logged', kind: 'dst' },
];

/* ---------- Courier chat script (scripted, feels real) ---------- */
/* Each step: who speaks, the line, and optional routing badge + delay. */
const COURIER_SCRIPT = [
  { from: 'courier', text: 'Hey \u2014 Courier here, OpSpot\u2019s front door. I catch inbound so nothing slips. What\u2019s the business?', expect: 'business' },
  { from: 'courier', text: 'Got it. And what keeps slipping the most right now \u2014 missed calls, slow follow-up, no-shows, billing?', expect: 'bottleneck' },
  { route: 'recon', text: 'Recon is auditing your inbound and pulling the leak\u2026' },
  { from: 'recon', text: 'Quick read: that one workflow is leaking real money every month. I\u2019ve flagged the dollar size and what\u2019s recoverable.', badge: 'Recon \u00b7 audit done' },
  { route: 'comms', text: 'Comms is drafting a plain-English summary\u2026' },
  { route: 'redpen', text: 'Redpen is checking it for overpromising before you see it\u2026' },
  { from: 'redpen', text: 'Cleared. No inflated claims, no risky promises. Safe to show.', badge: 'Redpen \u00b7 passed' },
  { from: 'courier', text: 'Here\u2019s the honest version: we can plug that leak with one workflow, and Deal Desk will size a package that pays for itself. Want the audit + a right-sized quote?', cta: true },
];

Object.assign(window, { CAL, CREW, LEAKS, ROI, TIERS, FEED, PIPELINE, COURIER_SCRIPT });
