// Direction 3 — "Before / After"
// Split-screen treatment. The left half is visually "before" (chaotic,
// muted, crossed out); the right is "after" (calm, ordered, accented).
// Uses the navy as background with a warm bone accent band.

function DirBeforeAfter({ hero }) {
  const HeroEl = hero || <BAHero />;
  return (
    <div style={{ background: '#fff', color: AX.ink, fontFamily: 'Inter, sans-serif', minHeight: '100%' }}>
      <BANav />
      {HeroEl}
      <BAProblem />
      <BASolution />
      <BABenefits />
      <BAProof />
      <BAProcess />
      <BAROI />
      <BAWhy />
      <BACTA />
      <SiteFooter theme="light" />
    </div>
  );
}

function BANav() {
  return (
    <nav style={{
      position: 'sticky', top: 0, zIndex: 20,
      padding: '18px 64px', display: 'flex', justifyContent: 'space-between', alignItems: 'center',
      background: 'rgba(255,255,255,0.85)', backdropFilter: 'blur(20px)',
      borderBottom: `1px solid ${AX.line}`,
    }}>
      <AxiomLogo color={AX.navy} accent={AX.teal} />
      <div style={{ display: 'flex', gap: 36, fontSize: 14, color: AX.slate }}>
        <a href="#how" style={linkSty3}>How it works</a>
        <a href="#results" style={linkSty3}>Results</a>
        <a href="#calc" style={linkSty3}>ROI</a>
        <a href="#about" style={linkSty3}>About</a>
      </div>
      <a href="#book" style={{
        padding: '10px 20px', background: AX.teal, color: '#fff',
        borderRadius: 999, fontSize: 13, fontWeight: 600, textDecoration: 'none',
        display: 'flex', alignItems: 'center', gap: 8,
      }}>
        Book a review {Icon.arrow('#fff')}
      </a>
    </nav>
  );
}
const linkSty3 = { cursor: 'pointer', textDecoration: 'none', color: 'inherit', fontWeight: 500 };

