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

function Founder({ mark, accent, photo, name }) {
  const [hover, setHover] = useState(false);
  return (
    <div onMouseEnter={()=>setHover(true)} onMouseLeave={()=>setHover(false)}
      style={{display:'flex', flexDirection:'column', width:'100%', cursor:'default'}}>
      <div style={{width:'100%', aspectRatio:'1/1', alignSelf:'flex-start', background:photo?'var(--paper-2)':(accent?'var(--accent)':'var(--ink)'), color:'var(--paper)', borderRadius:'var(--r-3)', display:'grid', placeItems:'center', fontFamily:'var(--font-serif)', fontSize:'clamp(120px, 18vw, 200px)', fontWeight:500, letterSpacing:'-0.03em', lineHeight:1, position:'relative', overflow:'hidden', boxShadow:hover?'0 24px 60px -28px rgba(14,14,16,0.28)':'0 0 0 rgba(0,0,0,0)', transform:hover?'translateY(-4px)':'translateY(0)', transition:'transform 480ms var(--ease-out),box-shadow 480ms var(--ease-out)'}}>
        {photo ? (
          <>
            <img src={photo} alt={name} style={{position:'absolute', inset:0, width:'100%', height:'100%', objectFit:'cover', objectPosition:'center 30%', display:'block', filter:hover?'grayscale(0) contrast(1.02)':'grayscale(100%) contrast(0.98)', transform:hover?'scale(1.04)':'scale(1)', transition:'filter 700ms var(--ease-out),transform 900ms var(--ease-out)'}}/>
            <div aria-hidden="true" style={{position:'absolute', inset:0, background:'var(--accent)', mixBlendMode:'multiply', opacity:hover?0:0.18, transition:'opacity 700ms var(--ease-out)', pointerEvents:'none'}}/>
            {[{top:12,left:12,br:'2px 0 0 2px',bb:'2px 0 0 0'},{top:12,right:12,bl:'2px 2px 0 0',bb:'0 2px 0 0'},{bottom:12,left:12,bt:'2px 0 0 2px',br:'0 0 0 2px'},{bottom:12,right:12,bt:'2px 2px 0 0',bl:'0 0 2px 0'}].map((c,i)=>(
              <span key={i} aria-hidden="true" style={{position:'absolute', width:16, height:16, top:c.top, right:c.right, bottom:c.bottom, left:c.left, borderTop:c.bt?'1.5px solid var(--paper)':'none', borderRight:c.br?'1.5px solid var(--paper)':'none', borderBottom:c.bb?'1.5px solid var(--paper)':'none', borderLeft:c.bl?'1.5px solid var(--paper)':'none', opacity:hover?.95:0, transform:hover?'scale(1)':'scale(0.6)', transformOrigin:`${c.top?'top':'bottom'} ${c.left?'left':'right'}`, transition:'opacity 360ms var(--ease-out),transform 360ms var(--ease-out)', transitionDelay:`${60+i*40}ms`}}/>
            ))}
          </>
        ) : (
          <>
            <div aria-hidden="true" style={{position:'absolute', right:-20, bottom:-16, opacity:.12, pointerEvents:'none'}}><Bars w={180} color="var(--paper)"/></div>
            <span style={{position:'relative'}}>{mark}</span>
          </>
        )}
      </div>
      <div style={{marginTop:24}}>
        <div style={{fontFamily:'var(--font-mono)', fontSize:11, color:'var(--accent)', letterSpacing:'0.16em', fontWeight:600, textTransform:'uppercase'}}>Co-founder</div>
        <h3 style={{fontFamily:'var(--font-serif)', fontSize:40, fontWeight:500, letterSpacing:'-0.02em', color:'var(--ink)', lineHeight:1.02, margin:'10px 0 0', backgroundImage:'linear-gradient(var(--ink),var(--ink))', backgroundRepeat:'no-repeat', backgroundPosition:'left 95%', backgroundSize:hover?'100% 1.5px':'0% 1.5px', transition:'background-size 520ms var(--ease-out)', paddingBottom:4, display:'inline'}}>{name}</h3>
      </div>
    </div>
  );
}

