/* global React */
/* AI Innovation · Composer Family landing → Hero+link → Flows Analyst → MCP + Anthropic */
const { useState: useStateAI } = React;

const aiStyles = {
  /* === Composer Agent Family (landing) === */
  cafSection: {
    background: "var(--k-cotton)",
    color: "var(--k-charcoal)",
    padding: "140px 56px 160px",
    position: "relative", overflow: "hidden"
  },
  glow: {
    position: "absolute", top: "-20%", right: "-20%",
    width: "70%", height: "60%",
    background: "radial-gradient(circle at center, rgba(124,93,191,0.16), transparent 65%)",
    filter: "blur(40px)", pointerEvents: "none"
  },
  inner: { maxWidth: 1320, margin: "0 auto", position: "relative", zIndex: 2 },

  cafGrid: { display: "grid", gridTemplateColumns: "0.85fr 1.15fr", gap: 64, alignItems: "center" },
  cafLeft: {},
  cafEye: { fontSize: 11, letterSpacing: "0.22em", textTransform: "uppercase", color: "#7C5DBF", marginBottom: 24, fontWeight: 700, display: "inline-flex", alignItems: "center", gap: 10 },
  cafBeta: { fontSize: 9, padding: "3px 8px", background: "#7C5DBF", color: "var(--k-cotton)", borderRadius: 3, letterSpacing: "0.16em", fontWeight: 700 },
  cafT: { fontFamily: "var(--serif)", fontSize: "clamp(44px, 5.4vw, 84px)", lineHeight: 1.0, margin: 0, fontWeight: 400, letterSpacing: "-0.02em", color: "var(--k-charcoal)" },
  cafB: { marginTop: 28, fontSize: 17, lineHeight: 1.65, color: "var(--k-muted)", maxWidth: 440 },
  cafFootline: { marginTop: 36, paddingTop: 24, borderTop: "1px solid var(--k-stone)", fontSize: 14, color: "var(--k-muted)", lineHeight: 1.6, maxWidth: 440 },

  cafRight: {
    background: "linear-gradient(180deg, #F2E8F5 0%, #E5D5EA 100%)",
    border: "1px solid #C9B6F2",
    borderRadius: 16, padding: 36,
    boxShadow: "0 24px 60px rgba(124,93,191,0.12)"
  },
  cafHeader: {
    background: "linear-gradient(90deg, #7C5DBF 0%, #9176D1 100%)",
    color: "var(--k-cotton)", padding: "14px 28px",
    borderRadius: 999, textAlign: "center", fontWeight: 700, fontSize: 18,
    marginBottom: 28, letterSpacing: "0.02em"
  },
  cafLanes: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 20, marginBottom: 20 },
  cafLaneHead: { background: "rgba(124,93,191,0.12)", borderRadius: 999, padding: "12px 22px", textAlign: "center", fontWeight: 700, fontSize: 15, color: "#5E3F9C" },
  cafColumns: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 20 },
  cafPillList: { display: "flex", flexDirection: "column", gap: 14 },
  cafPill: {
    background: "var(--k-cotton)",
    border: "1px solid #7C5DBF",
    borderRadius: 999, padding: "14px 22px",
    color: "var(--k-charcoal)", fontSize: 14, fontWeight: 500, textAlign: "center",
    boxShadow: "0 4px 12px rgba(124,93,191,0.14)",
    display: "flex", justifyContent: "center", alignItems: "center", gap: 10
  },
  cafAlpha: { fontSize: 9, padding: "2px 7px", borderRadius: 999, background: "#7C5DBF", color: "var(--k-cotton)", letterSpacing: "0.14em", fontWeight: 700 },
  cafMore: { textAlign: "center", marginTop: 22, fontSize: 12, letterSpacing: "0.18em", textTransform: "uppercase", color: "#7C5DBF", fontWeight: 700 },

  /* === Composer hero ("You dream it") === */
  composerSection: {
    background: "var(--k-cotton)",
    color: "var(--k-charcoal)",
    padding: "140px 56px 160px",
    borderTop: "1px solid var(--k-stone)",
    position: "relative", overflow: "hidden"
  },
  composerGlow: {
    position: "absolute", top: "10%", right: "-15%",
    width: "60%", height: "60%",
    background: "radial-gradient(circle at center, rgba(249,99,83,0.14), transparent 65%)",
    filter: "blur(40px)", pointerEvents: "none"
  },
  head: { display: "grid", gridTemplateColumns: "1.1fr 1fr", gap: 80, alignItems: "end", marginBottom: 56 },
  eyebrow: { fontSize: 11, letterSpacing: "0.22em", textTransform: "uppercase", color: "var(--k-poppy)", marginBottom: 24, fontWeight: 700 },
  title: { fontFamily: "var(--serif)", fontWeight: 400, fontSize: "clamp(40px, 5vw, 76px)", lineHeight: 1.0, letterSpacing: "-0.02em", margin: 0, color: "var(--k-charcoal)" },
  sub: { fontSize: 17, lineHeight: 1.65, color: "var(--k-muted)", maxWidth: 540 },

  /* Hero showcase row */
  heroRow: { display: "grid", gridTemplateColumns: "1.5fr 1fr", gap: 24, marginBottom: 64, alignItems: "stretch" },
  composerHero: {
    background: "linear-gradient(135deg, #2A1B2E 0%, #16182C 60%, #0c0a14 100%)",
    border: "1px solid rgba(246,244,239,0.1)",
    borderRadius: 16, overflow: "hidden",
    display: "flex", flexDirection: "column"
  },
  composerHeroImg: { width: "100%", display: "block", flex: 1, objectFit: "cover" },
  composerHeroFoot: {
    padding: "22px 28px",
    background: "rgba(15,14,14,0.5)",
    borderTop: "1px solid rgba(246,244,239,0.08)",
    display: "flex", justifyContent: "space-between", alignItems: "center",
    gap: 16, flexWrap: "wrap"
  },
  composerHeroLine: { fontFamily: "var(--serif)", fontStyle: "italic", fontSize: 17, color: "var(--k-cotton)" },
  composerHeroLink: {
    color: "var(--k-poppy)", textDecoration: "none", fontSize: 12,
    letterSpacing: "0.16em", fontWeight: 700, textTransform: "uppercase",
    display: "inline-flex", alignItems: "center", gap: 8
  },
  kpiStack: { display: "flex", flexDirection: "column", gap: 16 },
  kpi: {
    background: "linear-gradient(180deg, #F2E8F5 0%, #ECE0F0 100%)",
    border: "1px solid #C9B6F2",
    borderRadius: 12, padding: "22px 24px",
    flex: 1, display: "flex", flexDirection: "column", justifyContent: "center", gap: 6
  },
  kpiNum: { fontFamily: "var(--serif)", fontSize: 52, lineHeight: 1, color: "var(--k-poppy)", fontWeight: 400, letterSpacing: "-0.02em" },
  kpiLab: { fontSize: 11, letterSpacing: "0.18em", textTransform: "uppercase", color: "var(--k-charcoal)", fontWeight: 700 },
  kpiSub: { fontSize: 12.5, lineHeight: 1.5, color: "var(--k-muted)" },

  /* 6-feature grid */
  builds: {
    background: "var(--nb-cream-2)",
    border: "1px solid var(--k-stone)",
    borderRadius: 16,
    padding: 48,
    marginBottom: 64
  },
  buildsHead: { display: "grid", gridTemplateColumns: "1.1fr 1fr", gap: 48, alignItems: "end", marginBottom: 36 },
  buildsT: { fontFamily: "var(--serif)", fontSize: "clamp(28px, 3.4vw, 44px)", lineHeight: 1.1, margin: 0, fontWeight: 400, letterSpacing: "-0.01em", color: "var(--k-charcoal)" },
  buildsSub: { fontSize: 14, lineHeight: 1.6, color: "var(--k-muted)", maxWidth: 460 },
  buildsGrid: { display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 18 },
  buildsCard: {
    background: "var(--k-cotton)", color: "var(--k-charcoal)",
    border: "1px solid var(--k-stone)",
    borderRadius: 10, padding: "24px 24px 28px",
    display: "flex", flexDirection: "column", gap: 10,
    minHeight: 180
  },
  buildsLab: { fontSize: 10, letterSpacing: "0.16em", textTransform: "uppercase", color: "var(--k-poppy)", fontWeight: 700 },
  buildsCardT: { fontFamily: "var(--serif)", fontSize: 20, lineHeight: 1.2, fontWeight: 400, margin: 0, letterSpacing: "-0.005em" },
  buildsCardB: { fontSize: 13, lineHeight: 1.55, color: "#5a5755" },

  /* Brand-aware Composer mock */
  comboGrid: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 20 },
  panel: {
    background: "rgba(246,244,239,0.04)",
    border: "1px solid rgba(246,244,239,0.1)",
    borderRadius: 12, overflow: "hidden",
    display: "flex", flexDirection: "column"
  },
  panelBar: {
    padding: "14px 22px",
    background: "rgba(15,14,14,0.5)",
    borderBottom: "1px solid rgba(246,244,239,0.08)",
    display: "flex", justifyContent: "space-between", alignItems: "center",
    fontSize: 12, color: "var(--k-stone)"
  },
  panelLogo: { fontFamily: "var(--serif)", fontStyle: "italic", fontSize: 16, color: "var(--k-cotton)" },
  panelTag: { fontSize: 9, padding: "3px 8px", borderRadius: 3, background: "var(--k-poppy)", color: "var(--k-cotton)", letterSpacing: "0.14em", fontWeight: 700 },
  panelTagAlt: { background: "#D97757" },

  composerBody: { padding: 26, display: "flex", flexDirection: "column", gap: 16, flex: 1 },
  promptLabel: { fontSize: 10, letterSpacing: "0.2em", textTransform: "uppercase", color: "var(--k-poppy)", fontWeight: 700 },
  promptBar: { background: "rgba(246,244,239,0.06)", border: "1px solid rgba(246,244,239,0.18)", borderRadius: 6, padding: "14px 16px", fontSize: 14, color: "var(--k-cotton)", lineHeight: 1.5 },
  brandToggleRow: { display: "flex", gap: 6, flexWrap: "wrap" },
  brandToggle: (active, color) => ({
    fontSize: 11, padding: "6px 12px", fontWeight: 600,
    color: active ? "#fff" : "var(--k-stone)",
    background: active ? color : "transparent",
    border: `1px solid ${active ? color : "rgba(246,244,239,0.18)"}`,
    cursor: "pointer", fontFamily: "var(--sans)", borderRadius: 999
  }),
  output: { background: "var(--k-cotton)", color: "var(--k-charcoal)", borderRadius: 8, padding: 22, flex: 1 },
  brandBadge: (color) => ({ display: "inline-block", padding: "3px 9px", background: color, color: "#fff", fontSize: 10, letterSpacing: "0.14em", fontWeight: 700, marginBottom: 10, borderRadius: 2 }),
  emailMockSubj: { fontSize: 10, letterSpacing: "0.14em", textTransform: "uppercase", color: "#9a9694", marginBottom: 4, fontWeight: 700 },
  emailMockH: { fontFamily: "var(--serif)", fontSize: 22, lineHeight: 1.2, marginBottom: 10 },
  emailMockP: { fontSize: 13, lineHeight: 1.6, color: "#5a5755" },
  meta: { marginTop: 14, paddingTop: 12, borderTop: "1px dashed rgba(35,33,33,0.18)", fontFamily: "var(--serif)", fontStyle: "italic", fontSize: 13, color: "var(--k-poppy)" },

  chatBody: { padding: 22, display: "flex", flexDirection: "column", gap: 14, flex: 1, minHeight: 520 },
  msgUser: { background: "rgba(249,99,83,0.18)", color: "var(--k-cotton)", borderRadius: "14px 14px 4px 14px", alignSelf: "flex-end", padding: "12px 16px", fontSize: 14, lineHeight: 1.5, maxWidth: "85%" },
  msgAi: { background: "rgba(246,244,239,0.06)", color: "var(--k-cotton)", borderRadius: "14px 14px 14px 4px", alignSelf: "flex-start", padding: "14px 16px", fontSize: 14, lineHeight: 1.55, maxWidth: "92%", border: "1px solid rgba(246,244,239,0.1)" },
  actionPill: { display: "inline-block", padding: "4px 10px", borderRadius: 999, background: "rgba(249,99,83,0.18)", color: "var(--k-poppy)", fontSize: 11, letterSpacing: "0.06em", marginRight: 6, marginTop: 6, border: "1px solid rgba(249,99,83,0.4)" },
  aiBranding: { display: "inline-flex", alignItems: "center", gap: 6, fontSize: 10, letterSpacing: "0.18em", textTransform: "uppercase", color: "var(--k-poppy)", fontWeight: 700, marginBottom: 6 },
  pulse: { width: 8, height: 8, borderRadius: 999, background: "var(--k-poppy)", boxShadow: "0 0 12px rgba(249,99,83,0.6)" },
  chatInput: { marginTop: "auto", padding: "12px 14px", background: "rgba(246,244,239,0.06)", border: "1px solid rgba(246,244,239,0.15)", borderRadius: 8, display: "flex", justifyContent: "space-between", alignItems: "center", fontSize: 12, color: "var(--k-stone)" }
};

