// primer-sections.jsx — HowItWorks, Features, UseCases, FAQ, CTASection, Footer

function platformTrialUrl(medium) {
  return (window.PrimerLinks && window.PrimerLinks.trial(medium)) || "#";
}

const { useState: useSt2 } = React;

// ── How it works ────────────────────────────────────────────────────────────
function HowItWorks() {
  const steps = [
    {
      n: "01", label: "PASTE",
      title: "Drop in any address.",
      body: "We pull parcel geometry, zoning, overlays, comps and topography from 3,142 county sources — no data prep required.",
      viz: (
        <div style={{ display: "flex", alignItems: "center", justifyContent: "center", height: "100%", padding: "0 20px" }}>
          <div style={{ width: "100%", background: "var(--paper)", border: "1px solid var(--line)", borderRadius: 999, padding: "10px 16px", display: "flex", alignItems: "center", gap: 10, fontSize: 13, color: "var(--muted)" }}>
            <Ico.pin/>
            <span style={{ flex: 1 }}>2401 Pacific Ave, Venice CA</span>
            <span style={{ width: 7, height: 7, borderRadius: 999, background: "var(--accent)" }}/>
          </div>
        </div>
      ),
    },
    {
      n: "02", label: "TUNE",
      title: "Adjust assumptions.",
      body: "Toggle TOC tiers, ADU bonuses, parking, construction type, and affordability. Everything that shifts feasibility is yours to control.",
      viz: (
        <div style={{ padding: "16px 20px", display: "flex", flexDirection: "column", gap: 9 }}>
          {[["TOC Tier 3", true], ["ADU bonus", true], ["Parking min", false], ["Affordable 11%", true]].map(([l, on]) => (
            <div key={l} style={{ display: "flex", justifyContent: "space-between", alignItems: "center" }}>
              <span style={{ fontSize: 12.5, color: "var(--ink-soft)" }}>{l}</span>
              <div style={{ width: 28, height: 16, borderRadius: 999, background: on ? "var(--accent)" : "var(--line)", position: "relative" }}>
                <div style={{ width: 12, height: 12, borderRadius: 999, background: on ? "var(--accent-ink)" : "var(--muted-2)", position: "absolute", top: 2, left: on ? 14 : 2 }}/>
              </div>
            </div>
          ))}
        </div>
      ),
    },
    {
      n: "03", label: "SHIP",
      title: "Get a full report.",
      body: "Yield study, pro forma, code summary, comps and a 3D massing — branded, exportable, and decision-ready in under 60 seconds.",
      viz: (
        <div style={{ padding: "16px 20px", display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 7 }}>
          {["YIELD", "PRO-FORMA", "CODE", "COMPS", "MASSING", "PDF"].map(t => (
            <div key={t} style={{ padding: "9px 6px", background: "var(--paper)", border: "1px solid var(--line)", borderRadius: 7, textAlign: "center" }}>
              <div className="p-mono" style={{ fontSize: 10, color: "var(--muted)", letterSpacing: "0.06em" }}>{t}</div>
            </div>
          ))}
          <div style={{ gridColumn: "1/-1", marginTop: 4, display: "flex", justifyContent: "space-between" }}>
            <span className="p-mono" style={{ fontSize: 10, color: "var(--muted)" }}>READY</span>
            <span className="p-mono" style={{ fontSize: 10, color: "var(--ink)", fontWeight: 600 }}>58.2s</span>
          </div>
        </div>
      ),
    },
  ];

  return (
    <section className="p-section">
      <div className="p-container">
        <div className="p-section-head">
          <div>
            <div className="p-mono p-section-label">— 01 · Workflow</div>
            <h2 className="p-h2">From address to <em>underwriting</em><br/>in under a minute.</h2>
          </div>
          <p className="p-body-muted" style={{ maxWidth: 360 }}>Three steps. No spreadsheets, no zoning PDFs, no waiting on a junior analyst.</p>
        </div>
        <div className="p-steps">
          {steps.map(s => (
            <div key={s.n} className="p-step">
              <div className="p-step-head">
                <span className="p-step-num">{s.n}</span>
                <span className="p-mono" style={{ color: "var(--muted)", fontSize: 11, letterSpacing: "0.08em" }}>{s.label}</span>
              </div>
              <h3 className="p-step-title">{s.title}</h3>
              <p className="p-body-muted" style={{ fontSize: 14, marginBottom: 20 }}>{s.body}</p>
              <div className="p-step-viz">{s.viz}</div>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

// ── Features (bento grid) ───────────────────────────────────────────────────
// ── Capability visuals (swap inside the sticky frame) ───────────────────────
const FV = {
  ink: "#0F172A", muted: "#64748B", muted2: "#94A3B8", border: "#E2E8F0",
  blue: "#2563EB", blueBg: "#EFF4FF", bg: "#FFFFFF", bg2: "#F8FAFC",
  mono: '"Geist Mono", monospace',
};

function VizZoning() {
  return (
    <div style={{ width: 340, display: "flex", flexDirection: "column", gap: 12 }}>
      <div style={{ display: "inline-flex", alignSelf: "flex-start", alignItems: "center", gap: 8, background: FV.bg, border: `1px solid ${FV.border}`, borderRadius: 999, padding: "8px 16px", boxShadow: "0 4px 16px -8px rgba(15,23,42,0.2)" }}>
        <span style={{ width: 9, height: 9, borderRadius: 999, background: "#22C55E" }}/>
        <span style={{ fontWeight: 700, fontSize: 15 }}>R7-2</span>
        <span style={{ fontSize: 12.5, color: FV.muted }}>+ TOC Tier 3 overlay</span>
      </div>
      <div style={{ background: FV.bg, border: `1px solid ${FV.border}`, borderRadius: 16, padding: "16px 18px", boxShadow: "0 12px 40px -16px rgba(15,23,42,0.18)" }}>
        {[["Height limit", "85 ft", true], ["FAR", "3.44 → 4.6", true], ["Density", "22 units", true], ["Setbacks", "F 15 / R 30", true], ["Parking min", "0 stalls", true]].map(([k, v], i, a) => (
          <div key={k} style={{ display: "flex", justifyContent: "space-between", alignItems: "center", padding: "9px 0", borderBottom: i < a.length - 1 ? `1px solid ${FV.bg2}` : "none" }}>
            <span style={{ fontSize: 13, color: FV.muted }}>{k}</span>
            <span style={{ display: "flex", alignItems: "center", gap: 7 }}>
              <span style={{ fontSize: 13, fontWeight: 600, fontFamily: FV.mono }}>{v}</span>
              <span style={{ width: 17, height: 17, borderRadius: 999, background: FV.blue, color: "#fff", display: "grid", placeItems: "center" }}><Ico.check/></span>
            </span>
          </div>
        ))}
      </div>
    </div>
  );
}

function VizYield() {
  return (
    <div style={{ width: 360, display: "flex", flexDirection: "column", gap: 12 }}>
      <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 12 }}>
        {[["Max units", "22", "units"], ["Buildable", "14,820", "sf GBA"], ["NOI (yr 1)", "$1.42", "M"], ["uIRR", "18.4", "%"]].map(([l, v, u]) => (
          <div key={l} style={{ background: FV.bg, border: `1px solid ${FV.border}`, borderRadius: 14, padding: "14px 16px", boxShadow: "0 8px 28px -14px rgba(15,23,42,0.16)" }}>
            <div style={{ fontSize: 11, color: FV.muted, fontFamily: FV.mono, textTransform: "uppercase", letterSpacing: "0.05em" }}>{l}</div>
            <div style={{ fontSize: 28, fontWeight: 600, letterSpacing: "-0.03em", marginTop: 5 }}>{v}<span style={{ fontSize: 13, fontWeight: 400, color: FV.muted, marginLeft: 4 }}>{u}</span></div>
          </div>
        ))}
      </div>
      <div style={{ background: FV.ink, borderRadius: 14, padding: "14px 18px", color: "#fff" }}>
        <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 10 }}>
          <span style={{ fontSize: 11.5, color: "rgba(255,255,255,0.6)", fontFamily: FV.mono, textTransform: "uppercase", letterSpacing: "0.06em" }}>Pro forma · 10-yr</span>
          <span style={{ fontSize: 12, fontWeight: 600, color: "#4ADE80" }}>+18.4% ↑</span>
        </div>
        <svg viewBox="0 0 320 70" style={{ width: "100%", height: 70 }}>
          <polyline points="0,58 40,52 80,48 120,38 160,30 200,24 240,16 280,12 320,5" fill="none" stroke="#fff" strokeWidth="2"/>
          <polyline points="0,58 40,52 80,48 120,38 160,30 200,24 240,16 280,12 320,5 320,70 0,70" fill="rgba(255,255,255,0.1)"/>
          <circle cx="320" cy="5" r="4" fill="#4ADE80"/>
        </svg>
      </div>
    </div>
  );
}

function VizScenarios() {
  const rows = [
    ["By-right", "12 units", 0.42, false],
    ["+ ADU bonus", "16 units", 0.58, false],
    ["+ TOC Tier 2", "19 units", 0.74, false],
    ["+ TOC Tier 3", "22 units", 1.0, true],
  ];
  return (
    <div style={{ width: 360, background: FV.bg, border: `1px solid ${FV.border}`, borderRadius: 18, padding: "20px 20px 18px", boxShadow: "0 12px 40px -16px rgba(15,23,42,0.18)" }}>
      <div style={{ fontSize: 11.5, color: FV.muted, fontFamily: FV.mono, textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: 16 }}>Scenario comparison</div>
      <div style={{ display: "flex", flexDirection: "column", gap: 14 }}>
        {rows.map(([l, v, pct, win]) => (
          <div key={l}>
            <div style={{ display: "flex", justifyContent: "space-between", marginBottom: 6 }}>
              <span style={{ fontSize: 13, fontWeight: win ? 700 : 500, color: win ? FV.ink : FV.muted }}>{l}</span>
              <span style={{ fontSize: 13, fontWeight: 600, fontFamily: FV.mono, color: win ? FV.blue : FV.muted }}>{v}</span>
            </div>
            <div style={{ height: 10, borderRadius: 999, background: FV.bg2 }}>
              <div style={{ width: `${pct * 100}%`, height: "100%", borderRadius: 999, background: win ? FV.blue : "#CBD5E1", transition: "width .6s" }}/>
            </div>
          </div>
        ))}
      </div>
      <div style={{ marginTop: 16, paddingTop: 14, borderTop: `1px solid ${FV.bg2}`, display: "flex", justifyContent: "space-between", alignItems: "center" }}>
        <span style={{ fontSize: 12.5, color: FV.muted }}>Δ vs by-right</span>
        <span style={{ fontSize: 15, fontWeight: 700, color: FV.blue }}>+10 units · +$640K NOI</span>
      </div>
    </div>
  );
}

function VizSitePlan() {
  return (
    <div style={{ width: 360, background: FV.bg, border: `1px solid ${FV.border}`, borderRadius: 18, padding: 18, boxShadow: "0 12px 40px -16px rgba(15,23,42,0.18)" }}>
      <div style={{ borderRadius: 12, overflow: "hidden", background: "#EEF1F4", border: `1px solid ${FV.border}` }}>
        <svg viewBox="0 0 320 220" style={{ width: "100%", height: 220, display: "block" }}>
          <defs>
            <pattern id="fvhatch" patternUnits="userSpaceOnUse" width="7" height="7" patternTransform="rotate(45)">
              <line x1="0" y1="0" x2="0" y2="7" stroke="rgba(15,23,42,0.08)" strokeWidth="1"/>
            </pattern>
          </defs>
          <rect width="320" height="220" fill="#EEF1F4"/>
          <path d="M40 28 L 286 28 L 296 192 L 50 192 Z" fill="url(#fvhatch)" stroke={FV.ink} strokeWidth="1.4"/>
          <path d="M70 48 L 256 48 L 264 172 L 78 172 Z" fill="none" stroke={FV.muted} strokeWidth="1" strokeDasharray="5 3"/>
          <rect x="98" y="66" width="160" height="86" fill={FV.blue} opacity="0.16"/>
          <rect x="98" y="66" width="160" height="86" fill="none" stroke={FV.blue} strokeWidth="2"/>
          <text x="46" y="22" fontFamily={FV.mono} fontSize="9" fill={FV.muted}>LOT · 7,200 SF</text>
          <text x="104" y="112" fontFamily={FV.mono} fontSize="10" fill={FV.blue} fontWeight="600">14,820 SF · 4 STORIES</text>
        </svg>
      </div>
      <div style={{ display: "flex", justifyContent: "space-between", padding: "12px 4px 2px" }}>
        {[["Footprint", "3,705 sf"], ["Stories", "4"], ["Massing", "Podium"]].map(([k, v]) => (
          <div key={k}>
            <div style={{ fontSize: 11, color: FV.muted, fontFamily: FV.mono, textTransform: "uppercase", letterSpacing: "0.04em" }}>{k}</div>
            <div style={{ fontSize: 15, fontWeight: 600, marginTop: 2 }}>{v}</div>
          </div>
        ))}
      </div>
    </div>
  );
}

const CAPABILITIES = [
  { tag: "ZONING", title: "Zoning, decoded — not just cited.", body: "Every base zone, overlay, height and FAR limit interpreted and applied to your parcel. Primer reads the code so you don't open a single municipal PDF.", Viz: VizZoning },
  { tag: "YIELD", title: "A full yield study in minutes.", body: "Unit counts, buildable GBA, NOI and unlevered IRR — driven by the same envelope your architect would draw, with your hard and soft costs baked in.", Viz: VizYield },
  { tag: "SCENARIOS", title: "Stack every incentive, side by side.", body: "Run by-right against ADU bonuses and each TOC tier at once. See exactly what every assumption is worth before you commit a dollar of pre-dev.", Viz: VizScenarios },
  { tag: "SITE PLAN", title: "Buildable footprint, drawn for you.", body: "Setbacks, footprint and a massing study generated straight from the live envelope — a site plan you can hand to design without a redraw.", Viz: VizSitePlan },
];

// ── Features (sticky-scroll showcase; stacked below 1024px) ─────────────────
function Features() {
  const [active, setActive] = useSt2(0);
  const [stacked, setStacked] = useSt2(() => window.matchMedia("(max-width: 1024px)").matches);
  const refs = React.useRef([]);

  React.useEffect(() => {
    const mq = window.matchMedia("(max-width: 1024px)");
    const onChange = (e) => setStacked(e.matches);
    mq.addEventListener("change", onChange);
    return () => mq.removeEventListener("change", onChange);
  }, []);

  React.useEffect(() => {
    if (stacked) return; // no scroll-sync needed for the stacked layout
    let ticking = false;
    const onScroll = () => {
      if (ticking) return;
      ticking = true;
      requestAnimationFrame(() => {
        ticking = false;
        const mid = window.innerHeight / 2;
        let best = 0, bestDist = Infinity;
        refs.current.forEach((el, i) => {
          if (!el) return;
          const b = el.getBoundingClientRect();
          const c = b.top + b.height / 2;
          const d = Math.abs(c - mid);
          if (d < bestDist) { bestDist = d; best = i; }
        });
        setActive(best);
      });
    };
    window.addEventListener("scroll", onScroll, { passive: true });
    onScroll();
    return () => window.removeEventListener("scroll", onScroll);
  }, [stacked]);

  return (
    <section className="p-section" style={{ paddingTop: 0 }}>
      <div className="p-container">
        <div className="p-section-head" style={{ marginBottom: 60 }}>
          <div>
            <div className="p-mono p-section-label">— 02 · Capabilities</div>
            <h2 className="p-h2">A real underwriter,<br/>not a parcel viewer.</h2>
          </div>
          <p className="p-body-muted" style={{ maxWidth: 360 }}>Everything an acquisition team builds badly in a spreadsheet, shipped in one report.</p>
        </div>

        {stacked ?
        <div className="p-cap-stack">
          {CAPABILITIES.map((c, i) => {
            const Viz = c.Viz;
            return (
              <div key={i}>
                <div className="p-cap-tag">{c.tag}</div>
                <h3 className="p-cap-title">{c.title}</h3>
                <p className="p-cap-body" style={{ marginBottom: 24 }}>{c.body}</p>
                <div className="p-sticky-frame p-cap-stack-frame"><Viz/></div>
              </div>
            );
          })}
        </div>
        :
        <div className="p-sticky-wrap">
          {/* sticky visual frame */}
          <div className="p-sticky-col">
            <div className="p-sticky-frame">
              {CAPABILITIES.map((c, i) => {
                const Viz = c.Viz;
                return (
                  <div key={i} className={`p-sticky-viz${active === i ? " is-active" : ""}`}>
                    <Viz/>
                  </div>
                );
              })}
            </div>
          </div>

          {/* scrolling category list */}
          <div className="p-cap-list">
            {CAPABILITIES.map((c, i) => (
              <div
                key={i}
                data-idx={i}
                ref={el => refs.current[i] = el}
                className={`p-cap-item${active === i ? " is-active" : ""}`}
              >
                <div className="p-cap-tag">{c.tag}</div>
                <h3 className="p-cap-title">{c.title}</h3>
                <p className="p-cap-body">{c.body}</p>
              </div>
            ))}
          </div>
        </div>
        }
      </div>
    </section>
  );
}

// ── Use cases ───────────────────────────────────────────────────────────────
function UseCases() {
  const cases = [
    { tag: "Acquisitions", title: "Triage 50 deals on Monday. Underwrite 3 on Tuesday.", stat: "42×", sub: "faster top-of-funnel screening", dark: true },
    { tag: "Development", title: "Compare by-right vs. bonus envelopes before you call the architect.", stat: "$0", sub: "per re-run, after first report", dark: false, accent: true },
    { tag: "Brokerage", title: "Land sellers and buyers with a feasibility, not a flyer.", stat: "3.4×", sub: "higher LOI close rate", dark: false },
  ];

  const compare = [
    { label: "Timeline", old: "4–6 weeks", neu: "Under a minute", mag: "≈ 50,000× faster" },
    { label: "Cost per study", old: "$10K–200K", neu: "Included", mag: "$0 per re-run" },
    { label: "Scenarios modeled", old: "1–3", neu: "1,000+", mag: "≈ 1,000× more" },
    { label: "Coverage", old: "1 sub-market", neu: "50 states", mag: "Nationwide" },
  ];

  return (
    <section className="p-section" style={{ paddingTop: 0 }}>
      <div className="p-container">
        <div className="p-section-head">
          <div>
            <div className="p-mono p-section-label">— 03 · Who uses it</div>
            <h2 className="p-h2">Built for the deal team,<br/>not the data team.</h2>
          </div>
          <p className="p-body-muted" style={{ maxWidth: 360 }}>Acquisitions, development, and brokerage teams use Primer to triage the top of their funnel.</p>
        </div>
        <div className="p-use-grid">
          {cases.map(c => (
            <div key={c.tag} className={`p-use-card ${c.dark ? "dark" : ""} ${c.accent ? "accent" : ""}`}>
              <div>
                <div className="p-mono p-use-tag">{c.tag}</div>
                <h4 className="p-use-title">{c.title}</h4>
              </div>
              <div>
                <div className="p-use-stat">{c.stat}</div>
                <div className="p-mono p-use-sub">{c.sub}</div>
              </div>
            </div>
          ))}
        </div>

        {/* Part 2 — consultant → client comparison */}
        <div className="p-compare-block">
          <div className="p-compare-head">
            <div className="p-mono p-section-label" style={{ marginBottom: 0 }}>— The math</div>
            <div className="p-compare-legend">
              <span><span className="p-dot p-dot-old" />Feasibility consultant</span>
              <span><span className="p-dot p-dot-new" />Primer</span>
            </div>
          </div>
          <div className="p-compare-rows">
            {compare.map(r => (
              <div key={r.label} className="p-compare-row">
                <div className="p-mono p-compare-label">{r.label}</div>
                <div className="p-compare-old">{r.old}</div>
                <div className="p-compare-arrow" aria-hidden="true">→</div>
                <div className="p-compare-new">{r.neu}</div>
                <div className="p-mono p-compare-mag">{r.mag}</div>
              </div>
            ))}
          </div>
        </div>
      </div>
    </section>
  );
}

// ── FAQ ─────────────────────────────────────────────────────────────────────
function FAQ() {
  const [open, setOpen] = useSt2(-1);
  const items = [
    ["Where does your data come from?", "We license parcel geometry and ownership from regrid plus 3,142 county recorders, zoning text from municipal codifiers, and pro-forma comps from public deeds plus a curated private set."],
    ["How accurate is the feasibility?", "Within 4% of architect-drawn envelopes on our 600-parcel validation set. Pro-forma uses your hard and soft cost assumptions — set them once at the team level."],
    ["Can I customize the outputs?", "Yes — that's the whole point. Toggle TOC, ADU, density bonus, parking, construction type, affordability, financing assumptions. Re-runs take about 14 seconds."],
    ["What markets do you cover?", "All 50 states. Deep zoning interpretation is live in 240+ metros, with new cities added within 5 business days on request."],
    ["Do you integrate with our CRM?", "Salesforce, HubSpot, Dealpath, and Juniper Square. Reports auto-attach to the deal record."],
    ["Is there a free trial?", "14 days, most teams convert after their first underwrite."],
  ];

  return (
    <section className="p-section" style={{ paddingTop: 0 }}>
      <div className="p-container">
        <div className="p-faq-grid" style={{ display: "grid", gridTemplateColumns: "1fr 1.6fr", gap: 100, alignItems: "start" }}>
          <div>
            <div className="p-mono p-section-label">— 04 · Questions</div>
            <h2 className="p-h2">Things people<br/>ask first.</h2>
            <p className="p-body-muted" style={{ marginTop: 20, maxWidth: 320 }}>
              Didn't see yours? Email <strong style={{ color: "var(--ink)" }}>hello@primer.app</strong> or grab a 15-min walkthrough.
            </p>
          </div>
          <div>
            {items.map(([q, a], i) => (
              <div key={i} className="p-faq-item" onClick={() => setOpen(open === i ? -1 : i)}>
                <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", gap: 16 }}>
                  <span className="p-faq-q">{q}</span>
                  <span className="p-faq-toggle">{open === i ? <Ico.minus/> : <Ico.plus/>}</span>
                </div>
                {open === i && <p className="p-faq-a">{a}</p>}
              </div>
            ))}
          </div>
        </div>
      </div>
    </section>
  );
}

// ── CTA ─────────────────────────────────────────────────────────────────────
function CTASection() {
  return (
    <section className="p-section" style={{ paddingTop: 100 }}>
      <div className="p-container">
        <div className="p-cta">
          <div className="p-cta-grid"></div>
          <div className="p-cta-inner">
            <div className="p-mono" style={{ color: "rgba(255,255,255,0.45)", marginBottom: 28, letterSpacing: "0.08em" }}>— READY WHEN YOU ARE</div>
            <h2 className="p-cta-h">
              Stop chasing line&nbsp;items.<br/>
              <span className="p-cta-accent">Underwrite&nbsp;the&nbsp;address.</span>
            </h2>
            <div className="p-cta-actions" style={{ display: "flex", gap: 12, alignItems: "center", marginTop: 40, flexWrap: "wrap" }}>
              <a href={platformTrialUrl("cta")} className="p-btn p-btn-accent" data-track="cta_trial_click" style={{ background: "var(--paper)", color: "var(--ink)" }}>
                Start free trial <Ico.arrow/>
              </a>
              <button className="p-btn p-btn-ghost" style={{ borderColor: "rgba(255,255,255,0.2)", color: "var(--paper)" }}>
                Book a 15-min demo
              </button>
              <span className="p-mono" style={{ marginLeft: 12, fontSize: 11, color: "rgba(255,255,255,0.4)", letterSpacing: "0.08em" }}>
                NO CARD · 14 DAYS · UNLIMITED REPORTS
              </span>
            </div>
          </div>
        </div>
      </div>
    </section>
  );
}

// ── Footer ──────────────────────────────────────────────────────────────────
function Footer() {
  return (
    <footer className="p-footer">
      <div className="p-container" style={{ maxWidth: 1320, margin: "0 auto" }}>
        <div className="p-footer-grid">
          <div>
            <div style={{ display: "flex", alignItems: "center", gap: 10, fontSize: 20, fontWeight: 600, letterSpacing: "-0.02em", marginBottom: 14 }}>
              <img src="assets/primer-mark.png" alt="" style={{ width: 34, height: 34, objectFit: "contain", filter: "invert(1)" }}/>
              Primer
            </div>
            <p style={{ fontSize: 14, color: "rgba(255,255,255,0.5)", maxWidth: 260, lineHeight: 1.55 }}>Feasibility for real estate developers. Address in, report out — under a minute.</p>
          </div>
          {[
            ["Use cases", ["Home builders", "Developers", "Acquisitions", "Brokerages", "Lenders", "Capital markets"]],
            ["Company", ["Insights", "Pricing", "Careers", "Press", "Contact"]],
            ["Legal", ["Privacy", "Terms", "Security"]],
          ].map(([h, links]) => (
            <div key={h}>
              <div className="p-mono p-footer-label">{h}</div>
              {links.map(l => {
                const ucSlugs = { "Home builders": "home-builders", "Developers": "developers", "Acquisitions": "acquisitions", "Brokerages": "brokerages", "Lenders": "lenders", "Capital markets": "capital-markets" };
                if (l === "Careers") {
                  return <a key={l} href="https://www.linkedin.com/company/primitive-ai/?viewAsMember=true" target="_blank" rel="noopener noreferrer" className="p-footer-link">{l}</a>;
                }
                const href = ucSlugs[l] ? `UseCase.html?slug=${ucSlugs[l]}`
                  : l === "Pricing" ? "Pricing.html"
                  : l === "Contact" || l === "Press" ? "Contact.html"
                  : l === "Insights" ? "Insights.html" : "#";
                return <a key={l} href={href} className="p-footer-link">{l}</a>;
              })}
            </div>
          ))}
        </div>
        <div className="p-footer-meta">
          <span>© 2026 PRIMITIVE AI INC.</span>
          <span>SOC 2 TYPE II &nbsp;·&nbsp; MADE IN NEW YORK</span>
        </div>
      </div>
    </footer>
  );
}

Object.assign(window, { HowItWorks, Features, UseCases, FAQ, CTASection, Footer });
