// SIGNAL — Fuel Talent homepage
// Editorial-techno: Space Grotesk (display) + Geist Mono (meta) + cream/ink/rust

const { useState, useEffect, useRef, useMemo, useCallback } = React;

const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{
  "accent": "#b94a1f",
  "theme": "light",
  "typeMode": "geo-mono"
}/*EDITMODE-END*/;

const ACCENTS = {
  rust:   { color: "#b94a1f", label: "Rust" },
  forest: { color: "#1f6b3a", label: "Forest" },
  blue:   { color: "#1e4ed8", label: "Electric" },
  amber:  { color: "#c98c1a", label: "Amber" },
};

// ─── content ────────────────────────────────────────────────────────────
const NAV = [
  { label: "Expertise", href: "#expertise", panel: "expertise" },
  { label: "Services", href: "#services", panel: "services" },
  { label: "Resources", href: "#resources", panel: "resources" },
  { label: "Find a Job", href: "jobs.html", panel: null, noUnderline: true },
  { label: "About", href: "#about", panel: null, noUnderline: true },
];

const EXPERTISE = [
  { id: "tech",     short: "Tech",        title: "Tech & Engineering",          blurb: "Software, infra, ML, security and platform leaders for high-growth tech.", glyph: "Σ" },
  { id: "design",   short: "Design",      title: "Design & UX Research",         blurb: "Product designers, design systems leads, and research-led practitioners.", glyph: "◐" },
  { id: "product",  short: "Product",     title: "Product",                      blurb: "PMs and product leadership who can ship inside ambiguity.", glyph: "△" },
  { id: "marketing",short: "Marketing",   title: "Marketing",                    blurb: "Growth, brand, content and demand-gen operators for B2B and consumer.", glyph: "◉" },
  { id: "csuite",   short: "C-Suite",     title: "C-Suite",                      blurb: "Founder, CEO, CTO, CPO and CFO searches for venture-backed companies.", glyph: "✕" },
  { id: "admin",    short: "Admin",       title: "Admin & Lifestyle",            blurb: "Executive assistants, chiefs of staff and household operators.", glyph: "✦" },
  { id: "hrops",    short: "HR & Ops",    title: "HR & Operations",              blurb: "People leaders, recruiters, biz-ops and program managers.", glyph: "⌘" },
  { id: "finance",  short: "Finance",     title: "Finance & Accounting",         blurb: "Controllers, FP&A, CFOs and finance operators ready to scale.", glyph: "$" },
];

const SERVICES = [
  { num: "01", title: "Recruiting & Staffing",        blurb: "Permanent and contract hires across engineering, design, product and operations. We average 18 days to offer and close 91% of extended offers." },
  { num: "02", title: "Professional & Managed Services", blurb: "Embedded teams of senior specialists who execute critical initiatives or run ongoing operations end-to-end." },
  { num: "03", title: "Digital Workers",              blurb: "An AI-fueled workforce of digital agents that automates repetitive work — so your humans can do the hard thinking." },
];

const TESTIMONIALS = [
  { quote: "Fuel consistently takes the time to learn what's needed from an open role, how it fits within the team, and the qualities that will help a candidate thrive.", name: "CHRO", role: "Think Tank / Executive Private Office", initials: "TT" },
  { quote: "We have worked with Fuel for our top technical hiring efforts. They are incredibly responsive, adaptable and a valuable partner that delivers results.", name: "Beth Mead", role: "Providence", initials: "BM" },
  { quote: "Continuous improvement is in your DNA. The experience and the vision I had before working with your team was exactly what I'd hoped for.", name: "Casey Bayless", role: "Moss Adams — Recruiting Manager", initials: "CB" },
  { quote: "Fuel's ability to consistently present high-quality candidates tailored to our specific needs has been remarkable.", name: "Marc", role: "Co-Founder & CTO", initials: "MC" },
  { quote: "We dropped the other firms. Fuel found the most effective candidates for us.", name: "Director of Product Design", role: "Remitly", initials: "RT" },
];

const CLIENT_WORDMARKS = [
  { name: "Providence",   render: () => <span className="wm wm-providence">Providence</span> },
  { name: "Moss Adams",   render: () => <span className="wm wm-mossadams">MOSS ADAMS</span> },
  { name: "Appen",         render: () => <span className="wm wm-appen"><i>a</i>ppen</span> },
  { name: "Remitly",       render: () => <span className="wm wm-remitly">Remitly</span> },
  { name: "Whitepages",    render: () => <span className="wm wm-whitepages">white<b>pages</b></span> },
  { name: "Madrona",       render: () => <span className="wm wm-madrona">Madrona</span> },
  { name: "RealSelf",      render: () => <span className="wm wm-realself">real<b>self</b></span> },
  { name: "KnowLabs",      render: () => <span className="wm wm-knowlabs">knowlabs</span> },
  { name: "Pacagen",       render: () => <span className="wm wm-pacagen">P<i>aca</i>gen</span> },
];

const JOBS_PREVIEW = [
  { id: "FT-0481", title: "Staff Software Engineer, Platform", company: "Series C SaaS", loc: "Seattle, WA · Hybrid",  type: "Direct Hire", area: "Tech" },
  { id: "FT-0476", title: "Senior Product Designer",            company: "AI Health Startup",   loc: "Remote (US)", type: "Direct Hire", area: "Design" },
  { id: "FT-0470", title: "Director of Product, Growth",        company: "Consumer Marketplace", loc: "Bellevue, WA", type: "Direct Hire", area: "Product" },
  { id: "FT-0463", title: "Head of Recruiting",                 company: "Climate Tech",       loc: "Seattle, WA · Onsite", type: "Direct Hire", area: "HR & Ops" },
];