const aiStylesPart2 = {
  /* === Flows Analyst === */
  faSection: {
    background: "var(--k-cotton)",
    color: "var(--k-charcoal)",
    padding: "140px 56px 160px",
    borderTop: "1px solid var(--k-stone)"
  },
  inner: { maxWidth: 1320, margin: "0 auto" },
  faHead: { display: "grid", gridTemplateColumns: "1.1fr 1fr", gap: 80, alignItems: "end", marginBottom: 56 },
  faEye: { fontSize: 11, letterSpacing: "0.22em", textTransform: "uppercase", color: "var(--k-poppy)", marginBottom: 24, fontWeight: 700 },
  faT: { fontFamily: "var(--serif)", fontWeight: 400, fontSize: "clamp(36px, 4.5vw, 64px)", lineHeight: 1.1, letterSpacing: "-0.01em", margin: 0 },
  faSub: { fontSize: 17, lineHeight: 1.65, color: "var(--k-muted)", maxWidth: 500 },

  /* Wallpaper banner (recreates the PDF page 14 "FLOWS ANALYST" repeated header strip) */
  faBanner: {
    background: "linear-gradient(180deg, #2A1B2E 0%, #16182C 100%)",
    color: "var(--k-cotton)",
    borderRadius: 12, overflow: "hidden",
    marginBottom: 28
  },
  faBannerStrip: {
    overflow: "hidden",
    background: "rgba(0,0,0,0.4)",
    borderBottom: "1px solid rgba(229,181,219,0.18)",
    padding: "14px 0",
    fontFamily: "var(--serif)", fontStyle: "italic",
    fontSize: 22, letterSpacing: "0.16em", textTransform: "uppercase",
    color: "rgba(229,181,219,0.4)",
    whiteSpace: "nowrap",
    textAlign: "center"
  },
  faBannerInner: {
    padding: "56px 56px 60px",
    display: "grid", gridTemplateColumns: "1.1fr 1fr", gap: 56, alignItems: "center"
  },
  faBannerH: { fontFamily: "var(--serif)", fontSize: 44, lineHeight: 1.05, margin: 0, fontWeight: 400, letterSpacing: "-0.01em" },
  faBannerSub: { marginTop: 18, fontSize: 15, lineHeight: 1.65, color: "var(--k-stone)" },
  faAgentCard: {
    background: "rgba(229,181,219,0.06)",
    border: "1px solid rgba(229,181,219,0.4)",
    borderRadius: 12, padding: "32px 36px",
    boxShadow: "0 18px 40px rgba(229,181,219,0.08)"
  },
  faAgentBadge: { fontSize: 11, letterSpacing: "0.22em", textTransform: "uppercase", color: "#E5B5DB", fontWeight: 700, marginBottom: 14 },
  faAgentT: { fontFamily: "var(--serif)", fontSize: 28, lineHeight: 1.15, margin: 0, fontWeight: 400, letterSpacing: "-0.005em" },
  faAgentB: { marginTop: 12, fontSize: 13.5, lineHeight: 1.55, color: "var(--k-stone)" },
  faAgentList: { marginTop: 20, paddingTop: 16, borderTop: "1px dashed rgba(229,181,219,0.3)", display: "flex", flexDirection: "column", gap: 8 },
  faAgentItem: { display: "grid", gridTemplateColumns: "16px 1fr", gap: 12, alignItems: "start", fontSize: 13, color: "var(--k-cotton)" },
  faAgentBullet: { width: 6, height: 6, borderRadius: 999, background: "#E5B5DB", marginTop: 8 },

  /* Capability cards */
  capRow: { display: "grid", gridTemplateColumns: "repeat(5, 1fr)", gap: 14 },
  capCard: {
    background: "var(--nb-bone)",
    border: "1px solid var(--nb-line)",
    borderRadius: 10,
    padding: "26px 24px 28px",
    display: "flex", flexDirection: "column", gap: 10,
    minHeight: 220
  },
  capN: { fontFamily: "var(--serif)", fontSize: 32, color: "var(--nb-rust)", lineHeight: 1, fontWeight: 400 },
  capLab: { fontSize: 10, letterSpacing: "0.18em", textTransform: "uppercase", color: "var(--nb-soft)", fontWeight: 700 },
  capT: { fontSize: 17, lineHeight: 1.25, fontWeight: 700, color: "var(--nb-ink)", margin: 0 },
  capB: { fontSize: 13, lineHeight: 1.55, color: "var(--nb-navy)", marginTop: "auto" },

  /* === MCP === */
  mcpSection: {
    background: "var(--k-charcoal)",
    color: "var(--k-cotton)",
    padding: "140px 56px 160px",
    borderTop: "1px solid rgba(246,244,239,0.08)",
    position: "relative", overflow: "hidden"
  },
  mcpGlow: {
    position: "absolute", top: "-10%", left: "-10%",
    width: "50%", height: "60%",
    background: "radial-gradient(circle at center, rgba(217,119,87,0.2), transparent 65%)",
    filter: "blur(40px)", pointerEvents: "none"
  },
  mcpHead: { display: "grid", gridTemplateColumns: "1.1fr 1fr", gap: 80, alignItems: "end", marginBottom: 56 },
  mcpEye: { fontSize: 11, letterSpacing: "0.22em", textTransform: "uppercase", color: "#FFB991", marginBottom: 24, fontWeight: 700, display: "inline-flex", alignItems: "center", gap: 10 },
  mcpEyeBadge: { fontSize: 9, padding: "3px 8px", background: "#D97757", color: "var(--k-cotton)", borderRadius: 3, letterSpacing: "0.16em", fontWeight: 700 },
  mcpT: { fontFamily: "var(--serif)", fontSize: "clamp(40px, 5vw, 72px)", lineHeight: 1.05, letterSpacing: "-0.015em", margin: 0, fontWeight: 400 },
  mcpSub: { fontSize: 17, lineHeight: 1.65, color: "var(--k-stone)", maxWidth: 520 },

  /* Anthropic partnership highlight */
  partnerCard: {
    background: "linear-gradient(135deg, rgba(217,119,87,0.12) 0%, rgba(217,119,87,0.04) 100%)",
    border: "1px solid rgba(217,119,87,0.4)",
    borderRadius: 16,
    padding: "44px 48px",
    display: "grid", gridTemplateColumns: "1.2fr 1fr", gap: 48,
    alignItems: "center",
    marginBottom: 40
  },
  partnerLabel: { fontSize: 10, letterSpacing: "0.24em", textTransform: "uppercase", color: "#FFB991", fontWeight: 700, marginBottom: 16 },
  partnerLogos: { display: "flex", alignItems: "center", gap: 24, marginBottom: 26 },
  partnerLogo: {
    fontFamily: "var(--serif)", fontSize: 36, lineHeight: 1,
    color: "var(--k-cotton)", fontWeight: 400, letterSpacing: "-0.01em",
    fontStyle: "italic"
  },
  partnerCross: { color: "#D97757", fontSize: 24, fontFamily: "var(--serif)" },
  partnerT: { fontFamily: "var(--serif)", fontSize: 32, lineHeight: 1.15, margin: 0, fontWeight: 400, letterSpacing: "-0.005em" },
  partnerB: { marginTop: 16, fontSize: 14.5, lineHeight: 1.7, color: "var(--k-stone)" },
  partnerQuote: {
    background: "rgba(15,14,14,0.4)",
    border: "1px solid rgba(217,119,87,0.3)",
    borderRadius: 10, padding: "24px 28px"
  },
  partnerQuoteMark: { fontFamily: "var(--serif)", fontSize: 56, lineHeight: 0.4, color: "#D97757", marginBottom: 14 },
  partnerQuoteP: { fontFamily: "var(--serif)", fontStyle: "italic", fontSize: 18, lineHeight: 1.4, color: "var(--k-cotton)", margin: 0 },
  partnerQuoteAttr: { marginTop: 14, fontSize: 12, color: "#FFB991", letterSpacing: "0.06em" },

  /* GIF grid */
  gifGrid: { display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 16, marginBottom: 40 },
  gifCard: {
    background: "rgba(246,244,239,0.04)",
    border: "1px solid rgba(246,244,239,0.12)",
    borderRadius: 12, overflow: "hidden",
    display: "flex", flexDirection: "column"
  },
  gifFrame: {
    aspectRatio: "788 / 540",
    background: "#000",
    overflow: "hidden",
    borderBottom: "1px solid rgba(217,119,87,0.2)"
  },
  gifImg: { width: "100%", height: "100%", objectFit: "cover", display: "block" },
  gifBody: { padding: "20px 24px 24px", display: "flex", flexDirection: "column", gap: 8 },
  gifLab: { fontSize: 10, letterSpacing: "0.18em", textTransform: "uppercase", color: "#FFB991", fontWeight: 700 },
  gifT: { fontFamily: "var(--serif)", fontSize: 19, lineHeight: 1.25, fontWeight: 400, margin: 0, color: "var(--k-cotton)" },
  gifB: { fontSize: 12.5, lineHeight: 1.55, color: "var(--k-stone)" },

  /* Use cases / capability block */
  mcpUse: { display: "flex", flexDirection: "column", gap: 12 },
  mcpUseItem: { display: "grid", gridTemplateColumns: "16px 1fr", gap: 12, fontSize: 13.5, lineHeight: 1.55, color: "var(--k-cotton)" },
  mcpBullet: { width: 7, height: 7, borderRadius: 999, background: "#D97757", marginTop: 7 }
};