function AboutPage() {
  const isMobile = useIsMobile();

  const stats = [
    { k:'Top-10', v:'RepVue company',    m:'where they lead sales' },
    { k:'5,000+', v:'meetings booked',   m:'under their leadership' },
    { k:'$140M+', v:'attributed revenue',m:'generated' },
    { k:'8 → 40+',v:'BDRs scaled',      m:'in one fiscal year' },
  ];

  const beliefs = [
    { h:"We’re hands-on.", b:"Sam and George are on every engagement. We’ve spent years building outbound systems that work, and we want to share what we’ve learned with founders trying to do the same. Your team runs better. Your business grows faster." },
    { h:"We build, your team runs.", b:"We build the system and empower your team to operate it. Advisory, not a fractional headcount you’ll be paying for forever." },
    { h:"We keep current.", b:"We test the new tools, not recommend the old ones out of habit. George sits on various customer advisory boards for exactly this reason." },
    { h:"We’re selective.", b:"A small number of engagements at a time. If we’re not the right fit, we say so on the first call." },
  ];

  return (
    <div data-screen-label="02 About">
      <Nav current="about"/>
      <main>
        {/* ---------- HERO ---------- */}
        <section style={{padding:isMobile?'72px 20px 56px':'112px 32px 88px', 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'}}/>

          {/* ascending pipeline animation */}
          <div aria-hidden="true" style={{position:'absolute', inset:0, pointerEvents:'none', maskImage:'linear-gradient(to right, transparent 0%, #000 12%, #000 88%, transparent 100%)', WebkitMaskImage:'linear-gradient(to right, transparent 0%, #000 12%, #000 88%, transparent 100%)'}}>
            <style>{`@keyframes scgPipelineFlow{from{stroke-dashoffset:0}to{stroke-dashoffset:-240}}@keyframes scgPipelineDot{0%{offset-distance:0%;opacity:0}8%{opacity:1}92%{opacity:1}100%{offset-distance:100%;opacity:0}}`}</style>
            <svg width="100%" height="100%" viewBox="0 0 1600 720" preserveAspectRatio="xMidYMid slice" style={{display:'block', overflow:'visible'}}>
              {(()=>{
                const d=`M -60 580 C 320 580, 540 540, 780 420 S 1240 200, 1660 120`;
                return (
                  <g>
                    <line x1="0" y1="580" x2="1600" y2="580" stroke="var(--slate-300)" strokeWidth="1" opacity="0.45"/>
                    <path d={d} stroke="var(--accent)" strokeWidth="2" fill="none" strokeDasharray="8 14" strokeLinecap="round" style={{opacity:.32, animation:'scgPipelineFlow 18s linear infinite'}}/>
                    <circle r="5" fill="var(--accent)" style={{opacity:.9, offsetPath:`path('${d}')`, offsetRotate:'0deg', animation:'scgPipelineDot 22s linear infinite'}}/>
                  </g>
                );
              })()}
            </svg>
          </div>

          <div style={{maxWidth:1240, margin:'0 auto', position:'relative'}}>
            <div style={{display:'grid', gridTemplateColumns:isMobile?'1fr':'1fr 1.2fr', gap:isMobile?28:80, alignItems:'end'}}>
              <div>
                <h1 style={{fontFamily:'var(--font-serif)', fontSize:isMobile?52:88, fontWeight:500, lineHeight:.96, letterSpacing:'-0.025em', color:'var(--ink)', margin:0, textWrap:'balance'}}>
                  Built by <span style={{color:'var(--slate-300)'}}>operators.</span>
                </h1>
              </div>
              <div style={{paddingBottom:isMobile?0:14}}>
                <p style={{fontFamily:'var(--font-serif)', fontSize:isMobile?18:24, lineHeight:1.35, letterSpacing:'-0.005em', color:'var(--fg-2)', margin:0, textWrap:'pretty'}}>
                  Sam Sansone and George Cunningham lead sales at a <span style={{color:'var(--ink)'}}>RepVue Top-10</span> company. SCG is the advisory firm built on what they run there, every day, right now.
                </p>
              </div>
            </div>

            {/* stat strip */}
            <div style={{display:'grid', gridTemplateColumns:isMobile?'1fr 1fr':'repeat(4, 1fr)', marginTop:isMobile?40:64, borderTop:'1px solid var(--border-1)', borderBottom:'1px solid var(--border-1)'}}>
              {stats.map((s,i)=>(
                <div key={i} style={{padding:`${isMobile?20:40}px ${isMobile?0:32}px ${isMobile?20:40}px`, borderRight:isMobile?(i%2===0?'1px solid var(--border-1)':'none'):(i<stats.length-1?'1px solid var(--border-1)':'none'), borderBottom:(isMobile&&i<2)?'1px solid var(--border-1)':'none', paddingRight:isMobile?(i%2===0?16:0):(!isMobile&&i===stats.length-1?0:undefined), paddingLeft:isMobile?(i%2===1?16:0):(!isMobile&&i===0?0:undefined), textAlign:'center'}}>
                  <div style={{fontFamily:'var(--font-serif)', fontSize:isMobile?40:56, fontWeight:500, lineHeight:1, letterSpacing:'-0.025em', color:'var(--ink)'}}>{s.k}</div>
                  <div style={{marginTop:10, fontSize:13, lineHeight:1.45, color:'var(--fg-3)'}}>
                    <span style={{color:'var(--fg-1)', fontWeight:600}}>{s.v}</span> {s.m}
                  </div>
                </div>
              ))}
            </div>
          </div>
        </section>

        <ClientLogos/>

        {/* ---------- FOUNDERS ---------- */}
        <section style={{padding:isMobile?'64px 20px':'112px 32px', borderTop:'1px solid var(--border-1)', background:'var(--paper-2)'}}>
          <div style={{maxWidth:1240, margin:'0 auto'}}>
            <div style={{display:'grid', gridTemplateColumns:isMobile?'1fr':'1fr 1.2fr', gap:isMobile?20:80, alignItems:'end', paddingBottom:isMobile?40:72}}>
              <h2 style={{fontFamily:'var(--font-serif)', fontSize:isMobile?48:72, fontWeight:500, lineHeight:.96, letterSpacing:'-0.025em', color:'var(--ink)', margin:0, textWrap:'balance'}}>
                The<br/>Founders.
              </h2>
              <p style={{fontFamily:'var(--font-serif)', fontSize:isMobile?17:22, lineHeight:1.4, color:'var(--fg-3)', margin:'0 0 14px', textWrap:'pretty'}}>
                We both built the BDR team. George runs it today. Sam built out the AE onboarding alongside it. Between the two of us, we have a holistic view of the whole sales motion.
              </p>
            </div>

            <div style={{display:'grid', gridTemplateColumns:isMobile?'1fr':'1fr 1fr', gap:isMobile?48:56}}>
              <Founder photo="assets/sam.png" mark="S" name="Sam Sansone"/>
              <Founder photo="assets/george.jpg" mark="G" name="George Cunningham"/>
            </div>
          </div>
        </section>

        {/* ---------- HOW WE WORK ---------- */}
        <section style={{padding:isMobile?'64px 20px':'128px 32px', borderTop:'1px solid var(--border-1)'}}>
          <div style={{maxWidth:1240, margin:'0 auto'}}>
            <div style={{display:'grid', gridTemplateColumns:isMobile?'1fr':'1fr 1.4fr', gap:isMobile?20:80, alignItems:'end', paddingBottom:isMobile?36:56}}>
              <h2 style={{fontFamily:'var(--font-serif)', fontSize:isMobile?44:64, fontWeight:500, lineHeight:1, letterSpacing:'-0.025em', color:'var(--ink)', margin:0, textWrap:'balance'}}>
                How we <span style={{color:'var(--slate-300)'}}>work.</span>
              </h2>
              <p style={{fontFamily:'var(--font-serif)', fontSize:isMobile?16:22, lineHeight:1.4, color:'var(--fg-3)', margin:'0 0 10px', textWrap:'pretty'}}>
                Four operating principles we hold ourselves to on every engagement.
              </p>
            </div>

            <div style={{display:'grid', gridTemplateColumns:isMobile?'1fr':'1fr 1fr', gap:0}}>
              {beliefs.map((b,i)=>(
                <div key={b.h} style={{padding:'36px 0', paddingRight:(!isMobile&&i%2===0)?48:0, paddingLeft:(!isMobile&&i%2===1)?48:0, borderTop:'1px solid var(--border-1)', borderBottom:i>=beliefs.length-2?'1px solid var(--border-1)':'none'}}>
                  <div style={{fontFamily:'var(--font-mono)', fontSize:11, color:'var(--accent)', letterSpacing:'0.16em', fontWeight:600, marginBottom:12}}>{String(i+1).padStart(2,'0')}</div>
                  <h3 style={{fontFamily:'var(--font-serif)', fontSize:isMobile?26:32, fontWeight:500, lineHeight:1.1, letterSpacing:'-0.018em', color:'var(--ink)', margin:'0 0 12px', textWrap:'balance'}}>{b.h}</h3>
                  <p style={{fontSize:15, lineHeight:1.6, color:'var(--fg-3)', margin:0}}>{b.b}</p>
                </div>
              ))}
            </div>
          </div>
        </section>

        {/* ---------- FINAL CTA ---------- */}
        <section style={{padding:isMobile?'0 20px 0':'48px 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'}}>
                  Start building outbound pipeline <span style={{color:'rgba(244,241,236,0.55)'}}>today.</span>
                </h2>
              </div>
              <div style={{display:'flex', flexDirection:'column', gap:14, alignItems:isMobile?'stretch':'flex-start', position:'relative'}}>
                <Button kind="primary" size="lg" href="/contact" full={isMobile} iconRight={<Icon.ArrowRight size={16}/>}>Book a call</Button>
              </div>
            </div>
          </div>
        </section>
      </main>
      <Footer/>
    </div>
  );
}

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