// CONSTANTS — shared across all variations
// Brand Ambassador terms pulled straight from v3 copy.
// Never change the orb gradient; it is the product mark.

window.BRAND = {
  orbSrc: (window.__resources && window.__resources.orbImg) || 'https://pub-d2c40d7e49a640ee994468fa70621189.r2.dev/apex-orb-hd.png',
  videoSrc: (window.__resources && window.__resources.heroVideo) || 'https://apex-video-proxy.apex-os.workers.dev/webinar-booking.mp4',

  // Gradient is locked on the orb. Accents derive from it.
  gradient: 'linear-gradient(135deg,#7c3aed 0%,#6366f1 50%,#3b82f6 100%)',
  gradientSoft: 'linear-gradient(135deg,rgba(124,58,237,0.12),rgba(59,130,246,0.08))',
  purple: '#7c3aed',
  indigo: '#6366f1',
  blue: '#3b82f6',

  // Brand Ambassador deal — from v3
  priceNow: 97,
  priceAfter: 997,
  dealCutoffISO: '2026-07-07T23:59:59-07:00',
  dealCutoffLabel: 'July 7',

  // Founding Ambassador movement — 30,000 seats total
  ambassadorCap: 30000,
  // We'll animate toward this so it feels live but caps out honestly
  ambassadorTaken: 18427,

  // Proof numbers straight from the walkthrough (page 18)
  proof: {
    objection: { pct: 87, label: 'Objection Handling', note: 'Improvement after 30 days of Level Up training.' },
    listing:   { pct: 64, label: 'Listing Conversion', note: 'Lift once agents reach Green Belt.' },
    production:{ pct: 142, label: 'Production Increase', note: 'Commission growth for Black Belt agents, Y1.' },
  },

  // Replaceable-stack pricing from p.39
  stackItems: [
    { k:'marketing', label:'Marketing Agency',         cost: 900,  pre:true  },
    { k:'crm',       label:'CRM Software',              cost: 300,  pre:true  },
    { k:'tasks',     label:'Task Management',           cost: 50,   pre:false },
    { k:'social',    label:'Social Media Agency',       cost: 800,  pre:true  },
    { k:'va',        label:'Virtual Assistant',         cost: 4000, pre:true  },
    { k:'coach',     label:'Sales Coaching',            cost: 5000, pre:false },
    { k:'dialer',    label:'Dialer Service',            cost: 100,  pre:true  },
    { k:'leads',     label:'Lead Gen Software',         cost: 200,  pre:true  },
    { k:'email',     label:'Email Marketing Platform',  cost: 100,  pre:false },
    { k:'video',     label:'Video Creation Tools',      cost: 50,   pre:false },
    { k:'cal',       label:'Calendar Tools',            cost: 50,   pre:false },
  ],
  apexStack: 117, // $97 membership + $20 dedicated line

  // Affiliate math from p.40 — $97 residual per referred agent
  affiliate: { residualPerAgent: 97 },

  guarantee: { pct: '200%', window: '90 days' },
};

window.HEADLINES = {
  'I-have-to-see': {
    kicker: 'Brand Ambassador · Private walkthrough',
    main: ['You\'re about to see', 'the thing every agent', 'is going to be using.'],
    sub: '45 minutes. Live. No pitch. Either you walk out with the tool that runs your business — or you walk out with the best real-estate tech tour you\'ll ever get. Either way we\'re good.',
  },
  '3x': {
    kicker: 'Brand Ambassador · Apex OS',
    main: ['Sell 3× more homes.', 'With 3× less stress.', 'And 3× less effort.'],
    sub: 'Apex is the first AI operating system built for real estate agents. Watch it live — 45 minutes, no pitch, no fluff.',
  },
  'unfair': {
    kicker: 'Private, invite-only',
    main: ['The unfair advantage', 'every agent in your market', 'is about to have.'],
    sub: 'Brand Ambassador pricing closes July 7. After that, this page shows a $997/mo price tag. Today, $97/mo — for life.',
  },
  'demo': {
    kicker: 'Live walkthrough · 45 minutes',
    main: ['Watch Apex run', 'a real agent\'s business.', 'Live, on Zoom.'],
    sub: 'Bring a cold lead, a listing appointment, a buyer you lost last week. We\'ll show you exactly how Apex would have handled each one.',
  },
};