// ── Hero — split screen ──────────────────────────────────────
function BAHero() {
  const BEFORE_IMG = 'https://images.unsplash.com/photo-1450101499163-c8848c66ca85?w=1600&q=80&auto=format&fit=crop';
  const AFTER_IMG  = 'https://images.unsplash.com/photo-1531482615713-2afd69097998?w=1600&q=80&auto=format&fit=crop';
  return (
    <section style={{ position: 'relative' }}>
      <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', minHeight: 620 }}>
        {/* BEFORE */}
        <div style={{ background: AX.bone, padding: '80px 56px', position: 'relative', overflow: 'hidden' }}>
          {/* duotone photo layer */}
          <div aria-hidden="true" style={{
            position: 'absolute', inset: 0,
            backgroundImage: `url(${BEFORE_IMG})`,
            backgroundSize: 'cover', backgroundPosition: 'center',
            filter: 'grayscale(1) contrast(1.05)',
            opacity: 0.22,
            mixBlendMode: 'multiply',
          }} />
          <div aria-hidden="true" style={{
            position: 'absolute', inset: 0,
            background: `linear-gradient(135deg, ${AX.bone}ee 0%, ${AX.bone}aa 40%, ${AX.coral}22 100%)`,
            mixBlendMode: 'normal',
          }} />
          <div style={{ fontSize: 11, letterSpacing: 2.5, textTransform: 'uppercase', color: AX.mute, fontFamily: 'JetBrains Mono, monospace', fontWeight: 700, marginBottom: 20, position: 'relative' }}>
            Before · Manual
          </div>
          <div style={{ fontFamily: 'Space Grotesk, sans-serif', fontSize: 54, fontWeight: 600, color: AX.ink, letterSpacing: -1.8, lineHeight: 1.02, textWrap: 'balance', position: 'relative' }}>
            Your team spends<br/>hours on tasks<br/>
            <span style={{ textDecoration: 'line-through', textDecorationColor: AX.coral, textDecorationThickness: 3, color: AX.mute }}>software can do</span>
          </div>
          {/* chaotic scribbles */}
          <div style={{ marginTop: 40, display: 'flex', flexDirection: 'column', gap: 10, position: 'relative' }}>
            {[
              { t: 'Re-enter invoice data into Xero', done: false },
              { t: 'Chase approvals in email', done: false },
              { t: 'Compile weekly report from 4 spreadsheets', done: false },
              { t: 'Reconcile deliveries from yesterday', done: false },
              { t: 'Fix errors from yesterday\'s fixes', done: false },
            ].map((r, i) => (
              <div key={i} style={{ display: 'flex', alignItems: 'center', gap: 12, fontSize: 14, color: AX.slate, fontFamily: 'Inter, sans-serif' }}>
                <div style={{ width: 16, height: 16, borderRadius: 4, border: `1.5px solid ${AX.mute}`, background: '#fff' }} />
                {r.t}
              </div>
            ))}
          </div>
          <div style={{ position: 'absolute', bottom: 40, left: 56, right: 56, display: 'flex', alignItems: 'center', gap: 14, fontFamily: 'JetBrains Mono, monospace', fontSize: 13, color: AX.coral }}>
            <div style={{ flex: 1, height: 1, background: AX.coral, opacity: 0.3 }} />
            ~6 HOURS/DAY LOST
            <div style={{ flex: 1, height: 1, background: AX.coral, opacity: 0.3 }} />
          </div>
        </div>

        {/* AFTER */}
        <div style={{ background: AX.navy, color: '#fff', padding: '80px 56px', position: 'relative', overflow: 'hidden' }}>
          {/* duotone photo layer */}
          <div aria-hidden="true" style={{
            position: 'absolute', inset: 0,
            backgroundImage: `url(${AFTER_IMG})`,
            backgroundSize: 'cover', backgroundPosition: 'center',
            filter: 'grayscale(1) contrast(1.1)',
            opacity: 0.20,
            mixBlendMode: 'screen',
          }} />
          <div aria-hidden="true" style={{
            position: 'absolute', inset: 0,
            background: `linear-gradient(135deg, ${AX.navy}ee 0%, ${AX.navy}cc 50%, ${AX.teal}22 100%)`,
          }} />
          <div style={{ position: 'absolute', top: -100, right: -100, width: 400, height: 400, borderRadius: '50%', background: `radial-gradient(circle, ${AX.teal}40 0%, transparent 70%)`, pointerEvents: 'none' }} />
          <div style={{ fontSize: 11, letterSpacing: 2.5, textTransform: 'uppercase', color: AX.teal, fontFamily: 'JetBrains Mono, monospace', fontWeight: 700, marginBottom: 20, position: 'relative' }}>
            After · Automated
          </div>
          <div style={{ fontFamily: 'Space Grotesk, sans-serif', fontSize: 54, fontWeight: 600, letterSpacing: -1.8, lineHeight: 1.02, textWrap: 'balance', position: 'relative' }}>
            Your systems<br/>do the work.<br/>
            <span style={{ color: AX.teal, fontStyle: 'italic', fontWeight: 500 }}>Automatically.</span>
          </div>
          <div style={{ marginTop: 40, display: 'flex', flexDirection: 'column', gap: 10, position: 'relative' }}>
            {[
              'Invoices synced to Xero on receipt',
              'Approvals routed & logged in Teams',
              'Reports generated before you arrive',
              'Deliveries reconciled overnight',
              'Exceptions flagged — the rest just works',
            ].map((t, i) => (
              <div key={i} style={{ display: 'flex', alignItems: 'center', gap: 12, fontSize: 14, color: 'rgba(255,255,255,0.9)', fontFamily: 'Inter, sans-serif' }}>
                <div style={{ width: 16, height: 16, borderRadius: 4, background: AX.teal, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
                  <svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="#fff" strokeWidth="3.5" strokeLinecap="round" strokeLinejoin="round"><path d="M4 12l5 5L20 6" /></svg>
                </div>
                {t}
              </div>
            ))}
          </div>
          <div style={{ position: 'absolute', bottom: 40, left: 56, right: 56, display: 'flex', alignItems: 'center', gap: 14, fontFamily: 'JetBrains Mono, monospace', fontSize: 13, color: AX.teal }}>
            <div style={{ flex: 1, height: 1, background: AX.teal, opacity: 0.3 }} />
            ~5 MIN OVERSIGHT
            <div style={{ flex: 1, height: 1, background: AX.teal, opacity: 0.3 }} />
          </div>
        </div>

        {/* Center arrow */}
        <div style={{ position: 'absolute', left: '50%', top: '50%', transform: 'translate(-50%, -50%)', zIndex: 5 }}>
          <div style={{
            width: 84, height: 84, borderRadius: '50%', background: '#fff',
            display: 'flex', alignItems: 'center', justifyContent: 'center',
            boxShadow: '0 10px 40px rgba(0,0,0,0.15), 0 0 0 8px rgba(255,255,255,0.4)',
          }}>
            <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke={AX.navy} strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round">
              <path d="M5 12h14M13 5l7 7-7 7" />
            </svg>
          </div>
        </div>
      </div>

      {/* subhead band */}
      <div style={{ padding: '56px 64px', display: 'grid', gridTemplateColumns: '1fr auto', gap: 48, alignItems: 'center', background: '#fff' }}>
        <div>
          <h1 style={{ fontFamily: 'Space Grotesk, sans-serif', fontSize: 52, fontWeight: 600, color: AX.navy, letterSpacing: -1.8, lineHeight: 1, margin: 0, textWrap: 'balance' }}>
            Your systems should work together.<br/>
            <span style={{ color: AX.teal }}>Not against you.</span>
          </h1>
          <p style={{ fontSize: 18, color: AX.slate, lineHeight: 1.55, marginTop: 20, maxWidth: 720, textWrap: 'pretty' }}>
            We connect and automate your tools to eliminate double handling, delays, and inefficiencies — using the Microsoft 365 environment you already have.
          </p>
        </div>
        <div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
          <a href="#book" style={{
            padding: '16px 26px', background: AX.teal, color: '#fff', borderRadius: 999,
            fontSize: 15, fontWeight: 600, textDecoration: 'none', display: 'inline-flex', alignItems: 'center', gap: 10, justifyContent: 'center',
          }}>
            Book a 30-minute review {Icon.arrow('#fff')}
          </a>
          <a href="#calc" style={{
            padding: '16px 26px', background: 'transparent', color: AX.navy,
            border: `1px solid ${AX.line}`, borderRadius: 999,
            fontSize: 15, fontWeight: 500, textDecoration: 'none', textAlign: 'center',
          }}>
            Calculate your ROI
          </a>
        </div>
      </div>
    </section>
  );
}

function BATrust() {
  return (
    <section style={{ padding: '56px 64px', background: AX.bone, borderTop: `1px solid ${AX.line}`, borderBottom: `1px solid ${AX.line}` }}>
      <TrustStrip theme="light" />
    </section>
  );
}

function BASectionHeader({ kicker, title, sub }) {
  return (
    <Reveal>
    <div style={{ marginBottom: 48, maxWidth: 760 }}>
      <div style={{ fontSize: 11, letterSpacing: 2, textTransform: 'uppercase', color: AX.teal, fontWeight: 700, marginBottom: 14, fontFamily: 'JetBrains Mono, monospace' }}>{kicker}</div>
      <h2 style={{ fontFamily: 'Space Grotesk, sans-serif', fontSize: 52, fontWeight: 600, letterSpacing: -1.8, lineHeight: 1.02, margin: 0, color: AX.navy, textWrap: 'balance' }}>{title}</h2>
      {sub && <p style={{ fontSize: 18, color: AX.slate, marginTop: 20, lineHeight: 1.5, textWrap: 'pretty' }}>{sub}</p>}
    </div>
    </Reveal>
  );
}

// ── Problem ──────────────────────────────────────────────────
function BAProblem() {
  return (
    <section style={{ padding: '80px 64px', borderTop: `1px solid ${AX.line}`, background: AX.paper }}>
      <BASectionHeader kicker="The Problem" title={<>Your business is slowed down by manual work.</>} />
      <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 48 }}>
        <p style={{ fontSize: 19, lineHeight: 1.6, color: AX.slate, margin: 0, textWrap: 'pretty' }}>
          Most growing businesses rely on manual processes to run critical operations. Data gets entered multiple times. Reports take hours to prepare. Teams chase tasks instead of staying ahead.
        </p>
        <p style={{ fontSize: 19, lineHeight: 1.6, color: AX.slate, margin: 0, textWrap: 'pretty' }}>
          It works, but it's <span style={{ color: AX.ink, fontWeight: 500 }}>inefficient, expensive, and it doesn't scale.</span> As your business grows, these inefficiencies only get worse.
        </p>
      </div>
    </section>
  );
}

