const { useState, useEffect, useRef } = React;

const C = {
  bg: "#F7F3EF", fg: "#3B2F28", muted: "#9A8673", border: "#E5DDD3",
  accent: "#B8845C", dark: "#3B2F28", alt: "#F0EAE3",
  peach: "#F4C9A8", sage: "#BFCBA8", butter: "#F2DDA4", plum: "#C9A3A3", sky: "#B8C9D6",
};

/* Soft tinted gradients for build cards & accents */
const TINTS = [
  { bg: "linear-gradient(135deg, #F4C9A8 0%, #E8A87C 100%)", fg: "#5C3A1F", letter: "P" },
  { bg: "linear-gradient(135deg, #BFCBA8 0%, #9CB088 100%)", fg: "#2F3D24", letter: "C" },
  { bg: "linear-gradient(135deg, #F2DDA4 0%, #E5C870 100%)", fg: "#5C4A1A", letter: "V" },
  { bg: "linear-gradient(135deg, #C9A3A3 0%, #B07F7F 100%)", fg: "#4A2828", letter: "I" },
  { bg: "linear-gradient(135deg, #B8C9D6 0%, #8FA6B8 100%)", fg: "#2A3D4A", letter: "B" },
  { bg: "linear-gradient(135deg, #D8C5E0 0%, #B89AC4 100%)", fg: "#3D2A48", letter: "R" },
];

/* ── Page-ready gate: keeps below-the-fold sections from animating until the hero entrance finishes ── */
const REVEAL_GATE_MS = 3400;
let __revealReady = false;
const __revealListeners = new Set();
if (typeof window !== "undefined") {
  setTimeout(() => { __revealReady = true; __revealListeners.forEach(fn => fn()); }, REVEAL_GATE_MS);
}
function useRevealReady() {
  const [r, setR] = useState(__revealReady);
  useEffect(() => {
    if (__revealReady) { setR(true); return; }
    const fn = () => setR(true);
    __revealListeners.add(fn);
    return () => __revealListeners.delete(fn);
  }, []);
  return r;
}

/* ── Scroll reveal ── */
function useReveal(t = 0.08) {
  const ref = useRef(null);
  const [v, setV] = useState(false);
  const ready = useRevealReady();
  useEffect(() => {
    if (!ready) return;
    const el = ref.current; if (!el) return;
    const o = new IntersectionObserver(([e]) => { if (e.isIntersecting) { setV(true); o.unobserve(el); } }, { threshold: t });
    o.observe(el); return () => o.disconnect();
  }, [t, ready]);
  return [ref, v];
}
function R({ children, delay = 0, style = {}, from = "bottom" }) {
  const [ref, v] = useReveal();
  const transforms = { bottom: "translateY(48px)", left: "translateX(-48px)", right: "translateX(48px)", scale: "scale(0.92)" };
  return (
    <div ref={ref} style={{ ...style, opacity: v ? 1 : 0, transform: v ? "translateY(0) translateX(0) scale(1)" : transforms[from] || transforms.bottom, transition: `opacity 1.4s cubic-bezier(.22,1,.36,1) ${delay}s, transform 1.4s cubic-bezier(.22,1,.36,1) ${delay}s` }}>
      {children}
    </div>
  );
}

/* ── 3D Tilt Card ── */
function TiltCard({ children, style = {}, dark = false }) {
  const ref = useRef(null);
  const [transform, setTransform] = useState("perspective(800px) rotateX(0) rotateY(0)");
  const [shadow, setShadow] = useState(dark ? "0 4px 20px rgba(0,0,0,0.2)" : "0 2px 12px rgba(0,0,0,0.04)");
  const handleMove = (e) => {
    const rect = ref.current.getBoundingClientRect();
    const x = (e.clientX - rect.left) / rect.width - 0.5;
    const y = (e.clientY - rect.top) / rect.height - 0.5;
    setTransform(`perspective(800px) rotateY(${x * 6}deg) rotateX(${-y * 6}deg) translateY(-4px)`);
    setShadow(dark ? "0 20px 60px rgba(0,0,0,0.35)" : "0 20px 60px rgba(0,0,0,0.1)");
  };
  const handleLeave = () => {
    setTransform("perspective(800px) rotateX(0) rotateY(0) translateY(0)");
    setShadow(dark ? "0 4px 20px rgba(0,0,0,0.2)" : "0 2px 12px rgba(0,0,0,0.04)");
  };
  return (
    <div ref={ref} onMouseMove={handleMove} onMouseLeave={handleLeave}
      style={{ ...style, transform, boxShadow: shadow, transition: "transform 0.4s cubic-bezier(.16,1,.3,1), box-shadow 0.4s cubic-bezier(.16,1,.3,1)", willChange: "transform" }}>
      {children}
    </div>
  );
}

/* ── Magnetic button ── */
function MagButton({ children, href, className = "", style = {}, target, rel }) {
  const ref = useRef(null);
  const [offset, setOffset] = useState({ x: 0, y: 0 });
  const handleMove = (e) => {
    const rect = ref.current.getBoundingClientRect();
    const x = (e.clientX - rect.left - rect.width / 2) * 0.15;
    const y = (e.clientY - rect.top - rect.height / 2) * 0.15;
    setOffset({ x, y });
  };
  const handleLeave = () => setOffset({ x: 0, y: 0 });
  return (
    <a ref={ref} href={href} target={target} rel={rel} className={className} onMouseMove={handleMove} onMouseLeave={handleLeave}
      style={{ ...style, transform: `translate(${offset.x}px, ${offset.y}px)`, transition: "transform 0.3s cubic-bezier(.16,1,.3,1)" }}>
      {children}
    </a>
  );
}