window.SURFACES = {
  light: {
    bg: '#fafafa',
    card: '#ffffff',
    ink: '#0b0b14',
    mute: '#5b6473',
    dim: '#8a94a6',
    border: 'rgba(11,11,20,0.08)',
    borderStrong: 'rgba(11,11,20,0.16)',
    shadow: '0 4px 20px rgba(11,11,20,0.06)',
    shadowLg: '0 20px 60px rgba(11,11,20,0.12)',
    glow: '0 10px 40px rgba(124,58,237,0.28)',
    heroBg: '#ffffff',
    breakBg: '#f4f4f7',
  },
  obsidian: {
    bg: '#05050a',
    card: '#0f0f18',
    ink: '#f4f4f7',
    mute: '#9aa3b2',
    dim: '#5b6473',
    border: 'rgba(255,255,255,0.08)',
    borderStrong: 'rgba(255,255,255,0.16)',
    shadow: '0 4px 24px rgba(0,0,0,0.4)',
    shadowLg: '0 30px 80px rgba(0,0,0,0.6)',
    glow: '0 10px 40px rgba(124,58,237,0.45)',
    heroBg: 'radial-gradient(ellipse at 50% -10%, rgba(124,58,237,0.22) 0%, transparent 55%), #05050a',
    breakBg: '#0a0a12',
  },
  editorial: {
    bg: '#f6f2ec',
    card: '#ffffff',
    ink: '#1a1511',
    mute: '#6b6258',
    dim: '#a39a8f',
    border: 'rgba(26,21,17,0.1)',
    borderStrong: 'rgba(26,21,17,0.2)',
    shadow: '0 4px 20px rgba(26,21,17,0.06)',
    shadowLg: '0 20px 60px rgba(26,21,17,0.1)',
    glow: '0 10px 40px rgba(124,58,237,0.22)',
    heroBg: '#f6f2ec',
    breakBg: '#ede6dc',
  },
};

// Live toast content — same tone as v3
window.TOAST_PEOPLE = [
  {n:'Sarah M.',c:'Dallas, TX'},{n:'Marcus T.',c:'Phoenix, AZ'},{n:'Jessica R.',c:'Miami, FL'},
  {n:'David K.',c:'Atlanta, GA'},{n:'Amanda L.',c:'Denver, CO'},{n:'Michael S.',c:'Seattle, WA'},
  {n:'Rachel P.',c:'Nashville, TN'},{n:'James C.',c:'Charlotte, NC'},{n:'Lauren W.',c:'Austin, TX'},
  {n:'Tyler B.',c:'San Diego, CA'},{n:'Priya N.',c:'Chicago, IL'},{n:'Brandon D.',c:'Tampa, FL'},
  {n:'Alex H.',c:'Las Vegas, NV'},{n:'Emily V.',c:'Portland, OR'},{n:'Ryan F.',c:'Boston, MA'},
  {n:'Jordan A.',c:'Raleigh, NC'},{n:'Nikki G.',c:'Orlando, FL'},{n:'Chris W.',c:'Salt Lake City'},
];
window.TOAST_ACTIONS = [
  'locked in a seat',
  'booked the 4 PM session',
  'just joined as an ambassador',
  'grabbed the $97 rate',
  'booked tomorrow\'s session',
];