const AGENTS_CREATORS = ["Flow Creator", "Campaign Creator", "Segmentation Creator", "Content Creator"];
const AGENTS_ANALYSTS = [
{ name: "Flows Analyst", alpha: true },
{ name: "Campaign Analyst" },
{ name: "Segmentation Analyst" },
{ name: "Content Analyst" }];


const COMPOSER_VARIANTS = [
{
  brand: "JD Williams", color: "var(--b-jdwilliams)",
  subj: "Subject · Your autumn picks are ready",
  h: "We've pulled a rail just for you.",
  p: "Six new arrivals in your saved sizes. Three of them work with your Insider Loyalty rewards. The new season is in.",
  meta: "Voice match: JD Williams editorial · Predicted open 28.4%"
},
{
  brand: "Simply Be", color: "var(--b-simplybe)",
  subj: "Subject · This week's drop, in your size",
  h: "47 new pieces. Every one in your size.",
  p: "Filtered by your saved fit profile. Loyalty members get early access tonight at 7pm — use code EARLY at checkout.",
  meta: "Voice match: Simply Be confident · Predicted open 34.1%"
},
{
  brand: "Heritage Brands", color: "var(--b-heritage)",
  subj: "Subject · 4-week free credit on home essentials",
  h: "Refresh now. Spread the cost.",
  p: "Selected bedding, cookware and storage with 4-week free credit on your Fashion Voucher account. Subject to status. Representative 27.9% APR variable.",
  meta: "FS template · Readability 62 · Compliance-checked"
}];