// ── Solution ─────────────────────────────────────────────────
function BASolution() {
  const items = [
    {
      num: '01', label: 'Capture',
      before: { tag: 'Monthly invoice run', text: 'A 100-page combined PDF lands in an inbox. Someone spends the day splitting it and reading each invoice to find the client name.' },
      after:  { tag: 'Monthly invoice run', text: 'The PDF is dropped into a folder. Pages split, client and amount extracted, filed as individual records — ready to match.' },
    },
    {
      num: '02', label: 'Connect',
      before: { tag: 'Matching & routing', text: 'A staffer cross-references each invoice against a spreadsheet of contacts, looking up the right email for each client and product line.' },
      after:  { tag: 'Matching & routing', text: 'Layered rules match every invoice to its recipient — client + product first, then client, then billing contact. No manual lookup.' },
    },
    {
      num: '03', label: 'Trigger',
      before: { tag: 'Daily exception handling', text: 'The ops team pulls a CSV at 10am, scans for overdue deliveries, and types each one into the ticket system until lunch.' },
      after:  { tag: 'Daily exception handling', text: 'Overdue shipments flagged overnight. Tickets created, categorised by carrier and region, waiting when the team logs in.' },
    },
    {
      num: '04', label: 'Validate',
      before: { tag: 'After the fact', text: 'A misrouted invoice reaches the wrong client. Duplicate tickets pile up. Nobody can say who touched what, or when.' },
      after:  { tag: 'Before it ships', text: 'Email addresses validated, duplicates blocked, a full daily audit trail written — every step tracked, every exception visible.' },
    },
  ];
  return (
    <section style={{ padding: '80px 64px', borderTop: `1px solid ${AX.line}`, background: '#fff' }}>
      <BASectionHeader kicker="The Solution" title={<>Automate the work that shouldn't be manual.</>}
        sub="We transform manual, time-consuming processes into automated workflows that run in the background — using your existing Microsoft 365 environment." />
      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: 20 }}>
        {items.map((it) => (
          <BABAStep key={it.num} {...it} />
        ))}
      </div>
    </section>
  );
}