function Styles() {
  return (<style>{`
    *{margin:0;padding:0;box-sizing:border-box}
    html{scroll-behavior:smooth}
    body{background:#F7F3EF;color:#3B2F28;font-family:'Inter',system-ui,sans-serif;-webkit-font-smoothing:antialiased;overflow-x:hidden;position:relative}
    body::before{
      content:'';position:fixed;inset:0;pointer-events:none;z-index:1;opacity:0.45;mix-blend-mode:multiply;
      background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.23 0 0 0 0 0.18 0 0 0 0 0.15 0 0 0 0.08 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    }
    ::selection{background:#3B2F28;color:#F7F3EF}
    .serif{font-family:'Outfit',sans-serif}
    .wrap{max-width:1480px;margin:0 auto;padding:0 48px;position:relative;z-index:2}
    @media(max-width:768px){.wrap{padding:0 24px}}
    .s{padding:120px 0;position:relative;overflow:hidden}
    @media(max-width:768px){.s{padding:72px 0}}
    .g2{display:grid;grid-template-columns:1fr 1fr;gap:20px}
    .g3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
    .ga{display:grid;grid-template-columns:320px 1fr;gap:72px;align-items:center}
    @media(max-width:768px){.g2,.g3,.ga{grid-template-columns:1fr}.ga{gap:40px}}
    /* Workshops gallery */
    .ws-grid{display:grid;grid-template-columns:1.05fr 1fr;gap:16px;align-items:stretch}
    .ws-talks{display:grid;grid-template-columns:1fr 1fr;gap:16px}
    @media(max-width:860px){.ws-grid{grid-template-columns:1fr}}
    @media(max-width:480px){.ws-talks{grid-template-columns:1fr}}
    .ws-card{position:relative;border-radius:18px;overflow:hidden;border:1px solid #E5DDD3;box-shadow:0 10px 30px rgba(0,0,0,0.07);background:#fff;height:100%}
    .ws-card img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .6s cubic-bezier(.22,1,.36,1)}
    .ws-talk img{aspect-ratio:3/2}
    .ws-feature img{height:100%;min-height:260px}
    .ws-card:hover img{transform:scale(1.045)}
    .ws-cap{position:absolute;left:0;right:0;bottom:0;padding:28px 16px 12px;font-size:0.75rem;font-weight:500;letter-spacing:0.01em;color:#fff;background:linear-gradient(0deg,rgba(0,0,0,0.6),transparent);z-index:2}
    .btn{display:inline-flex;align-items:center;gap:8px;padding:12px 24px;font-size:0.875rem;font-weight:500;border-radius:100px;cursor:pointer;text-decoration:none;font-family:inherit;border:none;white-space:nowrap;transition:all 0.3s cubic-bezier(.16,1,.3,1)}
    .btn:active{transform:scale(0.96)!important}
    .btn-dark{background:#3B2F28;color:#FFF}
    .btn-dark:hover{background:#1f1813;box-shadow:0 4px 20px rgba(0,0,0,0.15)}
    .btn-outline{background:transparent;border:1.5px solid #E5DDD3;color:#3B2F28}
    .btn-outline:hover{border-color:#3B2F28;background:rgba(0,0,0,0.02)}
    .btn-light-outline{background:transparent;border:1.5px solid rgba(247,243,239,0.3);color:#F7F3EF}
    .btn-light-outline:hover{border-color:rgba(247,243,239,0.7);background:rgba(247,243,239,0.05)}
    .btn-accent{background:#B8845C;color:#FFF}
    .btn-accent:hover{background:#A67548;box-shadow:0 4px 20px rgba(184,132,92,0.3)}
    .nav-link{text-decoration:none;font-size:0.8125rem;color:#888;position:relative;padding:4px 0}
    .nav-link::after{content:'';position:absolute;bottom:0;left:0;width:0;height:1px;background:#B8845C;transition:width 0.3s cubic-bezier(.16,1,.3,1)}
    .nav-link:hover{color:#3B2F28}
    .nav-link:hover::after{width:100%}
    .eyebrow{display:inline-flex;align-items:center;gap:14px;font-size:0.6875rem;font-weight:600;color:#B8845C;letter-spacing:0.18em;text-transform:uppercase;margin-bottom:28px}
    .eyebrow::before{content:'';width:32px;height:1px;background:currentColor;display:inline-block}
    .eyebrow .dot{display:none}
    .eyebrow.eyebrow-dark{color:#B8845C}
    .chip{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;border-radius:100px;font-size:0.6875rem;font-weight:500;background:rgba(255,253,251,0.9);border:1px solid #E5DDD3;color:#3B2F28;white-space:nowrap;backdrop-filter:blur(8px);transition:transform 0.3s cubic-bezier(.16,1,.3,1)}
    .chip:hover{transform:translateY(-2px)}
    .chip .swatch{width:8px;height:8px;border-radius:50%}
    .blob{position:absolute;border-radius:50%;filter:blur(70px);pointer-events:none;will-change:transform}
    .grain-card{position:relative}
    .grain-card::after{
      content:'';position:absolute;inset:0;pointer-events:none;border-radius:inherit;opacity:0.35;mix-blend-mode:overlay;
      background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.08 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    }
    @keyframes float{0%,100%{transform:translateY(0)}50%{transform:translateY(8px)}}
    @keyframes drift1{0%,100%{transform:translate(0,0) scale(1)}33%{transform:translate(40px,-30px) scale(1.08)}66%{transform:translate(-30px,40px) scale(0.94)}}
    @keyframes drift2{0%,100%{transform:translate(0,0) scale(1)}50%{transform:translate(-60px,30px) scale(1.12)}}
    @keyframes drift3{0%,100%{transform:translate(0,0) scale(1)}40%{transform:translate(30px,50px) scale(0.9)}80%{transform:translate(-40px,-20px) scale(1.1)}}
    @keyframes marquee{from{transform:translateX(0)}to{transform:translateX(-50%)}}
    @keyframes breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.03)}}
    @keyframes wordIn{from{transform:translateY(28px);opacity:0;filter:blur(10px)}to{transform:translateY(0);opacity:1;filter:blur(0)}}
    @keyframes logoFly{
      0%{transform:translate(45vw, 70vh) scale(0.25) rotate(-65deg);opacity:0;filter:blur(18px)}
      18%{opacity:1}
      55%{transform:translate(18vw, 28vh) scale(0.55) rotate(-35deg);opacity:1;filter:blur(6px)}
      80%{transform:translate(-12px, -10px) scale(1.08) rotate(2deg);opacity:1;filter:blur(0)}
      90%{transform:translate(4px, 3px) scale(0.97) rotate(-0.6deg)}
      100%{transform:translate(0,0) scale(1) rotate(0);opacity:1;filter:blur(0)}
    }
    @keyframes logoLetter{0%{opacity:0;transform:translateY(28px);filter:blur(10px)}100%{opacity:1;transform:translateY(0);filter:blur(0)}}
    .logo-letter{display:inline-block;animation:logoLetter 1.25s cubic-bezier(.22,1,.36,1) both}
    /* Dots 1 and 2 roll right and merge into dot 3 — three dots become one */
    @keyframes dotMergeIn{
      0%  {transform:translate(0, 0) rotate(0) scale(1, 1);opacity:1}
      14% {transform:translate(0, -2px) rotate(0) scale(1, 1);opacity:1}
      78% {transform:translate(var(--merge-x, 0px), 0) rotate(var(--merge-rot, 360deg)) scale(1, 1);opacity:1}
      90% {transform:translate(var(--merge-x, 0px), 0) rotate(var(--merge-rot, 360deg)) scale(0.5, 1.1);opacity:0.5}
      100%{transform:translate(var(--merge-x, 0px), 0) rotate(var(--merge-rot, 360deg)) scale(0, 1);opacity:0}
    }
    /* Dot 3 holds while 1+2 roll in, absorbs them, tips over the cliff, free-falls, then explodes */
    @keyframes dotDropPoof{
      0%  {transform:translate(0, 0) scale(1, 1);opacity:1}
      28% {transform:translate(0, 0) scale(1, 1);opacity:1}
      32% {transform:translate(0, 0) scale(1.22, 0.84);opacity:1}
      36% {transform:translate(0, -3px) scale(1, 1);opacity:1}
      42% {transform:translate(0, 1px) scale(1, 1);opacity:1}
      48% {transform:translate(var(--drop-x, 0px), calc(var(--drop-y, 36vh) * 0.09)) scale(1, 1);opacity:1}
      56% {transform:translate(var(--drop-x, 0px), calc(var(--drop-y, 36vh) * 0.34)) scale(1, 1);opacity:1}
      64% {transform:translate(var(--drop-x, 0px), calc(var(--drop-y, 36vh) * 0.66)) scale(1, 1);opacity:1}
      72% {transform:translate(var(--drop-x, 0px), var(--drop-y, 36vh)) scale(1.7, 0.42);opacity:1}
      82% {transform:translate(var(--drop-x, 0px), var(--drop-y, 36vh)) scale(2.8, 0.14);opacity:0.45}
      100%{transform:translate(var(--drop-x, 0px), var(--drop-y, 36vh)) scale(4, 0);opacity:0}
    }
    /* Particle burst at the landing point */
    @keyframes poofParticle{
      0%  {transform:translate(-50%, -50%) translate(0, 0) scale(0);opacity:0}
      10% {transform:translate(-50%, -50%) translate(calc(var(--px,0px) * 0.18), calc(var(--py,0px) * 0.18)) scale(1);opacity:1}
      55% {transform:translate(-50%, -50%) translate(calc(var(--px,0px) * 0.85), calc(var(--py,0px) * 0.85)) scale(0.8);opacity:0.85}
      100%{transform:translate(-50%, -50%) translate(var(--px,0px), var(--py,0px)) scale(0.15);opacity:0}
    }
    /* Expanding shockwave ring */
    @keyframes poofRing{
      0%  {transform:translate(-50%,-50%) scale(0);opacity:0}
      15% {transform:translate(-50%,-50%) scale(0.4);opacity:0.9}
      100%{transform:translate(-50%,-50%) scale(3.4);opacity:0}
    }
    .ellipsis-drop{display:inline-block;margin-left:0.06em;font-size:1.4em;line-height:0.85;position:relative}
    .dot-fall{display:inline-block;will-change:transform;transform-origin:50% 95%}
    .ellipsis-drop.is-falling .dot-fall:nth-child(1){animation:dotMergeIn 0.62s cubic-bezier(.55,.05,.4,1) 0s both}
    .ellipsis-drop.is-falling .dot-fall:nth-child(2){animation:dotMergeIn 0.55s cubic-bezier(.55,.05,.4,1) 0.04s both}
    .ellipsis-drop.is-falling .dot-fall:nth-child(3){animation:dotDropPoof 1.5s cubic-bezier(.55,.05,.4,1) 0s both}
    .poof-burst{position:fixed;top:0;left:0;width:0;height:0;pointer-events:none;z-index:5;opacity:0;will-change:transform}
    .ellipsis-drop.is-falling .poof-burst{opacity:1}
    .poof-particle{position:absolute;top:0;left:0;width:5px;height:5px;border-radius:50%;background:#F7F3EF;box-shadow:0 0 8px rgba(247,243,239,0.9), 0 0 16px rgba(184,132,92,0.55);opacity:0;will-change:transform,opacity}
    .ellipsis-drop.is-falling .poof-particle{animation:poofParticle 0.85s cubic-bezier(.18,.7,.4,1) 1.05s both}
    .poof-ring{position:absolute;top:0;left:0;width:32px;height:32px;border-radius:50%;border:1.5px solid rgba(247,243,239,0.85);opacity:0;box-shadow:0 0 12px rgba(184,132,92,0.45);will-change:transform,opacity}
    .ellipsis-drop.is-falling .poof-ring{animation:poofRing 0.95s cubic-bezier(.18,.7,.4,1) 1.05s both}
    .dot-fade{display:inline-block;animation:logoLetter 0.7s cubic-bezier(.22,1,.36,1) both}
    .ellipsis-drop.dissolved{opacity:0;transition:opacity 0.9s cubic-bezier(.22,1,.36,1)}
    @keyframes appPop{
      0%{transform:scale(0) rotate(-12deg);opacity:0}
      60%{transform:scale(1.18) rotate(4deg);opacity:0.5}
      80%{transform:scale(0.94) rotate(-1deg);opacity:0.4}
      100%{transform:scale(1) rotate(0);opacity:0.35}
    }
    @keyframes wordPop{
      0%{transform:scale(0);opacity:0;filter:blur(6px)}
      55%{transform:scale(1.25);opacity:1;filter:blur(0)}
      80%{transform:scale(0.9)}
      100%{transform:scale(1);opacity:1}
    }
    .ai-logos{position:relative;z-index:5;display:flex;justify-content:center;gap:18px;margin-top:48px;flex-wrap:wrap;pointer-events:none}
    .ai-logo{width:56px;height:56px;border-radius:14px;display:flex;align-items:center;justify-content:center;font-family:'Outfit',sans-serif;font-weight:700;font-size:1.375rem;box-shadow:0 8px 24px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.18);opacity:0;will-change:transform,opacity}
    .ai-logos.is-popped .ai-logo{animation:appPop 0.62s cubic-bezier(.34,1.4,.5,1) both}
    .ai-logos.is-popped .ai-logo:nth-child(1){animation-delay:0s}
    .ai-logos.is-popped .ai-logo:nth-child(2){animation-delay:0.07s}
    .ai-logos.is-popped .ai-logo:nth-child(3){animation-delay:0.14s}
    .ai-logos.is-popped .ai-logo:nth-child(4){animation-delay:0.21s}
    .ai-logos.is-popped .ai-logo:nth-child(5){animation-delay:0.28s}
    .ai-logos.is-popped .ai-logo:nth-child(6){animation-delay:0.35s}
    .ai-logos.is-popped .ai-logo:nth-child(7){animation-delay:0.42s}
    @keyframes wcSlideIn{0%{transform:translateY(0.6em);opacity:0;filter:blur(8px)}100%{transform:translateY(0);opacity:1;filter:blur(0)}}
    @keyframes wcSlideOut{0%{transform:translateY(0);opacity:1;filter:blur(0)}100%{transform:translateY(-0.6em);opacity:0;filter:blur(8px)}}
    @keyframes confettiBurst{
      0%{transform:translate(0,0) rotate(0);opacity:0}
      8%{opacity:1}
      55%{transform:translate(var(--bx,0px),var(--by,-80px)) rotate(var(--end-r, 240deg));opacity:1}
      100%{transform:translate(calc(var(--bx,0px) * 1.15),calc(var(--by,-80px) + 90px)) rotate(calc(var(--end-r, 240deg) * 1.4));opacity:0}
    }
    .stag-word{display:inline-block;animation:wordIn 1.25s cubic-bezier(.22,1,.36,1) both;padding-right:0.22em}
    .confetti-piece{position:absolute;pointer-events:none;border-radius:2px}
    @keyframes shimmer{0%{background-position:200% center}100%{background-position:-200% center}}
    @keyframes fadeUp{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
    @keyframes spin-slow{from{transform:translate(-50%,-50%) rotate(0deg)}to{transform:translate(-50%,-50%) rotate(360deg)}}
    @keyframes scrollCue{0%{transform:translateY(-100%)}50%{transform:translateY(100%)}100%{transform:translateY(100%)}}
    @keyframes chevronBob{0%,100%{transform:translateY(0);opacity:0.55}50%{transform:translateY(5px);opacity:0.95}}
    @keyframes shineSweep{
      0%{transform:translateX(-260px) skewX(-22deg);opacity:0}
      8%{opacity:0.95}
      92%{opacity:0.95}
      100%{transform:translateX(calc(100vw + 260px)) skewX(-22deg);opacity:0}
    }
    @keyframes twinkle{0%,100%{opacity:var(--o,0.4);transform:scale(1)}50%{opacity:0.9;transform:scale(1.4)}}
    @keyframes starFlash{0%,80%,100%{opacity:var(--o,0.3);transform:scale(1)}88%{opacity:1;transform:scale(2.6)}94%{opacity:0.9;transform:scale(1.5)}}
    @keyframes ringSpin{from{transform:rotateZ(0deg)}to{transform:rotateZ(360deg)}}
    @keyframes wordOrbitIn{
      0%{transform:translate(var(--sx),var(--sy)) rotate(var(--sr)) scale(0.35);opacity:0;filter:blur(14px)}
      55%{transform:translate(calc(var(--sx) * 0.25),calc(var(--sy) * 0.25)) rotate(calc(var(--sr) * 0.3)) scale(0.78);opacity:0.7;filter:blur(4px)}
      85%{transform:translate(0,0) rotate(0) scale(1.04);opacity:1;filter:blur(0)}
      100%{transform:translate(0,0) rotate(0) scale(1);opacity:1;filter:blur(0)}
    }
    .hero-word{display:inline-block;opacity:0;will-change:transform,opacity,filter;transform:translate(var(--sx,0),var(--sy,0)) rotate(var(--sr,0)) scale(0.35);filter:blur(14px)}
    .hero-word.is-in{animation:wordOrbitIn 1.65s cubic-bezier(.22,1,.36,1) forwards}
    .hero-word-accent.is-in{background:linear-gradient(90deg,#B8845C,#D4A574,#F4C9A8,#B8845C);background-size:200% auto;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:wordOrbitIn 1.65s cubic-bezier(.22,1,.36,1) forwards,shimmer 4s linear 2.5s infinite}
    .hero-scroll-cue{position:absolute;bottom:24px;left:50%;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:8px;z-index:3}
    @media(max-height:720px){.hero-scroll-cue{display:none}}
    @keyframes blink{0%,100%{opacity:1}50%{opacity:0}}
    @keyframes dotPulse{0%,80%,100%{opacity:0.3;transform:scale(0.8)}40%{opacity:1;transform:scale(1)}}
    @media(max-width:768px){.vibe-grid{grid-template-columns:1fr!important}}
    .faq-answer{overflow:hidden;transition:max-height 0.5s cubic-bezier(.16,1,.3,1),opacity 0.4s ease}
    .faq-answer>p{animation:fadeUp 0.3s ease forwards}
    nav, [data-z-top]{z-index:100}
  `}</style>);
}

