
/* Fragment Intelligence — Components */
/* global React */
const { useState, useEffect, useRef } = React;

/* ─── Logomark: 5 stacked translucent planes per brand spec ─── */
function Logomark({ size = 24, dark = false }) {
  // Brand spec literally describes this: 5 stacked translucent planes,
  // each offset, with deepest layer in teal, internal grid lines, depth connectors.
  const stroke = dark ? "#A1A1AA" : "#52525B";
  const strokeFaint = dark ? "#3F3F46" : "#A1A1AA";
  const teal = dark ? "#0EA5A8" : "#0D8F91";
  return (
    <svg width={size} height={size} viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
      {/* depth connectors */}
      <line x1="6" y1="6" x2="2" y2="22" stroke={strokeFaint} strokeWidth="0.5" />
      <line x1="26" y1="6" x2="30" y2="22" stroke={strokeFaint} strokeWidth="0.5" />
      {/* layer 1 (top, faintest) */}
      <rect x="6" y="6" width="20" height="4" stroke={strokeFaint} strokeWidth="0.75" />
      <line x1="11" y1="6" x2="11" y2="10" stroke={strokeFaint} strokeWidth="0.5" />
      <line x1="16" y1="6" x2="16" y2="10" stroke={strokeFaint} strokeWidth="0.5" />
      <line x1="21" y1="6" x2="21" y2="10" stroke={strokeFaint} strokeWidth="0.5" />
      {/* layer 2 */}
      <rect x="5" y="10" width="22" height="4" stroke={strokeFaint} strokeWidth="0.75" />
      <line x1="11" y1="10" x2="11" y2="14" stroke={strokeFaint} strokeWidth="0.5" />
      <line x1="16" y1="10" x2="16" y2="14" stroke={strokeFaint} strokeWidth="0.5" />
      <line x1="21" y1="10" x2="21" y2="14" stroke={strokeFaint} strokeWidth="0.5" />
      {/* layer 3 */}
      <rect x="4" y="14" width="24" height="4" stroke={stroke} strokeWidth="0.75" />
      <line x1="11" y1="14" x2="11" y2="18" stroke={stroke} strokeWidth="0.5" />
      <line x1="16" y1="14" x2="16" y2="18" stroke={stroke} strokeWidth="0.5" />
      <line x1="21" y1="14" x2="21" y2="18" stroke={stroke} strokeWidth="0.5" />
      {/* layer 4 */}
      <rect x="3" y="18" width="26" height="4" stroke={stroke} strokeWidth="0.75" />
      <line x1="11" y1="18" x2="11" y2="22" stroke={stroke} strokeWidth="0.5" />
      <line x1="16" y1="18" x2="16" y2="22" stroke={stroke} strokeWidth="0.5" />
      <line x1="21" y1="18" x2="21" y2="22" stroke={stroke} strokeWidth="0.5" />
      {/* layer 5 — deepest, teal accent + data points */}
      <rect x="2" y="22" width="28" height="4" stroke={teal} strokeWidth="1" />
      <line x1="11" y1="22" x2="11" y2="26" stroke={teal} strokeOpacity="0.5" strokeWidth="0.5" />
      <line x1="16" y1="22" x2="16" y2="26" stroke={teal} strokeOpacity="0.5" strokeWidth="0.5" />
      <line x1="21" y1="22" x2="21" y2="26" stroke={teal} strokeOpacity="0.5" strokeWidth="0.5" />
      <circle cx="11" cy="24" r="0.9" fill={teal} />
      <circle cx="16" cy="24" r="0.9" fill={teal} />
      <circle cx="21" cy="24" r="0.9" fill={teal} />
    </svg>
  );
}

function Logo({ dark = false }) {
  return (
    <a href="/" className="logo" aria-label="Fragment Intelligence — home">
      <Logomark size={24} dark={dark} />
      <span className="logo-words">
        <span className="lw1">FRAGMENT</span>
        <span className="lw2">INTELLIGENCE</span>
      </span>
    </a>
  );
}