// Before/After step card — two stacked panels (bone → navy) with a shared timestamp.
function BABAStep({ num, label, before, after }) {
  return (
    <div style={{ borderRadius: 16, overflow: 'hidden', border: `1px solid ${AX.line}` }}>
      {/* Card header */}
      <div style={{ padding: '18px 24px', display: 'flex', alignItems: 'baseline', gap: 14, background: '#fff', borderBottom: `1px solid ${AX.line}` }}>
        <div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 11, color: AX.teal, fontWeight: 700, letterSpacing: 1 }}>{num}</div>
        <div style={{ fontFamily: 'Space Grotesk, sans-serif', fontSize: 22, fontWeight: 600, color: AX.navy, letterSpacing: -0.5 }}>{label}</div>
      </div>

      <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', minHeight: 180 }}>
        {/* BEFORE */}
        <div style={{ background: AX.bone, padding: '20px 22px', borderRight: `1px solid ${AX.line}`, display: 'flex', flexDirection: 'column', gap: 10 }}>
          <div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
            <span style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 10, letterSpacing: 1.4, textTransform: 'uppercase', color: AX.mute, fontWeight: 700 }}>Before</span>
            <span style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 10, color: AX.slate, opacity: 0.7 }}>{before.tag}</span>
          </div>
          <div style={{
            fontFamily: 'Inter, sans-serif', fontSize: 14, lineHeight: 1.5, color: AX.slate, textWrap: 'pretty',
            textDecoration: 'line-through', textDecorationColor: `${AX.coral}aa`, textDecorationThickness: 1.5, textDecorationSkipInk: 'all',
          }}>
            {before.text}
          </div>
        </div>

        {/* AFTER */}
        <div style={{ background: AX.navy, padding: '20px 22px', display: 'flex', flexDirection: 'column', gap: 10, position: 'relative', overflow: 'hidden' }}>
          <div style={{ position: 'absolute', top: -60, right: -60, width: 200, height: 200, borderRadius: '50%', background: `radial-gradient(circle, ${AX.teal}33 0%, transparent 70%)`, pointerEvents: 'none' }} />
          <div style={{ display: 'flex', alignItems: 'center', gap: 10, position: 'relative' }}>
            <span style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 10, letterSpacing: 1.4, textTransform: 'uppercase', color: AX.teal, fontWeight: 700 }}>After</span>
            <span style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 10, color: 'rgba(255,255,255,0.5)' }}>{after.tag}</span>
          </div>
          <div style={{ fontFamily: 'Inter, sans-serif', fontSize: 14, lineHeight: 1.5, color: 'rgba(255,255,255,0.92)', textWrap: 'pretty', position: 'relative' }}>
            {after.text}
          </div>
        </div>
      </div>
    </div>
  );
}

