// Variant J — the "best of" composite page.
// Stitches together the strongest moments from variants A/D/G/I + new
// components: SavingsCalculator, CancelLinkedInMini, IntegrationsGrid,
// SecurityStrip, CustomerQuotes, SameBriefSplit, TickerLive, MigrationTimeline.

/* ============================================================
   HeroVideo — big click-to-play video card for the hero right column.
   Custom-branded controls (not native). Expand = in-page theater
   mode with blurred backdrop, NOT native fullscreen.
   ============================================================ */
const HERO_VIDEO_POSTER = 'assets/video-poster.png'; // Scout UI on blue gradient

const fmtTime = (s) => {
  if (!isFinite(s) || s < 0) return '0:00';
  const m = Math.floor(s / 60);
  const ss = Math.floor(s % 60).toString().padStart(2, '0');
  return `${m}:${ss}`;
};

// Inline SVG icons — 24×24 viewBox, currentColor fill/stroke
const VIcon = {
  play:   <svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden><path d="M8 5v14l11-7z" /></svg>,
  pause:  <svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden><rect x="6" y="5" width="4" height="14" rx="1" /><rect x="14" y="5" width="4" height="14" rx="1" /></svg>,
  vol:    <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" aria-hidden><path d="M4 9h3l5-4v14l-5-4H4z" fill="currentColor" /><path d="M16 9a4 4 0 010 6M19 6a8 8 0 010 12" /></svg>,
  muted:  <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" aria-hidden><path d="M4 9h3l5-4v14l-5-4H4z" fill="currentColor" /><path d="M16 9l5 6M21 9l-5 6" /></svg>,
  expand: <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden><path d="M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5" /></svg>,
  close:  <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" aria-hidden><path d="M6 6l12 12M18 6L6 18" /></svg>,
};

function CtrlBtn({ children, onClick, label }) {
  const [hover, setHover] = React.useState(false);
  return (
    <button
      type="button"
      aria-label={label}
      onClick={onClick}
      onMouseEnter={() => setHover(true)}
      onMouseLeave={() => setHover(false)}
      style={{
        width: 34, height: 34, borderRadius: 8,
        background: hover ? 'rgba(255,255,255,0.16)' : 'transparent',
        border: 'none', color: '#fff', cursor: 'pointer',
        display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
        transition: 'background 140ms ease',
        padding: 0,
      }}
    >
      {children}
    </button>
  );
}

