// ── Video Gallery (shared scroll component) ──────────────────────
function VideoScroller({ title, videos }) {
  const scrollRef = React.useRef(null);
  const [atStart, setAtStart] = React.useState(true);
  const [atEnd, setAtEnd] = React.useState(false);

  const updateBounds = () => {
    const el = scrollRef.current;
    if (!el) return;
    setAtStart(el.scrollLeft <= 0);
    setAtEnd(el.scrollLeft + el.clientWidth >= el.scrollWidth - 1);
  };

  const scroll = (direction) => {
    const el = scrollRef.current;
    if (!el) return;
    const step = el.clientWidth;
    el.scrollBy({ left: direction === 'left' ? -step : step, behavior: 'smooth' });
    setTimeout(updateBounds, 350);
  };

  const btnStyle = (disabled) => ({
    width: 36, height: 36, borderRadius: '50%',
    border: `1px solid ${disabled ? 'rgba(255,255,255,0.04)' : BORDER}`,
    background: SURFACE, color: disabled ? '#333' : TEXT_PRIMARY,
    cursor: disabled ? 'default' : 'pointer',
    display: 'flex', alignItems: 'center', justifyContent: 'center',
    transition: 'border-color 0.2s, color 0.2s',
    opacity: disabled ? 0.4 : 1,
  });

  return (
    <div style={{ width: '100%', minWidth: 0 }}>
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 16 }}>
        <div style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.65rem', color: ACCENT, letterSpacing: '0.1em', textTransform: 'uppercase' }}>{title}</div>
        <div style={{ display: 'flex', gap: 8 }}>
          <button aria-label="Scroll left" onClick={() => !atStart && scroll('left')} style={btnStyle(atStart)}
            onMouseEnter={(e) => { if (!atStart) e.currentTarget.style.borderColor = ACCENT; }}
            onMouseLeave={(e) => { if (!atStart) e.currentTarget.style.borderColor = BORDER; }}>
            <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M15 18l-6-6 6-6"/></svg>
          </button>
          <button aria-label="Scroll right" onClick={() => !atEnd && scroll('right')} style={btnStyle(atEnd)}
            onMouseEnter={(e) => { if (!atEnd) e.currentTarget.style.borderColor = ACCENT; }}
            onMouseLeave={(e) => { if (!atEnd) e.currentTarget.style.borderColor = BORDER; }}>
            <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M9 18l6-6-6-6"/></svg>
          </button>
        </div>
      </div>
      <div ref={scrollRef} onScroll={updateBounds} className="no-scrollbar" style={{ display: 'flex', overflowX: 'auto', scrollSnapType: 'x mandatory', paddingTop: 10, paddingBottom: 20, width: '100%' }}>
        {videos.map((vid, i) => (
          <div key={i} style={{
            flex: '0 0 100%', scrollSnapAlign: 'start',
            background: SURFACE, border: `1px solid ${BORDER}`, borderRadius: 16,
            overflow: 'hidden', position: 'relative', aspectRatio: '16 / 9',
            display: 'flex', alignItems: 'center', justifyContent: 'center',
            transition: 'border-color 0.3s, transform 0.3s cubic-bezier(0.25,0.46,0.45,0.94)',
          }}
            onMouseEnter={e => { e.currentTarget.style.borderColor = 'rgba(255,107,0,0.25)'; e.currentTarget.style.transform = 'translateY(-3px)'; }}
            onMouseLeave={e => { e.currentTarget.style.borderColor = BORDER; e.currentTarget.style.transform = 'translateY(0)'; }}
          >
            <div style={{ textAlign: 'center', padding: 20 }}>
              <div style={{
                width: 48, height: 48, borderRadius: '50%',
                background: 'rgba(255,107,0,0.1)', border: `1px solid rgba(255,107,0,0.3)`,
                display: 'flex', alignItems: 'center', justifyContent: 'center',
                margin: '0 auto 10px',
              }}>
                <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke={ACCENT} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
                  <polygon points="5 3 19 12 5 21 5 3" />
                </svg>
              </div>
              <div style={{ fontSize: '0.82rem', fontWeight: 600, color: TEXT_PRIMARY, marginBottom: 3 }}>{vid.title}</div>
              <div style={{ fontSize: '0.7rem', color: MUTED }}>{vid.desc}</div>
            </div>
          </div>
        ))}
      </div>
    </div>
  );
}

function VideoGallery({ isMobile }) {
  return (
    <FadeUp delay={80}>
      <div style={{ marginBottom: 32 }}>
        <div style={{ display: 'grid', gridTemplateColumns: isMobile ? '1fr' : 'minmax(0, 1fr) minmax(0, 1fr)', gap: isMobile ? 32 : 28 }}>
          <VideoScroller
            title="Client Results"
            videos={[
              { title: 'AI Ops Audit Walkthrough', desc: 'How we map your revenue per employee gap' },
              { title: 'First Build Demo', desc: 'See the system in action' },
            ]}
          />
          <VideoScroller
            title="Product Walkthroughs"
            videos={[
              { title: 'System Architecture', desc: 'How everything connects' },
              { title: 'Notion Environment', desc: 'Your command centre setup' },
              { title: 'Claude Environment', desc: 'AI core configuration' },
              { title: 'Integrations & Workflows', desc: 'Connecting your stack' },
              { title: 'Prompt Engineering', desc: 'Building reusable prompts' },
            ]}
          />
        </div>
      </div>
    </FadeUp>
  );
}

// ── Proof + ROI + Comparison + Pricing + FAQ + Footer + Status Bar ─

const BEFORE_AFTER = [
  { scenario: 'Client Follow-Up', icon: <Mail size={22} strokeWidth={1.5} />, before: { time: '3-5 days', result: '30% drop-off', detail: 'Spreadsheet tracking. Leads go cold.' }, after: { time: 'Under 2 hours', result: '0% missed', detail: 'Triggered by conversation context. Automatically.' } },
  { scenario: 'Meeting Scheduling', icon: <CalendarDays size={22} strokeWidth={1.5} />, before: { time: '2 days', result: '6 emails back-forth', detail: 'Calendar chaos. Double bookings. Wasted time.' }, after: { time: '60 seconds', result: '1-click booking', detail: 'AI finds the slot. Sends the confirm.' } },
  { scenario: 'Document Chasing', icon: <ClipboardList size={22} strokeWidth={1.5} />, before: { time: '45 mins per client', result: 'PM bottleneck', detail: 'Chase. Remind. Track down. Repeat.' }, after: { time: '0 minutes', result: 'Auto-requested', detail: 'Tracked. Reminded. Escalated. Automatically.' } },
  { scenario: 'Invoice Reconciliation', icon: <DollarSign size={22} strokeWidth={1.5} />, before: { time: 'End-of-month scramble', result: 'Delayed revenue', detail: 'Errors. Discrepancies. Manual tracking.' }, after: { time: 'Real-time sync', result: 'Paid faster', detail: 'Discrepancies flagged. Records accurate.' } },
  { scenario: 'Weekly Reporting', icon: <BarChart3 size={22} strokeWidth={1.5} />, before: { time: '2 hours every Friday', result: 'Outdated by Monday', detail: 'Hand-built Excel. Manual entry. Stale by Monday.' }, after: { time: '0 minutes', result: 'Auto-delivered', detail: 'Generated. Delivered. Always current.' } },
];