// ─── Station demos ──────────────────────────────────────────
function DemoCapture() {
  // An email card slides in, then a row drops into a table below.
  return (
    <div style={{ position: 'relative', width: '100%', height: '100%' }}>
      <style>{`
        @keyframes ba-slideIn { 0%, 10% { transform: translateX(-120%); opacity: 0 } 25%, 65% { transform: translateX(0); opacity: 1 } 80%, 100% { transform: translateX(8%); opacity: 0 } }
        @keyframes ba-rowIn    { 0%, 55% { transform: translateY(-8px); opacity: 0 } 70%, 90% { transform: translateY(0); opacity: 1 } 100% { transform: translateY(0); opacity: 0 } }
      `}</style>
      <div style={{
        position: 'absolute', top: 8, left: 6, right: 6, padding: '8px 10px', background: '#fff',
        border: `1px solid ${AX.line}`, borderRadius: 8, fontSize: 11, display: 'flex', gap: 8, alignItems: 'center',
        animation: 'ba-slideIn 4s ease-in-out infinite',
        boxShadow: '0 4px 12px rgba(11,30,63,0.08)',
      }}>
        <div style={{ width: 20, height: 20, borderRadius: 4, background: '#0078D4', color: '#fff', display: 'flex', alignItems: 'center', justifyContent: 'center', fontFamily: 'Space Grotesk, sans-serif', fontWeight: 700, fontSize: 10 }}>O</div>
        <div style={{ overflow: 'hidden', flex: 1 }}>
          <div style={{ color: AX.navy, fontWeight: 600, fontFamily: 'Inter, sans-serif', whiteSpace: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden' }}>Invoice #4812 — Acme Co.</div>
          <div style={{ color: AX.slate, fontSize: 10 }}>3 attachments · $4,820</div>
        </div>
      </div>
      <div style={{ position: 'absolute', left: 6, right: 6, bottom: 8, borderRadius: 8, border: `1px solid ${AX.line}`, background: AX.paper, fontSize: 10, fontFamily: 'JetBrains Mono, monospace', overflow: 'hidden' }}>
        <div style={{ padding: '6px 10px', color: AX.slate, borderBottom: `1px solid ${AX.line}`, display: 'flex', justifyContent: 'space-between' }}>
          <span>Invoice log</span><span style={{ color: AX.teal }}>●●●</span>
        </div>
        <div style={{ padding: '6px 10px', color: AX.slate, display: 'flex', justifyContent: 'space-between' }}>
          <span>#4810 — Bravo</span><span>$2.1k</span>
        </div>
        <div style={{ padding: '6px 10px', color: AX.navy, display: 'flex', justifyContent: 'space-between', background: `${AX.teal}15`, animation: 'ba-rowIn 4s ease-in-out infinite' }}>
          <span style={{ fontWeight: 600 }}>#4812 — Acme</span><span style={{ fontWeight: 600 }}>$4.8k</span>
        </div>
      </div>
    </div>
  );
}

function DemoConnect() {
  // Three app chips with lines drawing between them.
  const Chip = ({ x, y, label, color = '#fff', bg = AX.navy }) => (
    <div style={{
      position: 'absolute', left: x, top: y,
      width: 44, height: 44, borderRadius: 10, background: bg, color,
      display: 'flex', alignItems: 'center', justifyContent: 'center',
      fontFamily: 'Space Grotesk, sans-serif', fontWeight: 700, fontSize: 12,
      boxShadow: '0 2px 8px rgba(11,30,63,0.12)',
    }}>{label}</div>
  );
  return (
    <div style={{ position: 'relative', width: '100%', height: '100%' }}>
      <style>{`
        @keyframes ba-drawLine { 0% { stroke-dashoffset: 80 } 50%, 100% { stroke-dashoffset: 0 } }
        @keyframes ba-pulseNode { 0%, 100% { transform: scale(1) } 50% { transform: scale(1.08) } }
      `}</style>
      <svg style={{ position: 'absolute', inset: 0, width: '100%', height: '100%' }}>
        <path d="M 36 36 Q 100 20, 164 36" stroke={AX.teal} strokeWidth="2" fill="none" strokeDasharray="80" style={{ animation: 'ba-drawLine 3s ease-in-out infinite' }} />
        <path d="M 36 80 Q 100 110, 164 80" stroke={AX.teal} strokeWidth="2" fill="none" strokeDasharray="80" style={{ animation: 'ba-drawLine 3s ease-in-out infinite 0.6s' }} />
        <path d="M 20 46 Q 20 65, 20 70" stroke={AX.teal} strokeWidth="2" fill="none" strokeDasharray="40" style={{ animation: 'ba-drawLine 3s ease-in-out infinite 0.3s' }} />
        <path d="M 180 46 Q 180 65, 180 70" stroke={AX.teal} strokeWidth="2" fill="none" strokeDasharray="40" style={{ animation: 'ba-drawLine 3s ease-in-out infinite 0.9s' }} />
      </svg>
      <Chip x={0} y={14} label="X" bg="#13B5EA" />
      <Chip x={75} y={50} label="AX" bg={AX.navy} />
      <Chip x={150} y={14} label="T" bg="#6264A7" />
      <Chip x={0} y={88} label="SP" bg="#036C70" />
      <Chip x={150} y={88} label="D" bg="#0078D4" />
    </div>
  );
}

function DemoTrigger() {
  // Clock sweeps, button depresses, "sent" chip appears.
  return (
    <div style={{ position: 'relative', width: '100%', height: '100%', display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 10 }}>
      <style>{`
        @keyframes ba-sweep   { 0% { transform: rotate(0deg) } 100% { transform: rotate(360deg) } }
        @keyframes ba-press   { 0%, 30% { transform: scale(1); background: ${AX.navy} } 40%, 50% { transform: scale(0.94); background: ${AX.teal} } 60%, 100% { transform: scale(1); background: ${AX.navy} } }
        @keyframes ba-sentIn  { 0%, 45% { opacity: 0; transform: translateY(6px) } 60%, 90% { opacity: 1; transform: translateY(0) } 100% { opacity: 0; transform: translateY(0) } }
      `}</style>
      <div style={{ position: 'relative', width: 54, height: 54, borderRadius: '50%', border: `2px solid ${AX.line}`, background: '#fff' }}>
        <div style={{ position: 'absolute', left: '50%', top: '50%', width: 2, height: 20, background: AX.teal, transformOrigin: '50% 100%', transform: 'translate(-50%, -100%)', animation: 'ba-sweep 4s linear infinite', borderRadius: 2 }} />
        <div style={{ position: 'absolute', left: '50%', top: '50%', width: 6, height: 6, background: AX.navy, borderRadius: '50%', transform: 'translate(-50%, -50%)' }} />
      </div>
      <div style={{
        padding: '6px 14px', background: AX.navy, color: '#fff', borderRadius: 999,
        fontSize: 11, fontWeight: 600, fontFamily: 'Inter, sans-serif',
        animation: 'ba-press 4s ease-in-out infinite',
      }}>
        Send approval
      </div>
      <div style={{
        fontSize: 10, fontFamily: 'JetBrains Mono, monospace', color: AX.teal, fontWeight: 700, letterSpacing: 0.5,
        display: 'flex', alignItems: 'center', gap: 4,
        animation: 'ba-sentIn 4s ease-in-out infinite',
      }}>
        <svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke={AX.teal} strokeWidth="3.5" strokeLinecap="round" strokeLinejoin="round"><path d="M4 12l5 5L20 6" /></svg>
        SENT · LOGGED
      </div>
    </div>
  );
}

function DemoValidate() {
  // Self-ticking checklist.
  const items = ['Amount matches PO', 'Tax code valid', 'Approver assigned', 'Logged to audit'];
  return (
    <div style={{ width: '100%', height: '100%', display: 'flex', flexDirection: 'column', gap: 8, justifyContent: 'center' }}>
      <style>{`
        @keyframes ba-tick0 { 0%, 20% { stroke-dashoffset: 24 } 35%, 100% { stroke-dashoffset: 0 } }
        @keyframes ba-tick1 { 0%, 40% { stroke-dashoffset: 24 } 55%, 100% { stroke-dashoffset: 0 } }
        @keyframes ba-tick2 { 0%, 60% { stroke-dashoffset: 24 } 75%, 100% { stroke-dashoffset: 0 } }
        @keyframes ba-tick3 { 0%, 80% { stroke-dashoffset: 24 } 95%, 100% { stroke-dashoffset: 0 } }
        @keyframes ba-boxFill0 { 0%, 20% { background: #fff; border-color: ${AX.line} } 35%, 100% { background: ${AX.teal}; border-color: ${AX.teal} } }
        @keyframes ba-boxFill1 { 0%, 40% { background: #fff; border-color: ${AX.line} } 55%, 100% { background: ${AX.teal}; border-color: ${AX.teal} } }
        @keyframes ba-boxFill2 { 0%, 60% { background: #fff; border-color: ${AX.line} } 75%, 100% { background: ${AX.teal}; border-color: ${AX.teal} } }
        @keyframes ba-boxFill3 { 0%, 80% { background: #fff; border-color: ${AX.line} } 95%, 100% { background: ${AX.teal}; border-color: ${AX.teal} } }
      `}</style>
      {items.map((t, i) => (
        <div key={i} style={{ display: 'flex', alignItems: 'center', gap: 10, fontSize: 11, color: AX.navy, fontFamily: 'Inter, sans-serif', fontWeight: 500 }}>
          <div style={{
            width: 16, height: 16, borderRadius: 4, border: `1.5px solid ${AX.line}`, background: '#fff',
            display: 'flex', alignItems: 'center', justifyContent: 'center',
            animation: `ba-boxFill${i} 4s ease-in-out infinite`,
          }}>
            <svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="#fff" strokeWidth="3.5" strokeLinecap="round" strokeLinejoin="round">
              <path d="M4 12l5 5L20 6" strokeDasharray="24" style={{ animation: `ba-tick${i} 4s ease-in-out infinite` }} />
            </svg>
          </div>
          {t}
        </div>
      ))}
    </div>
  );
}

// ── Benefits — tile grid with big numbers ────────────────────
function BABenefits() {
  const items = [
    { k: 'Save Time', big: '10+ hrs', unit: '/ week recovered', body: 'Tasks that take hours are completed in minutes, often before the day even starts.' },
    { k: 'Reduce Costs', big: '40%', unit: 'admin overhead cut', body: 'Free up your team from low-value admin and redeploy them to revenue-generating work.' },
    { k: 'Eliminate Errors', big: '99%', unit: 'accuracy achieved', body: 'Remove human error with consistent, system-driven execution.' },
    { k: 'Scale Without Hiring', big: '2–3×', unit: 'volume, same team', body: 'Handle more volume without increasing headcount or complexity.' },
  ];
  return (
    <section style={{ padding: '80px 64px', borderTop: `1px solid ${AX.line}`, background: AX.navy, color: '#fff' }}>
      <div style={{ marginBottom: 48, maxWidth: 760 }}>
        <div style={{ fontSize: 11, letterSpacing: 2, textTransform: 'uppercase', color: AX.teal, fontWeight: 700, marginBottom: 14, fontFamily: 'JetBrains Mono, monospace' }}>The Benefits</div>
        <h2 style={{ fontFamily: 'Space Grotesk, sans-serif', fontSize: 52, fontWeight: 600, letterSpacing: -1.8, lineHeight: 1.02, margin: 0, textWrap: 'balance' }}>What this means for your business.</h2>
      </div>
      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 0, border: '1px solid rgba(255,255,255,0.08)', borderRadius: 16, overflow: 'hidden' }}>
        {items.map((it, i) => (
          <div key={i} style={{ padding: 28, borderRight: i < 3 ? '1px solid rgba(255,255,255,0.08)' : 'none', minHeight: 260, display: 'flex', flexDirection: 'column' }}>
            <div style={{ fontFamily: 'Space Grotesk, sans-serif', fontSize: 44, fontWeight: 700, letterSpacing: -1.5, color: AX.teal, lineHeight: 1 }}>{it.big}</div>
            <div style={{ fontSize: 12, color: 'rgba(255,255,255,0.5)', fontFamily: 'JetBrains Mono, monospace', letterSpacing: 0.8, marginTop: 6 }}>{it.unit}</div>
            <div style={{ height: 1, background: 'rgba(255,255,255,0.1)', margin: '18px 0' }} />
            <div style={{ fontFamily: 'Space Grotesk, sans-serif', fontSize: 18, fontWeight: 600, letterSpacing: -0.3 }}>{it.k}</div>
            <div style={{ fontSize: 13, color: 'rgba(255,255,255,0.65)', lineHeight: 1.55, marginTop: 8, textWrap: 'pretty' }}>{it.body}</div>
          </div>
        ))}
      </div>
      <div style={{ fontSize: 12, color: 'rgba(255,255,255,0.4)', textAlign: 'center', marginTop: 14, fontFamily: 'JetBrains Mono, monospace' }}>
        * Indicative outcomes across recent engagements.
      </div>
    </section>
  );
}