function HeroVideo({ src, poster = HERO_VIDEO_POSTER }) {
  const videoRef = React.useRef(null);
  const [started, setStarted] = React.useState(false);
  const [playing, setPlaying] = React.useState(false);
  const [current, setCurrent] = React.useState(0);
  const [duration, setDuration] = React.useState(0);
  const [buffered, setBuffered] = React.useState(0);
  const [muted, setMuted] = React.useState(false);
  const [theater, setTheater] = React.useState(false);
  const [scrubbing, setScrubbing] = React.useState(false);
  const [ctrlsVisible, setCtrlsVisible] = React.useState(true);
  const hideTimerRef = React.useRef(null);

  // Show controls; restart the 2s auto-hide timer if playing
  const showCtrls = React.useCallback(() => {
    setCtrlsVisible(true);
    clearTimeout(hideTimerRef.current);
    const v = videoRef.current;
    if (v && !v.paused) {
      hideTimerRef.current = setTimeout(() => setCtrlsVisible(false), 2000);
    }
  }, []);

  // Mouse leaves card — hide only if playing (paused → keep visible)
  const hideCtrls = React.useCallback(() => {
    clearTimeout(hideTimerRef.current);
    const v = videoRef.current;
    if (v && !v.paused) setCtrlsVisible(false);
  }, []);

  React.useEffect(() => () => clearTimeout(hideTimerRef.current), []);

  const togglePlay = React.useCallback(() => {
    const v = videoRef.current;
    if (!v) return;
    if (v.paused) {
      setStarted(true);
      v.play().then(() => setPlaying(true)).catch(() => {});
    } else {
      v.pause();
    }
  }, []);

  const toggleMute = React.useCallback(() => {
    const v = videoRef.current;
    if (!v) return;
    v.muted = !v.muted;
    setMuted(v.muted);
  }, []);

  // ESC closes theater; space toggles play when theater open
  React.useEffect(() => {
    if (!theater) return;
    const onKey = (e) => {
      if (e.key === 'Escape') setTheater(false);
      if (e.key === ' ' || e.code === 'Space') { e.preventDefault(); togglePlay(); }
    };
    window.addEventListener('keydown', onKey);
    return () => window.removeEventListener('keydown', onKey);
  }, [theater, togglePlay]);

  // Lock body scroll during theater mode
  React.useEffect(() => {
    if (!theater) return;
    const prev = document.body.style.overflow;
    document.body.style.overflow = 'hidden';
    return () => { document.body.style.overflow = prev; };
  }, [theater]);

  const seekFromPointer = (e) => {
    const v = videoRef.current;
    if (!v || !duration) return;
    const rect = e.currentTarget.getBoundingClientRect();
    const ratio = Math.max(0, Math.min(1, (e.clientX - rect.left) / rect.width));
    v.currentTime = ratio * duration;
    setCurrent(ratio * duration);
  };

  const pct = duration ? (current / duration) * 100 : 0;
  const bufPct = duration ? (buffered / duration) * 100 : 0;

  return (
    <div style={{ position: 'relative', width: '100%', aspectRatio: '16 / 9' }}>
      {/* Stage — absolute-fills-parent normally, fixed-viewport in theater mode */}
      <div
        style={{
          position: theater ? 'fixed' : 'absolute',
          inset: 0,
          zIndex: theater ? 1000 : 'auto',
          display: theater ? 'flex' : 'block',
          alignItems: 'center', justifyContent: 'center',
          background: theater ? 'rgba(6,8,44,0.82)' : 'transparent',
          backdropFilter: theater ? 'blur(24px)' : 'none',
          WebkitBackdropFilter: theater ? 'blur(24px)' : 'none',
        }}
        onClick={theater ? (e) => { if (e.target === e.currentTarget) setTheater(false); } : undefined}
      >
        {theater && (
          <button
            type="button"
            aria-label="Close"
            onClick={() => setTheater(false)}
            style={{
              position: 'absolute', top: 24, right: 24,
              width: 44, height: 44, borderRadius: 999,
              background: 'rgba(255,255,255,0.1)',
              border: '1px solid rgba(255,255,255,0.18)',
              color: '#fff', cursor: 'pointer',
              display: 'flex', alignItems: 'center', justifyContent: 'center',
              backdropFilter: 'blur(10px)',
              WebkitBackdropFilter: 'blur(10px)',
            }}
          >
            {VIcon.close}
          </button>
        )}

        {/* Card */}
        <div
          style={{
            position: 'relative',
            width: theater ? 'min(95vw, calc(90vh * 16 / 9))' : '100%',
            height: theater ? 'auto' : '100%',
            aspectRatio: '16 / 9',
            borderRadius: 24,
            overflow: 'hidden',
            isolation: 'isolate',
            boxShadow: theater
              ? '0 40px 120px -20px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.1)'
              : '0 30px 70px -14px rgba(0,9,182,0.35), 0 0 0 1px var(--cal-line)',
            cursor: !started ? 'pointer' : 'default',
          }}
          onClick={!started ? togglePlay : undefined}
          onMouseMove={started ? showCtrls : undefined}
          onMouseLeave={started ? hideCtrls : undefined}
        >
          <video
            ref={videoRef}
            src={src}
            poster={poster}
            preload="metadata"
            playsInline
            disablePictureInPicture
            controlsList="nodownload noplaybackrate noremoteplayback"
            onPlay={() => {
              setPlaying(true); setStarted(true); setCtrlsVisible(true);
              clearTimeout(hideTimerRef.current);
              hideTimerRef.current = setTimeout(() => setCtrlsVisible(false), 2000);
            }}
            onPause={() => {
              setPlaying(false); setCtrlsVisible(true);
              clearTimeout(hideTimerRef.current);
            }}
            onTimeUpdate={(e) => setCurrent(e.currentTarget.currentTime)}
            onLoadedMetadata={(e) => setDuration(e.currentTarget.duration)}
            onProgress={(e) => {
              const v = e.currentTarget;
              if (v.buffered.length) setBuffered(v.buffered.end(v.buffered.length - 1));
            }}
            onClick={started ? togglePlay : undefined}
            style={{
              width: '100%', height: '100%', display: 'block',
              objectFit: 'cover',
              borderRadius: 24,
            }}
          />

          {/* Poster overlay — only before first play */}
          {!started && (
            <>
              <div aria-hidden style={{
                position: 'absolute', inset: 0,
                background: 'linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.55) 100%)',
                pointerEvents: 'none',
              }} />
              <div style={{
                position: 'absolute', top: 18, right: 18,
                background: 'var(--cal-accent)', color: '#fff',
                padding: '6px 12px', borderRadius: 999,
                fontSize: 11, fontWeight: 700, letterSpacing: '0.08em', textTransform: 'uppercase',
                boxShadow: '0 10px 22px -6px rgba(255,106,61,0.55)',
                pointerEvents: 'none',
              }}>
                save NZ$18k/seat
              </div>
              <div aria-hidden style={{
                position: 'absolute', inset: 0,
                display: 'flex', alignItems: 'center', justifyContent: 'center',
                pointerEvents: 'none',
              }}>
                <span style={{
                  width: 76, height: 76, borderRadius: 999,
                  background: 'rgba(255,255,255,0.16)',
                  backdropFilter: 'blur(20px) saturate(1.4)',
                  WebkitBackdropFilter: 'blur(20px) saturate(1.4)',
                  border: '1px solid rgba(255,255,255,0.6)',
                  color: '#fff',
                  display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
                  boxShadow: '0 12px 40px -10px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.45)',
                }}>
                  <svg width="44" height="44" viewBox="0 0 24 24"
                       fill="currentColor" stroke="currentColor"
                       strokeWidth="2.4" strokeLinejoin="round" strokeLinecap="round"
                       aria-hidden
                       style={{ filter: 'drop-shadow(0 1px 2px rgba(0,0,0,0.35))' }}>
                    <path d="M7 4v16L22 12z" />
                  </svg>
                </span>
              </div>
              <div style={{
                position: 'absolute', bottom: 20, left: 22,
                color: '#fff',
                textShadow: '0 2px 16px rgba(0,0,0,0.4)',
                pointerEvents: 'none',
              }}>
                <div style={{ fontSize: 15, fontWeight: 600, letterSpacing: '-0.005em', lineHeight: 1.2, marginBottom: 2 }}>
                  Watch Caliber
                </div>
                <div style={{ fontSize: 12, opacity: 0.85, letterSpacing: '0.02em' }}>
                  The 2-minute version
                </div>
              </div>
            </>
          )}

          {/* Custom controls — shown once started */}
          {started && (
            <div style={{
              position: 'absolute', left: 0, right: 0, bottom: 0,
              padding: '40px 14px 10px 14px',
              background: 'linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.62) 100%)',
              color: '#fff',
              pointerEvents: 'none',
              opacity: ctrlsVisible ? 1 : 0,
              transition: 'opacity 220ms ease',
            }}>
              {/* Progress bar */}
              <div
                role="slider"
                aria-label="Seek"
                aria-valuemin={0}
                aria-valuemax={100}
                aria-valuenow={Math.round(pct)}
                tabIndex={0}
                onPointerDown={(e) => {
                  e.currentTarget.setPointerCapture(e.pointerId);
                  setScrubbing(true);
                  seekFromPointer(e);
                }}
                onPointerMove={(e) => { if (scrubbing) seekFromPointer(e); }}
                onPointerUp={(e) => {
                  try { e.currentTarget.releasePointerCapture(e.pointerId); } catch (_) {}
                  setScrubbing(false);
                }}
                onPointerCancel={() => setScrubbing(false)}
                onKeyDown={(e) => {
                  const v = videoRef.current;
                  if (!v) return;
                  if (e.key === 'ArrowLeft')  { v.currentTime = Math.max(0, v.currentTime - 5); e.preventDefault(); }
                  if (e.key === 'ArrowRight') { v.currentTime = Math.min(duration, v.currentTime + 5); e.preventDefault(); }
                }}
                style={{
                  position: 'relative',
                  height: 18,
                  display: 'flex', alignItems: 'center',
                  cursor: 'pointer',
                  pointerEvents: ctrlsVisible ? 'auto' : 'none',
                  touchAction: 'none',
                }}
              >
                <div style={{
                  position: 'relative',
                  width: '100%', height: 4,
                  background: 'rgba(255,255,255,0.22)',
                  borderRadius: 999,
                  overflow: 'hidden',
                }}>
                  <div style={{
                    position: 'absolute', left: 0, top: 0, bottom: 0,
                    width: `${bufPct}%`,
                    background: 'rgba(255,255,255,0.35)',
                  }} />
                  <div style={{
                    position: 'absolute', left: 0, top: 0, bottom: 0,
                    width: `${pct}%`,
                    background: '#fff',
                  }} />
                </div>
                <div aria-hidden style={{
                  position: 'absolute',
                  left: `calc(${pct}% - 7px)`,
                  width: 14, height: 14,
                  borderRadius: 999,
                  background: 'var(--cal-accent)',
                  boxShadow: '0 2px 8px rgba(0,0,0,0.45)',
                  opacity: scrubbing ? 1 : 0,
                  transition: 'opacity 140ms ease',
                  pointerEvents: 'none',
                }} />
              </div>

              {/* Control row */}
              <div style={{
                display: 'flex', alignItems: 'center', gap: 8,
                marginTop: 2,
                pointerEvents: ctrlsVisible ? 'auto' : 'none',
              }}>
                <CtrlBtn onClick={togglePlay} label={playing ? 'Pause' : 'Play'}>
                  {playing ? VIcon.pause : VIcon.play}
                </CtrlBtn>
                <div style={{
                  fontVariantNumeric: 'tabular-nums',
                  fontSize: 12.5,
                  letterSpacing: '0.01em',
                  opacity: 0.95,
                  marginLeft: 2,
                }}>
                  {fmtTime(current)} <span style={{ opacity: 0.55 }}>/ {fmtTime(duration)}</span>
                </div>
                <div style={{ flex: 1 }} />
                <CtrlBtn onClick={toggleMute} label={muted ? 'Unmute' : 'Mute'}>
                  {muted ? VIcon.muted : VIcon.vol}
                </CtrlBtn>
                <CtrlBtn onClick={() => setTheater(t => !t)} label={theater ? 'Exit theater mode' : 'Enter theater mode'}>
                  {VIcon.expand}
                </CtrlBtn>
              </div>
            </div>
          )}
        </div>
      </div>
    </div>
  );
}