/* ── NAV ── */
function Nav() {
  const [scrolled, setScrolled] = useState(false);
  const [menuOpen, setMenuOpen] = useState(false);
  const [isMobile, setIsMobile] = useState(false);
  const [loaded, setLoaded] = useState(false);
  const [scrollY, setScrollY] = useState(0);
  useEffect(() => {
    const NAV_REVEAL_MS = 200;
    const timer = setTimeout(() => setLoaded(true), NAV_REVEAL_MS);
    const h = () => {
      setScrolled(window.scrollY > 50);
      setScrollY(window.scrollY);
      if (window.scrollY > 30) setLoaded(true);
    };
    const r = () => setIsMobile(window.innerWidth <= 768);
    h(); r();
    window.addEventListener("scroll", h, { passive: true }); window.addEventListener("resize", r);
    return () => { clearTimeout(timer); window.removeEventListener("scroll", h); window.removeEventListener("resize", r); };
  }, []);
  const navScatter = Math.min(1, Math.max(0, (scrollY - 50) / 550));
  return (
    <React.Fragment>
      <nav style={{
        position: "fixed", top: 0, left: 0, right: 0, zIndex: 100, height: 64,
        display: "flex", alignItems: "center", justifyContent: "center",
        background: scrolled ? "rgba(247,243,239,0.88)" : "transparent",
        backdropFilter: scrolled ? "blur(20px) saturate(180%)" : "none",
        WebkitBackdropFilter: scrolled ? "blur(20px) saturate(180%)" : "none",
        borderBottom: scrolled ? "1px solid rgba(0,0,0,0.06)" : "1px solid transparent",
        opacity: 1,
        transform: "translateY(0)",
        transition: "background 0.5s cubic-bezier(.16,1,.3,1), border-color 0.5s",
      }}>
        <div className="wrap" style={{ display: "flex", justifyContent: "space-between", alignItems: "center", width: "100%" }}>
          <a href="#" style={{ textDecoration: "none", fontSize: "1.375rem", fontWeight: 600, color: scrolled ? C.fg : "#F7F3EF", letterSpacing: "-0.02em", transition: "color 0.4s", opacity: loaded ? 1 : 0 }}
            onMouseEnter={e => e.currentTarget.style.opacity = 0.6} onMouseLeave={e => e.currentTarget.style.opacity = 1}>
            {loaded && "The Rec Lab".split(" ").map((w, i) => {
              const seed = i * 17 + 3;
              const r1 = ((seed * 9301 + 49297) % 233280) / 233280;
              const r2 = ((seed * 2731 + 12345) % 100) / 100;
              const r3 = ((seed * 4567 + 7654) % 100) / 100;
              const out = r1 < 0.5 ? -1 : 1;
              const sx = out * (60 + r1 * 200);
              const sy = -(40 + r2 * 160);
              const sr = (r3 - 0.5) * 80;
              const p = navScatter;
              return (
                <span key={i} className="stag-word" style={{
                  animationDelay: `${i * 0.29}s`, paddingRight: i < 2 ? "0.22em" : "0",
                  display: "inline-block",
                  transform: `translate(${sx * p}px, ${sy * p}px) rotate(${sr * p}deg)`,
                  opacity: Math.max(0, 1 - p * 1.3),
                  filter: `blur(${p * 3}px)`,
                  transition: "transform 0.5s cubic-bezier(.22,1,.36,1), opacity 0.5s cubic-bezier(.22,1,.36,1), filter 0.5s cubic-bezier(.22,1,.36,1)",
                }}>{w}</span>
              );
            })}
            {loaded && (
              <span className="ellipsis-drop" id="ellipsis-anchor" aria-hidden="true">
                <span className="dot-fall">
                  <span className="dot-fade" style={{ animationDelay: "0.76s" }}>.</span>
                </span>
                <span className="dot-fall">
                  <span className="dot-fade" style={{ animationDelay: "0.82s" }}>.</span>
                </span>
                <span className="dot-fall">
                  <span className="dot-fade" style={{ animationDelay: "0.88s" }}>.</span>
                </span>
                <span className="poof-burst" aria-hidden="true">
                  <span className="poof-ring" />
                  {Array.from({ length: 12 }).map((_, i) => {
                    const angle = (i / 12) * Math.PI * 2;
                    const reach = 34 + ((i * 7) % 12);
                    return (
                      <span key={i} className="poof-particle" style={{
                        "--px": `${Math.cos(angle) * reach}px`,
                        "--py": `${Math.sin(angle) * reach}px`,
                        animationDelay: `${1.05 + (i % 3) * 0.025}s`,
                      }} />
                    );
                  })}
                </span>
              </span>
            )}
          </a>
        </div>
      </nav>
    </React.Fragment>
  );
}

/* ── SERVICES (editorial, restrained) ── */
function ServiceBlock({ s, index, dark }) {
  return (
    <div style={{
      background: dark ? C.dark : "transparent",
      color: dark ? "#F7F3EF" : C.fg,
      padding: dark ? "96px 64px" : "0",
      borderRadius: dark ? 4 : 0,
      position: "relative",
    }}>
      {/* Header row: 01 / Training — title and description */}
      <div style={{
        display: "grid",
        gridTemplateColumns: "minmax(120px, 200px) 1fr",
        gap: "0 80px",
        marginBottom: 72,
        alignItems: "baseline",
      }}>
        <div style={{
          fontSize: "0.75rem",
          fontWeight: 600,
          letterSpacing: "0.18em",
          textTransform: "uppercase",
          color: dark ? "rgba(247,243,239,0.55)" : C.muted,
          whiteSpace: "nowrap",
        }}>
          {String(index).padStart(2, "0")} &nbsp;/&nbsp; {s.label}
        </div>
        <div>
          <h3 className="serif" style={{
            fontSize: "clamp(2.25rem, 4vw, 3.5rem)",
            fontWeight: 400,
            letterSpacing: "-0.025em",
            lineHeight: 1.05,
            marginBottom: 32,
            maxWidth: 820,
            color: dark ? "#F7F3EF" : C.fg,
          }}>{s.title}</h3>
          <p style={{
            fontSize: "1.0625rem",
            lineHeight: 1.7,
            color: dark ? "rgba(247,243,239,0.7)" : C.muted,
            maxWidth: 620,
          }}>{s.desc}</p>
        </div>
      </div>

      {/* Items list — clean editorial grid, no icons, no cards */}
      <div style={{
        display: "grid",
        gridTemplateColumns: "minmax(120px, 200px) 1fr",
        gap: "0 80px",
        marginBottom: 56,
      }}>
        <div /> {/* left column placeholder */}
        <div style={{
          display: "grid",
          gridTemplateColumns: "repeat(2, 1fr)",
          gap: "0 64px",
        }}>
          {s.items.map(([t, sub], j) => (
            <div key={j} style={{
              padding: "22px 0",
              borderTop: `1px solid ${dark ? "rgba(247,243,239,0.12)" : "rgba(0,0,0,0.08)"}`,
              borderBottom: j >= s.items.length - 2 ? `1px solid ${dark ? "rgba(247,243,239,0.12)" : "rgba(0,0,0,0.08)"}` : "none",
              display: "flex",
              gap: 22,
              alignItems: "baseline",
            }}>
              <div style={{
                fontSize: "0.75rem",
                fontWeight: 500,
                color: dark ? "rgba(247,243,239,0.45)" : C.muted,
                fontVariantNumeric: "tabular-nums",
                flexShrink: 0,
                paddingTop: 2,
              }}>{String(j + 1).padStart(2, "0")}</div>
              <div>
                <div style={{
                  fontSize: "1rem",
                  fontWeight: 500,
                  color: dark ? "#F7F3EF" : C.fg,
                  marginBottom: 4,
                  letterSpacing: "-0.005em",
                }}>{t}</div>
                <div style={{
                  fontSize: "0.875rem",
                  color: dark ? "rgba(247,243,239,0.55)" : C.muted,
                  lineHeight: 1.55,
                }}>{sub}</div>
              </div>
            </div>
          ))}
        </div>
      </div>

      {/* CTA — editorial text link, not a button */}
      <div style={{
        display: "grid",
        gridTemplateColumns: "minmax(120px, 200px) 1fr",
        gap: "0 80px",
      }}>
        <div /> {/* left column placeholder */}
        <a href="#contact" style={{
          display: "inline-flex",
          alignItems: "center",
          gap: 10,
          fontSize: "0.9375rem",
          fontWeight: 500,
          color: dark ? "#F7F3EF" : C.fg,
          textDecoration: "none",
          padding: "8px 0",
          borderBottom: `1px solid ${dark ? "rgba(247,243,239,0.4)" : "rgba(0,0,0,0.4)"}`,
          width: "fit-content",
          letterSpacing: "-0.005em",
          transition: "border-color 0.3s, color 0.3s",
        }}
          onMouseEnter={e => {
            e.currentTarget.style.borderColor = dark ? "#F4C9A8" : C.accent;
            e.currentTarget.style.color = dark ? "#F4C9A8" : C.accent;
          }}
          onMouseLeave={e => {
            e.currentTarget.style.borderColor = dark ? "rgba(247,243,239,0.4)" : "rgba(0,0,0,0.4)";
            e.currentTarget.style.color = dark ? "#F7F3EF" : C.fg;
          }}
        >
          {s.cta}
          <span style={{ fontSize: "1.0625rem", lineHeight: 1 }}>→</span>
        </a>
      </div>
    </div>
  );
}

function Services() {
  const TRAINING = {
    label: "Training",
    title: "We teach you how to use AI",
    desc: "Whether it's one person or a team of 50, you'll walk away knowing how to use AI in your day-to-day.",
    items: [
      ["Self-paced courses & guides", "Your own time, your own pace"],
      ["Team workshops", "Half or full day, remote or in-person"],
      ["1:1 coaching", "Personalised support for career development"],
      ["Job seeker AI coaching", "Build an AI portfolio and stand out in your job search"],
    ],
    cta: "Enquire about training",
  };
  const CONSULTING = {
    label: "Consulting",
    title: "Or we can build AI RecOps for you",
    desc: "Some teams would rather have someone come in and just sort it. We'll audit your workflows, figure out where AI fits, and build it into your operations.",
    items: [
      ["Process & workflow audit", "Find where AI saves your team real time"],
      ["Tool selection & implementation", "Cut through the noise, pick what works"],
      ["Automation builds", "We build it, hand it over, train you on it"],
      ["Ongoing support & iteration", "We don't just build and disappear"],
    ],
    cta: "Enquire about consulting",
  };
  return (
    <section id="services" className="s" style={{ background: C.alt }}>
      <div className="wrap">
        <R delay={0.05}>
          <div style={{ maxWidth: 880, marginBottom: 112 }}>
            <h2 className="serif" style={{
              fontSize: "clamp(2.25rem, 5vw, 4rem)",
              fontWeight: 400,
              letterSpacing: "-0.025em",
              lineHeight: 1.05,
            }}>
              How we help recruiting teams get more value out of their AI tools.
            </h2>
          </div>
        </R>
        <div style={{ display: "flex", flexDirection: "column", gap: 96 }}>
          <R delay={0.08}><ServiceBlock s={TRAINING} index={1} /></R>
          <R delay={0.14}><ServiceBlock s={CONSULTING} index={2} dark /></R>
        </div>
        <R delay={0.2}>
          <p style={{
            fontSize: "0.875rem",
            color: C.muted,
            marginTop: 96,
            lineHeight: 1.6,
          }}>
            However your team learns best, we'll make it work. Or a mix of all.
          </p>
        </R>
      </div>
    </section>
  );
}