const BUILDS = [
{ lab: "Audience + content", t: "Multi-channel campaign, ready to send.", b: "Audience, messages, content, channels — all generated together as one launch-ready campaign, not stitched from separate tools." },
{ lab: "Brand guardrails", t: "Your voice, every output.", b: "Generates within N Brown's specific voice and rules — per brand account — from the very first output." },
{ lab: "14+ years of intelligence", t: "Grounded in retail data at scale.", b: "Trained on performance data from 193k+ brands and 8B+ consumer profiles. Decisions backed by what's worked across retail." },
{ lab: "Human-in-the-loop", t: "Composer drafts. You approve.", b: "Full strategic control — nothing launches without your sign-off. Composer does the heavy lifting; you make the final call." },
{ lab: "Multi-turn conversation", t: "Refine in plain English.", b: "Refine through natural conversation and file uploads. 'Make the subject line punchier.' 'Shorten the SMS.'" },
{ lab: "Always-on optimisation", t: "Performance recommendations.", b: "Constantly surfaces opportunities, identifies gaps, and recommends what to launch, fix or optimise." }];


const FLOWS_ANALYST_CAPS = [
{ n: "01", lab: "Auditing", t: "Audit every live flow.", b: "Flow-by-flow health check across the portfolio — engagement, deliverability, channel mix, conversion. Run it weekly, automated." },
{ n: "02", lab: "Agent Skills", t: "Specialist skills, on tap.", b: "Plug Flows Analyst skills into your workflows — diagnose a single flow, summarise a portfolio, or grade an end-to-end journey." },
{ n: "03", lab: "Journey Mapping", t: "See the journey, end-to-end.", b: "Visualise the customer journey across every flow that touches them. Surface the cracks, the dead ends, the missing handovers." },
{ n: "04", lab: "Collision Detection", t: "Stop flows fighting each other.", b: "Detect when two flows compete for the same customer in the same window — and recommend the right precedence rule before the customer feels it." },
{ n: "05", lab: "Omnichannel Optimisation", t: "Right flow, right channel.", b: "Recommend channel reassignments across email, SMS, push, WhatsApp — based on per-profile affinity and predicted lift, not blanket rules." }];