// ── Proof ─────────────────────────────────────────────────────────
function ProofSection() {
  const { width } = useWindowSize();
  const isMobile = width <= 768;

  return (
    <section id="proof" style={{ padding: isMobile ? '60px 20px' : '100px 64px', background: 'rgba(6,6,6,0.88)' }}>
      <div style={{ maxWidth: 1200, margin: '0 auto' }}>
        <FadeUp>
          <div style={{ textAlign: 'center', marginBottom: 56 }}>
            <SectionLabel number="04">Proof Over Words</SectionLabel>
            <SectionH2 style={{ marginBottom: 16 }}>Every hour saved is an hour earning.</SectionH2>
            <p style={{ color: TEXT_SECONDARY, maxWidth: 560, margin: '0 auto', lineHeight: 1.75 }}>
              Real scenarios. Real hours back. Revenue per employee (RPE) gains come from systems, not headcount, not hustle.
            </p>
          </div>
        </FadeUp>

        {isMobile && (
          <div style={{ textAlign: 'center', marginBottom: 10, fontFamily: 'JetBrains Mono,monospace', fontSize: '0.6rem', color: '#666', letterSpacing: '0.08em' }}>
            <span style={{ color: ACCENT }}>←</span> swipe <span style={{ color: ACCENT }}>→</span>
          </div>
        )}

        <div className="no-scrollbar" style={{ display: 'flex', gap: 18, overflowX: 'auto', overflowY: 'hidden', overscrollBehaviorX: 'contain', scrollSnapType: 'x mandatory', paddingTop: 14, paddingBottom: 28, marginBottom: 36 }}>
          {BEFORE_AFTER.map((item, idx) => (
            <FadeUp key={item.scenario} delay={idx * 60}>
              <div style={{
                flex: isMobile ? '0 0 min(280px, 82vw)' : '0 0 220px', scrollSnapAlign: 'start',
                background: SURFACE, border: `1px solid ${BORDER}`, borderRadius: 20, overflow: 'hidden',
                transition: 'border-color 0.3s, transform 0.3s cubic-bezier(0.25,0.46,0.45,0.94)',
                height: '100%',
              }}
                onMouseEnter={e => { e.currentTarget.style.borderColor = 'rgba(255,107,0,0.2)'; e.currentTarget.style.transform = 'translateY(-3px)'; }}
                onMouseLeave={e => { e.currentTarget.style.borderColor = BORDER; e.currentTarget.style.transform = 'translateY(0)'; }}
              >
                <div style={{ padding: '16px 22px', borderBottom: `1px solid ${BORDER}`, background: 'rgba(255,255,255,0.02)' }}>
                  <div style={{ color: ACCENT, marginBottom: 8 }}>{item.icon}</div>
                  <div style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.7rem', color: ACCENT, letterSpacing: '0.08em' }}>
                    {item.scenario.toUpperCase()}
                  </div>
                </div>
                <div style={{ padding: '20px 22px' }}>
                  <div style={{ marginBottom: 16 }}>
                    <div style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.58rem', color: '#555', letterSpacing: '0.1em', marginBottom: 7, textTransform: 'uppercase' }}>Before</div>
                    <div style={{ fontSize: '1rem', lineHeight: 1.6 }}>
                      <strong style={{ color: '#666' }}>{item.before.time}</strong> - {item.before.detail}
                      <br /><span style={{ color: '#f87171', fontSize: '0.8rem', display: 'inline-flex', alignItems: 'center', gap: 4 }}><X size={14} strokeWidth={3} /> {item.before.result}</span>
                    </div>
                  </div>
                  <div style={{ textAlign: 'center', color: ACCENT, marginBottom: 14, fontSize: '1.1rem', display: 'flex', justifyContent: 'center' }}><ArrowDown size={20} /></div>
                  <div>
                    <div style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.58rem', color: ACCENT, letterSpacing: '0.1em', marginBottom: 7, textTransform: 'uppercase' }}>After Augment OS</div>
                    <div style={{ fontSize: '1rem', color: TEXT_SECONDARY, lineHeight: 1.6 }}>
                      <strong style={{ color: ACCENT }}>{item.after.time}</strong> - {item.after.detail}
                      <br /><span style={{ color: '#4ade80', fontSize: '0.8rem', display: 'inline-flex', alignItems: 'center', gap: 4 }}><Check size={14} strokeWidth={2.5} /> {item.after.result}</span>
                    </div>
                  </div>
                </div>
              </div>
            </FadeUp>
          ))}
        </div>

        {/* Video gallery - Client Results + Product Walkthroughs */}
        <VideoGallery isMobile={isMobile} />

        {/* What the Research Says */}
        <FadeUp delay={80}>
          <div style={{ marginTop: 36 }}>
            <CollapsibleCard title="What the Research Says">
              <div style={{ display: 'grid', gridTemplateColumns: isMobile ? '1fr' : '1fr 1fr', gap: isMobile ? 16 : 20 }}>
                {[
                  { source: 'International Data Corporation (IDC)', finding: '40% of a knowledge worker\'s week is spent on mechanical tasks, not thinking, not selling, not building.' },
                  { source: 'Stanford-Carnegie', finding: 'Hybrid human–artificial intelligence teams outperform pure-human teams by 24.3% on complex knowledge work tasks.' },
                  { source: 'National Bureau of Economic Research (NBER)', finding: 'Artificial intelligence (AI) automates 1.4-34% of tasks per occupation. Sales roles average ~12 hrs/week automatable.' },
                  { source: 'Boston Consulting Group (BCG)', finding: '74% of generative artificial intelligence (AI) pilots fail to scale. The #1 barrier: insufficient worker skills and training.' },
                  { source: 'McKinsey 2025', finding: 'Only 1% of leaders report artificial intelligence (AI) is fully mature across workflows, despite 91% adoption.' },
                  { source: 'Orgvue', finding: '55% of business leaders regret AI-driven workforce reductions.' },
                ].map(r => <ResearchCard key={r.source} source={r.source} finding={r.finding} />)}</div>
            </CollapsibleCard>
          </div>
        </FadeUp>
      </div>
    </section>
  );
}

function ResearchCard({ source, finding }) {
  const cardRef = React.useRef(null);
  const spotRef = React.useRef(null);
  const [hovered, setHovered] = React.useState(false);
  const flashTimeoutRef = React.useRef(null);

  const handleMove = (e) => {
    if (window.matchMedia('(pointer: coarse)').matches) return;
    const rect = cardRef.current?.getBoundingClientRect();
    if (!rect || !spotRef.current) return;
    const x = e.clientX - rect.left - 120;
    const y = e.clientY - rect.top - 120;
    spotRef.current.style.transform = `translate(${x}px, ${y}px)`;
  };

  const handleTouchStart = (e) => {
    const touch = e.touches[0];
    const rect = cardRef.current?.getBoundingClientRect();
    if (rect && spotRef.current) {
      const x = touch.clientX - rect.left - 120;
      const y = touch.clientY - rect.top - 120;
      spotRef.current.style.transform = `translate(${x}px, ${y}px)`;
    }
    setHovered(true);
    if (flashTimeoutRef.current) clearTimeout(flashTimeoutRef.current);
  };

  const handleTouchEnd = () => {
    flashTimeoutRef.current = setTimeout(() => setHovered(false), 400);
  };

  return (
    <div
      ref={cardRef}
      onMouseEnter={() => setHovered(true)}
      onMouseLeave={() => setHovered(false)}
      onMouseMove={handleMove}
      onTouchStart={handleTouchStart}
      onTouchEnd={handleTouchEnd}
      style={{
        padding: '16px 20px', background: SURFACE2, borderRadius: 12,
        border: `1px solid ${hovered ? 'rgba(255,107,0,0.35)' : BORDER}`,
        borderLeft: `3px solid ${ACCENT}`,
        transition: 'border-color 0.3s, transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94), box-shadow 0.35s',
        transform: hovered ? 'translateY(-5px) scale(1.015)' : 'translateY(0) scale(1)',
        boxShadow: hovered ? '0 16px 48px rgba(255,107,0,0.1)' : 'none',
        position: 'relative',
        overflow: 'hidden',
        cursor: 'default',
      }}
    >
      <div
        ref={spotRef}
        style={{
          position: 'absolute', left: 0, top: 0, width: 240, height: 240,
          borderRadius: '50%',
          background: 'radial-gradient(circle, rgba(255,107,0,0.11) 0%, transparent 70%)',
          pointerEvents: 'none', zIndex: 0,
          opacity: hovered ? 1 : 0, transition: 'opacity 0.3s', willChange: 'transform',
        }}
      />
      <div style={{ position: 'relative', zIndex: 1 }}>
        <div style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.6rem', color: ACCENT, letterSpacing: '0.1em', marginBottom: 6, textTransform: 'uppercase' }}>{source}</div>
        <div style={{ fontSize: '0.88rem', color: TEXT_SECONDARY, lineHeight: 1.6 }}>"{finding}"</div>
      </div>
    </div>
  );
}

// ── ROI Calculator ────────────────────────────────────────────────
function useCountUp(target, duration = 700) {
  const reduced = usePrefersReducedMotion();
  const [val, setVal] = React.useState(target);
  const prev = React.useRef(target);
  React.useEffect(() => {
    if (reduced) { setVal(target); prev.current = target; return; }
    const start = prev.current, diff = target - start, t0 = performance.now();
    let raf;
    const frame = (now) => {
      const p = Math.min((now - t0) / duration, 1);
      const e = 1 - Math.pow(1 - p, 3);
      setVal(Math.round(start + diff * e));
      if (p < 1) raf = requestAnimationFrame(frame);
      else prev.current = target;
    };
    raf = requestAnimationFrame(frame);
    return () => cancelAnimationFrame(raf);
  }, [target, duration, reduced]);
  return val;
}

function EditableValue({ value, format, parse, onChange, min, max, style }) {
  const [editing, setEditing] = React.useState(false);
  const [text, setText] = React.useState('');
  const ref = React.useRef(null);

  React.useEffect(() => {
    if (editing && ref.current) { ref.current.focus(); ref.current.select(); }
  }, [editing]);

  const startEdit = () => { setText(format(value)); setEditing(true); };
  const commit = () => {
    setEditing(false);
    const parsed = parse ? parse(text) : Number(text.replace(/[^0-9.-]/g, ''));
    if (!isNaN(parsed)) {
      const clamped = Math.max(min, Math.min(max, parsed));
      onChange(clamped);
    }
  };
  const onKey = (e) => { if (e.key === 'Enter') commit(); if (e.key === 'Escape') setEditing(false); };

  if (editing) {
    return (
      <input
        ref={ref}
        type="text"
        value={text}
        onChange={e => setText(e.target.value)}
        onBlur={commit}
        onKeyDown={onKey}
        style={{
          fontFamily: '"Playfair Display",serif', fontStyle: 'italic', fontSize: '1.5rem', fontWeight: 700,
          color: TEXT_PRIMARY, background: 'transparent', border: 'none',
          borderBottom: `1px solid ${ACCENT}`, width: '100%', textAlign: 'right',
          outline: 'none', padding: 0, margin: 0, ...style,
        }}
      />
    );
  }
  return (
    <span
      onClick={startEdit}
      style={{
        fontFamily: '"Playfair Display",serif', fontStyle: 'italic', fontSize: '1.5rem', fontWeight: 700,
        color: TEXT_PRIMARY, cursor: 'text', borderBottom: '1px solid transparent',
        transition: 'border-color 0.2s',
        ...style,
      }}
      onMouseEnter={e => e.currentTarget.style.borderBottomColor = 'rgba(255,107,0,0.3)'}
      onMouseLeave={e => e.currentTarget.style.borderBottomColor = 'transparent'}
    >
      {format(value)}
    </span>
  );
}