/* ── VIBE-CODING DEMO ── */
function ChatDemo() {
  const scenarios = [
    {
      tag: "Hiring brief",
      prompt: "Just had a screening call with Mark, Head of Eng, for a Senior Backend Engineer role. Build me the internal hiring brief.",
      response: "On it — drafting the brief from your call notes ✨",
      preview: "brief",
    },
    {
      tag: "Public JD",
      prompt: "Now turn that into a public job description we can post on LinkedIn.",
      response: "Cool — making it candidate-facing.",
      preview: "jd",
    },
    {
      tag: "Sourcing plan",
      prompt: "And the sourcing plan — target companies, channels, and 3 boolean strings.",
      response: "Got it — putting together the kickoff pack.",
      preview: "sourcing",
    },
    {
      tag: "Pipeline dashboard",
      prompt: "Pull my last 30 days of Metaview calls — build a dashboard with funnel, time-to-screen, and top rejection reasons.",
      response: "Cool — crunching your call data now.",
      preview: "dashboard",
    },
  ];

  const [scenarioIdx, setScenarioIdx] = useState(0);
  const [phase, setPhase] = useState("typing-prompt");
  const [promptText, setPromptText] = useState("");
  const [responseText, setResponseText] = useState("");
  const [buildStep, setBuildStep] = useState(0);
  const sc = scenarios[scenarioIdx];
  const PREVIEW_STEPS = 5;

  useEffect(() => {
    let t;
    if (phase === "typing-prompt") {
      if (promptText.length < sc.prompt.length) {
        t = setTimeout(() => setPromptText(sc.prompt.slice(0, promptText.length + 1)), 24 + Math.random() * 20);
      } else {
        t = setTimeout(() => setPhase("thinking"), 600);
      }
    } else if (phase === "thinking") {
      t = setTimeout(() => setPhase("claude-response"), 1100);
    } else if (phase === "claude-response") {
      if (responseText.length < sc.response.length) {
        t = setTimeout(() => setResponseText(sc.response.slice(0, responseText.length + 1)), 22 + Math.random() * 18);
      } else {
        t = setTimeout(() => setPhase("building"), 450);
      }
    } else if (phase === "building") {
      if (buildStep < PREVIEW_STEPS) {
        t = setTimeout(() => setBuildStep(s => s + 1), 340);
      } else {
        t = setTimeout(() => setPhase("done"), 3600);
      }
    } else if (phase === "done") {
      t = setTimeout(() => {
        setPromptText(""); setResponseText(""); setBuildStep(0);
        setScenarioIdx(i => (i + 1) % scenarios.length);
        setPhase("typing-prompt");
      }, 350);
    }
    return () => clearTimeout(t);
  }, [phase, promptText, responseText, buildStep, scenarioIdx]);

  const resetTo = (i) => {
    setScenarioIdx(i); setPromptText(""); setResponseText(""); setBuildStep(0); setPhase("typing-prompt");
  };

  const previewItem = (key, step, children) => (
    <div key={key} style={{
      opacity: buildStep > step ? 1 : 0,
      transform: buildStep > step ? "translateY(0) scale(1)" : "translateY(10px) scale(0.98)",
      transition: "opacity 0.5s cubic-bezier(.22,1,.36,1), transform 0.5s cubic-bezier(.22,1,.36,1)",
    }}>{children}</div>
  );

  const renderPreview = () => {
    if (phase === "typing-prompt" || phase === "thinking" || phase === "claude-response") {
      return (
        <div style={{ height: "100%", display: "flex", alignItems: "center", justifyContent: "center", color: C.muted, fontSize: 11, opacity: 0.5 }}>
          <span style={{ fontFamily: "ui-monospace, monospace" }}>// preview will render here</span>
        </div>
      );
    }
    if (buildStep === 0) {
      return (
        <div style={{ height: "100%", display: "flex", alignItems: "center", justifyContent: "center", color: C.muted, fontSize: 11, gap: 8 }}>
          <span style={{ width: 8, height: 8, borderRadius: "50%", background: C.accent, animation: "dotPulse 1.2s ease-in-out infinite" }}></span>
          Generating...
        </div>
      );
    }
    if (sc.preview === "brief") {
      return (
        <div style={{ padding: "16px 18px", display: "flex", flexDirection: "column", gap: 8 }}>
          {previewItem("h", 0,
            <div style={{ paddingBottom: 8, borderBottom: `1px solid ${C.border}`, marginBottom: 2 }}>
              <div style={{ fontSize: 9, color: C.muted, textTransform: "uppercase", letterSpacing: "0.08em", fontWeight: 600, marginBottom: 2 }}>Internal · Hiring brief</div>
              <div style={{ fontSize: 13, fontWeight: 700, color: C.fg }} className="serif">Senior Backend Engineer</div>
              <div style={{ fontSize: 10, color: C.muted, marginTop: 2 }}>Hiring Manager: Mark Chen · Eng</div>
            </div>
          )}
          {previewItem("ctx", 1,
            <div>
              <div style={{ fontSize: 9, fontWeight: 700, color: C.accent, textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: 4 }}>Context from call</div>
              <div style={{ fontSize: 10.5, color: C.muted, lineHeight: 1.55 }}>Replacing senior IC who left in Q4. New hire owns the payments service. Mark wants someone hands-on, not a manager.</div>
            </div>
          )}
          {previewItem("must", 2,
            <div>
              <div style={{ fontSize: 9, fontWeight: 700, color: C.accent, textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: 4 }}>Must-haves</div>
              {["5+ yrs production Go or similar", "Distributed systems at scale", "Owned a service end-to-end"].map((t, i) => (
                <div key={i} style={{ fontSize: 10.5, color: C.fg, marginBottom: 2, display: "flex", gap: 6 }}><span style={{ color: C.accent }}>•</span>{t}</div>
              ))}
            </div>
          )}
          {previewItem("nice", 3,
            <div>
              <div style={{ fontSize: 9, fontWeight: 700, color: C.muted, textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: 4 }}>Nice-to-have</div>
              {["Fintech / payments background", "Open-source contribution"].map((t, i) => (
                <div key={i} style={{ fontSize: 10.5, color: C.muted, marginBottom: 2, display: "flex", gap: 6 }}><span>•</span>{t}</div>
              ))}
            </div>
          )}
          {previewItem("comp", 4,
            <div style={{ display: "flex", gap: 6, flexWrap: "wrap", marginTop: 4 }}>
              <span style={{ padding: "4px 9px", borderRadius: 100, background: C.alt, fontSize: 10, fontWeight: 600, color: C.fg }}>£120–140k</span>
              <span style={{ padding: "4px 9px", borderRadius: 100, background: C.alt, fontSize: 10, fontWeight: 600, color: C.fg }}>Remote · UK</span>
              <span style={{ padding: "4px 9px", borderRadius: 100, background: C.alt, fontSize: 10, fontWeight: 600, color: C.fg }}>4-stage panel</span>
            </div>
          )}
        </div>
      );
    }
    if (sc.preview === "jd") {
      return (
        <div style={{ padding: "16px 18px", display: "flex", flexDirection: "column", gap: 8 }}>
          {previewItem("h", 0,
            <div>
              <div style={{ fontSize: 9, color: C.muted, textTransform: "uppercase", letterSpacing: "0.08em", fontWeight: 600, marginBottom: 2 }}>Public · LinkedIn ready</div>
              <div className="serif" style={{ fontSize: 15, fontWeight: 600, color: C.fg, letterSpacing: "-0.01em" }}>Senior Backend Engineer</div>
              <div style={{ fontSize: 10, color: C.muted, marginTop: 1 }}>Remote · UK · £120–140k</div>
            </div>
          )}
          {previewItem("intro", 1,
            <div style={{ fontSize: 10.5, color: C.fg, lineHeight: 1.6, paddingTop: 4, borderTop: `1px solid ${C.border}` }}>
              We're looking for a senior engineer to own our payments service. You'll work directly with our Head of Engineering on services that move real money for thousands of customers.
            </div>
          )}
          {previewItem("do", 2,
            <div>
              <div style={{ fontSize: 9, fontWeight: 700, color: C.fg, textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: 4 }}>What you'll do</div>
              {["Design + ship Go services end-to-end", "Lead architectural decisions across the team", "Mentor mid-level engineers"].map((t, i) => (
                <div key={i} style={{ fontSize: 10.5, color: C.muted, marginBottom: 2, display: "flex", gap: 6 }}><span style={{ color: C.accent }}>→</span>{t}</div>
              ))}
            </div>
          )}
          {previewItem("want", 3,
            <div>
              <div style={{ fontSize: 9, fontWeight: 700, color: C.fg, textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: 4 }}>What we want</div>
              {["5+ yrs production Go (or similar)", "Distributed systems experience", "Strong opinions, held loosely"].map((t, i) => (
                <div key={i} style={{ fontSize: 10.5, color: C.muted, marginBottom: 2, display: "flex", gap: 6 }}><span style={{ color: C.accent }}>→</span>{t}</div>
              ))}
            </div>
          )}
          {previewItem("cta", 4,
            <div style={{ padding: "8px 12px", borderRadius: 8, background: C.fg, color: "#FFF", fontSize: 10.5, fontWeight: 600, textAlign: "center", marginTop: 4 }}>Apply →</div>
          )}
        </div>
      );
    }
    if (sc.preview === "sourcing") {
      return (
        <div style={{ padding: "16px 18px", display: "flex", flexDirection: "column", gap: 10 }}>
          {previewItem("h", 0,
            <div>
              <div style={{ fontSize: 9, color: C.muted, textTransform: "uppercase", letterSpacing: "0.08em", fontWeight: 600, marginBottom: 2 }}>Plan · Backend Engineer</div>
              <div className="serif" style={{ fontSize: 13, fontWeight: 600, color: C.fg }}>Sourcing strategy</div>
            </div>
          )}
          {previewItem("comp", 1,
            <div>
              <div style={{ fontSize: 9, fontWeight: 700, color: C.accent, textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: 5 }}>Target companies</div>
              <div style={{ display: "flex", gap: 5, flexWrap: "wrap" }}>
                {["Monzo", "Revolut", "Wise", "Stripe", "GoCardless", "Checkout.com"].map((co, i) => (
                  <span key={i} style={{ padding: "3px 8px", borderRadius: 100, background: C.alt, fontSize: 10, fontWeight: 500, color: C.fg }}>{co}</span>
                ))}
              </div>
            </div>
          )}
          {previewItem("ch", 2,
            <div>
              <div style={{ fontSize: 9, fontWeight: 700, color: C.accent, textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: 5 }}>Channels</div>
              <div style={{ display: "flex", gap: 5, flexWrap: "wrap" }}>
                {[["LinkedIn Recruiter", C.sky], ["GitHub", C.sage], ["Gopher Slack", C.peach], ["Referrals", C.butter]].map(([n, c], i) => (
                  <span key={i} style={{ padding: "3px 8px", borderRadius: 100, background: "#FFFDFB", border: `1px solid ${C.border}`, fontSize: 10, fontWeight: 500, color: C.fg, display: "inline-flex", alignItems: "center", gap: 5 }}>
                    <span style={{ width: 5, height: 5, borderRadius: "50%", background: c }}></span>{n}
                  </span>
                ))}
              </div>
            </div>
          )}
          {previewItem("bool", 3,
            <div>
              <div style={{ fontSize: 9, fontWeight: 700, color: C.accent, textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: 5 }}>Boolean strings</div>
              <div style={{ display: "flex", flexDirection: "column", gap: 4 }}>
                {[
                  `("Senior Backend Engineer" OR "Staff Engineer") AND Go AND payments`,
                  `"Backend" AND (Monzo OR Wise OR Revolut) AND ("5 years" OR "6 years")`,
                  `Golang AND ("distributed systems" OR microservices) AND London`,
                ].map((s, i) => (
                  <div key={i} style={{ padding: "5px 8px", borderRadius: 4, background: C.alt, fontFamily: "ui-monospace, monospace", fontSize: 9.5, color: C.fg, lineHeight: 1.4 }}>{s}</div>
                ))}
              </div>
            </div>
          )}
          {previewItem("vol", 4,
            <div style={{ display: "flex", gap: 6, marginTop: 2 }}>
              <span style={{ padding: "4px 9px", borderRadius: 100, background: C.fg, color: "#FFF", fontSize: 10, fontWeight: 600 }}>Target: 40/wk</span>
              <span style={{ padding: "4px 9px", borderRadius: 100, background: C.alt, fontSize: 10, fontWeight: 600, color: C.fg }}>Reply rate: ~18%</span>
            </div>
          )}
        </div>
      );
    }
    if (sc.preview === "dashboard") {
      const funnel = [
        { stage: "Sourced", n: 248, color: C.sky },
        { stage: "Screened", n: 42, color: C.sage },
        { stage: "Tech interview", n: 18, color: C.butter },
        { stage: "Offer", n: 8, color: C.peach },
        { stage: "Hired", n: 6, color: C.accent },
      ];
      const max = funnel[0].n;
      const rejections = [
        { r: "Comp mismatch", pct: 38 },
        { r: "Notice period", pct: 24 },
        { r: "Skills gap", pct: 21 },
        { r: "Location", pct: 17 },
      ];
      return (
        <div style={{ padding: "14px 16px", display: "flex", flexDirection: "column", gap: 10 }}>
          {previewItem("h", 0,
            <div style={{ display: "flex", justifyContent: "space-between", alignItems: "baseline", paddingBottom: 8, borderBottom: `1px solid ${C.border}` }}>
              <div>
                <div style={{ fontSize: 9, color: C.muted, textTransform: "uppercase", letterSpacing: "0.08em", fontWeight: 600 }}>Pipeline · Last 30 days</div>
                <div className="serif" style={{ fontSize: 13, fontWeight: 600, color: C.fg, marginTop: 1 }}>Metaview · Backend Engineer</div>
              </div>
              <span style={{ padding: "2px 8px", borderRadius: 100, background: C.sage, color: C.fg, fontSize: 9, fontWeight: 700 }}>LIVE</span>
            </div>
          )}
          {previewItem("kpi", 1,
            <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr 1fr", gap: 6 }}>
              {[
                { v: "42", l: "Calls" },
                { v: "6", l: "Placements" },
                { v: "14%", l: "Conv. rate", accent: true },
              ].map((k, i) => (
                <div key={i} style={{ padding: "8px 10px", borderRadius: 8, background: k.accent ? C.fg : C.alt, color: k.accent ? "#FFF" : C.fg }}>
                  <div className="serif" style={{ fontSize: 18, fontWeight: 600, lineHeight: 1, letterSpacing: "-0.02em" }}>{k.v}</div>
                  <div style={{ fontSize: 9, opacity: 0.7, marginTop: 3, textTransform: "uppercase", letterSpacing: "0.06em", fontWeight: 600 }}>{k.l}</div>
                </div>
              ))}
            </div>
          )}
          {previewItem("funnel", 2,
            <div>
              <div style={{ fontSize: 9, fontWeight: 700, color: C.accent, textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: 6 }}>Funnel</div>
              <div style={{ display: "flex", flexDirection: "column", gap: 4 }}>
                {funnel.map((f, i) => (
                  <div key={i} style={{ display: "flex", alignItems: "center", gap: 8, fontSize: 10 }}>
                    <div style={{ width: 76, color: C.muted, flexShrink: 0 }}>{f.stage}</div>
                    <div style={{ flex: 1, height: 14, background: C.alt, borderRadius: 4, overflow: "hidden" }}>
                      <div style={{
                        height: "100%", width: buildStep > 2 ? `${(f.n / max) * 100}%` : "0%",
                        background: f.color, borderRadius: 4,
                        transition: `width 0.6s cubic-bezier(.22,1,.36,1) ${0.1 + i * 0.08}s`,
                      }}></div>
                    </div>
                    <div style={{ width: 28, textAlign: "right", fontWeight: 700, color: C.fg, fontVariantNumeric: "tabular-nums" }}>{f.n}</div>
                  </div>
                ))}
              </div>
            </div>
          )}
          {previewItem("time", 3,
            <div style={{ display: "flex", gap: 8 }}>
              <div style={{ flex: 1, padding: "8px 10px", borderRadius: 8, background: C.alt }}>
                <div style={{ fontSize: 9, color: C.muted, textTransform: "uppercase", letterSpacing: "0.06em", fontWeight: 600 }}>Avg time-to-screen</div>
                <div style={{ display: "flex", alignItems: "baseline", gap: 4, marginTop: 3 }}>
                  <span className="serif" style={{ fontSize: 16, fontWeight: 600, color: C.fg }}>2.4</span>
                  <span style={{ fontSize: 10, color: C.muted }}>days</span>
                  <span style={{ marginLeft: "auto", fontSize: 9, fontWeight: 700, color: "#2F7A4A" }}>↓ 38%</span>
                </div>
              </div>
              <div style={{ flex: 1, padding: "8px 10px", borderRadius: 8, background: C.alt }}>
                <div style={{ fontSize: 9, color: C.muted, textTransform: "uppercase", letterSpacing: "0.06em", fontWeight: 600 }}>Candidate wait</div>
                <div style={{ display: "flex", alignItems: "baseline", gap: 4, marginTop: 3 }}>
                  <span className="serif" style={{ fontSize: 16, fontWeight: 600, color: C.fg }}>5.1</span>
                  <span style={{ fontSize: 10, color: C.muted }}>days</span>
                  <span style={{ marginLeft: "auto", fontSize: 9, fontWeight: 700, color: "#A6502A" }}>↑ 12%</span>
                </div>
              </div>
            </div>
          )}
          {previewItem("rej", 4,
            <div>
              <div style={{ fontSize: 9, fontWeight: 700, color: C.accent, textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: 5 }}>Top rejection reasons</div>
              <div style={{ display: "flex", flexDirection: "column", gap: 3 }}>
                {rejections.map((r, i) => (
                  <div key={i} style={{ display: "flex", alignItems: "center", gap: 8, fontSize: 10 }}>
                    <div style={{ width: 90, color: C.fg, fontWeight: 500, flexShrink: 0 }}>{r.r}</div>
                    <div style={{ flex: 1, height: 6, background: C.alt, borderRadius: 3, overflow: "hidden" }}>
                      <div style={{ height: "100%", width: buildStep > 4 ? `${r.pct}%` : "0%", background: C.plum, transition: `width 0.6s cubic-bezier(.22,1,.36,1) ${0.1 + i * 0.07}s` }}></div>
                    </div>
                    <div style={{ width: 28, textAlign: "right", fontWeight: 600, color: C.muted, fontVariantNumeric: "tabular-nums" }}>{r.pct}%</div>
                  </div>
                ))}
              </div>
            </div>
          )}
        </div>
      );
    }
    return null;
  };

  return (
    <section className="s" style={{ background: "#FFFDFB", paddingTop: 100, paddingBottom: 100 }}>
      <div className="blob" style={{ top: "20%", left: "-8%", width: 360, height: 360, background: C.sage, opacity: 0.25 }} />
      <div className="blob" style={{ bottom: "10%", right: "-5%", width: 320, height: 320, background: C.peach, opacity: 0.25 }} />
      <div className="wrap" style={{ maxWidth: 1480 }}>
        <R>
          <div style={{ textAlign: "center", marginBottom: 48 }}>
            <span className="eyebrow" style={{ marginBottom: 12 }}>Vibe-coded</span>
            <h2 className="serif" style={{ fontSize: "clamp(1.75rem, 3vw, 2.75rem)", fontWeight: 400, letterSpacing: "-0.02em", lineHeight: 1.1, marginBottom: 16, marginTop: 8 }}>
              Tell Claude what you want.<br />Watch it build.
            </h2>
            <p style={{ fontSize: "0.9375rem", color: C.muted, lineHeight: 1.7, maxWidth: 520, margin: "0 auto" }}>
              No engineering background. No drag-and-drop builder. Just plain English describing the tool you wish existed — and it appears.
            </p>
          </div>
        </R>
        <R delay={0.08}>
          <div className="grain-card" style={{
            background: "#FFFDFB", borderRadius: 20, border: `1px solid ${C.border}`,
            boxShadow: "0 24px 70px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.03)",
            overflow: "hidden",
          }}>
            <div style={{ display: "flex", alignItems: "center", gap: 8, padding: "12px 16px", borderBottom: `1px solid ${C.border}`, background: C.alt }}>
              <div style={{ display: "flex", gap: 6 }}>
                <div style={{ width: 11, height: 11, borderRadius: "50%", background: "#FF6058" }}></div>
                <div style={{ width: 11, height: 11, borderRadius: "50%", background: "#FFBC2D" }}></div>
                <div style={{ width: 11, height: 11, borderRadius: "50%", background: "#28C940" }}></div>
              </div>
              <div style={{ flex: 1, textAlign: "center", fontSize: "0.6875rem", color: C.muted, fontWeight: 500, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }}>
                <span style={{ width: 7, height: 7, borderRadius: "50%", background: C.accent }}></span>
                claude.ai · {sc.tag}
              </div>
              <div style={{ width: 60 }}></div>
            </div>
            <div style={{ display: "grid", gridTemplateColumns: "1fr 1.1fr", minHeight: 380 }} className="vibe-grid">
              <div style={{ padding: 18, borderRight: `1px solid ${C.border}`, background: "#FFFDFB", display: "flex", flexDirection: "column", gap: 10 }}>
                <div style={{ display: "flex", justifyContent: "flex-end" }}>
                  <div style={{ maxWidth: "92%", padding: "10px 14px", borderRadius: "16px 16px 4px 16px", background: C.fg, color: "#F7F3EF", fontSize: "0.8125rem", lineHeight: 1.55 }}>
                    {promptText}
                    {phase === "typing-prompt" && <span style={{ display: "inline-block", width: 6, height: 12, background: "#F7F3EF", marginLeft: 2, verticalAlign: "middle", animation: "blink 0.9s steps(2) infinite" }}></span>}
                  </div>
                </div>
                {(phase === "thinking" || phase === "claude-response" || phase === "building" || phase === "done") && (
                  <div style={{ display: "flex", justifyContent: "flex-start", alignItems: "flex-end", gap: 8 }}>
                    <div style={{ width: 24, height: 24, borderRadius: "50%", background: `linear-gradient(135deg, ${C.peach}, ${C.accent})`, flexShrink: 0, display: "flex", alignItems: "center", justifyContent: "center", fontSize: 10, color: "#FFF", fontWeight: 700 }}>C</div>
                    <div style={{ maxWidth: "85%", padding: "10px 14px", borderRadius: "16px 16px 16px 4px", background: C.alt, color: C.fg, fontSize: "0.8125rem", lineHeight: 1.6 }}>
                      {phase === "thinking" ? (
                        <div style={{ display: "flex", gap: 4, padding: "2px 0" }}>
                          <span style={{ width: 6, height: 6, borderRadius: "50%", background: C.muted, animation: "dotPulse 1.2s ease-in-out infinite" }}></span>
                          <span style={{ width: 6, height: 6, borderRadius: "50%", background: C.muted, animation: "dotPulse 1.2s ease-in-out 0.2s infinite" }}></span>
                          <span style={{ width: 6, height: 6, borderRadius: "50%", background: C.muted, animation: "dotPulse 1.2s ease-in-out 0.4s infinite" }}></span>
                        </div>
                      ) : (
                        <>
                          {responseText}
                          {phase === "claude-response" && <span style={{ display: "inline-block", width: 6, height: 12, background: C.fg, marginLeft: 1, verticalAlign: "middle", animation: "blink 0.9s steps(2) infinite" }}></span>}
                        </>
                      )}
                    </div>
                  </div>
                )}
                {(phase === "building" || phase === "done") && responseText === sc.response && (
                  <div style={{ display: "flex", justifyContent: "flex-start", marginLeft: 32 }}>
                    <div style={{ display: "inline-flex", alignItems: "center", gap: 6, padding: "5px 10px", background: "rgba(184,132,92,0.1)", borderRadius: 100, fontSize: "0.6875rem", fontWeight: 500, color: C.accent }}>
                      <span style={{ width: 6, height: 6, borderRadius: "50%", background: C.accent, animation: phase === "building" ? "dotPulse 1.2s ease-in-out infinite" : "none" }}></span>
                      {phase === "building" ? "Building preview…" : "Preview ready"}
                    </div>
                  </div>
                )}
              </div>
              <div style={{ background: C.alt, position: "relative", minHeight: 380 }}>
                <div style={{ position: "absolute", top: 10, left: 14, fontSize: 9, color: C.muted, textTransform: "uppercase", letterSpacing: "0.08em", fontWeight: 600, zIndex: 2 }}>Preview</div>
                <div style={{ position: "absolute", inset: "32px 14px 14px 14px", background: "#FFFDFB", borderRadius: 12, border: `1px solid ${C.border}`, overflow: "hidden" }}>
                  {renderPreview()}
                </div>
              </div>
            </div>
          </div>
        </R>
        <R delay={0.16}>
          <div style={{ display: "flex", gap: 8, flexWrap: "wrap", justifyContent: "center", marginTop: 28 }}>
            {scenarios.map((s, i) => (
              <button key={i} onClick={() => resetTo(i)}
                style={{
                  padding: "8px 16px", borderRadius: 100, fontSize: "0.75rem", fontWeight: 500,
                  border: `1px solid ${i === scenarioIdx ? C.fg : C.border}`,
                  background: i === scenarioIdx ? C.fg : "transparent",
                  color: i === scenarioIdx ? "#FFF" : C.muted,
                  cursor: "pointer", fontFamily: "inherit",
                  transition: "all 0.3s cubic-bezier(.16,1,.3,1)",
                }}>
                {s.tag}
              </button>
            ))}
          </div>
        </R>
      </div>
    </section>
  );
}
/* ── ABOUT ── */
function About() {
  return (
    <section id="about" className="s" style={{ background: "#FFFDFB" }}>
      <div className="blob" style={{ top: "10%", left: "-8%", width: 340, height: 340, background: C.butter, opacity: 0.35 }} />
      <div className="blob" style={{ bottom: "15%", right: "-5%", width: 280, height: 280, background: C.peach, opacity: 0.3 }} />
      <div style={{ maxWidth: 960, margin: "0 auto", padding: "0 48px", position: "relative", zIndex: 2 }}>
        <div className="ga">
          <R from="left">
            <div style={{ position: "relative", width: 260, height: 280 }}>
              {/* layered cards behind */}
              <div style={{ position: "absolute", inset: 0, borderRadius: 24, background: `linear-gradient(135deg, ${C.sage}, ${C.butter})`, transform: "rotate(-5deg) translate(-12px, 8px)", opacity: 0.7 }} />
              <div style={{ position: "absolute", inset: 0, borderRadius: 24, background: `linear-gradient(135deg, ${C.peach}, ${C.plum})`, transform: "rotate(3deg) translate(8px, -4px)", opacity: 0.8 }} />
              <div className="grain-card" style={{ position: "absolute", inset: 0, borderRadius: 24, overflow: "hidden", border: `1px solid ${C.border}`, boxShadow: "0 12px 40px rgba(0,0,0,0.08)", animation: "float 6s ease-in-out infinite" }}>
                <img
                  src="founder.jpg"
                  alt="Jamie, founder of The Rec Lab"
                  style={{ display: "block", width: "100%", height: "100%", objectFit: "cover", objectPosition: "center 22%" }}
                />
              </div>
            </div>
          </R>
          <div>
            <R delay={0.08}>
              <span className="eyebrow"><span className="dot"></span>About</span>
            </R>
            <R delay={0.12}>
              <h2 className="serif" style={{ fontSize: "clamp(1.75rem, 3vw, 2.5rem)", fontWeight: 400, letterSpacing: "-0.02em", lineHeight: 1.15, marginBottom: 24 }}>Meet the founder, Jamie</h2>
            </R>
            <R delay={0.18}>
              <div style={{ fontSize: "0.9375rem", lineHeight: 1.8, color: C.muted }}>
                <p style={{ marginBottom: 16 }}>8 years in recruitment across agency, in-house, and AI rec-tech. 300+ hires across PlayStation, TikTok, AMEX and over 100 more brands. 2x founding teams and funded VC scale up.</p>
                <p style={{ marginBottom: 16 }}>Throughout my career I've naturally gravitated towards the ops side of recruitment; process, systems, making things work better. I began learning Python and SQL before AI entered the conversation. When it did, the pivot was a no-brainer.</p>
                <p>Now I spend my days researching the latest in AI, and how that can impact recruitment, and turning that into content, trainings, or directly building for recruitment teams.</p>
              </div>
            </R>
            <R delay={0.24}>
              <a href="https://www.linkedin.com/in/jamiejaylyons/" target="_blank" rel="noopener" style={{ display: "inline-block", marginTop: 24, fontSize: "0.875rem", color: C.accent, textDecoration: "none", fontWeight: 500, transition: "transform 0.2s" }}
                onMouseEnter={e => e.target.style.transform = "translateX(4px)"} onMouseLeave={e => e.target.style.transform = "translateX(0)"}>Find me on LinkedIn →</a>
            </R>
          </div>
        </div>
      </div>
    </section>
  );
}