const RESOURCES = [
  { kind: "Field Notes",  title: "10 strategies for attracting top talent in a thin market", read: "5 min", date: "May 12" },
  { kind: "Field Notes",  title: "Streamlining the virtual onboarding process",              read: "4 min", date: "Apr 29" },
  { kind: "Candidates",   title: "Affected by mass layoffs? Where to start and regain confidence", read: "6 min", date: "Apr 14" },
  { kind: "Case Study",   title: "How we built an engineering team from zero to 40 in 11 months", read: "8 min", date: "Mar 30" },
];

const ROLES_PERSONALIZE = [
  { id: "eng",     label: "Engineering",     meta: "48 hr to candidates",    line: "Engineers" },
  { id: "design",  label: "Design & UX",     meta: "Specialist network",     line: "Designers" },
  { id: "product", label: "Product",         meta: "PM-led search team",     line: "Product leaders" },
  { id: "leader",  label: "Leadership",      meta: "Confidential C-suite",   line: "Executives" },
  { id: "candidate", label: "I'm looking",   meta: "Career partner",         line: "Your next role" },
];

const STAGES = ["Seed", "Series A", "Series B", "Series C+", "Public", "Private Office"];

// ─── helpers ────────────────────────────────────────────────────────────
function useScrollProgress() {
  const [p, setP] = useState(0);
  useEffect(() => {
    const on = () => {
      const max = document.documentElement.scrollHeight - window.innerHeight;
      setP(Math.min(1, Math.max(0, window.scrollY / Math.max(1, max))));
    };
    on(); window.addEventListener("scroll", on, { passive: true });
    return () => window.removeEventListener("scroll", on);
  }, []);
  return p;
}

function useInView(opts = {}) {
  const ref = useRef(null);
  const [seen, setSeen] = useState(false);
  useEffect(() => {
    if (!ref.current || seen) return;
    const io = new IntersectionObserver(([e]) => {
      if (e.isIntersecting) { setSeen(true); io.disconnect(); }
    }, { threshold: 0.3, ...opts });
    io.observe(ref.current);
    return () => io.disconnect();
  }, [seen]);
  return [ref, seen];
}

function CountUp({ to, suffix = "", duration = 1400, decimals = 0 }) {
  const [ref, seen] = useInView();
  const [v, setV] = useState(0);
  useEffect(() => {
    if (!seen) return;
    const start = performance.now();
    let raf;
    const tick = (t) => {
      const k = Math.min(1, (t - start) / duration);
      const eased = 1 - Math.pow(1 - k, 3);
      setV(to * eased);
      if (k < 1) raf = requestAnimationFrame(tick);
    };
    raf = requestAnimationFrame(tick);
    return () => cancelAnimationFrame(raf);
  }, [seen, to, duration]);
  return <span ref={ref}>{v.toFixed(decimals)}{suffix}</span>;
}

// ─── geometric SVG art ──────────────────────────────────────────────────
function ArtConcentric({ accent }) {
  return (
    <svg viewBox="0 0 400 400" width="100%" height="100%" preserveAspectRatio="xMidYMid meet" style={{ display: "block" }}>
      <rect width="400" height="400" fill="var(--paper)" />
      {Array.from({ length: 22 }).map((_, i) => (
        <circle key={i} cx="200" cy="200" r={10 + i * 8.5}
          fill="none" stroke="var(--ink)" strokeOpacity={0.06 + (i % 6) * 0.06}
          strokeWidth={i === 16 ? 1.4 : 0.6}
          strokeDasharray={i % 3 === 0 ? "1 4" : "none"} />
      ))}
      <circle cx="200" cy="200" r="14" fill={accent} />
      <text x="220" y="200" fontFamily="var(--font-mono)" fontSize="11" fill="var(--muted)" dominantBaseline="middle">FIT · 0.96</text>
      <text x="20" y="380" fontFamily="var(--font-mono)" fontSize="10" fill="var(--muted)">FIG.01 — FIT MODEL</text>
    </svg>
  );
}

function ArtGrid({ accent }) {
  return (
    <svg viewBox="0 0 400 400" width="100%" height="100%" preserveAspectRatio="xMidYMid meet" style={{ display: "block" }}>
      <rect width="400" height="400" fill="var(--paper)" />
      {Array.from({ length: 14 }).map((_, r) =>
        Array.from({ length: 14 }).map((__, c) => {
          const cx = 30 + c * 26, cy = 30 + r * 26;
          const dist = Math.hypot(cx - 200, cy - 200);
          const k = Math.max(0, 1 - dist / 220);
          const size = 1 + k * 7;
          const isAccent = (r === 7 && c === 7) || (r === 5 && c === 9);
          return <circle key={`${r}-${c}`} cx={cx} cy={cy} r={size}
            fill={isAccent ? accent : "var(--ink)"}
            fillOpacity={isAccent ? 1 : (0.06 + k * 0.7)} />;
        })
      )}
      <text x="20" y="380" fontFamily="var(--font-mono)" fontSize="10" fill="var(--muted)">FIG.02 — NETWORK DENSITY</text>
    </svg>
  );
}

function ArtTopo({ accent }) {
  const paths = [];
  for (let i = 0; i < 18; i++) {
    let d = `M 0 ${40 + i * 18} `;
    for (let x = 0; x <= 400; x += 20) {
      const y = 40 + i * 18 + Math.sin(x * 0.024 + i * 0.6) * (8 + (i % 4)) + Math.cos(x * 0.01 + i) * 4;
      d += `L ${x} ${y.toFixed(1)} `;
    }
    paths.push(d);
  }
  return (
    <svg viewBox="0 0 400 400" width="100%" height="100%" preserveAspectRatio="xMidYMid meet" style={{ display: "block" }}>
      <rect width="400" height="400" fill="var(--paper)" />
      {paths.map((d, i) => (
        <path key={i} d={d} fill="none" stroke="var(--ink)"
          strokeOpacity={0.08 + (i % 5) * 0.06}
          strokeWidth={i === 9 ? 1.4 : 0.5} />
      ))}
      <line x1="200" y1="0" x2="200" y2="400" stroke={accent} strokeOpacity="0.7" strokeDasharray="2 6" strokeWidth="1" />
      <circle cx="200" cy="202" r="7" fill={accent} />
      <text x="20" y="380" fontFamily="var(--font-mono)" fontSize="10" fill="var(--muted)">FIG.03 — TALENT TOPOGRAPHY</text>
    </svg>
  );
}