/* ─── Nav ─── */
function Nav() {
  return (
    <nav className="nav">
      <div className="nav-inner">
        <Logo />
        <div className="nav-links">
          <a href="/#how">How it works</a>
          <a href="/#chat">Chat</a>
          <a href="/#modules">Modules</a>
          <a href="/#produces">Output</a>
          <a href="/#pricing">Pricing</a>
        </div>
        <div className="nav-cta">
          <a href="https://app.fragmentintelligence.com/login" className="btn btn-ghost" style={{fontSize:'13.5px'}}>Sign in</a>
          <a href="/demo.html" className="btn btn-primary">Request a demo <span className="arrow">→</span></a>
        </div>
      </div>
    </nav>
  );
}

/* ─── Hero ─── */
function Hero() {
  return (
    <section className="hero" data-screen-label="01 Hero">
      <div className="hero-grid-bg" />
      <div className="container hero-inner">
        <div className="hero-copy">
          <div className="eyebrow">GTM Intelligence Platform for B2B SaaS</div>
          <h1>
            Your HubSpot data is fragmented.<br />
            <em>We connect the pieces.</em>
          </h1>
          <p className="hero-sub">
            Connect your HubSpot portal and Fragment runs seven diagnostic modules against your live CRM data — returning written, analyst-grade intelligence with named deals, dollar amounts, and specific next steps.
          </p>
          <div className="hero-actions">
            <a href="/audit.html" className="btn btn-primary">Get a free HubSpot audit <span className="arrow">→</span></a>
            <a href="#how" className="btn btn-secondary">See how it works</a>
          </div>
          <div className="hero-meta">
            <div><strong>7</strong>Intelligence modules</div>
            <div><strong>Minutes</strong>Time to first insight</div>
            <div><strong>Zero</strong>Configuration</div>
          </div>
        </div>
        <ReportMock />
      </div>
    </section>
  );
}

function ReportMock() {
  return (
    <div className="report-mock" role="img" aria-label="Sample analyst output">
      <div className="report-head">
        <div>
          <div className="title">Pipeline Risk Assessment</div>
          <div className="sub">Module 05 · Run 04.21.26</div>
        </div>
        <span className="report-tag">Insight</span>
      </div>

      <div style={{display:'flex',justifyContent:'space-between',alignItems:'baseline',marginBottom:10}}>
        <span className="mono" style={{fontSize:10}}>Stalled deals · 60+ days no activity</span>
        <span className="mono" style={{fontSize:10,color:'#0D8F91'}}>13 found</span>
      </div>

      <div className="report-finding flagged">
        <span className="name">St. Luke's Health</span>
        <span className="amt">$0</span>
        <span className="days">175 days</span>
      </div>
      <div className="report-finding">
        <span className="name">lululemon</span>
        <span className="amt">$86,400</span>
        <span className="days">168 days</span>
      </div>
      <div className="report-finding">
        <span className="name">Flutter Entertainment</span>
        <span className="amt">$80,000</span>
        <span className="days">162 days</span>
      </div>
      <div className="report-finding">
        <span className="name">Northwell Health</span>
        <span className="amt">$54,200</span>
        <span className="days">141 days</span>
      </div>

      <div className="report-bars" aria-hidden="true">
        <span style={{height:'40%'}}></span>
        <span style={{height:'62%'}}></span>
        <span style={{height:'48%'}}></span>
        <span style={{height:'78%'}}></span>
        <span className="hot" style={{height:'95%'}}></span>
        <span style={{height:'52%'}}></span>
        <span style={{height:'34%'}}></span>
        <span style={{height:'70%'}}></span>
        <span style={{height:'58%'}}></span>
        <span style={{height:'42%'}}></span>
      </div>

      <div className="report-insight">
        <strong>Recommendation —</strong> disqualify the 8 deals with $0 value. Re-engage the remaining 5 with single-threaded contact via executive sponsor outreach. Net pipeline impact: <strong>$284k</strong>.
      </div>
    </div>
  );
}