/* ── WORKSHOPS GALLERY ── */
function Workshops() {
  const talks = [
    { src: "images/workshop-prompt.jpg", alt: "Jamie leading a hands-on prompting workshop", cap: "Prompt engineering, live" },
    { src: "images/workshop-cvinvaders.jpg", alt: "Jamie demoing the CV Invaders game to the room", cap: "CV Invaders — live demo" },
    { src: "images/workshop-tips.jpg", alt: "Jamie sharing final tips and tricks with attendees", cap: "Final tips & tricks" },
    { src: "images/workshop-room.jpg", alt: "A full room of recruiters at a Rec Lab workshop", cap: "Full house" },
  ];
  return (
    <section className="s" style={{ background: C.alt }}>
      <div className="blob" style={{ top: "8%", right: "-6%", width: 320, height: 320, background: C.sky, opacity: 0.28 }} />
      <div className="blob" style={{ bottom: "10%", left: "-6%", width: 300, height: 300, background: C.peach, opacity: 0.3 }} />
      <div className="wrap">
        <R><span className="eyebrow">In the room</span></R>
        <R delay={0.05}><h2 className="serif" style={{ fontSize: "clamp(1.75rem, 3vw, 2.5rem)", fontWeight: 400, letterSpacing: "-0.02em", marginBottom: 16 }}>Workshops &amp; talks</h2></R>
        <R delay={0.1}><p style={{ fontSize: "1rem", lineHeight: 1.7, color: C.muted, maxWidth: 560, marginBottom: 48 }}>Hands-on sessions where recruiting teams actually build with AI — from prompting fundamentals to shipping working tools live.</p></R>
        <R delay={0.14} from="scale">
          <div className="ws-grid">
            <div className="ws-card ws-feature">
              <img src="images/workshop-vibecoding.jpg" alt="Jamie presenting 'A Recruiter's Road to Vibe-Coding'" loading="lazy" />
              <div className="ws-cap">A Recruiter&rsquo;s Road to Vibe-Coding</div>
            </div>
            <div className="ws-talks">
              {talks.map((t, i) => (
                <div key={i} className="ws-card ws-talk">
                  <img src={t.src} alt={t.alt} loading="lazy" />
                  <div className="ws-cap">{t.cap}</div>
                </div>
              ))}
            </div>
          </div>
        </R>
      </div>
    </section>
  );
}