function VariantJ() {
  return (
    <div className="cal-page" data-screen-label="J Composite (best-of)">
      <ScrollProgress />
      <Nav ctaLabel="See the live demo" />

      {/* ──────────────── HERO ────────────────
          Negative marginTop + compensating paddingTop pulls the hero box up
          behind the floating nav capsule. This gives the capsule's
          backdrop-filter something to blur at scrollY=0 (the radial
          gradient + content), instead of plain page-bg white. */}
      <section style={{ marginTop: -128, padding: '168px 72px 100px', position: 'relative', overflow: 'hidden' }}>
        <div aria-hidden style={{
          position: 'absolute', inset: 0, pointerEvents: 'none',
          background: 'radial-gradient(900px 500px at 85% -10%, rgba(0,82,255,0.10), transparent 60%), radial-gradient(800px 400px at 5% 110%, rgba(255,106,61,0.08), transparent 60%)',
        }} />
        <div className="cal-container" style={{ position: 'relative' }}>
          {/* Row 1 — full-width eyebrow + H1 */}
          <div style={{ marginBottom: 48 }}>
            <div className="cal-eyebrow" style={{ marginBottom: 20 }}>
              <CalStar size={11} grad={false} style={{ color: 'var(--cal-blue-ink)' }} />
              The ATS + CRM for human recruitment agencies
            </div>
            <h1 style={{
              fontSize: 'clamp(40px, 4.6vw, 68px)', fontWeight: 500,
              letterSpacing: '-0.035em', lineHeight: 1.02,
              margin: 0, color: 'var(--cal-ink)',
            }}>
              <span style={{ display: 'block' }}>Everyone’s using AI to replace recruiters.</span>
              <span style={{ display: 'block', fontFamily: '"Fraunces", "Times New Roman", serif', fontStyle: 'normal', fontWeight: 700, fontVariationSettings: '"opsz" 14, "SOFT" 100, "WONK" 0, "wght" 700', color: 'var(--cal-blue-ink)', letterSpacing: '-0.02em' }}>
                We’re using it to{' '}
                <span style={{ color: 'var(--cal-accent)' }}>keep</span>
                {' '}them.
              </span>
            </h1>
          </div>

          {/* Row 2 — subhead + CTAs + proof strip on the left, video on the right */}
          <div style={{
            display: 'grid',
            gridTemplateColumns: '1fr 1fr',
            gap: 56,
            alignItems: 'start',
          }}>
            <div>
              <p style={{
                fontSize: 'clamp(17px, 1.3vw, 21px)', lineHeight: 1.5,
                color: 'var(--cal-body)', maxWidth: 560, margin: '0 0 28px',
              }}>
                Candidates are done talking to bots. Caliber is an ATS + CRM that points AI at the admin, not the candidate, so the humans on both sides stay in the room.
              </p>
              <div style={{ display: 'flex', gap: 12, flexWrap: 'wrap', alignItems: 'center', marginBottom: 36 }}>
                <a href="#live-demo" className="cal-btn cal-btn--blue" style={{ padding: '14px 24px', fontSize: 15, textDecoration: 'none' }}>
                  Try the live demo {Icon.arrowR({ size: 14, color: '#fff' })}
                </a>
                <a href="#honest-ai" className="cal-btn cal-btn--ghost" style={{ padding: '14px 22px', fontSize: 15, textDecoration: 'none' }}>
                  Why AI is hurting recruitment {Icon.arrowR({ size: 13 })}
                </a>
              </div>

              {/* Proof strip — 3 compact stats in mono, understated but credible.
                  Single row, no wrap. */}
              <div style={{
                display: 'flex',
                gap: 24, flexWrap: 'nowrap',
                paddingTop: 24,
                borderTop: '1px solid var(--cal-line-2)',
              }}>
                {[
                  { big: 'NZ$18k', small: 'saved per seat / year' },
                  { big: '2.4B+', small: 'public profiles in Scout' },
                  { big: '1 person', small: 'handles your whole move' },
                ].map(s => (
                  <div key={s.big} style={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
                    <div style={{
                      fontSize: 20, fontWeight: 500, letterSpacing: '-0.02em',
                      color: 'var(--cal-ink)',
                      fontFamily: 'ui-monospace, "SF Mono", Menlo, Consolas, monospace',
                      fontVariantNumeric: 'tabular-nums',
                    }}>
                      {s.big}
                    </div>
                    <div style={{
                      fontSize: 11, letterSpacing: '0.08em', textTransform: 'uppercase',
                      color: 'var(--cal-muted)', fontWeight: 600,
                      fontFamily: 'ui-monospace, "SF Mono", Menlo, Consolas, monospace',
                    }}>
                      {s.small}
                    </div>
                  </div>
                ))}
              </div>
            </div>

            {/* Right column — big click-to-play hero video */}
            <div>
              <HeroVideo src="https://r2.vidzflow.com/source/c613c43f-970d-4252-be55-ff19e4c7ab4d.mp4" />
            </div>
          </div>
        </div>
      </section>

      {/* Page order (PR 13.4 rework) — philosophy → pitch → workflow → product.
          Hero → AI (gray) → Cancel LinkedIn (cool) → Monday (dark) → Demo (white)
          → Calc → JobMarket → Placement (warm) → Quotes → Buyout → Pricing → FAQ → CTA.
          Colour rhythm: each tint (cool-blue, warm-cream) used once, separated by
          neutrals. Demo after Monday because click-around takes commitment — reader
          should be primed by the pitch + workflow first. */}

      {/* ──────────────── THE HONEST AI POSITION (soft-gray per PR 13.4) ──────────────── */}
      <HonestAISection />

      {/* ──────────────── CANCEL LINKEDIN + SCOUT (cool-blue) ──────────────── */}
      <CancelLinkedInSection />

      {/* ──────────────── MONDAY 9AM (dark) ──────────────── */}
      <section className="cal-section" data-screen-label="Monday 9am" data-nav-theme="dark" style={{
        padding: '120px 72px', background: '#06082C', color: '#fff',
        position: 'relative', overflow: 'hidden',
      }}>
        <div className="cal-noise" />
        <div className="cal-container" style={{ position: 'relative' }}>
          <div style={{ maxWidth: 720, marginBottom: 56 }}>
            <div className="cal-eyebrow" style={{
              background: 'rgba(255,255,255,0.08)', color: '#fff',
              border: '1px solid rgba(255,255,255,0.15)', marginBottom: 18,
            }}>
              <CalStar size={11} grad={false} style={{ color: 'var(--cal-accent)' }} />
              A Monday, 9am, anywhere
            </div>
            <h2 style={{ color: '#fff', margin: 0, fontSize: 'clamp(40px, 4.5vw, 64px)', letterSpacing: '-0.03em', lineHeight: 1.05 }}>
              Monday, 9am.{' '}
              <span style={{ fontFamily: '"Fraunces","Times New Roman",serif', fontStyle: 'italic', fontWeight: 500, fontVariationSettings: '"opsz" 72, "SOFT" 100, "WONK" 0, "wght" 500', color: 'var(--cal-accent)' }}>
                One brief, a shortlist by 9:15.
              </span>
            </h2>
            <p style={{ margin: '18px 0 0', fontSize: 18, lineHeight: 1.55, color: 'rgba(255,255,255,0.75)', maxWidth: 620 }}>
              Type a brief in plain English. Scout searches 2.4 billion public profiles. A matched pipeline lands in under a minute.
            </p>
          </div>
          <div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 24 }}>
            {[
              { n: '01', t: '9:02 — Brief Scout', b: '"Senior accountant in Auckland with Xero experience." No boolean strings, no filter stacking. Type it the way you\'d say it to a colleague.' },
              { n: '02', t: '9:03 — 1,025 matched candidates', b: 'Scout returns them in under 15 seconds. Each row shows work history, skills, location, current role. Every filter comes from your brief, no credits, no caps.' },
              { n: '03', t: '9:15 — Ten in your shortlist', b: 'Review the matches at your pace. You know the fit better than any AI ranking. Advance the ones worth a conversation.' },
            ].map(s => (
              <div key={s.n} style={{
                background: 'rgba(255,255,255,0.04)', border: '1px solid rgba(255,255,255,0.1)',
                borderRadius: 20, padding: 28,
              }}>
                <div style={{ fontSize: 11, letterSpacing: '0.12em', textTransform: 'uppercase', color: 'var(--cal-accent)', marginBottom: 14, fontWeight: 700, fontFamily: 'ui-monospace,"SF Mono",Menlo,monospace' }}>{s.n}</div>
                <div style={{ fontSize: 20, fontWeight: 500, marginBottom: 10, letterSpacing: '-0.015em' }}>{s.t}</div>
                <div style={{ fontSize: 14, opacity: 0.72, lineHeight: 1.55 }}>{s.b}</div>
              </div>
            ))}
          </div>
        </div>
      </section>

      {/* ──────────────── LIVE DEMO (white — post-workflow reveal) ──────────────── */}
      <section id="live-demo" style={{ padding: '100px 72px 80px', background: '#fff', scrollMarginTop: 80 }}>
        <div className="cal-container">
          {/* Demo header — single-column so the H2 can sit on one line. */}
          <div style={{ marginBottom: 28 }}>
            <div className="cal-eyebrow" style={{ marginBottom: 14, background: '#EEF4FF', color: 'var(--cal-blue-ink)' }}>
              <span className="dot" style={{ background: '#22C55E', boxShadow: '0 0 0 3px rgba(34,197,94,0.22)' }} />
              Caliber is live — click anything
            </div>
            <h2 style={{
              margin: 0,
              fontSize: 'clamp(32px, 3.6vw, 52px)',
              fontWeight: 500,
              letterSpacing: '-0.03em',
              lineHeight: 1.05,
              textWrap: 'balance',
            }}>
              The actual product. <span style={{ color: 'var(--cal-blue-ink)' }}>Not a rendered mock.</span>
            </h2>
          </div>

          {/* Try-these pills */}
          <div style={{ display: 'flex', gap: 8, flexWrap: 'wrap', marginBottom: 16 }}>
            {[
              { label: 'Brief Scout →', hint: 'Type a role in plain English' },
              { label: 'Open a candidate →', hint: 'See their full history' },
              { label: 'Advance a pipeline →', hint: 'Drag or click stage' },
            ].map((p) => (
              <div key={p.label} style={{
                display: 'inline-flex', alignItems: 'center', gap: 8,
                padding: '8px 14px', borderRadius: 999,
                background: '#fff', border: '1px solid var(--cal-line)',
                fontSize: 13, fontWeight: 500, color: 'var(--cal-ink)',
                boxShadow: '0 2px 6px rgba(0,0,0,0.04)',
              }}>
                <span>{p.label}</span>
                <span style={{ fontSize: 11, color: 'var(--cal-muted)', fontWeight: 400 }}>{p.hint}</span>
              </div>
            ))}
          </div>

          {/* Pulsing affordance sticker — sits in the bottom-left area of
              the iframe and straddles the LEFT edge (horizontal overhang off
              the left side of the wrapper). Reads as a note glued to the side. */}
          <div style={{ position: 'relative' }}>
            <LiveDemo variant="hero" />
            <div
              aria-hidden
              style={{
                position: 'absolute', bottom: 20, left: -28,
                display: 'inline-flex', alignItems: 'center', gap: 10,
                padding: '10px 18px', borderRadius: 20,
                background: 'var(--cal-accent)', color: '#fff',
                fontSize: 13, fontWeight: 500, letterSpacing: '-0.005em',
                lineHeight: 1.35,
                maxWidth: 340, textAlign: 'left',
                boxShadow: '0 14px 32px -10px rgba(255,106,61,0.55)',
                zIndex: 5,
                animation: 'cal-bob 2.2s ease-in-out infinite',
              }}
            >
              <span style={{ fontSize: 16, lineHeight: 1, flexShrink: 0 }} aria-hidden>👉</span>
              <span>
                No 45-min demo call. No form wall. Our product <em style={{ fontStyle: 'italic', fontWeight: 600 }}>is</em> the pitch, try it yourself.
              </span>
            </div>
          </div>

          {/* 3 "why the demo is up here" cards — outlined on white so they read as continuation, not footer. */}
          <div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 14, marginTop: 16 }}>
            {[
              {
                title: 'No marketing gloss.',
                body: "Every other product page Photoshops its screenshots. This is the actual tool, warts and all, we'd rather show you the real thing than sell you a fantasy.",
              },
              {
                title: 'No sales wall.',
                body: 'Every other ATS/CRM starts with "talk to sales." We\'d rather respect your time, let you poke at the product, and reach your own conclusion. Book a call later if it\'s a fit.',
              },
              {
                title: 'Want more than a click-around?',
                body: "For a full 1:1 walkthrough — your agency's data, migration plan, pricing scoped to your size — book a call. We'd rather you see the product first.",
              },
            ].map((c) => (
              <div key={c.title} style={{
                padding: '18px 20px', borderRadius: 14,
                background: 'var(--cal-bg-soft)', border: '1px solid var(--cal-line)',
                boxShadow: 'var(--shadow-sm)',
              }}>
                <div style={{ fontSize: 14, fontWeight: 600, color: 'var(--cal-ink)', marginBottom: 6 }}>{c.title}</div>
                <div style={{ fontSize: 13, color: 'var(--cal-body)', lineHeight: 1.5 }}>{c.body}</div>
              </div>
            ))}
          </div>
        </div>
      </section>

      {/* ──────────────── SAVINGS CALCULATOR (soft-gray) ──────────────── */}
      <section className="cal-section" style={{ padding: '120px 72px', background: 'var(--cal-bg-soft)' }}>
        <div className="cal-container">
          <div style={{ maxWidth: 760, marginBottom: 40 }}>
            <h2 style={{ margin: 0 }}>
              <span style={{ display: 'block' }}>Run the math.</span>
              <span style={{ display: 'block', color: 'var(--cal-blue-ink)' }}>Caliber's cost included.</span>
            </h2>
          </div>
          <SavingsCalculator />
        </div>
      </section>

      {/* ──────────────── JOB MARKETPLACE (moved here per PR 13.2 reorder) ──────────────── */}
      <JobMarketplace />

      {/* ──────────────── PLACEMENT SPREAD (cool-blue — pairs with the blue-ink endpoint spans) ──────────────── */}
      <section style={{
        borderTop: '1px solid var(--cal-line-2)',
        borderBottom: '1px solid var(--cal-line-2)',
        padding: '72px 72px',
        background: 'var(--cal-bg-cool)',
        textAlign: 'center',
      }}>
        <div className="cal-container">
          <div style={{
            maxWidth: 820, margin: '0 auto',
            fontSize: 'clamp(22px, 2.2vw, 32px)',
            fontWeight: 500, letterSpacing: '-0.02em',
            lineHeight: 1.3, color: 'var(--cal-ink)',
            textWrap: 'balance',
          }}>
            From a{' '}
            <span style={{ color: 'var(--cal-blue-ink)' }}>3-person Auckland startup</span>{' '}
            to an{' '}
            <span style={{ color: 'var(--cal-blue-ink)' }}>FTSE-100 bank in London</span>.{' '}
            <span style={{ color: 'var(--cal-muted)', fontWeight: 400 }}>
              Same pipeline, same data model, same tool.
            </span>
          </div>
        </div>
      </section>

      {/* ──────────────── CUSTOMER QUOTES (white — swapped with Placement Spread per new rhythm) ──────────────── */}
      <section className="cal-section" style={{ padding: '100px 72px', background: '#fff' }}>
        <div className="cal-container">
          <div style={{ maxWidth: 720, marginBottom: 40 }}>
            <div className="cal-eyebrow" style={{ marginBottom: 18 }}>
              <CalStar size={11} grad={false} style={{ color: 'var(--cal-blue-ink)' }} /> How we'd sell you Caliber
            </div>
            <h2 style={{ margin: '0 0 14px' }}>
              If we were sitting across from you,{' '}
              <span style={{ color: 'var(--cal-blue-ink)' }}>here's what we'd say.</span>
            </h2>
            <p style={{ margin: 0, fontSize: 17, color: 'var(--cal-body)', lineHeight: 1.55, maxWidth: 600 }}>
              Three honest reasons agencies trial Caliber. Not pitch deck reasons — the ones that come up after the demo.
            </p>
          </div>
          {/* 3-up honest cards */}
          <div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 20 }}>
            {[
              {
                n: '01',
                title: 'ATS + CRM + Scout. One subscription.',
                body: "You're currently paying four vendors for things that should talk to each other. Caliber is one screen, one bill, one login. The integration tax disappears.",
                cta: 'See what\'s included →',
                bg: 'var(--cal-blue-ink)', dark: true,
              },
              {
                n: '02',
                title: '14-day trial. No credit card. Real data.',
                body: "We don't demo against a fake environment. Bring your own candidates or use ours. If it doesn't click in 14 days, you walk with your data and no invoice.",
                cta: 'Start the trial →',
                bg: '#fff', dark: false,
              },
              {
                n: '03',
                title: 'Free migration. And we absorb the overlap.',
                body: "We move your candidates, notes, pipelines and contracts. And if your current tool has months left on contract, we absorb the overlap so you're not double-paying.",
                cta: 'Claim your buyout →',
                bg: '#fff', dark: false,
              },
            ].map((c) => (
              <div key={c.n} style={{
                background: c.bg,
                border: c.dark ? 'none' : '1px solid var(--cal-line)',
                borderRadius: 20,
                padding: '28px 26px',
                display: 'flex', flexDirection: 'column', gap: 14,
                position: 'relative', overflow: 'hidden',
                boxShadow: c.dark ? '0 30px 60px -20px rgba(0,9,182,0.35)' : 'none',
              }}>
                {c.dark && <div className="cal-noise" />}
                <div style={{ position: 'relative' }}>
                  <div style={{
                    fontSize: 11, fontWeight: 700, letterSpacing: '0.14em',
                    color: c.dark ? 'rgba(255,255,255,0.45)' : 'var(--cal-muted)',
                    fontFamily: 'ui-monospace, "SF Mono", Menlo, monospace',
                    marginBottom: 10,
                  }}>{c.n}</div>
                  <div style={{
                    fontSize: 20, fontWeight: 500, letterSpacing: '-0.015em',
                    lineHeight: 1.2, marginBottom: 10,
                    color: c.dark ? '#fff' : 'var(--cal-ink)',
                  }}>{c.title}</div>
                  <div style={{
                    fontSize: 14.5, lineHeight: 1.55,
                    color: c.dark ? 'rgba(255,255,255,0.78)' : 'var(--cal-body)',
                  }}>{c.body}</div>
                </div>
                <a href="#" style={{
                  marginTop: 'auto',
                  fontSize: 13.5, fontWeight: 500,
                  color: c.dark ? 'var(--cal-accent)' : 'var(--cal-blue-ink)',
                  textDecoration: 'none',
                  display: 'inline-flex', alignItems: 'center', gap: 4,
                }}>{c.cta}</a>
              </div>
            ))}
          </div>
        </div>
      </section>

      {/* ──────────────── MIGRATION + BUYOUT (dark set-piece) ──────────────── */}
      <BuyoutSection />

      {/* Security section PARKED per audit S13 — removed until SOC 2 / GDPR /
          SAML / workspace-level audit log claims can be dev-verified.
          SecurityStrip component retained in composite-sections.jsx as
          orphan for future re-ship (see HOMEPAGE-AUDIT-PLAN.md §S13-PARKED). */}

      {/* ──────────────── PRICING ──────────────── */}
      <section className="cal-section" id="pricing" style={{ padding: '100px 72px', background: 'var(--cal-bg-soft)' }}>
        <div className="cal-container">
          <div style={{ textAlign: 'center', marginBottom: 48 }}>
            <div className="cal-eyebrow" style={{ marginBottom: 16, display: 'inline-flex' }}><CalStar size={11} grad={false} style={{ color: 'var(--cal-blue-ink)' }} /> Simple pricing</div>
            <h2 style={{ margin: '0 0 12px' }}>One subscription. All of Caliber.</h2>
            <p style={{ fontSize: 17, color: 'var(--cal-body)' }}>Monthly or annual. NZD, AUD, GBP. Cancel any time.</p>
          </div>
          <Pricing />
        </div>
      </section>

      {/* ──────────────── FAQ ──────────────── */}
      <section className="cal-section" style={{ padding: '100px 72px 80px' }}>
        <div className="cal-container">
          <FAQ />
        </div>
      </section>

      {/* ──────────────── CTA BAND (cool-blue — pairs with Caliber-brand emphasis text) ──────────────── */}
      <section className="cal-section" style={{ padding: '80px 72px 120px', background: 'var(--cal-bg-cool)' }}>
        <div className="cal-container">
          <CTABand />
        </div>
      </section>

      <Footer />
    </div>
  );
}