const SliderRow = ({ label, value, min, max, step = 1, format, parse, onChange }) => (
  <div style={{ display: 'flex', flexDirection: 'column', gap: 8, userSelect: 'none', WebkitUserSelect: 'none' }}>
    <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: 12 }}>
      <div style={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
        <span style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.68rem', color: MUTED, letterSpacing: '0.1em', textTransform: 'uppercase' }}>{label}</span>
        <span style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.58rem', color: '#555', letterSpacing: '0.04em' }}>Type to edit →</span>
      </div>
      <EditableValue value={value} format={format} parse={parse} onChange={onChange} min={min} max={max} />
    </div>
    <input type="range" min={min} max={max} step={step} value={value} onChange={e => onChange(Number(e.target.value))} style={{ width: '100%', accentColor: ACCENT, cursor: 'pointer' }} />
    <div style={{ display: 'flex', justifyContent: 'space-between' }}>
      <span style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.6rem', color: '#333' }}>{format(min)}</span>
      <span style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.6rem', color: '#333' }}>{format(max)}</span>
    </div>
  </div>
);

function InfoToggle({ title, children, onHover, onLeave }) {
  const [open, setOpen] = React.useState(false);
  return (
    <div style={{ marginBottom: 10 }}>
      <button
        onClick={() => setOpen(!open)}
        onMouseEnter={onHover}
        onMouseLeave={onLeave}
        style={{
          display: 'flex', alignItems: 'center', gap: 6,
          background: 'transparent', border: 'none', padding: 0,
          cursor: 'pointer', fontSize: '0.65rem', fontFamily: 'JetBrains Mono,monospace',
          color: ACCENT, letterSpacing: '0.08em', textTransform: 'uppercase',
          lineHeight: 1.4,
        }}
      >
        <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke={ACCENT} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
          <circle cx="12" cy="12" r="10"/>
          <line x1="12" y1="16" x2="12" y2="12"/>
          <line x1="12" y1="8" x2="12.01" y2="8"/>
        </svg>
        {title}
        <span style={{ marginLeft: 2, display: 'inline-block', transform: open ? 'rotate(180deg)' : 'rotate(0)', transition: 'transform 0.25s', fontSize: '1rem' }}>▾</span>
      </button>
      {open && (
        <div style={{
          fontSize: '0.75rem', color: TEXT_SECONDARY, lineHeight: 1.6,
          marginTop: 8, padding: '10px 14px',
          background: SURFACE, borderRadius: 10,
          border: `1px solid ${BORDER}`,
        }}>
          {children}
        </div>
      )}
    </div>
  );
}

const StatBox = ({ label, value, accent = false, glow = false }) => (
  <div style={{
    background: accent ? 'rgba(255,107,0,0.08)' : SURFACE,
    border: `1px solid ${glow ? 'rgba(255,107,0,0.6)' : accent ? 'rgba(255,107,0,0.3)' : BORDER}`,
    borderRadius: 18, padding: '24px 22px',
    boxShadow: glow ? '0 0 24px rgba(255,107,0,0.12)' : 'none',
    transition: 'border-color 0.3s, box-shadow 0.3s',
  }}>
    <div style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.62rem', color: accent ? ACCENT : MUTED, letterSpacing: '0.1em', textTransform: 'uppercase', marginBottom: 8 }}>{label}</div>
    <div style={{ fontFamily: '"Playfair Display",serif', fontStyle: 'italic', fontSize: 'clamp(1.8rem,3vw,2.6rem)', fontWeight: 400, lineHeight: 1, color: TEXT_PRIMARY }}>{value}</div>
  </div>
);

// ── Features (moved here after Proof) ──────────────────────────────
function FeaturesSection() {
  const { width } = useWindowSize();
  const isMobile = width <= 768;

  return (
    <section id="features" style={{ padding: isMobile ? '60px 20px' : '100px 64px', background: 'rgba(6,6,6,0.88)' }}>
      <div style={{ maxWidth: 1200, margin: '0 auto' }}>
        <FadeUp>
          <div style={{ marginBottom: 28 }}>
            <SectionH2 style={{ marginBottom: 8 }}>Features by Category</SectionH2>
            <p style={{ color: TEXT_SECONDARY, fontSize: '1rem', lineHeight: 1.75, maxWidth: 600, marginBottom: 28 }}>Every feature either raises what your team generates or removes what's costing you revenue. Artificial intelligence (AI) delivers 2-12 hrs/week per person. 80% of teams never capture it, the integration layer is missing.</p>
          </div>
          <FeaturesByCategory />
        </FadeUp>
      </div>
    </section>
  );
}