// Chapter content — condensed from v3
window.CHAPTERS = [
  {
    num: '01',
    label: 'Closes With You',
    title: 'Apex closes <em>with</em> you.',
    lede: 'Hands-free, in real time, while you focus on the client.',
    items: [
      ['Apex Assist','Listens on sales calls and in-person presentations. Updates your CRM, sends contracts, schedules photographers, follows up — while you talk.'],
      ['Apex CRM','Mobile-first, voice-driven. Pulls in your leads and transaction history. Pipeline updates itself from your conversations.'],
      ['Apex Dialer','3–10 outbound lines. "Apex, call the lady with the German Shepherd I met yesterday." Turns dead time into commission time.'],
      ['Voice Commands','"Send Jane 3-bedrooms in Westlake under $750K with pools." Say it mid-conversation. Apex does it.'],
      ['Listing Workflow','Apex hears you close. Sends the agreement, schedules photos, drafts the MLS listing for your approval. You close — Apex coordinates.'],
    ],
  },
  {
    num: '02',
    label: 'Trains You To Win',
    title: 'Apex makes you <em>sharper</em>.',
    lede: 'AI training that drills, ranks, and taps you on the shoulder mid-conversation.',
    items: [
      ['Level Up','Apex analyzes your real client conversations, flags your weakest moments, drills the re-frames until they\'re second nature.'],
      ['Belt Ranking','White → Gold → Onyx → Obsidian. Earned through skill — can be lost if skills slip. Powerful incentive to stay sharp.'],
      ['Apex Life','Your dream car, vacation, debt-freedom date. Apex maps exactly how many deals per month to hit each goal. Your why, front and center.'],
      ['Apex Mindset','Rohn, Robbins, Ziglar, Nightingale. AI burnout detection. Ten pages of reading a day, tracked daily.'],
    ],
  },
  {
    num: '03',
    label: 'Markets For You',
    title: 'Apex runs your <em>marketing</em>.',
    lede: 'Content, ads, client experience, presentation — on-brand and automatic.',
    items: [
      ['Apex Social','AI-scripted posts with teleprompter. Just-Listed and open-house posts with one tap. Scheduled everywhere. Performance analytics.'],
      ['Apex Ads','Meta, Google, TikTok, LinkedIn — one portal. AI optimizes budget. Booked qualified calls drop on your calendar. Replaces your agency.'],
      ['Client Apps','"Dating-app" swipe home search. Financial tools, credit dashboards, in-app signing and notary. Your lender and photographer built in.'],
      ['Apex Style','Outfit analysis. Virtual wardrobe. One-tap hair, nails, spa booking that adjusts around your calendar.'],
    ],
  },
  {
    num: '04',
    label: 'Pays You Back',
    title: 'Apex <em>pays you</em> back.',
    lede: 'Health, team power, transaction coordination, affiliate income, plus the 90%-off-for-life Ambassador deal.',
    items: [
      ['Apex Health','Oura ring integration, mobile IV, NAD+ and vitamins, at-home hormone testing, AI supplement protocols. Peak body → peak closes.'],
      ['Apex TC','Flat $400/deal vs. the typical $600–800. Auto commission splits, cap tracking, compliance handled.'],
      ['Apex Affiliate','Every agent you refer pays you residually — for life. Wallet + physical card. Pay ads and SMS out of your balance.'],
      ['Team + Broker','Live rank, effort, and results per agent. AI coaching recommendations. Recruiting pipeline. Reward systems built in.'],
      ['90% off for life','Lock in $97/mo as a Brand Ambassador. After July 7 every new agent pays $997/mo.', true],
    ],
  },
];

// Real-ish reviews — no photos unless provided
window.REVIEWS = [
  {
    stars: 5,
    title: 'I closed three deals I would have dropped.',
    body: '"Apex caught two follow-ups I completely forgot about in the car. Both turned into showings. One closed. I\'m sold."',
    name: 'Darnell C.',
    meta: 'eXp Realty · Houston, TX',
  },
  {
    stars: 5,
    title: 'It\'s the first thing I open in the morning.',
    body: '"My CRM used to be my worst chore. Now Apex just… has it done. I spend my mornings on outbound, not data entry."',
    name: 'Maria V.',
    meta: 'Compass · Los Angeles, CA',
  },
  {
    stars: 5,
    title: 'The voice dialer paid for the year in a week.',
    body: '"I booked 4 listing appointments in a Tuesday afternoon just driving between showings. I\'ve never done that in my career."',
    name: 'Brian T.',
    meta: 'Keller Williams · Nashville, TN',
  },
];

// FAQ — trimmed to top 4 objections
window.FAQ = [
  {
    q: 'What\'s the catch with $97/mo?',
    a: 'No catch. Brand Ambassadors get 90% off for life in exchange for using it before public launch, giving us feedback, and telling a few agents. Rate is locked. It does not go up. Ever.',
  },
  {
    q: 'How long is the walkthrough?',
    a: '45 minutes. Live on Zoom. No pre-recorded pitch deck. No upsell funnel. You see the actual product, you ask actual questions, you decide.',
  },
  {
    q: 'What if it doesn\'t work for me?',
    a: '200% ROI guarantee. If Apex doesn\'t pay for itself twice over in 90 days, we refund every dollar. The guarantee is in writing before you pay anything.',
  },
  {
    q: 'Do I need to switch CRMs?',
    a: 'No. Apex connects to your existing CRM, MLS, dialer, and email. You can keep your stack and layer Apex on top, or move everything over. Your call.',
  },
];

Object.assign(window, { BRAND: window.BRAND, HEADLINES: window.HEADLINES, SURFACES: window.SURFACES });