/* ── PHILOSOPHY ── */
function Philosophy() {
  const items = [
    { t: "Practical over theoretical", b: "If you can't use it on Monday morning, we're not teaching it." },
    { t: "Built by a recruiter, for recruiters", b: "Who spends all day researching and building AI tools." },
    { t: "Tool-agnostic", b: "We teach you to think about AI regardless of which tools your team uses." },
    { t: "Tailored to your world", b: "We learn your tech stack, workflows, and pain points first." },
  ];
  return (
    <section className="s" style={{ background: C.dark, color: "#F7F3EF" }}>
      <div className="blob" style={{ top: "10%", left: "10%", width: 400, height: 400, background: C.accent, opacity: 0.25 }} />
      <div className="blob" style={{ bottom: "5%", right: "8%", width: 360, height: 360, background: C.plum, opacity: 0.18 }} />
      <div className="wrap">
        <R><span className="eyebrow" style={{ color: "#D4A574" }}>Why us</span></R>
        <R delay={0.05}><h2 className="serif" style={{ fontSize: "clamp(1.75rem, 3vw, 2.5rem)", fontWeight: 400, letterSpacing: "-0.02em", color: "#F7F3EF", marginBottom: 48 }}>Why it works</h2></R>
        <div className="g2">
          {items.map((item, i) => (
            <R key={i} delay={i * 0.08} from={i % 2 === 0 ? "left" : "right"}>
              <TiltCard dark style={{ background: "rgba(255,255,255,0.04)", border: "1px solid rgba(255,255,255,0.08)", borderRadius: 16, padding: "36px 32px", height: "100%" }}>
                <h3 style={{ fontSize: "0.9375rem", fontWeight: 600, marginBottom: 10, color: "#F7F3EF" }}>{item.t}</h3>
                <p style={{ fontSize: "0.8125rem", lineHeight: 1.7, color: "#888" }}>{item.b}</p>
              </TiltCard>
            </R>
          ))}
        </div>
      </div>
    </section>
  );
}

