/* =========================================================
   SCG Growth Partners · Offerings page
   ========================================================= */

function OfferingsPage() {
  const isMobile = useIsMobile();
  const [active, setActive] = useState(0);
  const [animKey, setAnimKey] = useState(0);

  const tabs = [
    {
      label: 'Cold Calling',
      icon: <Icon.Phone size={16}/>,
      headline: 'Turn your team into elite cold callers.',
      sub: 'Cold calling is still one of the highest-conversion activities in B2B, when it\'s done right. We teach your team to get to "yes, tell me more" in under 30 seconds.',
      includes: [
        'Call framework and opening script architecture',
        'Objection handling bank mapped to your ICP',
        'Live call coaching sessions with recorded feedback',
        'Talk-track library by persona and pain point',
        'Follow-up cadence framework',
      ],
      deliverable: 'Call Framework Doc + Recorded Coaching Sessions',
    },
    {
      label: 'High Impact Messaging',
      icon: <Icon.Mail size={16}/>,
      headline: 'Outbound that actually gets replies.',
      sub: 'We rebuild your outbound from the message up. ICP-specific sequences across email and LinkedIn, tested, refined, and built to scale with your team.',
      includes: [
        'Multi-channel sequence architecture (email + LinkedIn)',
        'Persona-based message variants for each ICP segment',
        'Subject line and hook testing framework',
        'Pattern interrupt and personalization playbook',
        'Reply-rate benchmarks and iteration cadence',
      ],
      deliverable: 'Full Sequence Library + Messaging Guide',
    },
    {
      label: 'KPIs',
      icon: <Icon.Sparkline size={16}/>,
      headline: 'The metrics that actually predict revenue.',
      sub: "You can't manage what you don't measure. We build the activity and conversion dashboards that give your managers real-time visibility into what's working and what isn't.",
      includes: [
        'Activity KPI framework (calls, emails, connects, meetings)',
        'Conversion benchmark mapping by funnel stage',
        'Weekly reporting templates and operating cadence',
        'Individual and team performance scorecards',
        'Leading vs. lagging indicator framework',
      ],
      deliverable: 'Live KPI Dashboard + Benchmark Framework',
    },
    {
      label: 'RevOps',
      icon: <Icon.Database size={16}/>,
      headline: 'A revenue stack your reps actually want to use.',
      sub: 'Outbound only scales when the systems underneath it do. We set up, migrate, and wire together your CRM and sales tools so your data is clean, your routing is automatic, and your reporting can be trusted.',
      includes: [
        'Salesforce setup and configuration: objects, fields, stages, and permissions',
        'CRM migration (HubSpot, Zoho, Pipedrive, spreadsheets) with data cleanup and dedupe',
        'Outbound tech stack selection and setup: dialer, sequencer, data enrichment, intent',
        'Lead routing, territory, and assignment rules',
        'Pipeline, forecast, and activity dashboards built on the KPI framework',
        'Integrations and automation across CRM, email, calendar, and call recording',
        'Admin documentation and rep training so it holds after we leave',
      ],
      deliverable: 'Configured CRM + Tech Stack Map + Admin Documentation',
    },
    {
      label: 'Onboarding',
      icon: <Icon.Users size={16}/>,
      headline: 'Ramp new reps in 14 to 21 days, not six months.',
      sub: 'Most ramps drag because onboarding is unstructured. We build a tight 14 to 21 day program that teaches your reps the playbook, gets them practicing fast, and has them productive and booking demos in their first week on the floor.',
      includes: [
        '14 to 21 day ramp plan with daily milestones and checkpoints',
        'Playbook training: ICP, personas, talk tracks, and objections',
        'Hands-on practice and live call reps before going live',
        'Booking demos in the first week after onboarding',
        'Certification criteria with defined pass/fail standards',
      ],
      deliverable: '14 to 21 Day Onboarding Program + Manager Guide',
    },
    {
      label: 'The Playbook',
      icon: <Icon.Workflow size={16}/>,
      headline: 'Your complete sales system in one document.',
      sub: 'ICP definition, buyer personas, talk tracks, objection handling, comp structure, activity targets. Your team can run it without you in the room.',
      includes: [
        'ICP definition and firmographic targeting criteria',
        'Buyer persona and pain-point mapping',
        'Full talk track and objection handling library',
        'Compensation and quota recommendation',
        'Team operating cadences and meeting rhythms',
      ],
      deliverable: 'Comprehensive Sales Playbook (living document)',
    },
  ];

  function handleTab(i) {
    if (i === active) return;
    setActive(i);
    setAnimKey(k => k + 1);
  }

  const t = tabs[active];

  return (
    <div data-screen-label="03 Offerings">
      <Nav current="offerings"/>
      <main>

        {/* ---------- HERO ---------- */}
        <section style={{padding:isMobile?'72px 20px 56px':'112px 32px 80px', position:'relative', overflow:'hidden'}}>
          <div aria-hidden="true" style={{position:'absolute', inset:0, backgroundImage:'linear-gradient(to right, rgba(14,14,16,0.035) 1px, transparent 1px),linear-gradient(to bottom, rgba(14,14,16,0.035) 1px, transparent 1px)', backgroundSize:'80px 80px', maskImage:'radial-gradient(ellipse at 50% 30%, #000 25%, transparent 75%)', WebkitMaskImage:'radial-gradient(ellipse at 50% 30%, #000 25%, transparent 75%)', pointerEvents:'none'}}/>
          <div style={{maxWidth:1240, margin:'0 auto', position:'relative'}}>
            <div style={{display:'grid', gridTemplateColumns:isMobile?'1fr':'1fr 1.2fr', gap:isMobile?24:80, alignItems:'end'}}>
              <h1 style={{fontFamily:'var(--font-serif)', fontSize:isMobile?52:88, fontWeight:500, lineHeight:.96, letterSpacing:'-0.025em', color:'var(--ink)', margin:0, textWrap:'balance'}}>
                What we <span style={{color:'var(--slate-300)'}}>build.</span>
              </h1>
              <p style={{fontFamily:'var(--font-serif)', fontSize:isMobile?18:24, lineHeight:1.35, letterSpacing:'-0.005em', color:'var(--fg-2)', margin:0, paddingBottom:isMobile?0:14, textWrap:'pretty'}}>
                Six engagements. Each one a discrete system your team keeps and operates after we're done.
              </p>
            </div>
          </div>
        </section>

        {/* ---------- TABS ---------- */}
        <section style={{borderTop:'1px solid var(--border-1)'}}>

          {/* Tab strip */}
          <div style={{position:'sticky', top:isMobile?60:84, zIndex:20, background:'rgba(244,241,236,0.95)', backdropFilter:'blur(12px)', WebkitBackdropFilter:'blur(12px)', borderBottom:'1px solid var(--border-1)', overflowX:'auto', WebkitOverflowScrolling:'touch'}}>
            <style>{`
              .tab-strip::-webkit-scrollbar{display:none}
              @keyframes scgTabIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
            `}</style>
            <div className="tab-strip" style={{display:'flex', maxWidth:1240, margin:'0 auto', padding:isMobile?'0 20px':'0 32px', minWidth:'max-content'}}>
              {tabs.map((tab, i) => (
                <button key={i} onClick={() => handleTab(i)}
                  style={{
                    display:'flex', alignItems:'center', gap:8,
                    padding:isMobile?'16px 14px':'20px 26px',
                    background:'none', border:'none', cursor:'pointer',
                    borderBottom:active===i?'2px solid var(--accent)':'2px solid transparent',
                    marginBottom:-1,
                    color:active===i?'var(--ink)':'var(--fg-3)',
                    fontFamily:'var(--font-sans)', fontSize:isMobile?13:14, fontWeight:active===i?600:400,
                    transition:'color 180ms ease, border-color 180ms ease',
                    whiteSpace:'nowrap', outline:'none',
                  }}>
                  <span style={{color:active===i?'var(--accent)':'var(--slate-300)', transition:'color 180ms ease', flexShrink:0, display:'flex'}}>
                    {tab.icon}
                  </span>
                  {tab.label}
                </button>
              ))}
            </div>
          </div>

          {/* Tab content panel */}
          <div key={animKey} style={{maxWidth:1240, margin:'0 auto', padding:isMobile?'48px 20px 80px':'80px 32px 120px', animation:'scgTabIn 320ms var(--ease-out) both'}}>
            <div style={{display:'grid', gridTemplateColumns:isMobile?'1fr':'1fr 1fr', gap:isMobile?40:96, alignItems:'start'}}>

              {/* Left: eyebrow + headline + description + CTA */}
              <div>
                <div style={{fontFamily:'var(--font-mono)', fontSize:11, color:'var(--accent)', letterSpacing:'0.16em', fontWeight:600, textTransform:'uppercase', marginBottom:20}}>
                  {String(active+1).padStart(2,'0')} · {t.label}
                </div>
                <h2 style={{fontFamily:'var(--font-serif)', fontSize:isMobile?36:54, fontWeight:500, lineHeight:1.03, letterSpacing:'-0.02em', color:'var(--ink)', margin:'0 0 24px', textWrap:'balance'}}>
                  {t.headline}
                </h2>
                <p style={{fontFamily:'var(--font-serif)', fontSize:isMobile?17:20, lineHeight:1.5, letterSpacing:'-0.003em', color:'var(--fg-2)', margin:'0 0 40px', textWrap:'pretty'}}>
                  {t.sub}
                </p>
                <Button kind="primary" size="lg" href="/contact" iconRight={<Icon.ArrowRight size={15}/>}>
                  Book a call
                </Button>
              </div>

              {/* Right: includes checklist + deliverable */}
              <div style={{paddingTop:isMobile?0:4}}>
                <div style={{fontFamily:'var(--font-sans)', fontSize:11, letterSpacing:'0.12em', textTransform:'uppercase', fontWeight:600, color:'var(--fg-4)', marginBottom:16}}>
                  What's included
                </div>
                <div>
                  {t.includes.map((item, i) => (
                    <div key={i} style={{display:'flex', alignItems:'flex-start', gap:14, padding:'14px 0', borderBottom:i < t.includes.length-1 ? '1px solid var(--border-2)' : 'none'}}>
                      <span style={{color:'var(--accent)', flexShrink:0, marginTop:2, display:'flex'}}><Icon.Check size={15}/></span>
                      <span style={{fontSize:15, lineHeight:1.55, color:'var(--fg-2)'}}>{item}</span>
                    </div>
                  ))}
                </div>

                {/* Deliverable badge */}
                <div style={{marginTop:28, background:'var(--accent-soft)', border:'1px solid rgba(31,58,107,0.14)', borderRadius:'var(--r-2)', padding:'16px 20px', display:'flex', alignItems:'flex-start', gap:12}}>
                  <span style={{color:'var(--accent)', flexShrink:0, marginTop:2, display:'flex'}}><Icon.ArrowUpRight size={15}/></span>
                  <div>
                    <div style={{fontFamily:'var(--font-mono)', fontSize:10, letterSpacing:'0.12em', textTransform:'uppercase', fontWeight:600, color:'var(--accent)', marginBottom:5}}>Deliverable</div>
                    <div style={{fontSize:14, fontWeight:500, color:'var(--ink)', lineHeight:1.4}}>{t.deliverable}</div>
                  </div>
                </div>
              </div>
            </div>
          </div>

          {/* Tab counter strip */}
          <div style={{borderTop:'1px solid var(--border-1)', background:'var(--paper-2)'}}>
            <div style={{maxWidth:1240, margin:'0 auto', padding:isMobile?'0 20px':'0 32px', display:'grid', gridTemplateColumns:`repeat(${tabs.length}, 1fr)`}}>
              {tabs.map((tab, i) => (
                <button key={i} onClick={() => handleTab(i)}
                  style={{
                    padding:isMobile?'20px 0':'24px 0',
                    background:'none', border:'none', cursor:'pointer', outline:'none',
                    borderRight:i<tabs.length-1?'1px solid var(--border-1)':'none',
                    display:'flex', flexDirection:'column', alignItems:'center', gap:6,
                    opacity:active===i?1:0.45,
                    transition:'opacity 200ms ease',
                  }}>
                  <div style={{fontFamily:'var(--font-mono)', fontSize:10, letterSpacing:'0.1em', color:active===i?'var(--accent)':'var(--fg-4)', fontWeight:600}}>
                    {String(i+1).padStart(2,'0')}
                  </div>
                  {!isMobile && (
                    <div style={{fontSize:12, color:active===i?'var(--ink)':'var(--fg-3)', fontWeight:active===i?500:400, fontFamily:'var(--font-sans)'}}>
                      {tab.label}
                    </div>
                  )}
                </button>
              ))}
            </div>
          </div>
        </section>

        {/* ---------- HOW ENGAGEMENTS WORK ---------- */}
        <section style={{padding:isMobile?'64px 20px 0':'96px 32px 0'}}>
          <div style={{maxWidth:'var(--content-max)', margin:'0 auto'}}>
            <div style={{display:'grid', gridTemplateColumns:isMobile?'1fr':'1fr 1.4fr', gap:isMobile?16:80, alignItems:'end', paddingBottom:isMobile?28:48}}>
              <h2 style={{fontFamily:'var(--font-serif)', fontSize:isMobile?40:56, fontWeight:500, lineHeight:1, letterSpacing:'-0.025em', color:'var(--ink)', margin:0, textWrap:'balance'}}>
                How it <span style={{color:'var(--slate-300)'}}>works.</span>
              </h2>
              <p style={{fontFamily:'var(--font-serif)', fontSize:isMobile?16:20, lineHeight:1.45, color:'var(--fg-3)', margin:'0 0 8px', textWrap:'pretty'}}>
                Every engagement is scoped to a defined deliverable with a fixed fee, so you know what you're getting before we start. Pricing is set after the first call.
              </p>
            </div>
            <div style={{display:'grid', gridTemplateColumns:isMobile?'1fr':'repeat(4, 1fr)', borderTop:'1px solid var(--border-1)', borderBottom:'1px solid var(--border-1)'}}>
              {[
                { h:'Intro call', b:'30 minutes on your motion, team, and number. We tell you whether we are the right fit.' },
                { h:'Scope', b:'A written scope: what we build, what you get, the timeline, and a fixed fee.' },
                { h:'Build', b:'We work alongside your team and train the people who will run it.' },
                { h:'Hand off', b:'You keep every document, template, and system. Optional advisory support after.' },
              ].map((st,i)=>(
                <div key={i} style={{padding:isMobile?'24px 0':'32px 28px 36px', paddingLeft:(!isMobile&&i===0)?0:undefined, borderRight:(!isMobile&&i<3)?'1px solid var(--border-1)':'none', borderBottom:(isMobile&&i<3)?'1px solid var(--border-1)':'none'}}>
                  <div style={{fontFamily:'var(--font-mono)', fontSize:11, color:'var(--accent)', letterSpacing:'0.16em', fontWeight:600, marginBottom:10}}>{String(i+1).padStart(2,'0')}</div>
                  <h3 style={{fontFamily:'var(--font-serif)', fontSize:26, fontWeight:500, letterSpacing:'-0.015em', color:'var(--ink)', margin:'0 0 8px'}}>{st.h}</h3>
                  <p style={{fontSize:14, lineHeight:1.55, color:'var(--fg-3)', margin:0}}>{st.b}</p>
                </div>
              ))}
            </div>
          </div>
        </section>

        {/* ---------- CLIENT LOGOS ---------- */}
        <section style={{padding:isMobile?'48px 20px 0':'72px 32px 0'}}>
          <div style={{maxWidth:'var(--content-max)', margin:'0 auto'}}><ClientLogos variant="card"/></div>
        </section>

        {/* ---------- FINAL CTA ---------- */}
        <section style={{padding:isMobile?'64px 20px 0':'80px 32px 0'}}>
          <div style={{maxWidth:'var(--content-max)', margin:'0 auto'}}>
            <div style={{background:'var(--ink)', color:'var(--paper)', borderRadius:'var(--r-4)', padding:isMobile?'48px 28px':'72px 64px', display:'grid', gridTemplateColumns:isMobile?'1fr':'1.4fr 1fr', gap:isMobile?28:48, alignItems:'center', position:'relative', overflow:'hidden'}}>
              <div aria-hidden="true" style={{position:'absolute', right:-30, bottom:-30, opacity:.08, pointerEvents:'none'}}><Bars w={300} color="var(--paper)"/></div>
              <div style={{position:'relative'}}>
                <h2 style={{fontFamily:'var(--font-serif)', fontSize:isMobile?34:56, fontWeight:500, lineHeight:1.05, letterSpacing:'-0.02em', color:'var(--paper)', margin:0, textWrap:'balance'}}>
                  Not sure where to start? <span style={{color:'rgba(244,241,236,0.5)'}}>Let's figure it out.</span>
                </h2>
              </div>
              <div style={{display:'flex', flexDirection:'column', gap:12, alignItems:isMobile?'stretch':'flex-start', position:'relative'}}>
                <Button kind="primary" size="lg" href="/contact" full={isMobile} iconRight={<Icon.ArrowRight size={16}/>}>Book a diagnostic call</Button>
                <div style={{fontSize:13, color:'rgba(244,241,236,0.5)', textAlign:isMobile?'center':'left'}}>30 minutes. No deck. No pitch.</div>
              </div>
            </div>
          </div>
        </section>

      </main>
      <Footer/>
    </div>
  );
}

ReactDOM.createRoot(document.getElementById('root')).render(<OfferingsPage/>);