const ANTHROPIC_GIFS = [
{
  id: "gifReporting",
  src: "https://cdn.sanity.io/images/6ct6b26e/marketing-prod/92e564b79fa9b9b09351538e5eb8685b2dfb3553-788x540.gif",
  lab: "Use case · Reporting",
  t: "Weekly performance digest, on demand.",
  b: "Ask Claude for a weekly Klaviyo performance summary — campaigns, revenue, anomalies, brand-by-brand — delivered as a digest, ready to share."
},
{
  id: "gifContent",
  src: "https://cdn.sanity.io/images/6ct6b26e/marketing-prod/52d01b101a73bb74c8a569c4c8926ee37e00a7ef-788x540.gif",
  lab: "Use case · Content",
  t: "Email copy for lapsed customers.",
  b: "Generate marketing copy grounded in the segment's behaviour. Claude pulls the segment via MCP, drafts the email, sends it back for review."
},
{
  id: "gifAuditing",
  src: "https://cdn.sanity.io/images/6ct6b26e/marketing-prod/31ce36f84bdab1236dc68d98f4388fec0a3ec656-788x540.gif",
  lab: "Use case · Auditing",
  t: "Flow audit, flagged drop-offs.",
  b: "Claude audits Klaviyo flows, flags low open rates and surfaces the specific steps to fix — without ever leaving the chat window."
}];