/* ── TESTIMONIALS ── */
/* ── CASE STUDIES (Metaview-style bento) ── */
function CaseStudies() {
  const cards = [
    // Big featured — image + metric + quote
    {
      kind: "featured",
      bg: C.peach,
      company: "Few and Far",
      metric: "Cut screening time by 40%",
      quote: "If you're in recruitment and want to explore AI in a way that actually feels useful and inspiring, I would thoroughly recommend Jamie. He's ridiculously knowledgeable, and explains things in a super digestible way.",
      name: "Kiera",
      role: "Head of People",
    },
    // Metric tile
    { kind: "metric", company: "PlayStation", metric: "300+ hires across 5 teams", bg: C.sage },
    // Logo + small metric
    { kind: "logo", company: "TikTok", metric: "AI sourcing workshop, 24 recruiters" },
    // Quote tile
    {
      kind: "quote",
      company: "Creatio",
      quote: "Jamie cuts through the noise. We had three workflows automated within a fortnight of his audit.",
      name: "Milan",
      role: "Head of Talent",
    },
    // Image card (placeholder)
    { kind: "image", company: "AMEX", metric: "Internal AI training programme" },
    // Pull-quote on dark
    {
      kind: "darkQuote",
      company: "Placeholder Co.",
      quote: "Saved my team 12 hours a week, easy.",
      name: "Placeholder",
      role: "TA Lead",
    },
    // Small metric
    { kind: "metric", company: "100+ brands", metric: "AI tooling consulted on", bg: C.butter },
    // Small quote
    {
      kind: "quote",
      company: "Placeholder",
      quote: "Bookmark every workshop. They keep paying off six months on.",
      name: "Placeholder",
      role: "Head of Recruitment",
      compact: true,
    },
  ];

  const LogoBlock = ({ company }) => (
    <div style={{ display: "flex", alignItems: "center", gap: 10 }}>
      <div style={{ width: 26, height: 26, borderRadius: 6, background: "rgba(59,47,40,0.08)", display: "flex", alignItems: "center", justifyContent: "center", fontSize: "0.625rem", fontWeight: 700, color: C.fg }}>{company[0]}</div>
      <span style={{ fontSize: "0.75rem", fontWeight: 600, letterSpacing: "-0.005em" }}>{company}</span>
    </div>
  );

  return (
    <section id="case-studies" className="s" style={{ background: "#FFFDFB", paddingTop: 100, paddingBottom: 100 }}>
      <div className="blob" style={{ top: "15%", right: "-5%", width: 320, height: 320, background: C.peach, opacity: 0.22 }} />
      <div className="blob" style={{ bottom: "10%", left: "-8%", width: 320, height: 320, background: C.sage, opacity: 0.22 }} />
      <div className="wrap">
        <R>
          <div style={{ display: "flex", alignItems: "flex-end", justifyContent: "space-between", flexWrap: "wrap", gap: 24, marginBottom: 48 }}>
            <h2 className="serif" style={{ fontSize: "clamp(1.75rem, 3vw, 2.75rem)", fontWeight: 400, letterSpacing: "-0.02em", lineHeight: 1.1, maxWidth: 720 }}>
              Designed for recruiting teams who actually care about hiring well.
            </h2>
            <a href="#contact" style={{ fontSize: "0.8125rem", color: C.accent, textDecoration: "none", fontWeight: 500, whiteSpace: "nowrap", transition: "transform 0.2s" }}
              onMouseEnter={e => e.target.style.transform = "translateX(4px)"} onMouseLeave={e => e.target.style.transform = "translateX(0)"}>All case studies →</a>
          </div>
        </R>
        <R delay={0.05}>
          <div className="case-grid" style={{
            display: "grid",
            gridTemplateColumns: "repeat(6, 1fr)",
            gridAutoRows: "minmax(160px, auto)",
            gap: 12,
          }}>
            {/* 1. Featured (spans 4×2) */}
            <div style={{ gridColumn: "span 4", gridRow: "span 2", background: cards[0].bg, borderRadius: 18, padding: "36px 36px", display: "flex", flexDirection: "column", justifyContent: "space-between", color: C.fg, minHeight: 360, position: "relative", overflow: "hidden" }}>
              <div style={{ position: "absolute", bottom: -80, right: -60, width: 280, height: 280, borderRadius: "50%", background: "rgba(184,132,92,0.18)", filter: "blur(40px)" }} />
              <div style={{ position: "relative" }}>
                <LogoBlock company={cards[0].company} />
                <p className="serif" style={{ fontSize: "clamp(1.5rem, 2.2vw, 2rem)", fontWeight: 500, marginTop: 28, lineHeight: 1.1, letterSpacing: "-0.02em" }}>{cards[0].metric}</p>
              </div>
              <div style={{ position: "relative", maxWidth: 480 }}>
                <p style={{ fontSize: "0.875rem", lineHeight: 1.65, color: "rgba(59,47,40,0.78)", marginBottom: 16, fontStyle: "italic" }}>"{cards[0].quote}"</p>
                <p style={{ fontSize: "0.75rem", fontWeight: 600 }}>{cards[0].name}</p>
                <p style={{ fontSize: "0.6875rem", color: C.muted }}>{cards[0].role} · {cards[0].company}</p>
              </div>
            </div>

            {/* 2. Metric */}
            <div style={{ gridColumn: "span 2", gridRow: "span 1", background: cards[1].bg, borderRadius: 16, padding: "24px 24px", display: "flex", flexDirection: "column", justifyContent: "space-between", color: C.fg }}>
              <LogoBlock company={cards[1].company} />
              <p className="serif" style={{ fontSize: "1.375rem", fontWeight: 500, lineHeight: 1.15, letterSpacing: "-0.015em" }}>{cards[1].metric}</p>
            </div>

            {/* 3. Logo + meta */}
            <div style={{ gridColumn: "span 2", gridRow: "span 1", background: "#FFFDFB", border: `1px solid ${C.border}`, borderRadius: 16, padding: "24px 24px", display: "flex", flexDirection: "column", justifyContent: "space-between" }}>
              <LogoBlock company={cards[2].company} />
              <p style={{ fontSize: "0.8125rem", fontWeight: 500, color: C.fg, lineHeight: 1.45 }}>{cards[2].metric}</p>
            </div>

            {/* 4. Quote */}
            <div style={{ gridColumn: "span 3", gridRow: "span 2", background: "#FFFDFB", border: `1px solid ${C.border}`, borderRadius: 16, padding: "32px 30px", display: "flex", flexDirection: "column", justifyContent: "space-between" }}>
              <LogoBlock company={cards[3].company} />
              <div>
                <p style={{ fontSize: "0.9375rem", lineHeight: 1.7, color: C.fg, marginBottom: 18, fontStyle: "italic" }}>"{cards[3].quote}"</p>
                <p style={{ fontSize: "0.75rem", fontWeight: 600 }}>{cards[3].name}</p>
                <p style={{ fontSize: "0.6875rem", color: C.muted }}>{cards[3].role} · {cards[3].company}</p>
              </div>
            </div>

            {/* 5. Image card placeholder */}
            <div style={{ gridColumn: "span 3", gridRow: "span 2", background: `linear-gradient(135deg, ${C.plum} 0%, ${C.peach} 100%)`, borderRadius: 16, padding: "24px 24px", display: "flex", flexDirection: "column", justifyContent: "space-between", color: "#FFFDFB", position: "relative", overflow: "hidden", minHeight: 320 }}>
              <div style={{ position: "absolute", top: "30%", left: "50%", transform: "translate(-50%, -50%)", width: 80, height: 80, borderRadius: "50%", background: "rgba(255,253,251,0.18)", backdropFilter: "blur(8px)", border: "1px solid rgba(255,253,251,0.3)", display: "flex", alignItems: "center", justifyContent: "center" }}>
                <span style={{ fontSize: "1.25rem", marginLeft: 4 }}>▶</span>
              </div>
              <div style={{ position: "relative", display: "flex", alignItems: "center", gap: 10 }}>
                <div style={{ width: 26, height: 26, borderRadius: 6, background: "rgba(255,253,251,0.2)", display: "flex", alignItems: "center", justifyContent: "center", fontSize: "0.625rem", fontWeight: 700 }}>{cards[4].company[0]}</div>
                <span style={{ fontSize: "0.75rem", fontWeight: 600 }}>{cards[4].company}</span>
              </div>
              <div style={{ position: "relative" }}>
                <p style={{ fontSize: "0.6875rem", textTransform: "uppercase", letterSpacing: "0.08em", fontWeight: 600, opacity: 0.85, marginBottom: 6 }}>Watch</p>
                <p style={{ fontSize: "0.9375rem", fontWeight: 500 }}>{cards[4].metric}</p>
              </div>
            </div>

            {/* 6. Dark quote */}
            <div style={{ gridColumn: "span 2", gridRow: "span 1", background: C.dark, color: "#F7F3EF", borderRadius: 16, padding: "24px 24px", display: "flex", flexDirection: "column", justifyContent: "space-between" }}>
              <p className="serif" style={{ fontSize: "1.125rem", fontWeight: 400, lineHeight: 1.25, letterSpacing: "-0.01em" }}>"{cards[5].quote}"</p>
              <div>
                <p style={{ fontSize: "0.6875rem", fontWeight: 600 }}>{cards[5].name}</p>
                <p style={{ fontSize: "0.625rem", color: "rgba(247,243,239,0.55)" }}>{cards[5].role}</p>
              </div>
            </div>

            {/* 7. Metric */}
            <div style={{ gridColumn: "span 2", gridRow: "span 1", background: cards[6].bg, borderRadius: 16, padding: "24px 24px", display: "flex", flexDirection: "column", justifyContent: "space-between" }}>
              <LogoBlock company={cards[6].company} />
              <p className="serif" style={{ fontSize: "1.25rem", fontWeight: 500, lineHeight: 1.15, letterSpacing: "-0.015em" }}>{cards[6].metric}</p>
            </div>

            {/* 8. Small quote */}
            <div style={{ gridColumn: "span 2", gridRow: "span 1", background: "#FFFDFB", border: `1px solid ${C.border}`, borderRadius: 16, padding: "24px 24px", display: "flex", flexDirection: "column", justifyContent: "space-between" }}>
              <p style={{ fontSize: "0.8125rem", lineHeight: 1.55, color: C.fg, fontStyle: "italic" }}>"{cards[7].quote}"</p>
              <div>
                <p style={{ fontSize: "0.6875rem", fontWeight: 600 }}>{cards[7].name}</p>
                <p style={{ fontSize: "0.625rem", color: C.muted }}>{cards[7].role}</p>
              </div>
            </div>
          </div>
        </R>
      </div>
      <style>{`
        @media (max-width: 900px) {
          .case-grid {
            grid-template-columns: 1fr !important;
          }
          .case-grid > div {
            grid-column: span 1 !important;
            grid-row: span 1 !important;
          }
        }
      `}</style>
    </section>
  );
}

/* ── TESTIMONIALS ── */
function Testimonials() {
  const items = [
    { q: "If you're in recruitment and want to explore AI in a way that actually feels useful and inspiring, I would thoroughly recommend Jamie. He's ridiculously knowledgeable, and explains things in a super digestible way.", name: "Kiera", title: "Head of People, Few and Far" },
    { q: null, name: "Milan", title: "Head of Talent, Creatio" },
    { q: null, name: "Placeholder", title: "TA Lead, Company" },
    { q: null, name: "Placeholder", title: "Head of Recruitment, Company" },
  ];
  const [active, setActive] = useState(0);
  const prev = () => setActive(p => (p - 1 + items.length) % items.length);
  const next = () => setActive(p => (p + 1) % items.length);
  useEffect(() => { const t = setInterval(next, 6000); return () => clearInterval(t); }, [active]);
  const getOffset = (i) => { let d = i - active; const h = Math.floor(items.length / 2); if (d > h) d -= items.length; if (d < -h) d += items.length; return d; };
  return (
    <section className="s" style={{ background: C.alt }}>
      <div className="blob" style={{ top: "10%", right: "-5%", width: 320, height: 320, background: C.peach, opacity: 0.3 }} />
      <div className="blob" style={{ bottom: "10%", left: "-5%", width: 300, height: 300, background: C.butter, opacity: 0.28 }} />
      <div className="wrap">
        <R><span className="eyebrow"><span className="dot"></span>Testimonials</span></R>
        <R delay={0.04}><p style={{ fontSize: "0.75rem", color: C.muted, letterSpacing: "0.08em", textTransform: "uppercase", fontWeight: 500, marginBottom: 48 }}>Here's what recruiters are saying</p></R>
        <R delay={0.06}>
          <div style={{ position: "relative", height: 260, maxWidth: 1000, margin: "0 auto" }}>
            {[{ fn: prev, pos: "left", icon: "‹" }, { fn: next, pos: "right", icon: "›" }].map(({ fn, pos, icon }) => (
              <button key={pos} onClick={fn} style={{
                position: "absolute", [pos]: 0, top: "50%", transform: "translateY(-50%)", zIndex: 20,
                width: 44, height: 44, borderRadius: "50%", border: `1px solid ${C.border}`, background: "#FFFDFB",
                cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center",
                fontSize: "1rem", color: C.fg, transition: "all 0.3s cubic-bezier(.16,1,.3,1)",
              }}
                onMouseEnter={e => { e.currentTarget.style.background = C.fg; e.currentTarget.style.color = "#FFF"; e.currentTarget.style.transform = "translateY(-50%) scale(1.1)"; }}
                onMouseLeave={e => { e.currentTarget.style.background = "#FFFDFB"; e.currentTarget.style.color = C.fg; e.currentTarget.style.transform = "translateY(-50%) scale(1)"; }}
              >{icon}</button>
            ))}
            <div style={{ height: "100%", position: "relative", overflow: "hidden", margin: "0 64px" }}>
              {items.map((t, i) => {
                const offset = getOffset(i); const isActive = offset === 0; const absOff = Math.abs(offset); const vis = absOff <= 1;
                return (
                  <div key={i} onClick={() => setActive(i)} style={{
                    position: "absolute", top: "50%", left: "50%",
                    width: isActive ? "70%" : "55%", maxWidth: isActive ? 520 : 400, height: 220,
                    transform: `translateX(calc(-50% + ${offset * 300}px)) translateY(calc(-50% - ${absOff * 8}px))`,
                    opacity: vis ? (isActive ? 1 : 0.2) : 0, zIndex: isActive ? 10 : 5 - absOff,
                    filter: isActive ? "none" : "blur(2px)",
                    transition: "all 0.7s cubic-bezier(.16,1,.3,1)",
                    cursor: isActive ? "default" : "pointer",
                    background: "#FFFDFB", border: `1px solid ${C.border}`, borderRadius: 16,
                    padding: "32px 36px", display: "flex", flexDirection: "column", justifyContent: "space-between",
                    overflow: "hidden", pointerEvents: vis ? "auto" : "none",
                    boxShadow: isActive ? "0 8px 40px rgba(0,0,0,0.06)" : "none",
                  }}>
                    <p style={{ fontSize: "0.875rem", lineHeight: 1.7, color: C.fg, fontStyle: t.q ? "normal" : "italic", opacity: t.q ? 1 : 0.4 }}>"{t.q || "Testimonial placeholder"}"</p>
                    <div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", marginTop: 16 }}>
                      <div>
                        <p style={{ fontSize: "0.8125rem", fontWeight: 600 }}>{t.name}</p>
                        <p style={{ fontSize: "0.6875rem", color: C.muted }}>{t.title}</p>
                      </div>
                      <svg width="14" height="14" viewBox="0 0 24 24" fill={C.muted} style={{ opacity: 0.3 }}><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 01-2.063-2.065 2.064 2.064 0 112.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"></path></svg>
                    </div>
                  </div>
                );
              })}
            </div>
          </div>
        </R>
      </div>
    </section>
  );
}