function ArtBars({ accent }) {
  const data = [12, 18, 9, 24, 32, 28, 41, 38, 52, 47, 62, 58, 71, 79, 91];
  return (
    <svg viewBox="0 0 400 400" width="100%" height="100%" preserveAspectRatio="xMidYMid meet" style={{ display: "block" }}>
      <rect width="400" height="400" fill="var(--paper)" />
      {data.map((v, i) => {
        const h = v * 3.2;
        const x = 30 + i * 24;
        const y = 340 - h;
        const isLast = i >= data.length - 3;
        return (
          <g key={i}>
            <rect x={x} y={y} width="16" height={h}
              fill={isLast ? accent : "var(--ink)"}
              fillOpacity={isLast ? 1 : 0.12 + i * 0.04} />
            <text x={x + 8} y="358" fontFamily="var(--font-mono)" fontSize="8" textAnchor="middle" fill="var(--muted)">
              {String(i + 1).padStart(2, "0")}
            </text>
          </g>
        );
      })}
      <line x1="20" y1="340" x2="380" y2="340" stroke="var(--ink)" strokeWidth="0.7" />
      <text x="20" y="380" fontFamily="var(--font-mono)" fontSize="10" fill="var(--muted)">FIG.04 — CLOSE RATE OVER 15 SEARCHES · 91%</text>
    </svg>
  );
}

const ART_MAP = {
  who: ArtConcentric,
  how: ArtGrid,
  why: ArtBars,
};

function ExpertGlyph({ kind, accent }) {
  // tiny SVGs per expertise card
  const stroke = "var(--ink)", op = 0.7;
  switch (kind) {
    case "tech":     return <svg viewBox="0 0 60 60" width="60" height="60"><rect x="6" y="6" width="48" height="48" fill="none" stroke={stroke} strokeOpacity={op}/><path d="M14 22 L22 30 L14 38" fill="none" stroke={accent} strokeWidth="1.5"/><line x1="26" y1="40" x2="46" y2="40" stroke={accent} strokeWidth="1.5"/></svg>;
    case "design":   return <svg viewBox="0 0 60 60" width="60" height="60"><circle cx="30" cy="30" r="22" fill="none" stroke={stroke} strokeOpacity={op}/><path d="M30 8 A22 22 0 0 1 30 52 Z" fill={accent}/></svg>;
    case "product":  return <svg viewBox="0 0 60 60" width="60" height="60"><polygon points="30,8 52,48 8,48" fill="none" stroke={stroke} strokeOpacity={op}/><polygon points="30,20 44,44 16,44" fill={accent}/></svg>;
    case "marketing":return <svg viewBox="0 0 60 60" width="60" height="60"><circle cx="30" cy="30" r="22" fill="none" stroke={stroke} strokeOpacity={op}/><circle cx="30" cy="30" r="12" fill="none" stroke={stroke} strokeOpacity={op}/><circle cx="30" cy="30" r="4" fill={accent}/></svg>;
    case "csuite":   return <svg viewBox="0 0 60 60" width="60" height="60"><line x1="10" y1="10" x2="50" y2="50" stroke={stroke} strokeOpacity={op}/><line x1="50" y1="10" x2="10" y2="50" stroke={stroke} strokeOpacity={op}/><circle cx="30" cy="30" r="6" fill={accent}/></svg>;
    case "admin":    return <svg viewBox="0 0 60 60" width="60" height="60"><polygon points="30,6 36,24 54,24 39,36 45,54 30,42 15,54 21,36 6,24 24,24" fill="none" stroke={stroke} strokeOpacity={op}/><polygon points="30,18 32,28 42,28 34,34 36,44 30,38 24,44 26,34 18,28 28,28" fill={accent}/></svg>;
    case "hrops":    return <svg viewBox="0 0 60 60" width="60" height="60"><rect x="8" y="8" width="20" height="20" fill="none" stroke={stroke} strokeOpacity={op}/><rect x="32" y="8" width="20" height="20" fill="none" stroke={stroke} strokeOpacity={op}/><rect x="8" y="32" width="20" height="20" fill="none" stroke={stroke} strokeOpacity={op}/><rect x="32" y="32" width="20" height="20" fill={accent}/></svg>;
    case "finance":  return <svg viewBox="0 0 60 60" width="60" height="60"><line x1="10" y1="46" x2="50" y2="46" stroke={stroke} strokeOpacity={op}/><polyline points="10,40 20,32 28,36 38,20 50,14" fill="none" stroke={accent} strokeWidth="1.5"/><circle cx="50" cy="14" r="3" fill={accent}/></svg>;
    default: return null;
  }
}