// ── Proof ────────────────────────────────────────────────────
function BAProof() {
  return (
    <section id="results" style={{ padding: '80px 64px', borderTop: `1px solid ${AX.line}`, background: '#fff', scrollMarginTop: 80 }}>
      <BASectionHeader kicker="Proof" title={<>Real results from automation.</>}
        sub="Automation isn't theoretical — it delivers measurable results quickly." />
      <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 24 }}>
        <CaseCard
          theme="dark" accent={AX.teal}
          client="Hatched Media" industry="Marketing / Media"
          logo="assets/hatched-logo.png"
          pdf="assets/Axiom_Hatched_Media_Case_Study.pdf"
          before="1–2 days" after="< 5 min"
          metric="4" metricUnit="days saved / month"
          metricCaption="A two-day invoice process, now five minutes. Finance closes the books earlier, every month."
          quote="I can't believe how quickly and easily it was built."
          author="Billie Gill" role="Head of Finance, Hatched Media"
          avatar="https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=160&h=160&q=80&auto=format&fit=crop" />
        <CaseCard
          theme="dark" accent={AX.teal}
          client="National Freight Management" industry="Logistics"
          logo="assets/nfm-logo.jpg"
          pdf="assets/Axiom_NFM_Case_Study.pdf"
          before="4–5 hrs/day" after="Eliminated"
          metric="4–5" metricUnit="hrs / day eliminated"
          metricCaption="Tickets ready before the team arrives. ROI in under 12 months — every day starts ahead."
          quote="We're effectively starting a day ahead, every day."
          author="Gerard Platz" role="General Manager, NFM"
          avatar="https://images.unsplash.com/photo-1560250097-0b93528c311a?w=160&h=160&q=80&auto=format&fit=crop" />
      </div>
    </section>
  );
}