/* ─── Problem ─── */
function Problem() {
  const cells = [
    {
      n: "01",
      h: "Dashboards show what happened",
      p: "HubSpot reports are backward-looking. They tell you the numbers, not what to do about them."
    },
    {
      n: "02",
      h: "RevOps is manual & slow",
      p: "Pipeline reports, win/loss analyses, persona studies — weeks of manual work, every quarter."
    },
    {
      n: "03",
      h: "Insights are buried",
      p: "Critical patterns — stalled deals, single-threaded risks, channel gaps — hide across disconnected reports."
    }
  ];
  return (
    <section className="section-divider" data-screen-label="02 Problem">
      <div className="container">
        <div className="sec-head">
          <div className="eyebrow">The Problem</div>
          <h2>The diagnostic layer your CRM was supposed to be.</h2>
          <p>Most revenue teams are flying on instruments built for reporting, not for decisions. Fragment is the diagnostic engine underneath.</p>
        </div>
        <div className="problem-grid" style={{marginTop:64}}>
          {cells.map(c => (
            <div className="problem-cell" key={c.n}>
              <div className="num">— {c.n}</div>
              <h3>{c.h}</h3>
              <p>{c.p}</p>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

/* ─── How it works ─── */
function How() {
  const steps = [
    { n: "Step 01", t: "Connect", b: "Paste your HubSpot token. No data warehouse, no implementation, no setup calls. Zero configuration." },
    { n: "Step 02", t: "Analyze", b: "Fragment runs 7 diagnostic modules against your live CRM data — pipeline, persona, source, stage, win/loss, and more." },
    { n: "Step 03", t: "Act", b: "Get written reports with named deals, dollar amounts, and specific next steps. Synthesized, not summarized." }
  ];
  return (
    <section id="how" className="section-divider" data-screen-label="03 How it works">
      <div className="container">
        <div className="sec-head">
          <div className="eyebrow">How it works</div>
          <h2>Connect HubSpot. Get analyst-grade intelligence in <em>minutes</em> — not weeks.</h2>
        </div>
        <div className="how-grid">
          {steps.map(s => (
            <div className="how-step" key={s.n}>
              <div className="step-line"></div>
              <div className="step-num">{s.n}</div>
              <div className="step-title">{s.t}</div>
              <div className="step-body">{s.b}</div>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

/* ─── What Fragment Produces ─── */
function Produces() {
  return (
    <section id="produces" className="section-divider" data-screen-label="04 Produces">
      <div className="container">
        <div className="sec-head">
          <div className="eyebrow">What Fragment Produces</div>
          <h2>Three formats. One intelligence layer.</h2>
          <p>Not a dashboard. Not a forecast. Three deliverables a senior analyst would hand to your VP of Revenue.</p>
        </div>
        <div className="produces-grid">
          <div className="produce-card">
            <div className="visual"><DocumentVisual /></div>
            <span className="pmono">— Documents</span>
            <h3>Narrative analyses</h3>
            <p>Consultant-grade documents — Win/Loss Patterns, Persona Gap, Pipeline Risk — 10–20 pages with real deal names and dollar amounts.</p>
          </div>
          <div className="produce-card">
            <div className="visual"><ReportVisual /></div>
            <span className="pmono">— Reports</span>
            <h3>Data-dense outputs</h3>
            <p>Built for pipeline meetings — Source Performance, Pipeline Health, Stage Analysis. Interpreted metrics, not raw tables.</p>
          </div>
          <div className="produce-card">
            <div className="visual"><InsightVisual /></div>
            <span className="pmono">— Insights</span>
            <h3>Prioritized actions</h3>
            <p>Cross-module synthesis. Each recommendation is specific, named, and tied to the evidence that generated it.</p>
          </div>
        </div>
      </div>
    </section>
  );
}

function DocumentVisual() {
  return (
    <svg viewBox="0 0 200 96" width="100%" height="100%" preserveAspectRatio="xMidYMid meet">
      <rect x="40" y="6" width="120" height="84" fill="#fff" stroke="#D4D4D8" strokeWidth="0.75" />
      <rect x="50" y="16" width="60" height="3" fill="#27272A" />
      <rect x="50" y="24" width="100" height="1" fill="#D4D4D8" />
      <rect x="50" y="32" width="100" height="1" fill="#E4E4E7" />
      <rect x="50" y="36" width="100" height="1" fill="#E4E4E7" />
      <rect x="50" y="40" width="76" height="1" fill="#E4E4E7" />
      <rect x="50" y="50" width="100" height="1" fill="#E4E4E7" />
      <rect x="50" y="54" width="100" height="1" fill="#E4E4E7" />
      <rect x="50" y="58" width="64" height="1" fill="#E4E4E7" />
      <rect x="50" y="68" width="2" height="14" fill="#0D8F91" />
      <rect x="56" y="68" width="80" height="2" fill="#27272A" />
      <rect x="56" y="74" width="60" height="1" fill="#A1A1AA" />
      <rect x="56" y="78" width="70" height="1" fill="#A1A1AA" />
    </svg>
  );
}
function ReportVisual() {
  return (
    <svg viewBox="0 0 200 96" width="100%" height="100%" preserveAspectRatio="xMidYMid meet">
      <line x1="40" y1="80" x2="160" y2="80" stroke="#D4D4D8" strokeWidth="0.5" />
      {[
        [50, 50], [62, 38], [74, 58], [86, 30], [98, 42],
        [110, 22], [122, 36], [134, 18], [146, 30]
      ].map(([x, h], i) => (
        <rect key={i} x={x} y={80 - h} width="6" height={h} fill={i === 5 ? "#0D8F91" : "#D4D4D8"} />
      ))}
      <text x="40" y="14" fontFamily="JetBrains Mono, monospace" fontSize="6" fill="#71717A" letterSpacing="1">SOURCE PERFORMANCE</text>
      <text x="120" y="14" fontFamily="JetBrains Mono, monospace" fontSize="6" fill="#0D8F91" letterSpacing="1">+ PEAK</text>
    </svg>
  );
}
function InsightVisual() {
  return (
    <svg viewBox="0 0 200 96" width="100%" height="100%" preserveAspectRatio="xMidYMid meet">
      <rect x="44" y="14" width="112" height="14" fill="none" stroke="#D4D4D8" strokeWidth="0.5" />
      <rect x="44" y="14" width="2" height="14" fill="#0D8F91" />
      <rect x="52" y="19" width="80" height="1.5" fill="#27272A" />
      <rect x="52" y="23" width="60" height="1" fill="#71717A" />
      <rect x="44" y="34" width="112" height="14" fill="none" stroke="#D4D4D8" strokeWidth="0.5" />
      <rect x="52" y="39" width="80" height="1.5" fill="#27272A" />
      <rect x="52" y="43" width="60" height="1" fill="#71717A" />
      <rect x="44" y="54" width="112" height="14" fill="none" stroke="#D4D4D8" strokeWidth="0.5" />
      <rect x="52" y="59" width="80" height="1.5" fill="#27272A" />
      <rect x="52" y="63" width="60" height="1" fill="#71717A" />
      <rect x="44" y="74" width="112" height="14" fill="none" stroke="#D4D4D8" strokeWidth="0.5" />
      <rect x="44" y="74" width="2" height="14" fill="#0D8F91" />
      <rect x="52" y="79" width="80" height="1.5" fill="#27272A" />
      <rect x="52" y="83" width="60" height="1" fill="#71717A" />
    </svg>
  );
}

/* ─── Chat with HubSpot data ─── */
function Chat() {
  const turns = [
    {
      role: "user",
      text: "Which deals over $50k haven't been touched in 30 days?"
    },
    {
      role: "assistant",
      tool: "hubspot.deals.search",
      params: '{ amount: { gte: 50000 }, last_activity: { lt: "-30d" } }',
      meta: "Returned 7 records · 412ms",
      body: (
        <>
          <p style={{margin:"0 0 14px"}}>Seven deals match. Three are single-threaded and worth flagging:</p>
          <div className="chat-finding"><span className="cname">Flutter Entertainment</span><span className="camt">$80,000</span><span className="cdays">42d cold · 1 contact</span></div>
          <div className="chat-finding"><span className="cname">lululemon</span><span className="camt">$86,400</span><span className="cdays">38d cold · 1 contact</span></div>
          <div className="chat-finding"><span className="cname">Northwell Health</span><span className="camt">$54,200</span><span className="cdays">35d cold · 2 contacts</span></div>
          <p style={{margin:"14px 0 0", color:"var(--text-body)", fontSize:13.5}}>Combined ARR exposure: <strong style={{color:"var(--text-strong)", fontWeight:500}}>$220,600</strong>. Want me to draft re-engagement notes addressed to the executive sponsor on each?</p>
        </>
      )
    },
    {
      role: "user",
      text: "Yes — and pull stage history for Flutter."
    },
    {
      role: "assistant",
      tool: "hubspot.deal.timeline",
      params: '{ deal_id: "8410-flutter-entertainment" }',
      meta: "Returned 14 events · 318ms",
      body: (
        <>
          <div className="chat-timeline">
            <div className="ct-row"><span className="ct-stage">Discovery</span><span className="ct-dur">11d</span><span className="ct-bar"><i style={{width:"22%"}}></i></span></div>
            <div className="ct-row"><span className="ct-stage">Qualified</span><span className="ct-dur">19d</span><span className="ct-bar"><i style={{width:"38%"}}></i></span></div>
            <div className="ct-row"><span className="ct-stage">Demo</span><span className="ct-dur">8d</span><span className="ct-bar"><i style={{width:"16%"}}></i></span></div>
            <div className="ct-row"><span className="ct-stage">Proposal</span><span className="ct-dur stalled">62d</span><span className="ct-bar"><i className="hot" style={{width:"100%"}}></i></span></div>
          </div>
          <p style={{margin:"14px 0 0", color:"var(--text-body)", fontSize:13.5}}>Flutter has been stuck in <em style={{fontStyle:"normal", color:"var(--accent)"}}>Proposal</em> for 62 days — 3.4× your average. Last touch was a one-line email on 03/14. Drafting executive-sponsor outreach now.</p>
        </>
      )
    }
  ];

  const suggestions = [
    "Show me deals at risk this quarter",
    "Which source produced our highest LTV customers?",
    "Find contacts at target accounts we've never emailed",
    "Compare won vs. lost deals in the Mid-Market segment"
  ];

  return (
    <section id="chat" className="section-divider chat-section" data-screen-label="05 Chat">
      <div className="container">
        <div className="sec-head">
          <div className="eyebrow">Chat with your HubSpot data</div>
          <h2>Ask anything. Fragment <em>queries your CRM live</em> and answers in plain English.</h2>
          <p>Built-in agent with first-class HubSpot tools. Search deals, pull contact timelines, cross-reference stages, draft outreach — without leaving the conversation.</p>
        </div>

        <div className="chat-shell">
          <div className="chat-frame">
            <div className="chat-frame-head">
              <div className="cfh-left">
                <span className="cfh-dot"></span>
                <span className="cfh-title">Fragment Chat</span>
                <span className="cfh-sep">·</span>
                <span className="cfh-portal">acme-saas.hubspot.com</span>
              </div>
              <span className="cfh-status"><i></i> Connected</span>
            </div>

            <div className="chat-stream">
              {turns.map((t, i) => t.role === "user" ? (
                <div key={i} className="chat-turn user">
                  <div className="chat-bubble">{t.text}</div>
                </div>
              ) : (
                <div key={i} className="chat-turn assistant">
                  <div className="chat-tool">
                    <div className="ct-head">
                      <span className="ct-icon">⌁</span>
                      <span className="ct-name">{t.tool}</span>
                      <span className="ct-meta">{t.meta}</span>
                    </div>
                    <div className="ct-params">{t.params}</div>
                  </div>
                  <div className="chat-answer">{t.body}</div>
                </div>
              ))}
            </div>

            <div className="chat-input">
              <span className="ci-prompt">›</span>
              <span className="ci-text">Draft the re-engagement notes…</span>
              <span className="ci-caret"></span>
              <span className="ci-kbd">↵</span>
            </div>
          </div>

          <aside className="chat-side">
            <div className="cs-block">
              <div className="cs-label">— Live tools</div>
              <ul className="cs-tools">
                <li><span className="cs-tdot"></span>deals.search</li>
                <li><span className="cs-tdot"></span>deals.timeline</li>
                <li><span className="cs-tdot"></span>contacts.find</li>
                <li><span className="cs-tdot"></span>companies.lookup</li>
                <li><span className="cs-tdot"></span>engagements.history</li>
                <li><span className="cs-tdot"></span>pipelines.compare</li>
                <li><span className="cs-tdot"></span>notes.draft</li>
              </ul>
            </div>

            <div className="cs-block">
              <div className="cs-label">— Try asking</div>
              <ul className="cs-suggest">
                {suggestions.map(s => (
                  <li key={s}>{s} <span className="cs-arr">→</span></li>
                ))}
              </ul>
            </div>

            <div className="cs-foot">
              <div><strong>Read-only by default.</strong> Writes (notes, tasks, drafts) require explicit confirmation per turn.</div>
            </div>
          </aside>
        </div>
      </div>
    </section>
  );
}

/* ─── 7 Modules table ─── */
function Modules() {
  const rows = [
    ["01", "Data Readiness", "Report",   "CRM hygiene score & gaps"],
    ["02", "Win/Loss Patterns", "Document", "Why deals close or die"],
    ["03", "Persona Gap", "Document", "Prospects vs. buyers analysis"],
    ["04", "Source Performance", "Report", "Channel-to-pipeline mapping"],
    ["05", "Pipeline Health", "Report", "Stage velocity & risk flags"],
    ["06", "Stage Analysis", "Report", "Drop-off between stages"],
    ["07", "GTM Insights", "Insights", "Cross-module synthesis"]
  ];
  return (
    <section id="modules" className="section-divider" data-screen-label="06 Modules">
      <div className="container">
        <div className="sec-head">
          <div className="eyebrow">Seven Modules</div>
          <h2>Every module is built for analytical rigor.</h2>
          <p>The kind of work that would take a senior analyst days — delivered in minutes, against your live CRM data.</p>
        </div>
        <div className="modules-table">
          <div className="modules-head">
            <div>—</div>
            <div>Module</div>
            <div>Output</div>
            <div className="h-desc">What it does</div>
          </div>
          {rows.map(([n, name, type, desc]) => (
            <div className="module-row" key={n}>
              <div className="midx">{n}</div>
              <div className="mname">{name}</div>
              <div className={`mtype ${type === "Document" ? "t-doc" : type === "Insights" ? "t-doc" : ""}`}>{type}</div>
              <div className="mdesc">{desc}</div>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

/* ─── Dark section: What HubSpot Cannot See ─── */
function Sees() {
  const items = [
    { n: "A", h: "Persona gap", p: "Prospects vs. buyers seniority cross-reference. Where you're talking to the wrong layer of the org." },
    { n: "B", h: "Deal path velocity", p: "Won vs. lost stage journey comparison. Which paths through your pipeline actually convert." },
    { n: "C", h: "Single-threading risk", p: "Named deals with one contact. Surfaced before they go dark." },
    { n: "D", h: "Stage drop-off", p: "Drop-off rates between any two pipeline stages. Specific, not aggregated." },
    { n: "E", h: "Narrative synthesis", p: "Written analyst output, not just tables. The interpretation that turns metrics into decisions." },
    { n: "F", h: "Cross-module insight", p: "Generated across all data simultaneously. Patterns that no single report could surface." }
  ];
  return (
    <section className="dark-section" data-screen-label="07 What HubSpot can't see">
      <div className="container">
        <div className="sec-head">
          <div className="eyebrow">What Fragment Sees</div>
          <h2>Six things HubSpot will never tell you.</h2>
          <p className="lead">Depth over dashboards. Fragment exposes the structural patterns in your GTM motion — the ones that hide between reports.</p>
        </div>
        <div className="sees-grid">
          {items.map(it => (
            <div className="sees-cell" key={it.n}>
              <span className="sm">— {it.n}</span>
              <h4>{it.h}</h4>
              <p>{it.p}</p>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

/* ─── Pricing — all "Contact us" ─── */
function Pricing() {
  const tiers = [
    {
      tier: "Tier 01",
      name: "Starter",
      sub: "For single-portal teams",
      featured: false,
      features: [
        "1 HubSpot portal",
        "All 7 intelligence modules",
        "Monthly analysis runs",
        "AI chat with live HubSpot tools",
        "Email support"
      ]
    },
    {
      tier: "Tier 02",
      name: "Growth",
      sub: "For scaling RevOps teams",
      featured: true,
      features: [
        "1 HubSpot portal",
        "All modules + Deal Path Analysis",
        "Weekly analysis runs",
        "Priority support",
        "Recommendation tracking"
      ]
    },
    {
      tier: "Tier 03",
      name: "Agency",
      sub: "For partners & consultancies",
      featured: false,
      features: [
        "Up to 10 HubSpot portals",
        "All modules, daily runs",
        "White-label ready",
        "Dedicated success manager",
        "API access (Q3 2026)"
      ]
    }
  ];
  return (
    <section id="pricing" className="section-divider" data-screen-label="08 Pricing">
      <div className="container">
        <div className="sec-head">
          <div className="eyebrow">Pricing</div>
          <h2>Built for the teams already paying $50k for less.</h2>
          <p>Pricing is set per portfolio during onboarding — talk to us about which tier fits your org.</p>
        </div>
        <div className="pricing-grid">
          {tiers.map(t => (
            <div className={`price-card ${t.featured ? "featured" : ""}`} key={t.name}>
              {t.featured && <span className="featured-tag">Most asked for</span>}
              <span className="ptier">— {t.tier}</span>
              <div className="pname">{t.name}</div>
              <div className="pprice">Contact us</div>
              <div className="pprice-sub">{t.sub}</div>
              <ul>
                {t.features.map(f => <li key={f}>{f}</li>)}
              </ul>
              <div className="price-cta">
                <a href="/audit.html" className={`btn ${t.featured ? "btn-primary" : "btn-secondary"}`}>
                  Talk to us <span className="arrow">→</span>
                </a>
              </div>
            </div>
          ))}
        </div>
        <div className="pricing-note">
          — Onboarding by invitation · Hand-selected B2B SaaS revenue teams
        </div>
      </div>
    </section>
  );
}

/* ─── Final CTA ─── */
function FinalCTA() {
  return (
    <section id="cta" className="final-cta" data-screen-label="09 Final CTA">
      <div className="grid-bg" />
      <div className="container final-cta-inner">
        <div className="eyebrow" style={{justifyContent:'center',color:'#A1A1AA'}}>
          <span style={{display:'inline-block',width:28,height:2,background:'#0EA5A8'}}></span>
          Free HubSpot audit · Limited cohort
        </div>
        <h2>HubSpot shows you what happened.<br /><em>Fragment tells you what to do about it.</em></h2>
        <p>Connect your portal and we'll return a written audit of your pipeline health, persona gaps, and stage drop-off — within 48 hours, no obligation.</p>
        <div style={{display:'flex',gap:14,justifyContent:'center',flexWrap:'wrap'}}>
          <a href="/audit.html" className="btn btn-primary">Request your audit <span className="arrow">→</span></a>
          <a href="#how" className="btn btn-secondary">Read the methodology</a>
        </div>
      </div>
    </section>
  );
}

/* ─── Footer ─── */
function Footer() {
  return (
    <footer>
      <div className="container">
        <div className="footer-grid">
          <div>
            <Logo dark />
            <p className="footer-blurb">The diagnostic layer your CRM was always supposed to provide. Fragment Intelligence is built for hand-selected B2B SaaS revenue teams.</p>
          </div>
          <div>
            <h5>Product</h5>
            <ul>
              <li><a href="/#how">How it works</a></li>
              <li><a href="/#modules">Modules</a></li>
              <li><a href="/#produces">Output</a></li>
              <li><a href="/#pricing">Pricing</a></li>
            </ul>
          </div>
          <div>
            <h5>Company</h5>
            <ul>
              <li><a href="#">About</a></li>
              <li><a href="#">Methodology</a></li>
              <li><a href="#">Contact</a></li>
            </ul>
          </div>
          <div>
            <h5>Legal</h5>
            <ul>
              <li><a href="Privacy.html">Privacy</a></li>
            </ul>
          </div>
        </div>
        <div className="footer-bottom">
          <span>© 2026 Fragment Intelligence</span>
          <span>fragmentintelligence.com</span>
        </div>
      </div>
    </footer>
  );
}

Object.assign(window, {
  Nav, Hero, Problem, How, Produces, Chat, Modules, Sees, Pricing, FinalCTA, Footer, Logo, Logomark
});