// ─── nav with mega menu ─────────────────────────────────────────────────
function TopNav() {
  const [open, setOpen] = useState(null);
  const closeT = useRef(null);
  const enter = (key) => { clearTimeout(closeT.current); setOpen(key); };
  const leave = () => { closeT.current = setTimeout(() => setOpen(null), 120); };

  return (
    <header className="topnav" onMouseLeave={leave}>
      <div className="container nav-inner">
        <a className="logo" href="index.html" aria-label="Fuel Talent">
          <img src="logo.png" alt="Fuel Talent" className="logo-img" />
          <span className="tag-tiny">SEA · EST 2014</span>
        </a>
        <nav className="nav-links">
          {NAV.map((n) => (
            <a key={n.label} href={n.href}
               className={`nav-link ${open && open === n.panel ? "is-open" : ""} ${n.noUnderline ? "no-underline" : ""}`}
               onMouseEnter={() => enter(n.panel)}>
              {n.label}
            </a>
          ))}
        </nav>
        <a className="nav-pill" href="jobs.html">For Candidates <span>→</span></a>
      </div>
      <MegaMenu open={open} onMouseEnter={() => clearTimeout(closeT.current)} onMouseLeave={leave} />
    </header>
  );
}

function MegaMenu({ open, onMouseEnter, onMouseLeave }) {
  const panels = {
    expertise: {
      eyebrow: "Expertise · 8 practices",
      cols: [
        { head: "Build", items: ["Tech & Engineering", "Product", "Design & UX Research"] },
        { head: "Operate", items: ["HR & Operations", "Finance & Accounting", "Admin & Lifestyle"] },
        { head: "Lead", items: ["C-Suite", "Marketing"] },
        { head: "Featured", items: ["Browse all expertise →", "Submit a role"] },
      ],
    },
    services: {
      eyebrow: "Services · 3 modes",
      cols: [
        { head: "01 — Recruiting & Staffing", items: ["Permanent placement", "Contract & contingent", "Embedded recruiting"] },
        { head: "02 — Professional & Managed", items: ["Specialist teams", "Operational coverage", "Project execution"] },
        { head: "03 — Digital Workers",     items: ["AI agent design", "Workflow automation", "Human + agent hybrids"] },
        { head: "Not sure?", items: ["Talk to a strategist →"] },
      ],
    },
    resources: {
      eyebrow: "Fuel for Thought",
      cols: [
        { head: "Field Notes", items: ["Hiring playbooks", "Career guides", "Salary trends 2026"] },
        { head: "Case Studies", items: ["Provider case · Providence", "Scale-up case · Pacagen"] },
        { head: "Podcast", items: ["Make Them Lose Sleep", "Browse all episodes →"] },
        { head: "Subscribe", items: ["Monthly newsletter"] },
      ],
    },
  };
  const p = open && panels[open];
  return (
    <div className="megamenu" style={{
      maxHeight: p ? 320 : 0,
      opacity: p ? 1 : 0,
      pointerEvents: p ? "auto" : "none",
    }} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>
      {p && (
        <div className="container" style={{ padding: "32px var(--pad)", display: "grid", gridTemplateColumns: "180px repeat(4, 1fr)", gap: 36 }}>
          <div className="mono" style={{ color: "var(--muted)" }}>{p.eyebrow}</div>
          {p.cols.map((c) => (
            <div key={c.head}>
              <div className="mono" style={{ color: "var(--muted)", marginBottom: 12 }}>{c.head}</div>
              <ul style={{ listStyle: "none", padding: 0, margin: 0, display: "flex", flexDirection: "column", gap: 8 }}>
                {c.items.map((it) => (
                  <li key={it}><a href="#" style={{ borderBottom: "1px solid transparent", paddingBottom: 1 }}
                    onMouseEnter={(e) => e.target.style.borderBottomColor = "currentColor"}
                    onMouseLeave={(e) => e.target.style.borderBottomColor = "transparent"}>
                    {it}
                  </a></li>
                ))}
              </ul>
            </div>
          ))}
        </div>
      )}
    </div>
  );
}

// ─── hero (interactive personalization) ─────────────────────────────────
function Hero() {
  const [role, setRole] = useState(ROLES_PERSONALIZE[0]);
  const [stage, setStage] = useState(STAGES[2]);
  const isCandidate = role.id === "candidate";

  return (
    <section className="hero" id="top">
      <div className="hero-rail"></div>
      <div className="hero-rail hero-rail-r"></div>

      <div className="hero-mark hero-mark-l">
        <span>N 47°37′</span>
        <span>W 122°20′</span>
        <span>SEATTLE · WA</span>
      </div>
      <div className="hero-mark hero-mark-r">
        <span>EST. 2014</span>
        <span>ISSUE Nº 047</span>
        <span>MAY · MMXXVI</span>
      </div>

      <div className="container" style={{ paddingTop: 36 }}>
        <h1 className="hero-headline">
          <span className="frag">We&nbsp;fuel</span><br/>
          <span className="frag" style={{ color: "var(--accent)", fontStyle: "italic", fontFamily: "var(--font-serif)" }}>
            {role.line.toLowerCase()}
          </span><br/>
          <span className="frag">for {stage}.</span>
        </h1>

        {/* personalize control panel */}
        <div className="personalize-row" style={{ marginTop: 56, border: "1px solid var(--ink)", background: "var(--paper)" }}>
          <span className="lbl">I'm hiring →</span>
          <div className="opts">
            {ROLES_PERSONALIZE.map((r) => (
              <button key={r.id}
                onClick={() => setRole(r)}
                className={`tag ${role.id === r.id ? "tag-active" : ""}`}
                style={{ cursor: "pointer", background: role.id === r.id ? "var(--ink)" : "transparent" }}>
                {r.label}
              </button>
            ))}
          </div>
          <span className="lbl right">{role.meta}</span>
        </div>

        <div className="personalize-row" style={{ borderInline: "1px solid var(--ink)", borderBottom: "1px solid var(--ink)", background: "var(--bg-soft)" }}>
          <span className="lbl">{isCandidate ? "I'm at →" : "Company stage →"}</span>
          <div className="opts">
            {(isCandidate ? ["Discovery", "Actively interviewing", "Open to new", "Just curious"] : STAGES).map((s) => (
              <button key={s}
                onClick={() => !isCandidate && setStage(s)}
                className={`tag ${stage === s ? "tag-active" : ""}`}
                style={{ cursor: "pointer", background: stage === s ? "var(--ink)" : "transparent" }}>
                {s}
              </button>
            ))}
          </div>
          <span className="lbl right">{isCandidate ? "Confidential" : "Tailored intake"}</span>
        </div>

        <p style={{ maxWidth: "62ch", margin: "40px 0 32px", fontSize: 18, lineHeight: 1.55, color: "var(--ink-2)" }}>
          Fuel Talent is a Seattle recruiting firm for high-growth companies. From direct hire to embedded teams to AI digital workers — we find the right people and build the right systems for teams that expect more from their talent partner.
        </p>

        <div style={{ display: "flex", gap: 12, flexWrap: "wrap" }}>
          <a className="btn btn-accent" href={isCandidate ? "jobs.html" : "#contact"}>
            {isCandidate ? "Browse open roles" : "Submit a role"}<span className="arr">→</span>
          </a>
          <a className="btn" href="#services">How it works<span className="arr">→</span></a>
        </div>
      </div>
    </section>
  );
}