/* ── BUILDS ── */
function Builds() {
  const projects = [
    { title: "Candidate Interview Packs", desc: "Branded, interactive interview prep sites.", tag: "Vibe-coded", tint: TINTS[0] },
    { title: "Vibe-coded CV", desc: "A fully interactive CV as a website.", tag: "Personal", tint: TINTS[2] },
    { title: "Vibe-coded CRM", desc: "A lightweight recruitment CRM from scratch.", tag: "Tool", tint: TINTS[1] },
    { title: "CV Invaders", desc: "Retro arcade game. Shoot down bad CVs.", tag: "Just for fun", tint: TINTS[3] },
    { title: "Custom Calendly", desc: "Bespoke booking page, no off-the-shelf.", tag: "Vibe-coded", tint: TINTS[4] },
    { title: "Research Agent", desc: "AI agent scraping ATS data and role counts.", tag: "Tool", tint: TINTS[5] },
  ];
  const BuildVisual = ({ tint, large }) => (
    <div className="grain-card" style={{ aspectRatio: large ? "16/9" : "4/3", background: tint.bg, display: "flex", alignItems: "center", justifyContent: "center", position: "relative", overflow: "hidden" }}>
      <div style={{ position: "absolute", inset: 0, background: "radial-gradient(circle at 30% 30%, rgba(255,255,255,0.5), transparent 60%)" }} />
      <span className="serif" style={{ fontSize: large ? "8rem" : "5rem", fontWeight: 300, color: tint.fg, opacity: 0.55, lineHeight: 1, letterSpacing: "-0.04em", position: "relative", zIndex: 1 }}>{tint.letter}</span>
      <span className="chip" style={{ position: "absolute", top: 12, right: 12, fontSize: "0.625rem", background: "rgba(255,253,251,0.85)" }}>
        <span className="swatch" style={{ background: tint.fg }}></span>Preview
      </span>
    </div>
  );
  return (
    <section id="builds" className="s" style={{ background: "#FFFDFB" }}>
      <div className="blob" style={{ top: "20%", right: "-10%", width: 380, height: 380, background: C.sky, opacity: 0.25 }} />
      <div className="wrap">
        <R>
          <span className="eyebrow"><span className="dot"></span>Recent work</span>
        </R>
        <R delay={0.05}>
          <h2 className="serif" style={{ fontSize: "clamp(1.75rem, 3vw, 2.5rem)", fontWeight: 400, letterSpacing: "-0.02em", lineHeight: 1.15, marginBottom: 12 }}>Things I've built</h2>
          <p style={{ fontSize: "0.9375rem", color: C.muted, maxWidth: 420, lineHeight: 1.6, marginBottom: 48 }}>All built with AI tools. No dev team. Just me and the tools I teach.</p>
        </R>
        <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 16, marginBottom: 16 }}>
          {projects.slice(0, 2).map((p, i) => (
            <R key={i} delay={i * 0.06} from={i === 0 ? "left" : "right"}>
              <TiltCard style={{ borderRadius: 18, overflow: "hidden", border: `1px solid ${C.border}`, background: "#FFFDFB", cursor: "pointer" }}>
                <BuildVisual tint={p.tint} large />
                <div style={{ padding: "24px 28px", borderTop: `1px solid ${C.border}` }}>
                  <span style={{ fontSize: "0.5625rem", fontWeight: 600, color: C.accent, letterSpacing: "0.08em", textTransform: "uppercase", marginBottom: 8, display: "block" }}>{p.tag}</span>
                  <h3 style={{ fontSize: "1.0625rem", fontWeight: 600, marginBottom: 6 }}>{p.title}</h3>
                  <p style={{ fontSize: "0.8125rem", lineHeight: 1.6, color: C.muted }}>{p.desc}</p>
                  <span style={{ fontSize: "0.75rem", color: C.accent, fontWeight: 500, display: "block", marginTop: 14 }}>View project →</span>
                </div>
              </TiltCard>
            </R>
          ))}
        </div>
        <div style={{ display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: 16 }}>
          {projects.slice(2).map((p, i) => (
            <R key={i} delay={0.12 + i * 0.05} from="scale">
              <TiltCard style={{ borderRadius: 16, overflow: "hidden", border: `1px solid ${C.border}`, background: "#FFFDFB", cursor: "pointer" }}>
                <BuildVisual tint={p.tint} />
                <div style={{ padding: "16px 18px", borderTop: `1px solid ${C.border}` }}>
                  <span style={{ fontSize: "0.5rem", fontWeight: 600, color: C.accent, letterSpacing: "0.06em", textTransform: "uppercase", marginBottom: 6, display: "block" }}>{p.tag}</span>
                  <h3 style={{ fontSize: "0.8125rem", fontWeight: 600, marginBottom: 4 }}>{p.title}</h3>
                  <p style={{ fontSize: "0.6875rem", lineHeight: 1.5, color: C.muted }}>{p.desc}</p>
                </div>
              </TiltCard>
            </R>
          ))}
        </div>
      </div>
    </section>
  );
}

/* ── FAQ + CTA ── */
function FAQ() {
  const [open, setOpen] = useState(null);
  const faqs = [
    { q: "Do you work with teams outside the UK?", a: "Yes. Workshops can be delivered remotely and most consulting work is done virtually." },
    { q: "How long is a typical workshop?", a: "Most run as a half-day or full day. We'll figure out the right format together." },
    { q: "What AI tools do you cover?", a: "Claude, ChatGPT, Gemini, Cursor, n8n, Make, Notion AI and more. We're tool-agnostic." },
    { q: "Do I need any technical experience?", a: "Not at all. Everything is designed for recruiters, not engineers." },
    { q: "What's the difference between training and consulting?", a: "Training teaches your team to use AI themselves. Consulting means we build the workflows for you." },
    { q: "How much does it cost?", a: "Depends on scope. Get in touch and we'll put something together. No templated packages." },
  ];
  return (
    <section id="contact" className="s" style={{ background: C.alt }}>
      <div className="blob" style={{ top: "20%", left: "-8%", width: 360, height: 360, background: C.sage, opacity: 0.28 }} />
      <div className="wrap">
        <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 64, alignItems: "start" }} className="faq-grid">
          <R>
            <div style={{ position: "sticky", top: 100 }}>
              <span className="eyebrow"><span className="dot"></span>Contact</span>
              <h2 className="serif" style={{ fontSize: "clamp(1.75rem, 3vw, 2.75rem)", fontWeight: 400, letterSpacing: "-0.02em", lineHeight: 1.1, marginBottom: 20, marginTop: 8 }}>
                Still got questions? Let's talk
              </h2>
              <p style={{ fontSize: "0.9375rem", color: C.muted, lineHeight: 1.7, marginBottom: 28 }}>
                Whether it's a workshop for 50, coaching for one, or some automated workflows, the first step is a conversation.
              </p>
              <div style={{ display: "flex", gap: 12, flexWrap: "wrap" }}>
                <MagButton href="mailto:hello@thereclab.com" className="btn btn-dark">hello@thereclab.com</MagButton>
                <MagButton href="https://www.linkedin.com/in/jamiejaylyons/" target="_blank" rel="noopener" className="btn btn-outline">LinkedIn</MagButton>
              </div>
            </div>
          </R>
          <R delay={0.1}>
            <div>
              {faqs.map((f, i) => (
                <div key={i} style={{ borderBottom: `1px solid ${C.border}` }}>
                  <button onClick={() => setOpen(open === i ? null : i)} style={{
                    width: "100%", padding: "16px 0", background: "none", border: "none",
                    cursor: "pointer", display: "flex", justifyContent: "space-between", alignItems: "center", gap: 16, textAlign: "left", fontFamily: "inherit",
                  }}>
                    <span style={{ fontSize: "0.875rem", fontWeight: 500, color: C.fg }}>{f.q}</span>
                    <span style={{ fontSize: "1.125rem", color: C.muted, transform: open === i ? "rotate(45deg)" : "none", transition: "transform 0.5s cubic-bezier(.16,1,.3,1)", flexShrink: 0 }}>+</span>
                  </button>
                  <div className="faq-answer" style={{ maxHeight: open === i ? 200 : 0, opacity: open === i ? 1 : 0 }}>
                    <p style={{ fontSize: "0.8125rem", lineHeight: 1.6, color: C.muted, paddingBottom: 16 }}>{f.a}</p>
                  </div>
                </div>
              ))}
            </div>
          </R>
        </div>
      </div>
    </section>
  );
}

/* ── FOOTER ── */
function Footer() {
  return (
    <footer style={{ padding: "40px 0", borderTop: `1px solid ${C.border}` }}>
      <div className="wrap">
        <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", flexWrap: "wrap", gap: 16 }}>
          <div>
            <span style={{ fontSize: "0.8125rem", fontWeight: 600 }}>The Rec Lab</span>
            <span style={{ fontSize: "0.75rem", color: C.muted, marginLeft: 16 }}>Where recruiters come to learn AI.</span>
          </div>
          <div style={{ display: "flex", gap: 24 }}>
            {[{ l: "LinkedIn", h: "https://www.linkedin.com/in/jamiejaylyons/" }, { l: "Email", h: "mailto:hello@thereclab.com" }].map(k => (
              <a key={k.l} href={k.h} target={k.l === "LinkedIn" ? "_blank" : undefined} rel="noopener" className="nav-link" style={{ fontSize: "0.75rem" }}>{k.l}</a>
            ))}
          </div>
        </div>
        <p style={{ fontSize: "0.6875rem", color: C.muted, marginTop: 24, opacity: 0.6 }}>© {new Date().getFullYear()} The Rec Lab. All rights reserved. London, UK.</p>
      </div>
    </footer>
  );
}

/* ── HERO (photo / full-bleed — from Claude Design "RecLab Hero.html", option 01) ── */
function HeroPhoto() {
  return (
    <section style={{
      position: "relative", width: "100%", minHeight: "100vh", overflow: "hidden",
      background: "#1c1a16", fontFamily: "'Schibsted Grotesk', system-ui, sans-serif",
    }}>
      {/* Full-bleed background photo — framed to keep the presenter in view */}
      <img
        src="images/hero.jpg"
        alt="Jamie leading a hands-on AI workshop for a room of recruiters"
        style={{ position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", objectPosition: "center 18%" }}
      />
      {/* Diagonal scrim for headline legibility */}
      <div style={{ position: "absolute", inset: 0,
        background: "linear-gradient(105deg, rgba(20,18,14,0.86) 0%, rgba(20,18,14,0.55) 42%, rgba(20,18,14,0.08) 75%)" }} />
      {/* Content pinned to lower-left */}
      <div style={{
        position: "absolute", inset: 0, display: "flex", flexDirection: "column", justifyContent: "flex-end",
        padding: "clamp(96px, 12vh, 140px) clamp(24px, 5vw, 64px) clamp(56px, 10vh, 96px)",
        zIndex: 2,
      }}>
        <div style={{ maxWidth: 760 }}>
          <h1 style={{
            fontFamily: "'Schibsted Grotesk', system-ui, sans-serif", fontWeight: 700,
            fontSize: "clamp(2.4rem, 6.2vw, 76px)", lineHeight: 1.02, letterSpacing: "-0.03em",
            color: "#fff", margin: 0,
          }}>
            Where recruiters turn AI into <span style={{ color: "#e0a589" }}>real impact</span>
          </h1>
          <p style={{
            fontFamily: "'Schibsted Grotesk', system-ui, sans-serif", fontWeight: 400,
            fontSize: "clamp(1rem, 1.5vw, 20px)", lineHeight: 1.5, color: "rgba(255,255,255,0.82)",
            maxWidth: 560, margin: "22px 0 0",
          }}>
            Hands-on training, mentorship and consulting projects to help talent teams put AI to work.
          </p>
        </div>
      </div>
    </section>
  );
}

function TheRecLab() {
  return (
    <div>
      <Styles />
      <Nav />
      <HeroPhoto />
      <Services />
      <About />
      <Philosophy />
      <CaseStudies />
      <Workshops />
      <Builds />
      <ChatDemo />
      <FAQ />
      <Footer />
    </div>
  );
}

ReactDOM.createRoot(document.getElementById("root")).render(<TheRecLab />);