// ── Process ──────────────────────────────────────────────────
function BAProcess() {
  const steps = [
    { n: '01', t: 'Identify Opportunities', b: 'We assess your business to uncover manual processes and inefficiencies.' },
    { n: '02', t: 'Design the Automation', b: 'We map out workflows based on your existing systems and business rules.' },
    { n: '03', t: 'Implement & Optimise', b: 'We deploy automation quickly and refine it to maximise results.' },
  ];
  return (
    <section id="how" style={{ padding: '80px 64px', borderTop: `1px solid ${AX.line}`, background: AX.paper, scrollMarginTop: 80 }}>
      <BASectionHeader kicker="How it works" title={<>A simple, low-risk process.</>} sub="Most businesses see an immediate impact." />
      <div style={{ display: 'flex', gap: 0, alignItems: 'stretch' }}>
        {steps.map((s, i) => (
          <React.Fragment key={s.n}>
            <div style={{ flex: 1, padding: 32, background: '#fff', border: `1px solid ${AX.line}`, borderRadius: 16, display: 'flex', flexDirection: 'column', gap: 16, minHeight: 240 }}>
              <div style={{ display: 'flex', alignItems: 'center', gap: 14 }}>
                <div style={{ width: 40, height: 40, borderRadius: 999, background: AX.teal, color: '#fff', display: 'flex', alignItems: 'center', justifyContent: 'center', fontFamily: 'Space Grotesk, sans-serif', fontWeight: 700, fontSize: 14 }}>{s.n}</div>
                <div style={{ fontFamily: 'Space Grotesk, sans-serif', fontSize: 22, fontWeight: 600, color: AX.navy, letterSpacing: -0.4 }}>{s.t}</div>
              </div>
              <div style={{ fontSize: 15, color: AX.slate, lineHeight: 1.55, textWrap: 'pretty' }}>{s.b}</div>
            </div>
            {i < steps.length - 1 && (
              <div style={{ width: 56, display: 'flex', alignItems: 'center', justifyContent: 'center', color: AX.teal }}>
                {Icon.arrow(AX.teal)}
              </div>
            )}
          </React.Fragment>
        ))}
      </div>
    </section>
  );
}