/* ============================================================
   MigrationTimeline — horizontal 4-step Day 0 → Day 30 timeline.
   Deliberately flat and trust-forward.
   ============================================================ */
const MIGRATION_STEPS = [
  {
    day: 'Day 0',
    title: 'Kick-off call',
    body: 'We scope your ATS exports, seats, and renewal date. You sign nothing yet.',
    color: 'var(--cal-blue-ink)',
  },
  {
    day: 'Day 3',
    title: 'Buy-out confirmed',
    body: 'We cover your remaining LinkedIn Recruiter term up to NZ$60k / seat.',
    color: 'var(--cal-accent)',
  },
  {
    day: 'Day 10',
    title: 'Data migrated',
    body: 'Candidates, notes, pipelines, contracts. Nothing is left behind. Nothing is manual.',
    color: '#7C3AED',
  },
  {
    day: 'Day 30',
    title: 'First placement on Scout',
    body: 'Average time to first placement once the team is trained. Most teams beat it.',
    color: '#22C55E',
  },
];

function MigrationTimeline() {
  return (
    <section className="cal-section" style={{
      padding: '100px 72px', background: 'var(--cal-blue-ink)', color: '#fff',
      position: 'relative', overflow: 'hidden',
    }}>
      <div className="cal-noise" />
      <div className="cal-container" style={{ position: 'relative' }}>
        <div style={{ maxWidth: 680, marginBottom: 48 }}>
          <div className="cal-eyebrow" style={{
            marginBottom: 18, background: 'rgba(255,255,255,0.08)',
            color: '#fff', border: '1px solid rgba(255,255,255,0.15)',
          }}>
            <CalStar size={11} grad={false} style={{ color: '#fff' }} /> Migration
          </div>
          <h2 style={{ margin: 0, color: '#fff' }}>
            30 days from contract to <span style={{ color: 'var(--cal-accent)' }}>first placement.</span>
          </h2>
        </div>

        <div style={{ position: 'relative' }}>
          {/* Rail */}
          <div style={{
            position: 'absolute', top: 20, left: '6%', right: '6%', height: 2,
            background: 'rgba(255,255,255,0.15)',
          }} />
          <div style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 24, position: 'relative' }}>
            {MIGRATION_STEPS.map((s, i) => (
              <div key={s.day} style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
                {/* Dot */}
                <div style={{
                  width: 40, height: 40, borderRadius: 999,
                  background: s.color, border: '4px solid var(--cal-blue-ink)',
                  display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
                  color: '#fff', fontSize: 13, fontWeight: 700,
                  boxShadow: `0 0 0 1px ${s.color}`,
                }}>{i + 1}</div>

                <div>
                  <div style={{
                    fontSize: 11, fontWeight: 600, letterSpacing: '0.12em',
                    textTransform: 'uppercase', color: s.color, marginBottom: 4,
                  }}>{s.day}</div>
                  <div style={{ fontSize: 18, fontWeight: 500, letterSpacing: '-0.015em', marginBottom: 6, color: '#fff' }}>
                    {s.title}
                  </div>
                  <div style={{ fontSize: 13.5, color: 'rgba(255,255,255,0.7)', lineHeight: 1.55 }}>
                    {s.body}
                  </div>
                </div>
              </div>
            ))}
          </div>
        </div>
      </div>
    </section>
  );
}

Object.assign(window, { VariantJ, MigrationTimeline });