function ROICalculator() {
  const [team, setTeam] = React.useState(10);
  const [rate, setRate] = React.useState(500);
  const [rpe, setRpe] = React.useState(150000);
  const [highlighted, setHighlighted] = React.useState(null);
  const { width } = useWindowSize();
  const isMobile = width <= 768;
  const GREEN = '#22c55e';

  const hrsWk = team * 10;
  const hrsYr = hrsWk * 52;
  const valYr = hrsYr * rate;
  const newRpe = rpe * 2;
  const totalLift = (newRpe - rpe) * team;

  const animHrsWk = useCountUp(hrsWk);
  const animHrsYr = useCountUp(hrsYr);
  const animVal = useCountUp(valYr);
  const fmt$ = n => n >= 1000000 ? `$${(n/1000000).toFixed(1)}M` : n >= 1000 ? `$${(n/1000).toFixed(0)}K` : `$${n}`;

  return (
    <section style={{ padding: isMobile ? '60px 20px' : '100px 64px', background: 'rgba(8,8,8,0.88)' }}>
      <div style={{ maxWidth: 940, margin: '0 auto' }}>
        <FadeUp>
          <div style={{ textAlign: 'center', marginBottom: 52 }}>
            <SectionLabel number="05">ROI Calculator</SectionLabel>
            <SectionH2 style={{ marginBottom: 14 }}>What is admin costing your revenue per employee, in dollars?</SectionH2>
            <p style={{ color: TEXT_SECONDARY, maxWidth: 520, margin: '0 auto', lineHeight: 1.75 }}>
              Every manual hour is an hour not earning. See exactly what your admin load costs you, in revenue per employee (RPE), hours, and dollars.
            </p>
          </div>
        </FadeUp>
        <FadeUp delay={80}>
          {/* Sliders */}
          <div style={{ background: SURFACE2, border: `1px solid ${BORDER}`, borderRadius: 24, padding: 36, marginBottom: 14 }}>
              <div style={{ display: 'grid', gridTemplateColumns: isMobile ? '1fr' : '1fr 1fr 1fr', gap: isMobile ? 28 : 32 }}>
                {/* Team Size */}
                <div>
                  <InfoToggle title="How team size works"
                    onHover={() => setHighlighted('time')}
                    onLeave={() => setHighlighted(null)}
                  >
                    <p style={{ margin: '0 0 8px' }}>Enter your total number of employees. This drives the total hours saved: <strong style={{ color: ACCENT }}>10 hrs/week × 52 weeks × team size</strong>.</p>
                    <p style={{ margin: 0, fontSize: '0.72rem', color: MUTED }}>With {team} people: {team * 10} hrs/week → {(team * 10 * 52).toLocaleString()} hrs/year.</p>
                  </InfoToggle>
                  <SliderRow label="Team Size" value={team} min={2} max={50} format={v => `${v} people`} parse={t => parseInt(t.replace(/[^0-9]/g, ''), 10)} onChange={setTeam} />
                </div>

                {/* Billable Rate */}
                <div>
                  <InfoToggle title="How billable rate works"
                    onHover={() => setHighlighted('value')}
                    onLeave={() => setHighlighted(null)}
                  >
                    Enter the average hourly rate your team bills at. This is used to calculate the <strong style={{ color: ACCENT }}>annual dollar value</strong> of reclaimed time.
                  </InfoToggle>
                  <SliderRow label="Billable Rate" value={rate} min={25} max={5000} step={25} format={v => `$${v}/hr`} parse={t => parseInt(t.replace(/[^0-9]/g, ''), 10)} onChange={setRate} />
                </div>

                {/* Revenue/Employee */}
                <div>
                  <InfoToggle title="How revenue per employee works"
                    onHover={() => setHighlighted('rpe')}
                    onLeave={() => setHighlighted(null)}
                  >
                    <p style={{ margin: '0 0 8px' }}>RPE = Total annual revenue ÷ Number of employees. It tells you what each employee produces on average.</p>
                    <p style={{ margin: 0, fontSize: '0.72rem', color: MUTED }}>Example: With {team} people generating <strong style={{ color: ACCENT }}>{fmt$(rpe * team)}</strong> total revenue, RPE = {fmt$(rpe * team)} ÷ {team} = <strong style={{ color: ACCENT }}>{fmt$(rpe)}</strong> per employee.</p>
                  </InfoToggle>
                  <SliderRow label="Revenue/Employee" value={rpe} min={50000} max={500000} step={10000} format={v => `$${v/1000}K`} parse={t => {
                    const n = parseFloat(t.replace(/[^0-9.]/g, ''));
                    return n * 1000;
                  }} onChange={setRpe} />
                </div>
              </div>
              <p style={{ marginTop: 24, fontFamily: 'JetBrains Mono,monospace', fontSize: '0.65rem', color: '#444', letterSpacing: '0.06em' }}>
                * Assumes 10 hrs/week saved per person. Results vary by team size and current workflow overhead.
              </p>
            </div>

          {/* Revenue per employee impact block */}
          <div style={{
            background: 'rgba(34,197,94,0.06)',
            border: `1px solid ${highlighted === 'rpe' ? 'rgba(34,197,94,0.7)' : 'rgba(34,197,94,0.25)'}`,
            boxShadow: highlighted === 'rpe' ? '0 0 28px rgba(34,197,94,0.15)' : 'none',
            borderRadius: 18, padding: '24px 28px', marginBottom: 14,
            transition: 'border-color 0.3s, box-shadow 0.3s',
          }}>
            <div style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.62rem', color: GREEN, letterSpacing: '0.1em', textTransform: 'uppercase', marginBottom: 16 }}>Revenue Per Employee Impact</div>
            <div style={{ display: 'grid', gridTemplateColumns: isMobile ? '1fr' : '1fr auto 1fr', gap: isMobile ? 12 : 24, alignItems: 'center' }}>
              <div>
                <div style={{ fontFamily: '"Playfair Display",serif', fontStyle: 'italic', fontSize: '1.9rem', fontWeight: 400, color: TEXT_SECONDARY, marginBottom: 4 }}>{fmt$(rpe)}</div>
                <div style={{ fontSize: '0.75rem', color: MUTED }}>Current per employee</div>
              </div>
              <div style={{ textAlign: 'center', color: GREEN, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
                <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><path d="M5 12h14M12 5l7 7-7 7"/></svg>
              </div>
              <div>
                <div style={{ fontFamily: '"Playfair Display",serif', fontStyle: 'italic', fontSize: '1.9rem', fontWeight: 400, color: GREEN, marginBottom: 4 }}>{fmt$(newRpe)}</div>
                <div style={{ fontSize: '0.75rem', color: TEXT_SECONDARY }}>With Augment OS (2×)</div>
              </div>
            </div>
            <div style={{ marginTop: 16, paddingTop: 16, borderTop: '1px solid rgba(34,197,94,0.15)', display: 'flex', alignItems: 'center', justifyContent: 'space-between', flexWrap: 'wrap', gap: 8 }}>
              <span style={{ fontSize: '0.82rem', color: TEXT_SECONDARY }}>Total revenue lift across team</span>
              <span style={{ fontFamily: '"Playfair Display",serif', fontStyle: 'italic', fontSize: '1.4rem', color: GREEN }}>{fmt$(totalLift)} / yr</span>
            </div>
          </div>

          {/* Time value stat boxes */}
          <div style={{ display: 'grid', gridTemplateColumns: isMobile ? '1fr' : 'repeat(3,1fr)', gap: 12 }}>
            <StatBox glow={highlighted === 'time'} label="Hours saved / week" value={`${animHrsWk} hrs`} />
            <StatBox glow={highlighted === 'time'} label="Hours saved / year" value={`${animHrsYr >= 1000 ? `${(animHrsYr/1000).toFixed(1)}K` : animHrsYr} hrs`} />
            <StatBox glow={highlighted === 'value'} label="Annual value of time" value={fmt$(animVal)} accent />
          </div>
        </FadeUp>
      </div>
    </section>
  );
}

// ── Comparison ────────────────────────────────────────────────────
const COMPARISON_DATA = [
  { category: 'Pricing', icon: <CreditCard size={24} strokeWidth={1.5} />, agency: { title: '$30K+ and climbing.', desc: 'Scope creep, change orders, surprise fees. The quote is never the bill.' }, consultants: { title: '$15K+ for a deck.', desc: 'You pay for analysis. You build it yourself.' }, augment: { title: 'Start small. Scale when ready.', desc: '$100 audit. $500 setup sprint. You see it work in your own environment before any bigger commitment.' } },
  { category: 'Ownership', icon: <Key size={24} strokeWidth={1.5} />, agency: { title: 'You rent. They own.', desc: 'Workflows live on their platform. Leave and you lose everything.' }, consultants: { title: 'You get a PDF.', desc: '50 slides of advice. No implementation. No system. Just advice' }, augment: { title: 'You own every line.', desc: 'Built in your Notion, your Claude, your stack. Export any day.' } },
  { category: 'Transparency', icon: <Eye size={24} strokeWidth={1.5} />, agency: { title: 'Black box.', desc: "You can't see the data. You can't see the decisions." }, consultants: { title: 'Advice, no execution.', desc: 'They diagnose. You implement. Alone.' }, augment: { title: 'Built in your enviroment.', desc: 'Every line visible. No shared logins. No data leaving your stack.' } },
  { category: 'Approach', icon: <Target size={24} strokeWidth={1.5} />, agency: { title: 'Replace your team.', desc: 'They sell headcount cuts. Study from; Orgvue says 55% of leaders regret it.' }, consultants: { title: 'Pretend AI isn\'t here.', desc: 'Built for the old game. Charged at new-game rates.' }, augment: { title: 'Augment your people.', desc: 'Your team gets installed capability, not replaced. Nobody fired for an algorithm.' } },
  { category: 'Relationship', icon: <Handshake size={24} strokeWidth={1.5} />, agency: { title: 'Vendor.', desc: 'Support tickets. Account managers. You\'re a row in their CRM.' }, consultants: { title: 'Advisor.', desc: 'Retainers forever. Their revenue depends on your dependence.' }, augment: { title: 'Partnership.', desc: 'Direct access during build. Knowledge transfer at handover. Your team runs it after.' } },
];

function ComparisonCard({ item }) {
  const ref = React.useRef(null);
  const spotlightRef = React.useRef(null);
  const [hovered, setHovered] = React.useState(false);

  const handleMouseMove = (e) => {
    const rect = ref.current?.getBoundingClientRect();
    if (!rect || !spotlightRef.current) return;
    const x = e.clientX - rect.left - 120;
    const y = e.clientY - rect.top - 120;
    spotlightRef.current.style.transform = `translate(${x}px, ${y}px)`;
  };

  return (
    <div
      ref={ref}
      onMouseEnter={() => setHovered(true)}
      onMouseLeave={() => setHovered(false)}
      onMouseMove={handleMouseMove}
      style={{
        flex: '0 0 min(300px, 85vw)', scrollSnapAlign: 'start',
        background: SURFACE,
        border: `1px solid ${hovered ? 'rgba(255,107,0,0.35)' : BORDER}`,
        borderRadius: 20, overflow: 'hidden',
        display: 'flex', flexDirection: 'column',
        transition: 'border-color 0.3s, transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94), box-shadow 0.35s',
        transform: hovered ? 'translateY(-5px) scale(1.02)' : 'translateY(0) scale(1)',
        boxShadow: hovered ? '0 16px 48px rgba(255,107,0,0.12)' : 'none',
        position: 'relative',
      }}
    >
      {/* Cursor-following spotlight */}
      <div
        ref={spotlightRef}
        style={{
          position: 'absolute', left: 0, top: 0, width: 240, height: 240,
          borderRadius: '50%',
          background: 'radial-gradient(circle, rgba(255,107,0,0.11) 0%, transparent 70%)',
          pointerEvents: 'none', zIndex: 0,
          opacity: hovered ? 1 : 0, transition: 'opacity 0.3s', willChange: 'transform',
        }}
      />

      <div style={{ position: 'relative', zIndex: 1, display: 'flex', flexDirection: 'column', height: '100%' }}>
        {/* Card Header */}
        <div style={{ padding: 24, borderBottom: `1px solid ${BORDER}`, background: 'rgba(255,255,255,0.02)' }}>
          <div style={{ fontSize: '1.5rem', marginBottom: 12, color: ACCENT }}>{item.icon}</div>
          <div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: '0.7rem', color: ACCENT, letterSpacing: '0.06em', textTransform: 'uppercase' }}>
            {item.category}
          </div>
        </div>

        {/* Card Content - Three Way Comparison */}
        <div style={{ padding: 20, display: 'flex', flexDirection: 'column', gap: 16, flex: 1 }}>
          {/* AI Agency */}
          <div style={{ padding: 14, background: 'rgba(255,255,255,0.02)', borderRadius: 10, border: `1px solid ${BORDER}` }}>
            <div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: '0.6rem', color: '#555', letterSpacing: '0.08em', marginBottom: 6 }}>AI AGENCY</div>
            <div style={{ fontSize: '1rem', fontWeight: 500, color: '#888', marginBottom: 6 }}>{item.agency.title}</div>
            <div style={{ fontSize: '0.75rem', color: '#666', lineHeight: 1.5 }}>{item.agency.desc}</div>
          </div>

          {/* Traditional Consultants */}
          <div style={{ padding: 14, background: 'rgba(255,255,255,0.02)', borderRadius: 10, border: `1px solid ${BORDER}` }}>
            <div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: '0.6rem', color: '#555', letterSpacing: '0.08em', marginBottom: 6 }}>CONSULTANTS</div>
            <div style={{ fontSize: '1rem', fontWeight: 500, color: '#888', marginBottom: 6 }}>{item.consultants.title}</div>
            <div style={{ fontSize: '0.75rem', color: '#666', lineHeight: 1.5 }}>{item.consultants.desc}</div>
          </div>

          {/* Augment OS (Winner) */}
          <div style={{ padding: 14, background: hovered ? 'rgba(255,107,0,0.12)' : 'rgba(255,107,0,0.08)', borderRadius: 10, border: `1px solid rgba(255,107,0,0.3)`, transition: 'background 0.3s' }}>
            <div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: '0.6rem', color: ACCENT, letterSpacing: '0.08em', marginBottom: 6, display: 'inline-flex', alignItems: 'center', gap: 4 }}>AUGMENT OS <Check size={10} strokeWidth={3} /></div>
            <div style={{ fontSize: '1rem', fontWeight: 600, color: TEXT_PRIMARY, marginBottom: 6 }}>{item.augment.title}</div>
            <div style={{ fontSize: '0.75rem', color: TEXT_SECONDARY, lineHeight: 1.5 }}>{item.augment.desc}</div>
          </div>
        </div>
      </div>
    </div>
  );
}