// ── ROI ──────────────────────────────────────────────────────
function BAROI() {
  return (
    <section id="calc" style={{ padding: '80px 64px', borderTop: `1px solid ${AX.line}`, background: '#fff', scrollMarginTop: 80 }}>
      <BASectionHeader kicker="ROI Calculator" title={<>Quantify what you're losing.</>}
        sub="Slide the inputs to reflect your business. We'll show you what automation could unlock." />
      <ROICalculator theme="light" accent={AX.teal} />
    </section>
  );
}

// ── Why ──────────────────────────────────────────────────────
function BAWhy() {
  const items = [
    { t: 'Built on your existing systems', s: 'Microsoft 365 — no rip-and-replace' },
    { t: 'Fast implementation', s: 'Minimal disruption to your team' },
    { t: 'Clear return on investment', s: 'Measured in hours saved and errors cut' },
    { t: 'Full visibility and control', s: 'Reporting and audit trails on every flow' },
  ];
  return (
    <section id="about" style={{ padding: '80px 64px', borderTop: `1px solid ${AX.line}`, background: AX.paper, scrollMarginTop: 80 }}>
      <BASectionHeader kicker="Why Motion" title={<>Built for speed,<br/>simplicity, and ROI.</>} />
      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: 20 }}>
        {items.map((it, i) => (
          <div key={i} style={{ padding: 28, background: '#fff', border: `1px solid ${AX.line}`, borderRadius: 14, display: 'grid', gridTemplateColumns: '28px 1fr', gap: 16 }}>
            <div style={{ color: AX.teal, display: 'flex', alignItems: 'flex-start', paddingTop: 2 }}>{Icon.check(AX.teal)}</div>
            <div>
              <div style={{ fontFamily: 'Space Grotesk, sans-serif', fontSize: 19, fontWeight: 600, color: AX.navy, letterSpacing: -0.3 }}>{it.t}</div>
              <div style={{ fontSize: 14, color: AX.slate, marginTop: 6, lineHeight: 1.55 }}>{it.s}</div>
            </div>
          </div>
        ))}
      </div>
      <div style={{ marginTop: 32, padding: 32, borderRadius: 14, background: AX.navy, color: '#fff', display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 24 }}>
        <div style={{ fontFamily: 'Space Grotesk, sans-serif', fontSize: 24, fontWeight: 500, letterSpacing: -0.6, lineHeight: 1.3, textWrap: 'balance' }}>
          This isn't about replacing your systems. <span style={{ color: AX.teal }}>It's about making them work properly.</span>
        </div>
        <a href="#book" style={{
          flexShrink: 0, padding: '14px 22px', background: AX.teal, color: '#fff',
          borderRadius: 999, fontSize: 14, fontWeight: 600, textDecoration: 'none',
          display: 'inline-flex', alignItems: 'center', gap: 10, whiteSpace: 'nowrap',
        }}>
          Book a 30-minute review {Icon.arrow('#fff')}
        </a>
      </div>
    </section>
  );
}

// ── CTA ──────────────────────────────────────────────────────
function BACTA() {
  return (
    <section id="book" style={{ padding: '100px 64px', borderTop: `1px solid ${AX.line}`, background: '#fff', scrollMarginTop: 80 }}>
      <div style={{ textAlign: 'center', maxWidth: 780, margin: '0 auto 48px' }}>
        <div style={{ fontSize: 11, letterSpacing: 2, textTransform: 'uppercase', color: AX.teal, fontWeight: 700, marginBottom: 14, fontFamily: 'JetBrains Mono, monospace' }}>Next step</div>
        <h2 style={{ fontFamily: 'Space Grotesk, sans-serif', fontSize: 56, fontWeight: 600, letterSpacing: -2, lineHeight: 1.02, margin: 0, color: AX.navy, textWrap: 'balance' }}>
          Discover where you're losing time — and how to fix it.
        </h2>
        <p style={{ fontSize: 18, color: AX.slate, marginTop: 20, lineHeight: 1.5 }}>
          In a short 30-minute session, we'll identify where automation can save you hours every week. No obligation. Just practical insights you can act on.
        </p>
      </div>
      <CalendarBooking theme="light" accent={AX.teal} />
    </section>
  );
}

window.DirBeforeAfter = DirBeforeAfter;
window.BAHero = BAHero;