// ─── marquee proof bar ──────────────────────────────────────────────────
function Marquee() {
  const items = [
    { num: "48", suf: "hr", lbl: "to first candidate slate" },
    { num: "18", suf: "d",  lbl: "average time-to-offer" },
    { num: "91", suf: "%",  lbl: "offer accept rate" },
    { num: "300", suf: "+", lbl: "active company partners" },
    { num: "10+", suf: "",  lbl: "years in market" },
    { num: "9", suf: "",   lbl: "specialty practices" },
  ];
  const doubled = [...items, ...items];
  return (
    <div className="marquee">
      <div className="marquee-track">
        {doubled.map((it, i) => (
          <span className="marquee-item" key={i}>
            <span className="marquee-num">{it.num}<span style={{ fontSize: 18 }}>{it.suf}</span></span>
            <span className="marquee-lbl">{it.lbl}</span>
            <span className="marquee-dot"></span>
          </span>
        ))}
      </div>
    </div>
  );
}

// ─── clients trust band ─────────────────────────────────────────────────
function Clients() {
  return (
    <section style={{ padding: "calc(var(--u) * 8) 0", borderBottom: "1px solid var(--line)", background: "#ffffff" }}>
      <div className="container">
        <div className="mono" style={{ color: "var(--muted)", marginBottom: 28, textAlign: "center", whiteSpace: "normal" }}>
          Trusted by category-defining teams ·  selected partners
        </div>
        <div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(140px, 1fr))", gap: 0, borderTop: "1px solid var(--line)" }}>
          {CLIENT_WORDMARKS.map((c, i) => (
            <div key={c.name} title={c.name} style={{
              padding: "26px 18px",
              borderRight: i < CLIENT_WORDMARKS.length - 1 ? "1px solid var(--line)" : "0",
              borderBottom: "1px solid var(--line)",
              display: "flex",
              alignItems: "center",
              justifyContent: "center",
              minHeight: 96,
              transition: "background var(--t-fast)",
              cursor: "default",
            }}
              onMouseEnter={(e) => { e.currentTarget.style.background = "#faf6ec"; }}
              onMouseLeave={(e) => { e.currentTarget.style.background = "transparent"; }}>
              {c.render()}
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

// ─── pillars (Who / How / Why) ──────────────────────────────────────────
const PILLARS = [
  { id: "who", idx: "01", tab: "Who we fuel",
    heading: "High-growth teams that value precision and people.",
    body: "We work with venture-backed startups, scale-ups and innovation-led enterprises. Whether you're building your first engineering team or scaling a mature org, we deliver talent that fits on paper and in culture, values and ambition.",
    stats: [{ k: "48 hr", v: "to first slate" }, { k: "18 d", v: "median offer time" }, { k: "91%", v: "offer accept rate" }] },
  { id: "how", idx: "02", tab: "How we fuel",
    heading: "A relationship-first process, accelerated by AI.",
    body: "Discovery, calibration, sourcing, vetting, present. Our consultants pair human judgment with proprietary AI sourcing that surfaces strong candidates outside the obvious channels — and removes the busywork that slows great recruiters down.",
    stats: [{ k: "5 step", v: "calibrated process" }, { k: "AI-assist", v: "outreach + screening" }, { k: "Human", v: "judgement, end-to-end" }] },
  { id: "why", idx: "03", tab: "Why we fuel",
    heading: "We build legacies, not just fill roles.",
    body: "We close 91% of extended offers because we don't push the wrong fits across the finish line. We invest in the long-term relationship with both sides — and that compounds.",
    stats: [{ k: "75+", v: "5-star reviews" }, { k: "100k", v: "podcast listeners" }, { k: "10+ yr", v: "client tenure (avg)" }] },
];

function Pillars() {
  const [active, setActive] = useState("who");
  const p = PILLARS.find((x) => x.id === active);
  const Art = ART_MAP[active];
  const [accentVar, setAccentVar] = useState("#b94a1f");
  useEffect(() => {
    const read = () => setAccentVar(getComputedStyle(document.documentElement).getPropertyValue("--accent").trim() || "#b94a1f");
    read();
    const t = setInterval(read, 500); return () => clearInterval(t);
  }, []);
  return (
    <section className="pillar" id="about">
      <div className="container">
        <div className="sect-head">
          <div>
            <div className="eyebrow"><span className="dot"></span> Operating system</div>
            <h2 style={{ marginTop: 18 }}>Who, how, <em>why</em> we fuel.</h2>
          </div>
          <div className="meta">
            <span className="mono" style={{ color: "var(--muted)" }}>§ 02 · OPERATING MODEL</span>
            <span className="mono" style={{ color: "var(--muted)" }}>3 PILLARS · TAP TO EXPLORE</span>
          </div>
        </div>
        <div className="pillar-grid">
          <div className="pillar-tabs">
            {PILLARS.map((x) => (
              <div key={x.id} className={`pillar-tab ${active === x.id ? "is-active" : ""}`}
                onClick={() => setActive(x.id)}>
                <span className="idx">{x.idx}</span>
                <span>{x.tab}</span>
                <span className="arrow">→</span>
              </div>
            ))}
          </div>
          <div className="pillar-panel">
            <h3>{p.heading}</h3>
            <p>{p.body}</p>
            <div className="pillar-stats">
              {p.stats.map((s) => (
                <div key={s.k}>
                  <div className="pillar-stat-k">{s.k}</div>
                  <div className="pillar-stat-v">{s.v}</div>
                </div>
              ))}
            </div>
            <div className="pillar-image">
              <Art accent={accentVar} />
            </div>
          </div>
        </div>
      </div>
    </section>
  );
}

// ─── services ───────────────────────────────────────────────────────────
function Services() {
  return (
    <section className="services" id="services">
      <div className="container">
        <div className="sect-head">
          <div>
            <div className="eyebrow"><span className="dot"></span> Services</div>
            <h2 style={{ marginTop: 18 }}>Talent solutions that <em>move you forward.</em></h2>
          </div>
          <div className="meta">
            <span className="mono" style={{ color: "var(--muted)" }}>§ 03 · DELIVERABLES</span>
            <a href="#contact" className="mono" style={{ color: "var(--accent)", textDecoration: "underline" }}>NOT SURE WHICH? TALK TO US →</a>
          </div>
        </div>
        {SERVICES.map((s) => (
          <a key={s.num} href="#" className="service-row">
            <div className="num">{s.num}</div>
            <h3>{s.title}</h3>
            <p>{s.blurb}</p>
            <div className="go">Explore<span>→</span></div>
          </a>
        ))}
      </div>
    </section>
  );
}

// ─── expertise (filterable) ─────────────────────────────────────────────
function Expertise() {
  const [filter, setFilter] = useState("All");
  const groups = ["All", "Build", "Operate", "Lead"];
  const filtered = useMemo(() => {
    if (filter === "All") return EXPERTISE;
    const g = {
      Build: ["tech", "product", "design"],
      Operate: ["hrops", "finance", "admin"],
      Lead: ["csuite", "marketing"],
    }[filter];
    return EXPERTISE.filter((e) => g.includes(e.id));
  }, [filter]);
  const [accentVar, setAccentVar] = useState("#b94a1f");
  useEffect(() => {
    const read = () => setAccentVar(getComputedStyle(document.documentElement).getPropertyValue("--accent").trim() || "#b94a1f");
    read();
    const t = setInterval(read, 500); return () => clearInterval(t);
  }, []);

  return (
    <section className="expertise" id="expertise">
      <div className="container">
        <div className="sect-head">
          <div>
            <div className="eyebrow"><span className="dot"></span> Expertise</div>
            <h2 style={{ marginTop: 18 }}>Deep expertise, delivered <em>with a human touch.</em></h2>
          </div>
          <div className="meta">
            <span className="mono" style={{ color: "var(--muted)" }}>§ 04 · {filtered.length} PRACTICES SHOWN</span>
          </div>
        </div>
        <div className="expert-filters">
          {groups.map((g) => (
            <button key={g}
              onClick={() => setFilter(g)}
              className={`tag ${filter === g ? "tag-active" : ""}`}
              style={{ cursor: "pointer", background: filter === g ? "var(--ink)" : "transparent" }}>
              {g}
            </button>
          ))}
        </div>
        <div className="expert-grid">
          {filtered.map((e, i) => (
            <a key={e.id} href="#" className="expert-card">
              <div className="glyph"><ExpertGlyph kind={e.id} accent={accentVar} /></div>
              <div>
                <div className="num">{String(i + 1).padStart(2, "0")} · {e.short.toUpperCase()}</div>
                <h3>{e.title}</h3>
                <p className="blurb">{e.blurb}</p>
              </div>
              <div className="links">
                <span>View service</span>
                <span>Open roles</span>
              </div>
            </a>
          ))}
        </div>
      </div>
    </section>
  );
}

// ─── testimonials ───────────────────────────────────────────────────────
function Testimonials() {
  const [i, setI] = useState(0);
  const next = useCallback(() => setI((x) => (x + 1) % TESTIMONIALS.length), []);
  const prev = useCallback(() => setI((x) => (x - 1 + TESTIMONIALS.length) % TESTIMONIALS.length), []);
  useEffect(() => {
    const t = setInterval(next, 7000);
    return () => clearInterval(t);
  }, [next]);
  const q = TESTIMONIALS[i];
  return (
    <section className="testimonials">
      <div className="container">
        <div className="sect-head">
          <div>
            <div className="eyebrow"><span className="dot"></span> Testimonials</div>
            <h2 style={{ marginTop: 18 }}>Fueling business with the <em>power of people.</em></h2>
          </div>
          <div className="meta">
            <span className="mono" style={{ color: "var(--muted)" }}>§ 05 · CLIENT VOICES</span>
            <span className="mono" style={{ color: "var(--muted)" }}>{String(i + 1).padStart(2, "0")} / {String(TESTIMONIALS.length).padStart(2, "0")}</span>
          </div>
        </div>
        <div className="quote-stage" key={i} style={{ animation: "fade .55s var(--t-med) both" }}>
          <span className="quote-mark">“</span>
          <p className="quote">{q.quote}</p>
          <div className="quote-attr">
            <div className="quote-avatar">{q.initials}</div>
            <div>
              <div className="quote-name">{q.name}</div>
              <div className="quote-role">{q.role}</div>
            </div>
          </div>
        </div>
        <div className="quote-controls">
          <button onClick={prev} aria-label="Previous"><span>←</span></button>
          <button onClick={next} aria-label="Next"><span>→</span></button>
          <span className="quote-count">{String(i + 1).padStart(2, "0")} / {String(TESTIMONIALS.length).padStart(2, "0")}</span>
          <div className="quote-dots">
            {TESTIMONIALS.map((_, k) => (
              <span key={k} className={`quote-dot ${k === i ? "is-active" : ""}`} onClick={() => setI(k)} />
            ))}
          </div>
        </div>
      </div>
    </section>
  );
}

// ─── job search (preview) ───────────────────────────────────────────────
function Jobs() {
  const [q, setQ] = useState("");
  const [loc, setLoc] = useState("");
  const filtered = useMemo(() => {
    const ql = q.toLowerCase(), ll = loc.toLowerCase();
    return JOBS_PREVIEW.filter((j) =>
      (!ql || j.title.toLowerCase().includes(ql) || j.area.toLowerCase().includes(ql)) &&
      (!ll || j.loc.toLowerCase().includes(ll))
    );
  }, [q, loc]);
  return (
    <section className="jobs">
      <div className="container">
        <div className="sect-head" style={{ borderBottom: "1px solid color-mix(in oklab, var(--bg) 22%, transparent)", paddingBottom: 28 }}>
          <div>
            <div className="eyebrow"><span className="dot"></span> Quick job search</div>
            <h2 style={{ marginTop: 18, color: "var(--bg)" }}>Where careers <em style={{ color: "var(--accent)" }}>get fueled.</em></h2>
          </div>
          <div className="meta">
            <span className="mono" style={{ color: "color-mix(in oklab, var(--bg) 55%, transparent)" }}>§ 06 · LIVE BOARD</span>
            <a href="jobs.html" className="mono" style={{ color: "var(--accent)", textDecoration: "underline" }}>OPEN FULL JOB BOARD →</a>
          </div>
        </div>

        <div className="jobs-form" style={{ marginTop: 32 }}>
          <label className="jobs-field">
            <span>Title / Practice</span>
            <input value={q} onChange={(e) => setQ(e.target.value)} placeholder="e.g. Staff Engineer, Product Designer..." />
          </label>
          <label className="jobs-field">
            <span>Location</span>
            <input value={loc} onChange={(e) => setLoc(e.target.value)} placeholder="Seattle, Remote, ..." />
          </label>
          <button className="jobs-btn" type="button">
            Search<span>→</span>
          </button>
        </div>

        <div className="jobs-results">
          {filtered.length === 0 && (
            <div style={{ padding: 32, opacity: 0.7, fontFamily: "var(--font-mono)" }}>
              No results — try clearing filters or <a href="jobs.html" style={{ color: "var(--accent)" }}>open the full board</a>.
            </div>
          )}
          {filtered.map((j) => (
            <a key={j.id} href="jobs.html" className="job-row">
              <span className="job-id">{j.id}</span>
              <span>
                <span className="job-title">{j.title}</span>
                <div style={{ marginTop: 4, fontFamily: "var(--font-mono)", fontSize: 11, opacity: 0.7 }}>
                  {j.company} · {j.area}
                </div>
              </span>
              <span className="job-meta">{j.loc}</span>
              <span className="pill">{j.type}</span>
              <span className="job-arrow">→</span>
            </a>
          ))}
        </div>
      </div>
    </section>
  );
}

// ─── resources ──────────────────────────────────────────────────────────
function Resources() {
  const [playing, setPlaying] = useState(false);
  const [pos, setPos] = useState(0.32);
  useEffect(() => {
    if (!playing) return;
    const t = setInterval(() => setPos((p) => (p >= 0.99 ? 0 : p + 0.005)), 200);
    return () => clearInterval(t);
  }, [playing]);
  const wave = useMemo(() => Array.from({ length: 64 }).map((_, i) => 6 + Math.sin(i * 0.5) * 4 + (i % 3) * 5 + Math.random() * 6), []);
  return (
    <section className="resources" id="resources">
      <div className="container">
        <div className="sect-head">
          <div>
            <div className="eyebrow"><span className="dot"></span> Latest resources</div>
            <h2 style={{ marginTop: 18 }}>Fuel for <em>thought.</em></h2>
          </div>
          <div className="meta">
            <a href="#" className="mono" style={{ color: "var(--accent)" }}>§ 07 · BROWSE ALL →</a>
          </div>
        </div>
        <div className="res-grid">
          <div className="res-list">
            {RESOURCES.map((r) => (
              <a key={r.title} className="res-item" href="#">
                <div>
                  <div className="meta">
                    <span>{r.kind}</span><span>·</span><span>{r.date}</span>
                  </div>
                  <h4>{r.title}</h4>
                </div>
                <div className="read">{r.read} read →</div>
              </a>
            ))}
          </div>
          <div className="podcast-card">
            <div className="mono" style={{ color: "var(--muted)" }}>LATEST PODCAST · EP. 047</div>
            <div className="pod-cover">
              <ArtTopo accent={getComputedStyle(document.documentElement).getPropertyValue("--accent").trim() || "#b94a1f"} />
            </div>
            <div className="pod-title">"Make Them Lose Sleep" — Dr. Evan Zhao, CEO of Pacagen.</div>
            <div className="pod-row">
              <button className="pod-play" onClick={() => setPlaying(!playing)} aria-label="Play">
                {playing ? <span>❚❚</span> : <span style={{ marginLeft: 3 }}>▶</span>}
              </button>
              <div className="pod-waveform">
                {wave.map((h, i) => (
                  <i key={i} className={i / wave.length < pos ? "played" : ""} style={{ height: `${h}px` }} />
                ))}
              </div>
              <div className="pod-time">{Math.floor(pos * 42)}:{String(Math.floor((pos * 42 * 60) % 60)).padStart(2, "0")} / 42:18</div>
            </div>
            <div className="pod-stats">
              <div className="pod-stat"><div className="n">75+</div><div className="l">5-star reviews</div></div>
              <div className="pod-stat"><div className="n">100k</div><div className="l">listeners</div></div>
            </div>
          </div>
        </div>
      </div>
    </section>
  );
}

// ─── CTA band + footer ──────────────────────────────────────────────────
function CTABand() {
  return (
    <section className="cta-band" id="contact">
      <div className="container">
        <div className="mono" style={{ color: "color-mix(in oklab, var(--bg) 55%, transparent)", textAlign: "center", marginBottom: 24 }}>
          § 08 · WHAT'S NEXT
        </div>
        <h2>
          <span style={{ display: "block" }}>We build <em>legacies</em>,</span>
          <span style={{ display: "block", marginTop: "0.18em" }}>not just fill roles.</span>
        </h2>
        <p>Haven't found the role? We'll help you find the right one. Hiring? We'll deliver people who change what's possible.</p>
        <div className="btns">
          <a className="btn btn-fill" href="jobs.html">Find a Job<span className="arr">→</span></a>
          <a className="btn" href="#contact">Let's talk<span className="arr">→</span></a>
        </div>
      </div>
    </section>
  );
}

function Footer() {
  return (
    <footer>
      <div className="container">
        <div className="foot-grid">
          <div className="foot-col">
            <a className="logo foot-brand" href="#top" aria-label="Fuel Talent">
              <img src="logo.png" alt="Fuel Talent" className="logo-img logo-img-foot" />
            </a>
            <div className="foot-addr" style={{ marginTop: 16 }}>
              500 108th Avenue NE, Suite 1100<br/>
              Bellevue, WA 98004
            </div>
            <div style={{ marginTop: 14 }}>
              <a href="mailto:Info@fueltalent.com" style={{ fontFamily: "var(--font-mono)", fontSize: 13 }}>Info@fueltalent.com</a>
            </div>
            <div style={{ display: "flex", gap: 14, marginTop: 18 }}>
              {["LinkedIn", "Instagram", "Facebook"].map((s) => (
                <a key={s} href="#" className="mono" style={{ borderBottom: "1px solid currentColor", paddingBottom: 2 }}>{s}</a>
              ))}
            </div>
          </div>
          <div className="foot-col">
            <h5>Expertise</h5>
            {EXPERTISE.slice(0, 6).map((e) => <a key={e.id} href="#expertise">{e.title}</a>)}
          </div>
          <div className="foot-col">
            <h5>Services</h5>
            {SERVICES.map((s) => <a key={s.num} href="#services">{s.title}</a>)}
          </div>
          <div className="foot-col">
            <h5>Find a Job</h5>
            <a href="jobs.html">Job Search</a>
            <a href="jobs.html">For Candidates</a>
            <a href="jobs.html">Upload Resume</a>
          </div>
          <div className="foot-col">
            <h5>About</h5>
            <a href="#">About Fuel Talent</a>
            <a href="#">Meet the Team</a>
            <a href="#">Insights</a>
            <a href="#">Privacy Policy</a>
          </div>
        </div>
        <div className="foot-meta">
          <span>© 2026 FUEL TALENT, LLC · ALL RIGHTS RESERVED</span>
          <span>HUMAN FIRST · AI-ENABLED · SEATTLE · WA</span>
          <a href="#">PRIVACY POLICY</a>
        </div>
      </div>
    </footer>
  );
}

// ─── tweaks ─────────────────────────────────────────────────────────────
function TweaksUI({ t, setTweak }) {
  return (
    <TweaksPanel>
      <TweakSection label="Theme" />
      <TweakRadio label="Mode" value={t.theme}
        options={["light", "dark"]}
        onChange={(v) => setTweak("theme", v)} />
      <TweakSection label="Accent" />
      <TweakColor label="Accent color" value={t.accent}
        options={Object.values(ACCENTS).map((a) => a.color)}
        onChange={(v) => setTweak("accent", v)} />
      <TweakSection label="Typography" />
      <TweakSelect label="Type mode" value={t.typeMode}
        options={[
          { label: "Geometric sans + mono (default)", value: "geo-mono" },
          { label: "Serif headlines + mono", value: "serif-mono" },
          { label: "All mono (brutalist)", value: "all-mono" },
        ]}
        onChange={(v) => setTweak("typeMode", v)} />
    </TweaksPanel>
  );
}

// ─── App root ───────────────────────────────────────────────────────────
function App() {
  const [t, setTweak] = useTweaks(TWEAK_DEFAULTS);

  useEffect(() => {
    document.documentElement.setAttribute("data-theme", t.theme);
    document.documentElement.style.setProperty("--accent", t.accent);
    // type mode swaps
    if (t.typeMode === "serif-mono") {
      document.documentElement.style.setProperty("--font-display", "'Instrument Serif', serif");
    } else if (t.typeMode === "all-mono") {
      document.documentElement.style.setProperty("--font-display", "'Geist Mono', monospace");
      document.documentElement.style.setProperty("--font-sans", "'Geist Mono', monospace");
    } else {
      document.documentElement.style.setProperty("--font-display", "'Space Grotesk', sans-serif");
      document.documentElement.style.setProperty("--font-sans", "'Geist', sans-serif");
    }
  }, [t.theme, t.accent, t.typeMode]);

  return (
    <>
      <TopNav />
      <Hero />
      <Marquee />
      <Clients />
      <Pillars />
      <Services />
      <Expertise />
      <Testimonials />
      <Jobs />
      <Resources />
      <CTABand />
      <Footer />
      <TweaksUI t={t} setTweak={setTweak} />
    </>
  );
}

ReactDOM.createRoot(document.getElementById("app")).render(<App />);