function ComparisonAccordion() {
  const scrollRef = React.useRef(null);
  const [atStart, setAtStart] = React.useState(true);
  const [atEnd, setAtEnd] = React.useState(false);

  const updateBounds = () => {
    const el = scrollRef.current;
    if (!el) return;
    setAtStart(el.scrollLeft <= 0);
    setAtEnd(el.scrollLeft + el.clientWidth >= el.scrollWidth - 1);
  };

  const scroll = (direction) => {
    if (scrollRef.current) {
      scrollRef.current.scrollBy({ left: direction === 'left' ? -320 : 320, behavior: 'smooth' });
      setTimeout(updateBounds, 350);
    }
  };

  const btnStyle = (disabled) => ({
    width: 44, height: 44, borderRadius: '50%',
    border: `1px solid ${disabled ? 'rgba(255,255,255,0.04)' : BORDER}`,
    background: SURFACE, color: disabled ? '#333' : TEXT_PRIMARY,
    cursor: disabled ? 'default' : 'pointer',
    display: 'flex', alignItems: 'center', justifyContent: 'center',
    transition: 'border-color 0.2s, color 0.2s',
    opacity: disabled ? 0.4 : 1,
  });

  return (
    <div>
      {/* Scroll Controls */}
      <div style={{ display: 'flex', justifyContent: 'flex-end', gap: 8, marginBottom: 20 }}>
        <button
          aria-label="Scroll left"
          onClick={() => !atStart && scroll('left')}
          style={btnStyle(atStart)}
          onMouseEnter={(e) => { if (!atStart) e.currentTarget.style.borderColor = ACCENT; }}
          onMouseLeave={(e) => { if (!atStart) e.currentTarget.style.borderColor = BORDER; }}
        >
          <ChevronLeft size={20} />
        </button>
        <button
          aria-label="Scroll right"
          onClick={() => !atEnd && scroll('right')}
          style={btnStyle(atEnd)}
          onMouseEnter={(e) => { if (!atEnd) e.currentTarget.style.borderColor = ACCENT; }}
          onMouseLeave={(e) => { if (!atEnd) e.currentTarget.style.borderColor = BORDER; }}
        >
          <ChevronRight size={20} />
        </button>
      </div>

      {/* Horizontal Scrolling Cards */}
      <div
        ref={scrollRef}
        onScroll={updateBounds}
        style={{
          display: 'flex', gap: 20, overflowX: 'auto',
          scrollSnapType: 'x mandatory', paddingBottom: 20,
          scrollbarWidth: 'none', msOverflowStyle: 'none',
        }}
      >
        <style>{`
          div::-webkit-scrollbar { display: none; }
        `}</style>

        {COMPARISON_DATA.map((item) => <ComparisonAccordionCard key={item.category} item={item} />)}
      </div>
    </div>
  );
}

function ComparisonAccordionCard({ item }) {
  const cardRef = React.useRef(null);
  const spotRef = React.useRef(null);
  const [hovered, setHovered] = React.useState(false);

  const flashTimeoutRef = React.useRef(null);

  const handleMouseMove = (e) => {
    if (window.matchMedia('(pointer: coarse)').matches) return;
    const rect = cardRef.current?.getBoundingClientRect();
    if (!rect || !spotRef.current) return;
    const x = e.clientX - rect.left - 120;
    const y = e.clientY - rect.top - 120;
    spotRef.current.style.transform = `translate(${x}px, ${y}px)`;
  };

  const handleTouchStart = (e) => {
    const touch = e.touches[0];
    const rect = cardRef.current?.getBoundingClientRect();
    if (rect && spotRef.current) {
      const x = touch.clientX - rect.left - 120;
      const y = touch.clientY - rect.top - 120;
      spotRef.current.style.transform = `translate(${x}px, ${y}px)`;
    }
    setHovered(true);
    if (flashTimeoutRef.current) clearTimeout(flashTimeoutRef.current);
  };

  const handleTouchEnd = () => {
    flashTimeoutRef.current = setTimeout(() => setHovered(false), 400);
  };

  return (
    <div
      ref={cardRef}
      onMouseEnter={() => setHovered(true)}
      onMouseLeave={() => setHovered(false)}
      onMouseMove={handleMouseMove}
      onTouchStart={handleTouchStart}
      onTouchEnd={handleTouchEnd}
      style={{
        flex: '0 0 min(300px, 85vw)', scrollSnapAlign: 'start',
        background: SURFACE,
        border: `1px solid ${hovered ? 'rgba(255,107,0,0.35)' : BORDER}`,
        borderRadius: 20, overflow: 'hidden',
        display: 'flex', flexDirection: 'column',
        transition: 'border-color 0.3s',
        position: 'relative',
      }}
    >
      <div
        ref={spotRef}
        style={{
          position: 'absolute', left: 0, top: 0, width: 240, height: 240,
          borderRadius: '50%',
          background: 'radial-gradient(circle, rgba(255,107,0,0.11) 0%, transparent 70%)',
          pointerEvents: 'none', zIndex: 0,
          opacity: hovered ? 1 : 0, transition: 'opacity 0.3s', willChange: 'transform',
        }}
      />

      <div style={{ position: 'relative', zIndex: 1, display: 'flex', flexDirection: 'column', height: '100%' }}>
            {/* Card Header */}
            <div style={{ padding: 24, borderBottom: `1px solid ${BORDER}`, background: 'rgba(255,255,255,0.02)' }}>
              <div style={{ fontSize: '1.5rem', marginBottom: 12, color: ACCENT }}>{item.icon}</div>
              <div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: '0.7rem', color: ACCENT, letterSpacing: '0.06em', textTransform: 'uppercase' }}>
                {item.category}
              </div>
            </div>

            <div style={{ padding: 20, display: 'flex', flexDirection: 'column', gap: 16, flex: 1 }}>
              {/* AI Agency */}
              <div style={{ padding: 14, background: 'rgba(255,255,255,0.02)', borderRadius: 10, border: `1px solid ${BORDER}` }}>
                <div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: '0.6rem', color: '#555', letterSpacing: '0.08em', marginBottom: 6 }}>AI AGENCY</div>
                <div style={{ fontSize: '1rem', fontWeight: 500, color: '#888', marginBottom: 6 }}>{item.agency.title}</div>
                <div style={{ fontSize: '0.75rem', color: '#666', lineHeight: 1.5 }}>{item.agency.desc}</div>
              </div>

              {/* Traditional Consultants */}
              <div style={{ padding: 14, background: 'rgba(255,255,255,0.02)', borderRadius: 10, border: `1px solid ${BORDER}` }}>
                <div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: '0.6rem', color: '#555', letterSpacing: '0.08em', marginBottom: 6 }}>CONSULTANTS</div>
                <div style={{ fontSize: '1rem', fontWeight: 500, color: '#888', marginBottom: 6 }}>{item.consultants.title}</div>
                <div style={{ fontSize: '0.75rem', color: '#666', lineHeight: 1.5 }}>{item.consultants.desc}</div>
              </div>

              {/* Augment OS (Winner) */}
              <div style={{ padding: 14, background: 'rgba(255,107,0,0.08)', borderRadius: 10, border: `1px solid rgba(255,107,0,0.3)` }}>
                <div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: '0.6rem', color: ACCENT, letterSpacing: '0.08em', marginBottom: 6, display: 'inline-flex', alignItems: 'center', gap: 4 }}>AUGMENT OS <Check size={10} strokeWidth={3} /></div>
                <div style={{ fontSize: '1rem', fontWeight: 600, color: TEXT_PRIMARY, marginBottom: 6 }}>{item.augment.title}</div>
                <div style={{ fontSize: '0.75rem', color: TEXT_SECONDARY, lineHeight: 1.5 }}>{item.augment.desc}</div>
              </div>
            </div>
          </div>
        </div>
      );
    }

    function ComparisonSection() {
  const { width } = useWindowSize();
  const isMobile = width <= 768;

  return (
    <section style={{ padding: isMobile ? '60px 20px' : '100px 64px', background: 'rgba(6,6,6,0.88)' }}>
      <div style={{ maxWidth: 940, margin: '0 auto' }}>
        <FadeUp>
          <div style={{ textAlign: 'center', marginBottom: 48 }}>
            <SectionLabel number="06">What Makes Us Different</SectionLabel>
            <SectionH2 style={{ marginBottom: 16 }}>Built, not sold. You own everything.</SectionH2>
          </div>
        </FadeUp>
        <FadeUp delay={80}>
          <ComparisonAccordion />
        </FadeUp>
      </div>
    </section>
  );
}

