// HOME / OVERVIEW — hero + live dashboard, plus a "what's underneath" peek into the system.

function HomeHero() {
  const [tick, setTick] = React.useState(0);
  const [pinned, setPinned] = React.useState(null); // user-clicked node index
  const [vw, setVw] = React.useState(() => typeof window !== 'undefined' ? window.innerWidth : 1440);
  React.useEffect(() => {
    const id = setInterval(() => setTick(t => t + 1), 1200);
    const onResize = () => setVw(window.innerWidth);
    window.addEventListener('resize', onResize);
    return () => { clearInterval(id); window.removeEventListener('resize', onResize); };
  }, []);
  // Slow node rotation — pause for 6s per node
  const [nodeIdx, setNodeIdx] = React.useState(0);
  React.useEffect(() => {
    if (pinned !== null) return; // user is steering
    const id = setInterval(() => setNodeIdx(i => (i + 1) % 8), 6000);
    return () => clearInterval(id);
  }, [pinned]);
  const activeNode = pinned !== null ? pinned : nodeIdx;
  const isNarrow = vw < 960;
  const isPhone  = vw < 640;

  const series = React.useMemo(() => {
    const arr = [];
    for (let i = 0; i < 60; i++) {
      const v = 0.5 + Math.sin(i * 0.32 + tick * 0.18) * 0.18 + Math.sin(i * 0.11) * 0.12;
      arr.push(v);
    }
    return arr;
  }, [tick]);

  const nodes = [
    { name: 'TEAM & LEADERSHIP',     accent: A.terracotta, blurb: 'Hiring, scaling, and managing culturally diverse teams across geographies — remote and onsite. Last team built: 0 → 5, time-to-hire 6w → 2w.' },
    { name: 'OPS & DELIVERY',        accent: A.signal,     blurb: 'The engine room. Throughput, reliability, the unglamorous handoffs that decide whether the company actually ships.' },
    { name: 'HR & PEOPLE OPS',       accent: A.ochre,      blurb: 'Policy, performance, on/offboarding, HRMS rollouts. The boring parts kept boring on purpose.' },
    { name: 'SYSTEMS DESIGN',        accent: A.olive,      blurb: 'Building the operating system the company can grow into. Org shape, decision rights, rituals, reporting that holds at double the headcount.' },
    { name: 'PROGRAMME MANAGEMENT',  accent: A.terracotta, blurb: 'Many streams, one cadence. 5+ critical initiatives run concurrently at any time, prioritised by impact and unblocked end-to-end.' },
    { name: 'PROJECT MANAGEMENT',    accent: A.signal,     blurb: 'End-to-end ownership of concurrent projects. Scope, cost, timeline, the tradeoffs, and the unpopular call on when to say no.' },
    { name: 'PRODUCT STRATEGY',      accent: A.ochre,      blurb: 'Market reality translated into product decisions. Roadmaps that serve the customer and the P&L on the same page.' },
    { name: 'BUSINESS DEVELOPMENT',  accent: A.olive,      blurb: 'Revenue growth the durable way. Pipeline, partners, client relationships that outlast the quarter. 200% client base expansion is the number I come back to.' },
  ];

  return (
    <>
      <div style={{
        display: 'grid', gridTemplateColumns: isNarrow ? '1fr' : '1.05fr 0.95fr',
        borderBottom: `1px solid ${A.line}`,
      }}>
        {/* LEFT — name + brief */}
        <div style={{ padding: isPhone ? '24px 18px 20px' : '64px 48px 48px', borderRight: isNarrow ? 'none' : `1px solid ${A.line}`, borderBottom: isNarrow ? `1px solid ${A.line}` : 'none', minWidth: 0 }}>
          <h1 style={{
            fontFamily: "'Fraunces', serif",
            fontVariationSettings: (window.TYPE || {}).h1 || '"opsz" 144, "wght" 600, "SOFT" 30, "WONK" 1',
            fontSize: isPhone ? 'clamp(48px, 14vw, 72px)' : 'clamp(64px, 11vw, 124px)',
            lineHeight: 0.92, margin: 0, color: A.cream, letterSpacing: '-0.03em',
          }}>
            Andrea<br/>
            <span style={{ fontStyle: 'italic', fontVariationSettings: (window.TYPE || {}).h1it || '"opsz" 144, "wght" 400, "SOFT" 100, "WONK" 1', color: A.terracotta }}>
              Ordonez{isPhone ? <br/> : ' '}Cardenas
            </span>
          </h1>

          <div style={{ marginTop: isPhone ? 28 : 40, paddingTop: 22, borderTop: `1px solid ${A.line}`,
            display: 'grid',
            gridTemplateColumns: isPhone ? '1fr' : '120px 1fr',
            rowGap: isPhone ? 6 : 22, columnGap: 22,
            fontSize: 14, lineHeight: 1.55,
          }}>
            <div style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 11, letterSpacing: '0.18em', color: A.creamDim }}>BRIEF</div>
            <div style={{ color: A.cream, maxWidth: 480, fontSize: 16, lineHeight: 1.6 }}>
              I'm hired onto executive teams when strategy and delivery have drifted apart. I contribute to one and build the other — the rhythms, ownership lines, and reporting that turn decisions into outcomes.
            </div>

            <div style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 11, letterSpacing: '0.18em', color: A.creamDim }}>RANGE</div>
            <div style={{ color: A.creamDim, fontSize: 13 }}>11 yrs · 9 industries · 4 continents · 5 languages · 6 yrs distributed</div>

            <div style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 11, letterSpacing: '0.18em', color: A.creamDim }}>FOCUS</div>
            <div style={{ display: 'flex', gap: 10, alignItems: 'center' }}>
              <span style={{ width: 8, height: 8, borderRadius: '50%', background: A.signal, boxShadow: `0 0 8px ${A.signal}` }} />
              <span style={{ color: A.cream, fontFamily: "'JetBrains Mono', monospace", fontSize: 12 }}>BUILDING THE OPERATING LAYER · COS → COO</span>
            </div>

            <div style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 11, letterSpacing: '0.18em', color: A.creamDim }}>CONTACT</div>
            <div>
              <a href="mailto:andreaordonezc@gmail.com" style={{ color: A.signal, textDecoration: 'none', borderBottom: `1px solid ${A.signal}`, fontFamily: "'JetBrains Mono', monospace", fontSize: 13 }}>andreaordonezc@gmail.com</a>
            </div>
          </div>
        </div>

        {/* RIGHT — live console (mobile: 2x3 square grid; desktop: rich console) */}
        <div style={{ padding: isPhone ? '8px 18px 18px' : '32px', display: 'flex', flexDirection: 'column', gap: isPhone ? 10 : 16, minWidth: 0 }}>
          <div style={{
            display: 'flex', justifyContent: 'space-between', alignItems: 'baseline',
            fontFamily: "'JetBrains Mono', monospace", fontSize: 11, letterSpacing: '0.2em', color: A.ochre, fontWeight: 700,
          }}>
            <span>OPERATING METRICS · CAREER</span>
            <span style={{ color: A.signal }}>↗ ALL-TIME</span>
          </div>

          {isPhone ? (
            // MOBILE — 6 square tiles, 2 cols × 3 rows, uniform typography
            <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 10 }}>
              {[
                { k: 'REVENUE',     v: '100%',   col: A.signal,     sub: '12 mo · P&L owned' },
                { k: 'EFFICIENCY',  v: '+90%',   col: A.cream,      sub: '2M records · 6 sources' },
                { k: 'COST CUT',    v: '10%',    col: A.cream,      sub: 'employment costs' },
                { k: 'CLIENT BASE', v: '+200%',  col: A.cream,      sub: '30 → 90 · 18 mo' },
                { k: 'DEAL',        v: '€4B',    col: A.terracotta, sub: 'logistics divestment' },
                { k: 'FOOTPRINT',   v: '7',      col: A.cream,      sub: 'countries · 4 continents' },
              ].map((s, i) => (
                <div key={i} style={{
                  background: A.panel, border: `1px solid ${A.line}`,
                  padding: '14px 14px 12px',
                  aspectRatio: '1 / 1',
                  display: 'flex', flexDirection: 'column', justifyContent: 'space-between',
                  minWidth: 0,
                }}>
                  <div style={{
                    fontFamily: "'JetBrains Mono', monospace", fontSize: 9, letterSpacing: '0.2em',
                    color: A.creamDim, fontWeight: 700,
                  }}>{s.k}</div>
                  <div style={{
                    fontFamily: "'Fraunces', serif",
                    fontVariationSettings: '"opsz" 144, "wght" 600, "SOFT" 30',
                    fontSize: 'clamp(34px, 9vw, 48px)',
                    color: s.col, letterSpacing: '-0.03em', lineHeight: 0.95,
                  }}>{s.v}</div>
                  <div style={{ fontFamily: "'Inter', sans-serif", fontSize: 11, lineHeight: 1.35, color: A.creamDim }}>{s.sub}</div>
                </div>
              ))}
            </div>
          ) : (
            <>
              <div style={{ background: A.panel, border: `1px solid ${A.line}`, padding: 22 }}>
                <div style={{ display: 'flex', justifyContent: 'space-between', fontFamily: "'JetBrains Mono', monospace", fontSize: 10, color: A.creamDim, letterSpacing: '0.18em', marginBottom: 8 }}>
                  <span>REVENUE GROWTH · LAST P&amp;L OWNED</span>
                  <span style={{ color: A.signal }}>IN 12 MO</span>
                </div>
                <div style={{ display: 'flex', alignItems: 'flex-end', gap: 18 }}>
                  <div style={{
                    fontFamily: "'Fraunces', serif",
                    fontVariationSettings: (window.TYPE || {}).num || '"opsz" 144, "wght" 700, "SOFT" 0, "WONK" 0',
                    fontSize: 96, lineHeight: 0.9, color: A.signal, letterSpacing: '-0.04em',
                  }}>100<span style={{ fontSize: 52, color: A.ochre, verticalAlign: 'top', marginLeft: 4 }}>%</span></div>
                  <svg viewBox="0 0 240 60" style={{ width: '100%', maxWidth: 240, height: 60, flex: '1 1 0', minWidth: 0 }} preserveAspectRatio="none">
                    <polyline fill="none" stroke={A.signal} strokeWidth="1.6"
                      points={series.map((v, i) => `${(i/(series.length-1))*240},${60 - v*54}`).join(' ')} />
                    <polyline fill={A.signal} fillOpacity="0.08" stroke="none"
                      points={`0,60 ${series.map((v, i) => `${(i/(series.length-1))*240},${60 - v*54}`).join(' ')} 240,60`} />
                  </svg>
                </div>
              </div>

              <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 12 }}>
                {[
                  { k: 'EFFICIENCY', v: '+90%', sub: '2M records · 6 sources' },
                  { k: 'COST CUT', v: '10%', sub: 'employment costs · new entity' },
                  { k: 'CLIENT BASE', v: '+200%', sub: '30 → 90 in 18 mo' },
                ].map((s, i) => (
                  <div key={i} style={{ background: A.panel, border: `1px solid ${A.line}`, padding: 16 }}>
                    <div style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 9, letterSpacing: '0.18em', color: A.creamDim }}>{s.k}</div>
                    <div style={{
                      fontFamily: "'Fraunces', serif",
                      fontVariationSettings: '"opsz" 96, "wght" 600',
                      fontSize: 38, color: A.cream, letterSpacing: '-0.02em', marginTop: 6, lineHeight: 1,
                    }}>{s.v}</div>
                    <div style={{ fontSize: 11, color: A.creamDim, marginTop: 8 }}>{s.sub}</div>
                  </div>
                ))}
              </div>

              <div style={{ display: 'grid', gridTemplateColumns: '1.4fr 1fr', gap: 12 }}>
                <div style={{ background: A.panel, border: `1px solid ${A.line}`, padding: 16, position: 'relative', overflow: 'hidden' }}>
                  <div style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 9, letterSpacing: '0.18em', color: A.creamDim }}>LARGEST TRANSACTION SUPPORTED</div>
                  <div style={{
                    fontFamily: "'Fraunces', serif",
                    fontVariationSettings: '"opsz" 144, "wght" 500, "SOFT" 60',
                    fontSize: 60, color: A.terracotta, letterSpacing: '-0.03em', marginTop: 4, lineHeight: 1,
                  }}>€4B</div>
                  <div style={{ fontSize: 11, color: A.creamDim, marginTop: 6 }}>Logistics group · divestment strategy</div>
                  <div style={{ position: 'absolute', right: 14, top: 14, bottom: 14, width: 60, display: 'flex', flexDirection: 'column-reverse', gap: 2 }}>
                    {Array.from({length: 20}).map((_, i) => (
                      <div key={i} style={{ height: 2, background: i < 18 ? A.terracotta : A.line, opacity: i < 18 ? (0.3 + i*0.04) : 1 }} />
                    ))}
                  </div>
                </div>
                <div style={{ background: A.panel, border: `1px solid ${A.line}`, padding: 16 }}>
                  <div style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 9, letterSpacing: '0.18em', color: A.creamDim }}>FOOTPRINT</div>
                  <div style={{
                    fontFamily: "'Fraunces', serif",
                    fontVariationSettings: '"opsz" 96, "wght" 600',
                    fontSize: 38, color: A.cream, marginTop: 6, lineHeight: 1, letterSpacing: '-0.02em',
                  }}>7 <span style={{ color: A.creamDim, fontSize: 22 }}>countries</span></div>
                  <div style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 10, color: A.ochre, marginTop: 12, lineHeight: 1.7, letterSpacing: '0.04em' }}>
                    South Africa · Germany · Portugal · Brazil · Mexico · United States · India
                  </div>
                </div>
              </div>

              <div style={{ background: A.panel, border: `1px solid ${A.line}`, padding: 14, fontFamily: "'JetBrains Mono', monospace", fontSize: 11, lineHeight: 1.7, color: A.creamDim, maxHeight: 130, overflow: 'hidden' }}>
                <div style={{ color: A.signal, marginBottom: 6, letterSpacing: '0.18em', fontSize: 9 }}>RECENT · SHIPPED</div>
                <div>2M records / mo · 90% auto-resolved · <span style={{ color: A.ochre }}>logistics client, 2026</span></div>
                <div>12/12 critical projects · <span style={{ color: A.ochre }}>2024</span></div>
                <div>Time-to-hire 6w → 2w · <span style={{ color: A.ochre }}>2025</span></div>
              </div>
            </>
          )}
        </div>
      </div>

      {/* Operating model schematic — kinetic node grid */}
      <div style={{ padding: isPhone ? '28px 18px 32px' : '64px 48px 80px' }}>
        <div style={{ display: 'flex', alignItems: 'baseline', justifyContent: 'space-between', marginBottom: isPhone ? 18 : 32, gap: 12, flexWrap: 'wrap' }}>
          <div>
            <div style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 11, letterSpacing: '0.2em', color: A.ochre, marginBottom: 8 }}>OPERATING MODEL</div>
            <h2 style={{
              fontFamily: "'Fraunces', serif",
              fontVariationSettings: (window.TYPE || {}).h2 || '"opsz" 144, "wght" 500, "SOFT" 60',
              fontSize: isPhone ? 32 : 56, margin: 0, color: A.cream, letterSpacing: '-0.03em', lineHeight: 1,
            }}>What I actually do, <span style={{ fontStyle: 'italic', color: A.terracotta }}>visualised.</span></h2>
          </div>
          <span style={{
            fontFamily: "'JetBrains Mono', monospace", fontSize: 10, letterSpacing: '0.2em',
            color: A.creamFaint,
          }}>CLICK ANY NODE TO PIN IT</span>
        </div>

        {isPhone ? (
          // MOBILE — compact pipeline: input/output as 2-line summary, then engine grid + active panel
          <div style={{ border: `1px solid ${A.line}`, background: A.panel }}>
            <div style={{
              display: 'grid', gridTemplateColumns: '1fr 12px 1fr',
              alignItems: 'stretch',
            }}>
              <div style={{
                padding: '14px 14px',
                background: 'linear-gradient(180deg, rgba(194,90,46,0.14), rgba(194,90,46,0.02))',
                borderRight: `1px solid ${A.line}`,
              }}>
                <div style={{
                  display: 'inline-block', padding: '2px 6px', marginBottom: 8,
                  border: `1px solid ${A.terracotta}`,
                  fontFamily: "'JetBrains Mono', monospace", fontSize: 9, letterSpacing: '0.18em',
                  color: A.terracotta, fontWeight: 700,
                }}>① IN</div>
                <div style={{
                  fontFamily: "'Fraunces', serif", fontVariationSettings: '"opsz" 96, "wght" 500, "SOFT" 60',
                  fontSize: 14, lineHeight: 1.25, color: A.cream, letterSpacing: '-0.01em',
                }}>Strategy and delivery have drifted apart.</div>
              </div>
              <div style={{
                background: A.bg,
                display: 'flex', alignItems: 'center', justifyContent: 'center',
                color: A.signal, fontFamily: "'JetBrains Mono', monospace", fontSize: 14, fontWeight: 700,
                borderRight: `1px solid ${A.line}`,
              }}>→</div>
              <div style={{
                padding: '14px 14px',
                background: 'linear-gradient(180deg, rgba(156,150,72,0.14), rgba(156,150,72,0.02))',
              }}>
                <div style={{
                  display: 'inline-block', padding: '2px 6px', marginBottom: 8,
                  border: `1px solid ${A.olive}`,
                  fontFamily: "'JetBrains Mono', monospace", fontSize: 9, letterSpacing: '0.18em',
                  color: A.olive, fontWeight: 700,
                }}>③ OUT</div>
                <div style={{
                  fontFamily: "'Fraunces', serif", fontVariationSettings: '"opsz" 96, "wght" 500, "SOFT" 60',
                  fontSize: 14, lineHeight: 1.25, color: A.cream, letterSpacing: '-0.01em',
                }}>Senior team owns its work. Reporting tells the truth.</div>
              </div>
            </div>
            <div style={{
              padding: '14px 14px',
              borderTop: `1px solid ${A.line}`,
              display: 'flex', justifyContent: 'space-between', alignItems: 'center', flexWrap: 'wrap', gap: 8,
            }}>
              <div style={{
                display: 'inline-block', padding: '3px 8px', border: `1px solid ${A.signal}`,
                fontFamily: "'JetBrains Mono', monospace", fontSize: 9, letterSpacing: '0.2em',
                color: A.signal, fontWeight: 700,
              }}>② ENGINE · 8 NODES</div>
              <div style={{
                fontFamily: "'JetBrains Mono', monospace", fontSize: 9, letterSpacing: '0.18em',
                color: A.signal, background: 'rgba(242,193,78,0.08)',
                padding: '3px 8px', border: `1px solid ${A.signal}`,
              }}>※ AI-AUGMENTED</div>
            </div>
            <div style={{ padding: '0 14px 14px', display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: 6 }}>
              {nodes.map((n, i) => {
                const isActive = i === activeNode;
                return (
                  <button key={i}
                    onClick={() => setPinned(i === pinned ? null : i)}
                    style={{
                      textAlign: 'left', position: 'relative',
                      border: `1px solid ${isActive ? n.accent : A.line}`,
                      background: isActive ? `${n.accent}1A` : 'transparent',
                      padding: '10px 8px 10px 18px',
                      fontFamily: "'JetBrains Mono', monospace", fontSize: 10.5, letterSpacing: '0.04em',
                      color: isActive ? n.accent : A.cream,
                      fontWeight: isActive ? 700 : 500,
                      lineHeight: 1.2, transition: 'all 0.3s ease',
                      minHeight: 38,
                    }}>
                    <span style={{
                      position: 'absolute', top: '50%', left: 6, transform: 'translateY(-50%)',
                      width: 5, height: 5, borderRadius: '50%',
                      background: n.accent, opacity: isActive ? 1 : 0.45,
                    }} />
                    {n.name}
                  </button>
                );
              })}
            </div>
            <div style={{
              margin: '0 14px 14px',
              padding: '12px 14px',
              border: `1px solid ${nodes[activeNode].accent}`,
              background: `${nodes[activeNode].accent}10`,
              transition: 'border-color 0.3s, background 0.3s',
            }}>
              <div style={{
                fontFamily: "'JetBrains Mono', monospace", fontSize: 9, color: A.creamDim,
                letterSpacing: '0.18em', marginBottom: 6,
              }}>
                ACTIVE: <span style={{ color: nodes[activeNode].accent }}>{nodes[activeNode].name}</span>
              </div>
              <div style={{
                fontFamily: "'Inter', sans-serif",
                fontSize: 13, lineHeight: 1.5, color: A.cream,
              }}>{nodes[activeNode].blurb}</div>
            </div>
          </div>
        ) : (
          <div style={{
            display: 'grid', gridTemplateColumns: isNarrow ? '1fr' : '240px 1fr 280px',
            border: `1px solid ${A.line}`, background: A.panel, minHeight: isNarrow ? 0 : 460,
            position: 'relative',
          }}>
            {/* INPUT column — labelled cap, terracotta tint, text centered */}
            <div style={{
              padding: '28px 24px',
              borderRight: isNarrow ? 'none' : `1px solid ${A.line}`,
              borderBottom: isNarrow ? `1px solid ${A.line}` : 'none',
              display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'flex-start',
              gap: 0,
              background: 'linear-gradient(180deg, rgba(194,90,46,0.14), rgba(194,90,46,0.02))',
              position: 'relative', minHeight: isNarrow ? 200 : 0,
            }}>
              <div style={{
                position: 'absolute', top: 28, left: 24,
                padding: '4px 10px', border: `1px solid ${A.terracotta}`,
                fontFamily: "'JetBrains Mono', monospace", fontSize: 10, letterSpacing: '0.22em',
                color: A.terracotta, fontWeight: 700,
              }}>① INPUT</div>
              <div style={{ fontFamily: "'Fraunces', serif", fontVariationSettings: '"opsz" 96, "wght" 500, "SOFT" 60', fontSize: 26, color: A.cream, lineHeight: 1.1, letterSpacing: '-0.02em' }}>A business where strategy and delivery have drifted apart.</div>
              {!isNarrow && (
                <div style={{
                  position: 'absolute', right: -14, top: '50%', transform: 'translateY(-50%)',
                  width: 28, height: 28, borderRadius: '50%',
                  background: A.bg, border: `1px solid ${A.terracotta}`,
                  display: 'flex', alignItems: 'center', justifyContent: 'center',
                  color: A.terracotta, fontFamily: "'JetBrains Mono', monospace", fontSize: 16, fontWeight: 700,
                  zIndex: 2,
                }}>→</div>
              )}
            </div>
            <div style={{
              padding: '28px 36px',
              borderRight: isNarrow ? 'none' : `1px solid ${A.line}`,
              borderBottom: isNarrow ? `1px solid ${A.line}` : 'none',
              display: 'flex', flexDirection: 'column', gap: 14,
            }}>
              <div style={{
                display: 'flex', justifyContent: 'space-between', alignItems: 'baseline',
                gap: 14, flexWrap: 'wrap',
              }}>
                <div style={{
                  display: 'inline-block',
                  padding: '4px 10px', border: `1px solid ${A.signal}`,
                  fontFamily: "'JetBrains Mono', monospace", fontSize: 10, letterSpacing: '0.22em',
                  color: A.signal, fontWeight: 700,
                }}>② ENGINE · 8 NODES</div>
                <div style={{
                  fontFamily: "'JetBrains Mono', monospace", fontSize: 10, letterSpacing: '0.2em',
                  color: A.signal, padding: '4px 10px',
                  background: 'rgba(242,193,78,0.08)',
                  border: `1px solid ${A.signal}`,
                }}>※ AI-AUGMENTED · ALL NODES</div>
              </div>
              <div style={{
                display: 'grid',
                gridTemplateColumns: 'repeat(4, 1fr)',
                gap: 8,
                flex: '1 1 auto',
                minHeight: 200,
              }}>
                {nodes.map((n, i) => {
                  const isActive = i === activeNode;
                  return (
                    <button key={i}
                      data-cursor="pointer"
                      onClick={() => setPinned(i === pinned ? null : i)}
                      style={{
                        cursor: 'none', textAlign: 'center', position: 'relative',
                        border: `1px solid ${isActive ? n.accent : A.line}`,
                        background: isActive
                          ? (n.accent === A.signal ? A.signalSoft : `${n.accent}1A`)
                          : 'transparent',
                        padding: '18px 12px',
                        fontFamily: "'JetBrains Mono', monospace", fontSize: 13, letterSpacing: '0.06em',
                        color: isActive ? n.accent : A.cream,
                        fontWeight: isActive ? 700 : 500,
                        lineHeight: 1.3, transition: 'all 0.3s ease',
                        display: 'flex', alignItems: 'center', justifyContent: 'center',
                        boxShadow: isActive ? `inset 0 0 0 1px ${n.accent}33` : 'none',
                      }}>
                      <span style={{
                        position: 'absolute', top: 6, left: 8,
                        width: 6, height: 6, borderRadius: '50%',
                        background: n.accent, opacity: isActive ? 1 : 0.45,
                        transition: 'opacity 0.3s',
                      }} />
                      {n.name}
                    </button>
                  );
                })}
              </div>
              <div style={{
                padding: '18px 20px',
                border: `1px solid ${nodes[activeNode].accent}`,
                background: `${nodes[activeNode].accent}10`,
                flex: '0 0 auto',
                transition: 'border-color 0.3s, background 0.3s',
              }}>
                <div style={{
                  fontFamily: "'JetBrains Mono', monospace", fontSize: 10, color: A.creamDim,
                  letterSpacing: '0.18em', marginBottom: 10,
                  display: 'flex', justifyContent: 'space-between', alignItems: 'baseline', gap: 12, flexWrap: 'wrap',
                }}>
                  <span>ACTIVE NODE: <span style={{ color: nodes[activeNode].accent }}>{nodes[activeNode].name}</span></span>
                  <span style={{ color: pinned !== null ? A.signal : A.creamFaint, fontSize: 9 }}>
                    {pinned !== null ? '◉ PINNED · CLICK AGAIN TO UNPIN' : '◯ AUTO-CYCLING · CLICK TO PIN'}
                  </span>
                </div>
                <div style={{
                  fontFamily: "'Inter', sans-serif",
                  fontSize: 15, lineHeight: 1.55, color: A.cream,
                }}>{nodes[activeNode].blurb}</div>
              </div>
            </div>
            <div style={{
              padding: '28px 24px',
              display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'flex-start',
              background: 'linear-gradient(180deg, rgba(156,150,72,0.14), rgba(156,150,72,0.02))',
              position: 'relative', minHeight: isNarrow ? 200 : 0,
            }}>
              {!isNarrow && (
                <div style={{
                  position: 'absolute', left: -14, top: '50%', transform: 'translateY(-50%)',
                  width: 28, height: 28, borderRadius: '50%',
                  background: A.bg, border: `1px solid ${A.olive}`,
                  display: 'flex', alignItems: 'center', justifyContent: 'center',
                  color: A.olive, fontFamily: "'JetBrains Mono', monospace", fontSize: 16, fontWeight: 700,
                  zIndex: 2,
                }}>→</div>
              )}
              <div style={{
                position: 'absolute', top: 28, left: 24,
                padding: '4px 10px', border: `1px solid ${A.olive}`,
                fontFamily: "'JetBrains Mono', monospace", fontSize: 10, letterSpacing: '0.22em',
                color: A.olive, fontWeight: 700,
              }}>③ OUTPUT</div>
              <div style={{ fontFamily: "'Fraunces', serif", fontVariationSettings: '"opsz" 96, "wght" 500, "SOFT" 60', fontSize: 26, color: A.cream, lineHeight: 1.1, letterSpacing: '-0.02em' }}>
                A senior team that knows what it owns. Reporting that tells the truth.
              </div>
            </div>
          </div>
        )}

        {/* Footnote — vibe-coded confession (AI-augmented note now lives inside the engine) */}
        <div style={{
          marginTop: isPhone ? 12 : 20,
          padding: isPhone ? '10px 12px' : '14px 18px',
          border: `1px dashed ${A.line}`,
          fontFamily: "'JetBrains Mono', monospace", fontSize: isPhone ? 9 : 10, letterSpacing: '0.16em',
          color: A.creamFaint, lineHeight: 1.5, textAlign: isPhone ? 'center' : 'right',
        }}>
          FOOTNOTE · THIS SITE WAS VIBE-CODED BY THE OPERATOR HERSELF · FIRST RODEO · BE KIND
        </div>
      </div>

      {/* "What's underneath" — modules as a vertical typographic list */}
      <div style={{ padding: isPhone ? '0 18px 32px' : '0 48px 80px' }}>
        <div style={{
          fontFamily: "'JetBrains Mono', monospace", fontSize: 11, letterSpacing: '0.2em', color: A.ochre,
          marginBottom: isPhone ? 10 : 18, display: 'flex', justifyContent: 'space-between', alignItems: 'baseline',
        }}>
          <span>EXPLORE</span>
          <span style={{ color: A.creamFaint, fontSize: 10 }}>KEYBOARD · KEYS 2–7</span>
        </div>

        {(() => {
          // Capability is folded into the engine room above — drop it from the modules list.
          const items = ROUTES.filter(r => r.id !== 'home' && r.id !== 'skills').map(r => ({
            ...r,
            label: { about: 'Brief', numbers: 'Metrics', work: 'Record', reach: 'Reach', contact: 'Contact' }[r.id] || r.label,
            blurb: {
              about:    'Why I exist on a leadership team.',
              numbers:  'Six results, balance-sheet style.',
              work:     'Eleven+ years of deployment logs.',
              reach:    '20+ markets, by depth.',
              contact:  'Open a channel.',
            }[r.id],
            tone: {
              about:    'cream',
              numbers:  'signal',
              work:     'ochre',
              reach:    'olive',
              contact:  'terracotta',
            }[r.id],
          }));
          const tones = { cream: A.cream, signal: A.signal, ochre: A.ochre, terracotta: A.terracotta, olive: A.olive };

          return (
            <div style={{ border: `1px solid ${A.line}`, background: A.panel }}>
              {items.map((it, i) => (
                <a key={it.id} href={it.href} style={{
                  display: 'grid',
                  gridTemplateColumns: isPhone ? 'auto 1fr 20px' : '1fr 1.6fr 36px',
                  alignItems: 'center',
                  gap: isPhone ? 14 : 36,
                  padding: isPhone ? '12px 14px' : '28px 36px',
                  borderTop: i > 0 ? `1px solid ${A.line}` : 'none',
                  color: A.cream, textDecoration: 'none',
                  background: A.panel,
                  transition: 'background 0.15s, padding-left 0.2s',
                }}
                  onMouseEnter={e => { e.currentTarget.style.background = A.panel2; e.currentTarget.style.paddingLeft = isPhone ? '20px' : '46px'; }}
                  onMouseLeave={e => { e.currentTarget.style.background = A.panel; e.currentTarget.style.paddingLeft = isPhone ? '14px' : '36px'; }}
                >
                  <div style={{
                    fontFamily: "'Fraunces', serif",
                    fontVariationSettings: '"opsz" 144, "wght" 600, "SOFT" 30, "WONK" 1',
                    fontSize: isPhone ? 20 : 'clamp(28px, 4.4vw, 48px)',
                    color: tones[it.tone], lineHeight: 1.1, letterSpacing: '-0.02em',
                    whiteSpace: 'nowrap',
                  }}>{it.label}</div>
                  <div style={{
                    fontFamily: "'Fraunces', serif",
                    fontVariationSettings: '"opsz" 24, "wght" 400, "SOFT" 60',
                    fontStyle: 'italic',
                    fontSize: isPhone ? 12.5 : 'clamp(15px, 1.5vw, 19px)', lineHeight: 1.35,
                    color: A.creamDim,
                  }}>{it.blurb}</div>
                  <div style={{
                    color: tones[it.tone],
                    fontFamily: "'JetBrains Mono', monospace", fontSize: isPhone ? 14 : 18,
                    textAlign: 'right',
                  }}>→</div>
                </a>
              ))}
            </div>
          );
        })()}
      </div>
    </>
  );
}
window.HomeHero = HomeHero;