function AIEfficiency() {
  const [variant, setVariant] = useStateAI(0);
  const v = COMPOSER_VARIANTS[variant];

  return (
    <React.Fragment>
      {/* ============ Composer Agent Family · Landing ============ */}
      <section id="ai" style={aiStyles.cafSection} data-screen-label="06 AI Innovation · Composer family">
        <div style={aiStyles.glow} />
        <div style={aiStyles.inner}>
          <div style={aiStyles.cafGrid}>
            <div style={aiStyles.cafLeft}>
              <div style={aiStyles.cafEye}>
                <span>AI Innovation · Composer Agent Family</span>
                <span style={aiStyles.cafBeta}>BETA</span>
              </div>
              <h2 style={aiStyles.cafT}>
                One Composer.<br />
                <span className="serif-i" style={{ color: "#E5B5DB" }}>Eight specialists.</span>
              </h2>
              <p style={aiStyles.cafB}>
                Composer splits into two sides for the N Brown team. Creators
                build from a brief — Flow, Campaign, Segmentation, Content.
                Analysts sit alongside the work and audit, optimise, diagnose.
                More agents shipping continuously through 2026.
              </p>
              <div style={aiStyles.cafFootline}>
                The Composer family is the engine underneath every AI feature
                on this tab — the Composer hero you'll see next, the Flows
                Analyst deep-dive, and the Claude-over-MCP integration with
                Anthropic.
              </div>
            </div>

            <div style={aiStyles.cafRight}>
              <div style={aiStyles.cafHeader}>Composer</div>
              <div style={aiStyles.cafLanes}>
                <div style={aiStyles.cafLaneHead}>Creators</div>
                <div style={aiStyles.cafLaneHead}>Analysts</div>
              </div>
              <div style={aiStyles.cafColumns}>
                <div style={aiStyles.cafPillList}>
                  {AGENTS_CREATORS.map((a) => <div key={a} style={aiStyles.cafPill}>{a}</div>)}
                </div>
                <div style={aiStyles.cafPillList}>
                  {AGENTS_ANALYSTS.map((a) =>
                  <div key={a.name} style={aiStyles.cafPill}>
                      {a.name}
                      {a.alpha && <span style={aiStyles.cafAlpha}>ALPHA</span>}
                    </div>
                  )}
                </div>
              </div>
              <div style={aiStyles.cafMore}>More coming soon</div>
            </div>
          </div>
        </div>
      </section>

      {/* ============ You dream it · Composer builds it ============ */}
      <section style={aiStyles.composerSection} data-screen-label="06 AI Innovation · Composer">
        <div style={aiStyles.composerGlow} />
        <div style={aiStyles.inner}>
          <div style={aiStyles.head}>
            <div>
              <div style={aiStyles.eyebrow}>Composer · Vibe marketing era</div>
              <h2 style={aiStyles.title}>
                You dream it.<br />
                <span className="serif-i" style={{ color: "var(--k-poppy)" }}>Composer builds it.</span>
              </h2>
            </div>
            <p style={aiStyles.sub}>
              Take an N Brown brief and turn it into a complete, ready-to-launch
              campaign — audience, copy, subject line, images, channels and
              send logic — from a single prompt. Welcome to the vibe marketing era.
            </p>
          </div>

          <div style={aiStyles.heroRow}>
            <div style={aiStyles.composerHero}>
              <img
                src={window.__asset("composerHero", "https://cdn.sanity.io/images/6ct6b26e/marketing-prod/1348f45329aa4d923930b7b97e8f064c259d5382-4098x1542.png")}
                alt="Klaviyo Composer · AI agent for vibe marketing"
                style={aiStyles.composerHeroImg} />
              
              <div style={aiStyles.composerHeroFoot}>
                <div style={aiStyles.composerHeroLine}>
                  Describe your goal. Approve the work. Launch directly in Klaviyo.
                </div>
                <a href="https://www.klaviyo.com/uk/composer" target="_blank" rel="noopener" style={aiStyles.composerHeroLink}>
                  See Composer at klaviyo.com/uk/composer <span style={{ fontSize: 16 }}>→</span>
                </a>
              </div>
            </div>
            <div style={aiStyles.kpiStack}>
              <div style={aiStyles.kpi}>
                <div style={aiStyles.kpiNum}>14<span style={{ fontSize: 22, color: "var(--k-stone)", marginLeft: 4 }}>yrs+</span></div>
                <div style={aiStyles.kpiLab}>Of performance data</div>
                <div style={aiStyles.kpiSub}>Every draft grounded in what&rsquo;s actually driven revenue across retail since 2012.</div>
              </div>
              <div style={aiStyles.kpi}>
                <div style={aiStyles.kpiNum}>193k<span style={{ fontSize: 22, color: "var(--k-stone)", marginLeft: 4 }}>+</span></div>
                <div style={aiStyles.kpiLab}>Brands' worth of signal</div>
                <div style={aiStyles.kpiSub}>Pattern-matched against the brands N Brown competes with — not generic AI training data.</div>
              </div>
              <div style={aiStyles.kpi}>
                <div style={aiStyles.kpiNum}>8B<span style={{ fontSize: 22, color: "var(--k-stone)", marginLeft: 4 }}>+</span></div>
                <div style={aiStyles.kpiLab}>Consumer profiles</div>
                <div style={aiStyles.kpiSub}>The behavioural intelligence layer underneath every Composer output.</div>
              </div>
            </div>
          </div>

          <div style={aiStyles.builds}>
            <div style={aiStyles.buildsHead}>
              <div>
                <div style={aiStyles.eyebrow}>The Klaviyo advantage</div>
                <h3 style={aiStyles.buildsT}>
                  Composer builds, refines, and optimises campaigns —<br />
                  <span className="serif-i" style={{ color: "var(--k-poppy)" }}>you just approve</span>.
                </h3>
              </div>
              <p style={aiStyles.buildsSub}>
                For an N Brown CRM team running four brand accounts plus FS
                comms, Composer is the lever that flips the 70/30 production
                ratio. Drafts in minutes. Brand-safe. Performance-grounded.
              </p>
            </div>
            <div style={aiStyles.buildsGrid}>
              {BUILDS.map((b) =>
              <div key={b.lab} style={aiStyles.buildsCard}>
                  <div style={aiStyles.buildsLab}>{b.lab}</div>
                  <h4 style={aiStyles.buildsCardT}>{b.t}</h4>
                  <div style={aiStyles.buildsCardB}>{b.b}</div>
                </div>
              )}
            </div>
          </div>
        </div>
      </section>

      {/* ============ Flows Analyst deep dive ============ */}
      <section style={aiStylesPart2.faSection} data-screen-label="06 AI Innovation · Flows Analyst">
        <div style={aiStylesPart2.inner}>
          <div style={aiStylesPart2.faHead}>
            <div>
              <div style={aiStylesPart2.faEye}>Flows Analyst · A closer look</div>
              <h2 style={aiStylesPart2.faT}>
                The analyst<br />
                <span className="serif-i" style={{ color: "var(--k-poppy)" }}>that watches every flow</span>.
              </h2>
            </div>
            <p style={aiStylesPart2.faSub}>
              Inside Composer&rsquo;s Analyst lane, Flows Analyst is the first
              specialist live. It diagnoses, optimises, and audits the
              automations that compound the most value for the N Brown
              portfolio.
            </p>
          </div>

          <div style={aiStylesPart2.faBanner}>
            <div style={aiStylesPart2.faBannerStrip}>
              FLOWS ANALYST &nbsp; · &nbsp; FLOWS ANALYST &nbsp; · &nbsp; FLOWS ANALYST &nbsp; · &nbsp; FLOWS ANALYST &nbsp; · &nbsp; FLOWS ANALYST &nbsp; · &nbsp; FLOWS ANALYST &nbsp; · &nbsp; FLOWS ANALYST
            </div>
            <div style={aiStylesPart2.faBannerInner}>
              <div>
                <h3 style={aiStylesPart2.faBannerH}>
                  Auditing. Mapping. Optimising.<br />
                  <span className="serif-i" style={{ color: "#E5B5DB" }}>Across the portfolio.</span>
                </h3>
                <p style={aiStylesPart2.faBannerSub}>
                  Flows Analyst is a Composer agent purpose-built for the
                  automations that drive long-term revenue. It sits over every
                  flow across JD Williams, Simply Be, Heritage Brands and
                  Jacamo — and surfaces what to fix, what to retire, what to
                  ship next.
                </p>
              </div>
              <div style={aiStylesPart2.faAgentCard}>
                <div style={aiStylesPart2.faAgentBadge}>Composer Agent · Flows Analyst · ALPHA</div>
                <h4 style={aiStylesPart2.faAgentT}>The agent skills.</h4>
                <p style={aiStylesPart2.faAgentB}>
                  Five capabilities ship with Flows Analyst at GA — each one
                  callable from the Klaviyo UI, from Composer, or from Claude
                  over MCP.
                </p>
                <div style={aiStylesPart2.faAgentList}>
                  <div style={aiStylesPart2.faAgentItem}><span style={aiStylesPart2.faAgentBullet} /><span>Auditing</span></div>
                  <div style={aiStylesPart2.faAgentItem}><span style={aiStylesPart2.faAgentBullet} /><span>Agent Skills</span></div>
                  <div style={aiStylesPart2.faAgentItem}><span style={aiStylesPart2.faAgentBullet} /><span>Journey Mapping</span></div>
                  <div style={aiStylesPart2.faAgentItem}><span style={aiStylesPart2.faAgentBullet} /><span>Collision Detection</span></div>
                  <div style={aiStylesPart2.faAgentItem}><span style={aiStylesPart2.faAgentBullet} /><span>Omnichannel Optimisation</span></div>
                </div>
              </div>
            </div>
          </div>

          <div style={aiStylesPart2.capRow}>
            {FLOWS_ANALYST_CAPS.map((c) =>
            <div key={c.n} style={aiStylesPart2.capCard}>
                <div style={aiStylesPart2.capN}>{c.n}</div>
                <div style={aiStylesPart2.capLab}>{c.lab}</div>
                <h4 style={aiStylesPart2.capT}>{c.t}</h4>
                <div style={aiStylesPart2.capB}>{c.b}</div>
              </div>
            )}
          </div>
        </div>
      </section>

      {/* ============ MCP server · Anthropic partnership + GIFs ============ */}
      <section style={aiStylesPart2.mcpSection} data-screen-label="06 AI Innovation · MCP · Anthropic">
        <div style={aiStylesPart2.mcpGlow} />
        <div style={aiStylesPart2.inner}>
          <div style={aiStylesPart2.mcpHead}>
            <div>
              <div style={aiStylesPart2.mcpEye}>
                <span>MCP server · Klaviyo × Anthropic</span>
                <span style={aiStylesPart2.mcpEyeBadge}>PARTNERSHIP</span>
              </div>
              <h2 style={aiStylesPart2.mcpT}>
                Connect Klaviyo MCP<br />
                <span className="serif-i" style={{ color: "#FFB991" }}>with any AI tool</span>.
              </h2>
            </div>
            <p style={aiStylesPart2.mcpSub}>
              Klaviyo&rsquo;s MCP Connector is live in the Claude Connector
              directory. Ask Claude questions about your N Brown data, draft
              campaigns, audit flows — the action lands in Klaviyo in real
              time, scoped to the right brand account.
            </p>
          </div>

          {/* Anthropic partnership highlight */}
          <div style={aiStylesPart2.partnerCard}>
            <div>
              <div style={aiStylesPart2.partnerLabel}>The partnership</div>
              <div style={aiStylesPart2.partnerLogos}>
                <span style={aiStylesPart2.partnerLogo}>Klaviyo</span>
                <span style={aiStylesPart2.partnerCross}>×</span>
                <span style={aiStylesPart2.partnerLogo}>Anthropic</span>
              </div>
              <h3 style={aiStylesPart2.partnerT}>
                Agentic marketing workflows,<br />
                <span className="serif-i" style={{ color: "#FFB991" }}>built into Claude</span>.
              </h3>
              <p style={aiStylesPart2.partnerB}>
                Expanded integration between Klaviyo and Anthropic brings
                agentic marketing workflows to Claude. New capabilities
                including Query Metric Aggregates and MCP Apps support — all
                accessible from inside Claude, all grounded in your live
                Klaviyo data.
              </p>
            </div>
            <div style={aiStylesPart2.partnerQuote}>
              <div style={aiStylesPart2.partnerQuoteMark}>&ldquo;</div>
              <p style={aiStylesPart2.partnerQuoteP}>
                Marketing teams are overwhelmed by reporting and repetitive
                production work. With Anthropic, we&rsquo;re turning Claude
                into an agentic surface for Klaviyo.
              </p>
              <div style={aiStylesPart2.partnerQuoteAttr}>Andrew Bialecki · Co-founder &amp; co-CEO, Klaviyo</div>
            </div>
          </div>

          {/* GIFs grid */}
          <div style={aiStylesPart2.gifGrid}>
            {ANTHROPIC_GIFS.map((g, i) =>
            <div key={i} style={aiStylesPart2.gifCard}>
                <div style={aiStylesPart2.gifFrame}>
                  <img src={window.__asset(g.id, g.src)} alt={g.t} style={aiStylesPart2.gifImg} loading="lazy" />
                </div>
                <div style={aiStylesPart2.gifBody}>
                  <div style={aiStylesPart2.gifLab}>{g.lab}</div>
                  <h4 style={aiStylesPart2.gifT}>{g.t}</h4>
                  <div style={aiStylesPart2.gifB}>{g.b}</div>
                </div>
              </div>
            )}
          </div>

          <div style={aiStylesPart2.mcpUse}>
            <div style={aiStylesPart2.mcpUseItem}>
              <span style={aiStylesPart2.mcpBullet} />
              <span>Secure OAuth or private Klaviyo API key — audit-logged, scoped to the brand account the user has permission for.</span>
            </div>
            <div style={aiStylesPart2.mcpUseItem}>
              <span style={aiStylesPart2.mcpBullet} />
              <span><strong style={{ color: "var(--k-cotton)" }}>Query Metric Aggregates</strong> — Claude pulls live performance numbers across N Brown&rsquo;s portfolio without an analyst in the loop.</span>
            </div>
            <div style={aiStylesPart2.mcpUseItem}>
              <span style={aiStylesPart2.mcpBullet} />
              <span><strong style={{ color: "var(--k-cotton)" }}>MCP Apps support</strong> — invoke Klaviyo skills from Claude conversation, drafts and segment work materialise back in the platform.</span>
            </div>
            <div style={aiStylesPart2.mcpUseItem}>
              <span style={aiStylesPart2.mcpBullet} />
              <span>Listed in the <strong style={{ color: "var(--k-cotton)" }}>Claude Connector directory</strong> — N Brown can enable it the day Claude is signed off internally.</span>
            </div>
          </div>
        </div>
      </section>
    </React.Fragment>);

}