// ── Pricing ───────────────────────────────────────────────────────
function PricingSection({ bookingUrl }) {
  const { width } = useWindowSize();
  const isMobile = width <= 768;

  const tiers = [
    { stage: 'Stage 1', name: 'AI Ops Audit', price: '$100', sub: 'One-time diagnostic', desc: "A focused diagnostic of your stack. You walk away with an audit sheet, a process map, and a 90-day AI roadmap built from what we find. No pitch, a clear picture of where AI pays off first.", highlight: false },
    { stage: 'Stage 2', name: 'Setup Sprint', price: '$500', sub: 'Outcome-based, no time cap', desc: "I set up your AI environment live in the session and hand you a Notion OS template with everything wired and ready to run. By the end you can start using AI in your business yourself, or we talk about going further.", highlight: true },
    { stage: 'Stage 3', name: 'Full Build', price: 'Contact Sales', sub: 'Scoped to your business', desc: "When you're ready to go beyond the basics: a fully connected environment, backend automation across your operation, and client communication systems, scoped to your business and built with you.", highlight: false },
  ];

  return (
    <section id="pricing" style={{ padding: isMobile ? '60px 20px' : '130px 64px', background: 'rgba(8,8,8,0.88)' }}>
      <div style={{ maxWidth: 1100, margin: '0 auto' }}>
        <FadeUp>
          <div style={{ textAlign: 'center', marginBottom: 56 }}>
            <SectionLabel number="07">Investment</SectionLabel>
            <SectionH2 style={{ marginBottom: 16 }}>See the value before you spend a dollar.</SectionH2>
            <p style={{ color: TEXT_SECONDARY, maxWidth: 520, margin: '0 auto', lineHeight: 1.75 }}>Same headcount. Higher revenue per employee. The system pays for itself in the first month.</p>
          </div>
        </FadeUp>
        <div style={{ display: 'grid', gridTemplateColumns: isMobile ? '1fr' : 'repeat(3,1fr)', gap: 20, marginBottom: 36 }}>
          {tiers.map((tier, i) => (
            <FadeUp key={tier.name} delay={i * 80}>
              <div style={{
                background: tier.highlight ? SURFACE2 : SURFACE_LIGHT,
                border: `1px solid ${tier.highlight ? 'rgba(255,107,0,0.4)' : BORDER}`,
                borderRadius: 20, padding: '36px 30px', position: 'relative',
                display: 'flex', flexDirection: 'column',
                boxShadow: tier.highlight ? '0 0 60px rgba(255,107,0,0.08)' : 'none',
                transition: 'transform 0.3s cubic-bezier(0.25,0.46,0.45,0.94), box-shadow 0.3s',
                height: '100%',
              }}
                onMouseEnter={e => { e.currentTarget.style.transform = 'translateY(-4px)'; e.currentTarget.style.boxShadow = tier.highlight ? '0 12px 60px rgba(255,107,0,0.15)' : '0 12px 40px rgba(0,0,0,0.3)'; }}
                onMouseLeave={e => { e.currentTarget.style.transform = 'translateY(0)'; e.currentTarget.style.boxShadow = tier.highlight ? '0 0 60px rgba(255,107,0,0.08)' : 'none'; }}
              >
                {tier.highlight && (
                  <div style={{ position: 'absolute', top: -14, left: '50%', transform: 'translateX(-50%)', background: ACCENT, color: SURFACE2, fontFamily: 'JetBrains Mono,monospace', fontSize: '0.65rem', letterSpacing: '0.1em', padding: '5px 16px', borderRadius: 100, fontWeight: 700, whiteSpace: 'nowrap' }}>START HERE</div>
                )}
                <div style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.65rem', color: MUTED, letterSpacing: '0.08em', marginBottom: 10 }}>{tier.stage}</div>
                <div style={{ fontFamily: '"Bebas Neue",sans-serif', fontSize: '1.6rem', letterSpacing: '0.02em', textTransform: 'uppercase', color: TEXT_PRIMARY, marginBottom: 4 }}>{tier.name}</div>
                <div style={{ fontFamily: '"Playfair Display",serif', fontSize: '2.2rem', fontWeight: 400, fontStyle: 'italic', color: tier.highlight ? ACCENT : TEXT_PRIMARY, marginBottom: 6 }}>{tier.price}</div>
                <div style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.65rem', color: MUTED, letterSpacing: '0.06em', marginBottom: 20 }}>{tier.sub}</div>
                <p style={{ color: TEXT_SECONDARY, fontSize: '0.88rem', lineHeight: 1.65, flex: 1 }}>{tier.desc}</p>
                <div style={{ marginTop: 28 }}>
                  {tier.highlight
                    ? <Btn href={bookingUrl} style={{ width: '100%', justifyContent: 'center' }}>Book a Free Call →</Btn>
                    : <BtnOutline href={bookingUrl} style={{ width: '100%', justifyContent: 'center' }}>{tier.price === 'Contact Sales' ? 'Contact Sales →' : 'Book a Free Call →'}</BtnOutline>}
                </div>
              </div>
            </FadeUp>
          ))}
        </div>
        <FadeUp delay={120}>
          <div style={{ background: SURFACE2, border: `1px solid rgba(255,107,0,0.2)`, borderRadius: 20, padding: '28px 32px', textAlign: 'center', marginBottom: 20 }}>
            <div style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.68rem', color: ACCENT, letterSpacing: '0.1em', marginBottom: 10 }}>HOW IT WORKS</div>
            <p style={{ color: TEXT_SECONDARY, fontSize: '0.9rem', lineHeight: 1.7, maxWidth: 560, margin: '0 auto' }}>
              Start with a $100 audit. See exactly where AI pays off first. Then a $500 setup sprint gets you running. No guesswork. No long-term commitment until you're ready.
            </p>
          </div>
        </FadeUp>
        <FadeUp delay={160}>
          <div style={{ textAlign: 'center' }}>
            <p style={{ color: MUTED, fontSize: '0.82rem', lineHeight: 1.6, maxWidth: 480, margin: '0 auto' }}>
              <span style={{ color: ACCENT }}>✦</span> You own every line. No lock-in. Cancel anytime. <span style={{ color: ACCENT }}>✦</span>
            </p>
          </div>
        </FadeUp>
      </div>
    </section>
  );
}

// ── FAQ - smooth expand/collapse ──────────────────────────────────
const FAQS = [
  { q: '"I don\'t trust artificial intelligence (AI)."', a: "Fair. You shouldn't trust artificial intelligence (AI) blindly. That's why everything is built in your accounts, visible to you, and reviewed before it goes out. AI drafts. You decide." },
  { q: '"What does the research actually say?"', a: "International Data Corporation (IDC): 40% of knowledge work is mechanical. Stanford-Carnegie: hybrid human–artificial intelligence teams outperform pure-human by 24.3%. National Bureau of Economic Research (NBER): artificial intelligence (AI) automates 1.40-34% of tasks per occupation. Boston Consulting Group (BCG): 74% of generative artificial intelligence (AI) pilots fail to scale, the #1 barrier is insufficient worker skills. McKinsey 2025: Only 1% of leaders say artificial intelligence (AI) is fully mature across workflows. The research is clear, AI works, but only when it's integrated, trained, and owned by the team using it." },
  { q: '"Is admin actually eating that many billable hours?"', a: "Add it up: follow-ups, status updates, onboarding docs, weekly reports. Most teams lose 10-15 hrs per person per week. That's your revenue per employee (RPE) leak, and it doesn't show up anywhere on your P&L." },
  { q: '"We\'ve tried automation tools before."', a: "Tools don't raise revenue per employee. Systems do. The difference is connection, your tools talking to each other, your voice reflected in every output, and a central hub that actually gets used." },
  { q: '"Why are the entry sessions so low-cost?"', a: "Most businesses I speak with are leaking revenue to workflow bottlenecks, or they're stuck because they lack AI, technology, or any real innovation. The $100 audit and $500 sprint are designed to be low-risk ways to see exactly where AI pays off in your own environment. If the fit isn't there after the diagnostic, we part ways, no pressure, no awkward conversation." },
  { q: '"What if we already use Notion / have a system?"', a: "Even better. We build on what you have. Most teams have the tools, they just aren't connected. The audit maps exactly where the hours are leaking." },
];

function FAQItem({ faq, isOpen, onToggle }) {
  const contentRef = React.useRef(null);
  const itemRef = React.useRef(null);
  const spotlightRef = React.useRef(null);
  const [height, setHeight] = React.useState(0);
  const [hovered, setHovered] = React.useState(false);

  React.useEffect(() => {
    if (contentRef.current) {
      setHeight(isOpen ? contentRef.current.scrollHeight : 0);
    }
  }, [isOpen]);

  const flashTimeoutRef = React.useRef(null);

  const handleMouseMove = (e) => {
    if (window.matchMedia('(pointer: coarse)').matches) return;
    const rect = itemRef.current?.getBoundingClientRect();
    if (!rect || !spotlightRef.current) return;
    const x = e.clientX - rect.left - 120;
    const y = e.clientY - rect.top - 120;
    spotlightRef.current.style.transform = `translate(${x}px, ${y}px)`;
  };

  const handleTouchStart = (e) => {
    const touch = e.touches[0];
    const rect = itemRef.current?.getBoundingClientRect();
    if (rect && spotlightRef.current) {
      const x = touch.clientX - rect.left - 120;
      const y = touch.clientY - rect.top - 120;
      spotlightRef.current.style.transform = `translate(${x}px, ${y}px)`;
    }
    setHovered(true);
    if (flashTimeoutRef.current) clearTimeout(flashTimeoutRef.current);
  };

  const handleTouchEnd = () => {
    flashTimeoutRef.current = setTimeout(() => setHovered(false), 400);
  };

  return (
    <div
      ref={itemRef}
      onMouseEnter={() => setHovered(true)}
      onMouseLeave={() => setHovered(false)}
      onMouseMove={handleMouseMove}
      onTouchStart={handleTouchStart}
      onTouchEnd={handleTouchEnd}
      style={{
        background: SURFACE,
        border: `1px solid ${isOpen ? 'rgba(255,107,0,0.3)' : hovered ? 'rgba(255,107,0,0.25)' : BORDER}`,
        borderLeft: `3px solid ${isOpen ? ACCENT : hovered ? ACCENT : 'transparent'}`,
        borderRadius: 16,
        overflow: 'hidden',
        transition: 'border-color 0.3s, transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94), box-shadow 0.35s',
        transform: hovered ? 'translateY(-5px) scale(1.015)' : 'translateY(0) scale(1)',
        boxShadow: hovered ? '0 16px 48px rgba(255,107,0,0.1)' : 'none',
        position: 'relative',
      }}
    >
      {/* Cursor-following spotlight */}
      <div
        ref={spotlightRef}
        style={{
          position: 'absolute',
          left: 0,
          top: 0,
          width: 240,
          height: 240,
          borderRadius: '50%',
          background: 'radial-gradient(circle, rgba(255,107,0,0.11) 0%, transparent 70%)',
          pointerEvents: 'none',
          zIndex: 0,
          opacity: hovered ? 1 : 0,
          transition: 'opacity 0.3s',
          willChange: 'transform',
        }}
      />
      <button onClick={onToggle} style={{
        width: '100%', padding: '22px 26px', background: 'transparent', border: 'none',
        display: 'flex', justifyContent: 'space-between', alignItems: 'center',
        cursor: 'pointer', gap: 16, textAlign: 'left',
        position: 'relative', zIndex: 1,
      }}>
        <span style={{ fontSize: '1rem', fontWeight: 600, color: isOpen ? TEXT_PRIMARY : hovered ? TEXT_PRIMARY : TEXT_SECONDARY, fontStyle: 'italic', transition: 'color 0.3s' }}>{faq.q}</span>
        <span style={{ color: ACCENT, fontSize: '1.3rem', transform: isOpen ? 'rotate(45deg)' : 'rotate(0)', transition: 'transform 0.35s cubic-bezier(0.34,1.56,0.64,1)', flexShrink: 0 }}>+</span>
      </button>
      <div style={{ height, overflow: 'hidden', transition: 'height 0.4s cubic-bezier(0.25,0.46,0.45,0.94)' }}>
        <div ref={contentRef} style={{ padding: '0 26px 22px', color: TEXT_SECONDARY, fontSize: '0.92rem', lineHeight: 1.75, position: 'relative', zIndex: 1 }}>
          {faq.a}
        </div>
      </div>
    </div>
  );
}

function FAQSection() {
  const [open, setOpen] = React.useState(null);
  const { width } = useWindowSize();
  const isMobile = width <= 768;

  return (
    <section style={{ padding: isMobile ? '60px 20px' : '100px 64px', background: 'rgba(8,8,8,0.88)' }}>
      <div style={{ maxWidth: 800, margin: '0 auto' }}>
        <FadeUp>
          <div style={{ textAlign: 'center', marginBottom: 52 }}>
            <SectionLabel number="-">FAQ</SectionLabel>
            <SectionH2 style={{ marginBottom: 16 }}>The questions worth answering honestly.</SectionH2>
          </div>
        </FadeUp>
        <div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
          {FAQS.map((faq, idx) => (
            <FadeUp key={idx} delay={idx * 50}>
              <FAQItem faq={faq} isOpen={open === idx} onToggle={() => setOpen(open === idx ? null : idx)} />
            </FadeUp>
          ))}
        </div>
      </div>
    </section>
  );
}

// ── The Two-Track Economy ──────────────────────────────────────────
function TwoTrackEconomy() {
  const { width } = useWindowSize();
  const isMobile = width <= 768;

  return (
    <section style={{ padding: isMobile ? '60px 20px' : '100px 64px', background: 'rgba(6,6,6,0.88)' }}>
      <div style={{ maxWidth: 900, margin: '0 auto' }}>
        <FadeUp>
          <div style={{ textAlign: 'center', marginBottom: 48 }}>
            <SectionLabel number="-">The Bigger Picture</SectionLabel>
            <SectionH2 style={{ marginBottom: 16 }}>The Two-Track Economy Is Already Here</SectionH2>
            <p style={{ color: TEXT_SECONDARY, maxWidth: 600, margin: '0 auto', lineHeight: 1.75, fontSize: '1.05rem' }}>
              Two speeds are emerging in professional services. The gap widens every quarter. It isn't about who has the better team, it's about who installed the better tools.
            </p>
          </div>
        </FadeUp>

        <div style={{ display: 'grid', gridTemplateColumns: isMobile ? '1fr' : '1fr 1fr', gap: 24, marginBottom: 40 }}>
          <FadeUp delay={60}>
            <div style={{
              background: SURFACE, border: `1px solid ${BORDER}`, borderRadius: 20, padding: isMobile ? 28 : 36,
              height: '100%',
              transition: 'border-color 0.3s, transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94), box-shadow 0.35s',
            }}
              onMouseEnter={e => { e.currentTarget.style.borderColor = 'rgba(255,107,0,0.25)'; e.currentTarget.style.transform = 'translateY(-5px) scale(1.015)'; e.currentTarget.style.boxShadow = '0 16px 48px rgba(255,107,0,0.1)'; }}
              onMouseLeave={e => { e.currentTarget.style.borderColor = BORDER; e.currentTarget.style.transform = 'translateY(0) scale(1)'; e.currentTarget.style.boxShadow = 'none'; }}
            >
              <div style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.62rem', color: '#666', letterSpacing: '0.1em', textTransform: 'uppercase', marginBottom: 16 }}>Track A</div>
              <h3 style={{ fontFamily: '"Bebas Neue",sans-serif', fontSize: '1.6rem', letterSpacing: '0.02em', textTransform: 'uppercase', color: '#666', marginBottom: 16 }}>Manual-First Businesses</h3>
              <ul style={{ color: TEXT_SECONDARY, fontSize: '0.9rem', lineHeight: 2, paddingLeft: 20, margin: 0 }}>
                <li>Admin owns 40% of the calendar</li>
                <li>Revenue leaks into follow-ups, formatting, data entry</li>
                <li>Revenue per employee (RPE) flatlines. Growth requires headcount.</li>
                <li>Team burns out on work systems should be doing</li>
                <li>Competing on effort. Losing on margin.</li>
              </ul>
            </div>
          </FadeUp>

          <FadeUp delay={120}>
            <div style={{
              background: SURFACE, border: `1px solid rgba(255,107,0,0.25)`, borderRadius: 20, padding: isMobile ? 28 : 36,
              height: '100%',
              boxShadow: '0 0 40px rgba(255,107,0,0.06)',
              transition: 'border-color 0.3s, transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94), box-shadow 0.35s',
            }}
              onMouseEnter={e => { e.currentTarget.style.borderColor = 'rgba(255,107,0,0.5)'; e.currentTarget.style.transform = 'translateY(-5px) scale(1.015)'; e.currentTarget.style.boxShadow = '0 16px 48px rgba(255,107,0,0.15)'; }}
              onMouseLeave={e => { e.currentTarget.style.borderColor = 'rgba(255,107,0,0.25)'; e.currentTarget.style.transform = 'translateY(0) scale(1)'; e.currentTarget.style.boxShadow = '0 0 40px rgba(255,107,0,0.06)'; }}
            >
              <div style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.62rem', color: ACCENT, letterSpacing: '0.1em', textTransform: 'uppercase', marginBottom: 16 }}>Track B</div>
              <h3 style={{ fontFamily: '"Bebas Neue",sans-serif', fontSize: '1.6rem', letterSpacing: '0.02em', textTransform: 'uppercase', color: ACCENT, marginBottom: 16 }}>AI-Augmented Businesses</h3>
              <ul style={{ color: TEXT_SECONDARY, fontSize: '0.9rem', lineHeight: 2, paddingLeft: 20, margin: 0 }}>
                <li>Systems own 40% of the calendar</li>
                <li>Revenue time reclaimed - 10+ hrs/person/week</li>
                <li>Revenue per employee (RPE) climbs. Headcount holds flat.</li>
                <li>Team does the work they were hired for</li>
                <li>Competing on capability. Winning on margin.</li>
              </ul>
            </div>
          </FadeUp>
        </div>

        <FadeUp delay={160}>
          <div style={{ textAlign: 'center', background: SURFACE2, border: `1px solid ${BORDER}`, borderRadius: 20, padding: isMobile ? 28 : 40 }}>
            <p style={{ color: TEXT_PRIMARY, fontSize: '1.1rem', fontWeight: 600, lineHeight: 1.75, maxWidth: 640, margin: '0 auto' }}>
              The research isn't ambiguous. The only question is which track your business is on, and whether you're making that choice intentionally or letting it be made for you.
            </p>
          </div>
        </FadeUp>
      </div>
    </section>
  );
}

// ── Final CTA ─────────────────────────────────────────────────────
function CtaSection({ bookingUrl }) {
  const { width } = useWindowSize();
  const isMobile = width <= 768;
  return (
    <section id="cta" style={{ padding: isMobile ? '80px 20px' : '130px 64px', background: 'rgba(6,6,6,0.88)', textAlign: 'center' }}>
      <div style={{ maxWidth: 700, margin: '0 auto' }}>
        <FadeUp>
          <div style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.7rem', color: ACCENT, letterSpacing: '0.12em', textTransform: 'uppercase', marginBottom: 24 }}>Ready?</div>
          <SectionH2 style={{ marginBottom: 16 }}>Let's find your revenue per employee gap.</SectionH2>
          <p style={{ color: TEXT_SECONDARY, fontSize: '1.1rem', lineHeight: 1.75, marginBottom: 36 }}>
            45 minutes. We map where your revenue time is going. We tell you what it takes to reclaim it. No pitch. No deck. Just the picture.
          </p>
          <div style={{ display: 'inline-flex', flexDirection: 'column', alignItems: 'center', gap: 12 }}>
            <Btn href={bookingUrl} style={{ fontSize: '1rem', padding: '16px 36px' }}>Book a Free Call →</Btn>
            <span style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.65rem', color: MUTED, letterSpacing: '0.08em' }}>45 MINUTES. ZERO COST. REVENUE PER EMPLOYEE GAP FOUND OR THE CALL'S ON ME.</span>
          </div>
        </FadeUp>
      </div>
    </section>
  );
}

// ── Footer ────────────────────────────────────────────────────────
function Footer({ onAbout, onHome, currentView }) {
  const { width } = useWindowSize();
  const isMobile = width <= 768;

  const handleFooterClick = (e, href) => {
    if (currentView === 'about') {
      e.preventDefault();
      onHome();
      requestAnimationFrame(() => {
        setTimeout(() => {
          const id = href.replace('#', '');
          const el = document.getElementById(id);
          if (el) el.scrollIntoView({ behavior: 'smooth' });
        }, 80);
      });
    }
  };

  return (
    <footer style={{ background: SURFACE2, borderTop: `1px solid ${BORDER}`, padding: isMobile ? '40px 20px' : '48px 64px' }}>
      <div style={{ maxWidth: 1200, margin: '0 auto', display: 'flex', justifyContent: isMobile ? 'flex-start' : 'space-between', alignItems: isMobile ? 'stretch' : 'center', flexDirection: isMobile ? 'column' : 'row', gap: 24 }}>
        <div style={{ alignSelf: isMobile ? 'flex-start' : undefined }}>
          <div style={{ fontWeight: 900, fontSize: '1rem', letterSpacing: '-0.03em', marginBottom: 6 }}>
            <span style={{ color: ACCENT }}>●</span> Augment OS
          </div>
          <div style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.65rem', color: MUTED, letterSpacing: '0.06em' }}>More revenue. Same headcount.</div>
        </div>

        <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 10, alignSelf: isMobile ? 'center' : undefined }}>
          <div style={{ display: 'flex', gap: 16, alignItems: 'center' }}>
            <button
              onClick={onAbout}
              style={{
                background: 'transparent', border: 'none', color: TEXT_SECONDARY,
                fontSize: '0.8rem', cursor: 'pointer', fontFamily: 'Inter, sans-serif',
                textDecoration: 'none', transition: 'color 0.2s', padding: 0,
              }}
              onMouseEnter={e => e.currentTarget.style.color = ACCENT}
              onMouseLeave={e => e.currentTarget.style.color = TEXT_SECONDARY}
            >
              About
            </button>
            <span style={{ color: 'rgba(255,255,255,0.1)' }}>|</span>
            <a href="#problem" onClick={(e) => handleFooterClick(e, '#problem')} style={{ color: TEXT_SECONDARY, fontSize: '0.8rem', textDecoration: 'none', transition: 'color 0.2s' }}
              onMouseEnter={e => e.target.style.color = ACCENT}
              onMouseLeave={e => e.target.style.color = TEXT_SECONDARY}
            >Problem</a>
            <span style={{ color: 'rgba(255,255,255,0.1)' }}>|</span>
            <a href="#solution" onClick={(e) => handleFooterClick(e, '#solution')} style={{ color: TEXT_SECONDARY, fontSize: '0.8rem', textDecoration: 'none', transition: 'color 0.2s' }}
              onMouseEnter={e => e.target.style.color = ACCENT}
              onMouseLeave={e => e.target.style.color = TEXT_SECONDARY}
            >Solution</a>
            <span style={{ color: 'rgba(255,255,255,0.1)' }}>|</span>
            <a href="#pricing" onClick={(e) => handleFooterClick(e, '#pricing')} style={{ color: TEXT_SECONDARY, fontSize: '0.8rem', textDecoration: 'none', transition: 'color 0.2s' }}
              onMouseEnter={e => e.target.style.color = ACCENT}
              onMouseLeave={e => e.target.style.color = TEXT_SECONDARY}
            >Pricing</a>
          </div>
          <div style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.62rem', color: MUTED, letterSpacing: '0.1em', textTransform: 'uppercase', marginTop: 4 }}>Follow</div>
          <div style={{ display: 'flex', gap: 14 }}>
            <a href="https://www.youtube.com/channel/UCWnkXvaHFNL7H-YQR-vQ2Bg" target="_blank" rel="noopener noreferrer" aria-label="YouTube"
              style={{ color: '#666', transition: 'color 0.2s' }}
              onMouseEnter={e => e.currentTarget.style.color = '#FF6B00'}
              onMouseLeave={e => e.currentTarget.style.color = '#666'}
            >
              <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M23.498 6.186a2.996 2.996 0 0 0-2.107-2.118C19.51 3.5 12 3.5 12 3.5s-7.51 0-9.391.568a2.996 2.996 0 0 0-2.107 2.118C0 8.066 0 12 0 12s0 3.934.502 5.814a2.996 2.996 0 0 0 2.107 2.118C4.49 20.5 12 20.5 12 20.5s7.51 0 9.391-.568a2.996 2.996 0 0 0 2.107-2.118C24 15.934 24 12 24 12s0-3.934-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/></svg>
            </a>
            <a href="https://www.instagram.com/brody.zwierz/" target="_blank" rel="noopener noreferrer" aria-label="Instagram"
              style={{ color: '#666', transition: 'color 0.2s' }}
              onMouseEnter={e => e.currentTarget.style.color = '#FF6B00'}
              onMouseLeave={e => e.currentTarget.style.color = '#666'}
            >
              <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><rect x="2" y="2" width="20" height="20" rx="5" ry="5"/><path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"/><line x1="17.5" y1="6.5" x2="17.51" y2="6.5"/></svg>
            </a>
            <a href="https://www.linkedin.com/in/brody-zwiers-5206b1365/" target="_blank" rel="noopener noreferrer" aria-label="LinkedIn"
              style={{ color: '#666', transition: 'color 0.2s' }}
              onMouseEnter={e => e.currentTarget.style.color = '#FF6B00'}
              onMouseLeave={e => e.currentTarget.style.color = '#666'}
            >
              <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 0 1-2.063-2.065 2.064 2.064 0 1 1 2.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg>
            </a>
          </div>
        </div>

        <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-end', gap: 6, alignSelf: isMobile ? 'flex-end' : undefined }}>
          <a href="mailto:bzwiersai@gmail.com" style={{ color: TEXT_SECONDARY, fontSize: '1rem', textDecoration: 'none', transition: 'color 0.2s' }}
            onMouseEnter={e => e.target.style.color = ACCENT}
            onMouseLeave={e => e.target.style.color = TEXT_SECONDARY}
          >bzwiersai@gmail.com</a>
          <div style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.6rem', color: MUTED, letterSpacing: '0.06em' }}>ABN 77 318 303 608</div>
        </div>
      </div>
    </footer>
  );
}

// ── System Operational Status Bar ─────────────────────────────────
function SystemStatus() {
  const [visible, setVisible] = React.useState(false);
  const { width } = useWindowSize();
  const isMobile = width <= 768;
  React.useEffect(() => {
    const t = setTimeout(() => setVisible(true), 1200);
    return () => clearTimeout(t);
  }, []);
  return (
    <div style={{
      position: 'fixed', bottom: isMobile ? 16 : 24, left: isMobile ? 16 : 24, zIndex: 9000,
      display: 'flex', alignItems: 'center', gap: 10,
      background: 'rgba(13,13,13,0.92)', backdropFilter: 'blur(16px)',
      border: `1px solid rgba(34,197,94,0.25)`, borderRadius: 100,
      padding: '8px 16px 8px 12px',
      opacity: visible ? 1 : 0,
      transform: visible ? 'translateY(0)' : 'translateY(12px)',
      transition: 'opacity 0.6s cubic-bezier(0.25,0.46,0.45,0.94), transform 0.6s cubic-bezier(0.25,0.46,0.45,0.94)',
    }}>
      <div style={{ width: 7, height: 7, borderRadius: '50%', background: '#22c55e', animation: 'pulse-dot 2s ease-in-out infinite' }} />
      <span style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.62rem', color: '#22c55e', letterSpacing: '0.12em', fontWeight: 500 }}>SYSTEM OPERATIONAL</span>
    </div>
  );
}

// ── Apply Modal ───────────────────────────────────────────────────
function ApplyModal({ open, onClose }) {
  if (!open) return null;
  const { width } = useWindowSize();
  const isMobile = width <= 768;
  return (
    <div style={{ position: 'fixed', inset: 0, zIndex: 10000, display: 'flex', alignItems: 'center', justifyContent: 'center', padding: isMobile ? 16 : 20 }}>
      <div style={{ position: 'absolute', inset: 0, background: 'rgba(0,0,0,0.8)', backdropFilter: 'blur(8px)', animation: 'fadeIn 0.25s' }} onClick={onClose} />
      <div style={{ position: 'relative', background: SURFACE_LIGHT, border: `1px solid ${BORDER}`, borderRadius: 24, padding: isMobile ? '32px 20px' : 48, maxWidth: 520, width: '100%', zIndex: 1, animation: 'modalSlideUp 0.35s cubic-bezier(0.34,1.56,0.64,1)' }}>
        <button onClick={onClose} style={{ position: 'absolute', top: 20, right: 20, background: 'transparent', border: 'none', color: MUTED, cursor: 'pointer', fontSize: '1.3rem', lineHeight: 1, transition: 'color 0.2s' }}
          onMouseEnter={e => e.target.style.color = TEXT_PRIMARY}
          onMouseLeave={e => e.target.style.color = MUTED}
        >✕</button>
        <div style={{ fontFamily: 'JetBrains Mono,monospace', fontSize: '0.68rem', color: ACCENT, letterSpacing: '0.1em', marginBottom: 16 }}>BOOK YOUR FREE CALL</div>
        <h3 style={{ fontFamily: '"Bebas Neue",sans-serif', fontSize: '2rem', fontWeight: 400, textTransform: 'uppercase', color: TEXT_PRIMARY, marginBottom: 12 }}>Find Your Revenue Per Employee Gap</h3>
        <p style={{ color: TEXT_SECONDARY, fontSize: '0.9rem', lineHeight: 1.7, marginBottom: 28 }}>45 minutes. We'll map exactly where your team's revenue time is going and what it would take to reclaim it.</p>
        <Btn href="https://bzwiers.notion.site/271a4250e076448fb277f7e47551aa53?pvs=105" style={{ width: '100%', justifyContent: 'center', fontSize: '0.95rem' }}>
          Open Booking Page →
        </Btn>
        <p style={{ textAlign: 'center', fontFamily: 'JetBrains Mono,monospace', fontSize: '0.62rem', color: MUTED, letterSpacing: '0.06em', marginTop: 16 }}>ZERO COST. NO OBLIGATION.</p>
      </div>
    </div>
  );
}

Object.assign(window, { ProofSection, ResearchCard, VideoScroller, VideoGallery, EditableValue, SliderRow, InfoToggle, FeaturesSection, ROICalculator, ComparisonSection, ComparisonAccordion, ComparisonAccordionCard, PricingSection, FAQSection, TwoTrackEconomy, CtaSection, Footer, SystemStatus, ApplyModal });
