// jsx/Glyphs.jsx — shared brand integration logos. Used by the AI Agents page
// (floating chips, library cards, integrations band) and the homepage (console
// stack row, service cards, integrations strip). One source of truth so the
// logo set never drifts between pages. Compact, recognizable at ~20-30px.
function FloatGlyph({ kind }) {
  switch (kind) {
    case "gmail":    return (<svg viewBox="0 0 24 24"><rect x="2" y="5" width="20" height="14" rx="2" fill="#fff"/><path d="M3 6.5l9 6 9-6" fill="none" stroke="#EA4335" strokeWidth="2.4" strokeLinejoin="round"/></svg>);
    case "calendar": return (<svg viewBox="0 0 24 24"><rect x="3" y="5" width="18" height="16" rx="2.5" fill="#fff" stroke="#E2E2DE"/><rect x="3" y="5" width="18" height="5" rx="2.5" fill="#4285F4"/><text x="12" y="18.5" fontSize="8.5" fontWeight="700" fill="#202124" textAnchor="middle" fontFamily="Hanken Grotesk, system-ui">31</text></svg>);
    case "slack":    return (<svg viewBox="0 0 24 24"><rect x="10" y="3"  width="4" height="9" rx="2" fill="#36C5F0"/><rect x="3" y="10" width="9" height="4" rx="2" fill="#2EB67D"/><rect x="10" y="12" width="4" height="9" rx="2" fill="#ECB22E"/><rect x="12" y="10" width="9" height="4" rx="2" fill="#E01E5A"/></svg>);
    case "notion":   return (<svg viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="5" fill="#111"/><path d="M9 8v8M9 8l6 8M15 8v8" stroke="#fff" strokeWidth="1.6" fill="none" strokeLinecap="round" strokeLinejoin="round"/></svg>);
    case "drive":    return (<svg viewBox="0 0 24 24"><polygon points="9,3 15,3 22,15 16,15" fill="#FFCF63"/><polygon points="9,3 2,15 5,20 12,9" fill="#4688F1"/><polygon points="5,20 19,20 22,15 8,15" fill="#2A9E63"/></svg>);
    case "sheets":   return (<svg viewBox="0 0 24 24"><rect x="4" y="3" width="16" height="18" rx="3" fill="#188038"/><rect x="7" y="8" width="10" height="9" rx="1" fill="#fff"/><path d="M7 11.5h10M7 14.5h10M12 8.5v8.5" stroke="#188038" strokeWidth="1.2"/></svg>);
    case "github":   return (<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="11" fill="#181717"/><path d="M9 16l-2-2 2-2M15 12l2 2-2 2M13 9l-2 6" stroke="#fff" strokeWidth="1.5" fill="none" strokeLinecap="round" strokeLinejoin="round"/></svg>);
    case "discord":  return (<svg viewBox="0 0 24 24"><rect x="2" y="4" width="20" height="16" rx="6" fill="#5865F2"/><circle cx="9" cy="12" r="1.7" fill="#fff"/><circle cx="15" cy="12" r="1.7" fill="#fff"/></svg>);
    case "linkedin": return (<svg viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="4" fill="#0A66C2"/><circle cx="7.5" cy="8" r="1.4" fill="#fff"/><rect x="6.2" y="10.5" width="2.6" height="7" fill="#fff"/><path d="M11 17.5v-4a2.3 2.3 0 0 1 4.6 0v4M11 10.5v7" stroke="#fff" strokeWidth="2.4" fill="none" strokeLinecap="butt"/></svg>);
    case "asana":    return (<svg viewBox="0 0 24 24"><circle cx="12" cy="7" r="3.3" fill="#F06A6A"/><circle cx="7" cy="15.5" r="3.3" fill="#F06A6A"/><circle cx="17" cy="15.5" r="3.3" fill="#F06A6A"/></svg>);
    case "whatsapp": return (<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="11" fill="#25D366"/><path d="M8.5 8.2c.4-.2.9 0 1.1.4l.6 1.4c.1.3 0 .6-.2.8l-.5.5c.6 1.1 1.4 1.9 2.5 2.5l.5-.5c.2-.2.5-.3.8-.2l1.4.6c.4.2.6.7.4 1.1-.5 1.1-1.8 1.6-2.9 1.2A8 8 0 0 1 7.3 11c-.4-1.1.1-2.4 1.2-2.8z" fill="#fff"/></svg>);
    case "telegram": return (<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="11" fill="#229ED9"/><path d="M6.5 11.8l10-3.8-1.7 8.6-2.7-2-1.6 1.5-.4-2.8 4.4-3.9-5.5 3.2z" fill="#fff"/></svg>);
    case "hubspot":  return (<svg viewBox="0 0 24 24"><rect x="2" y="2" width="20" height="20" rx="6" fill="#fff" stroke="#E2E2DE"/><circle cx="11" cy="14" r="3.6" fill="none" stroke="#FF7A59" strokeWidth="1.7"/><circle cx="16.5" cy="8" r="1.6" fill="#FF7A59"/><path d="M16.5 8v3.5a3.6 3.6 0 0 1-2.2 3.3M11 10.4V7" stroke="#FF7A59" strokeWidth="1.5" fill="none"/></svg>);
    case "xero":     return (<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="11" fill="#13B5EA"/><text x="12" y="16.5" fontSize="13" fontWeight="800" fill="#fff" textAnchor="middle" fontFamily="Hanken Grotesk, system-ui">X</text></svg>);
    case "granola":  return (<svg viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="6" fill="#1C1B19"/><text x="12" y="17" fontSize="13" fontWeight="800" fill="#E9DCC3" textAnchor="middle" fontFamily="Hanken Grotesk, system-ui">g</text></svg>);
    case "onedrive": return (<svg viewBox="0 0 24 24"><path d="M7.5 11.5C8 8.4 10.7 6 14 6c2.4 0 4.5 1.3 5.6 3.3.3-.1.6-.1 1-.1 2.4 0 4.4 1.9 4.4 4.2 0 2.3-2 4.1-4.4 4.1H7c-2.4 0-4.5-1.8-4.5-4 0-2 1.5-3.6 3.5-4 .4 0 .7 0 1 .1z" fill="#0078D4"/></svg>);
    case "jira":     return (<svg viewBox="0 0 24 24"><path d="M12 2.5l9 9H3z" fill="#2684FF"/><path d="M12 8.5l6 6H6z" fill="#0052CC"/></svg>);
    case "intercom": return (<svg viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="6" fill="#1F8DED"/><g fill="#fff"><rect x="6.4" y="7.6" width="1.8" height="7" rx="0.9"/><rect x="9.6" y="6.6" width="1.8" height="9" rx="0.9"/><rect x="12.6" y="6.6" width="1.8" height="9" rx="0.9"/><rect x="15.8" y="7.6" width="1.8" height="7" rx="0.9"/></g></svg>);
    case "airtable": return (<svg viewBox="0 0 24 24"><path d="M12 4l8 3.2-8 3.2-8-3.2z" fill="#FCB400"/><path d="M12.6 11.4l7.4-3v6.2l-7.4 3.4z" fill="#18BFFF"/><path d="M4 8.4l7 3v6.6l-7-3.2z" fill="#F82B60"/></svg>);
    case "clickup":  return (<svg viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="6" fill="#7B68EE"/><path d="M7 14l3.5-3 3.5 3" fill="none" stroke="#fff" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round"/></svg>);
    case "salesforce": return (<svg viewBox="0 0 24 24"><path d="M9.2 9.6a3.2 3.2 0 0 1 5.6-1.3 3.6 3.6 0 0 1 1.3-.3 3.4 3.4 0 1 1 .5 6.8H7.6a3 3 0 0 1-.5-5.9 3.2 3.2 0 0 1 2.1.7z" fill="#00A1E0"/></svg>);
    case "stripe":   return (<svg viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="5" fill="#635BFF"/><text x="12" y="17" fontSize="13" fontWeight="800" fill="#fff" textAnchor="middle" fontFamily="Hanken Grotesk, system-ui">S</text></svg>);
    case "zoom":     return (<svg viewBox="0 0 24 24"><rect x="3" y="4.5" width="18" height="15" rx="6" fill="#2D8CFF"/><path d="M8 10.5a1.5 1.5 0 0 1 1.5-1.5h3a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-3A1.5 1.5 0 0 1 8 13.5z" fill="#fff"/><path d="M15 11l2.6-1.6v5.2L15 13z" fill="#fff"/></svg>);
    case "figma":    return (<svg viewBox="0 0 24 24"><circle cx="13.8" cy="12" r="2.6" fill="#1ABCFE"/><path d="M8.6 4.8h3v4.4h-3a2.2 2.2 0 0 1 0-4.4z" fill="#F24E1E"/><path d="M11.6 4.8h1.8a2.2 2.2 0 0 1 0 4.4h-1.8z" fill="#FF7262"/><path d="M8.6 9.2h3v4.4h-3a2.2 2.2 0 0 1 0-4.4z" fill="#A259FF"/><path d="M11.6 13.6v2.2a2.2 2.2 0 1 1-2.2-2.2z" fill="#0ACF83"/></svg>);
    case "docs":     return (<svg viewBox="0 0 24 24"><rect x="5" y="3" width="14" height="18" rx="2.5" fill="#4285F4"/><rect x="7.5" y="7" width="9" height="1.6" rx="0.8" fill="#fff"/><rect x="7.5" y="10.2" width="9" height="1.6" rx="0.8" fill="#fff"/><rect x="7.5" y="13.4" width="6" height="1.6" rx="0.8" fill="#fff"/></svg>);
    case "dropbox":  return (<svg viewBox="0 0 24 24"><g fill="#0061FF"><path d="M7 3L2 6.3l5 3.3 5-3.3z"/><path d="M17 3l5 3.3-5 3.3-5-3.3z"/><path d="M2 12.9l5-3.3 5 3.3-5 3.3z"/><path d="M12 12.9l5-3.3 5 3.3-5 3.3z"/><path d="M7 17l5-3.3 5 3.3-5 3.2z"/></g></svg>);
    case "gitlab":   return (<svg viewBox="0 0 24 24"><path d="M12 20.5l3.4-10.5H8.6z" fill="#E24329"/><path d="M12 20.5L8.6 10H3.8z" fill="#FC6D26"/><path d="M3.8 10l-1 3.2a.7.7 0 0 0 .25.78L12 20.5z" fill="#FCA326"/><path d="M12 20.5l3.4-10.5h4.8z" fill="#FC6D26"/><path d="M20.2 10l1 3.2a.7.7 0 0 1-.25.78L12 20.5z" fill="#FCA326"/></svg>);
    case "shopify":  return (<svg viewBox="0 0 24 24"><path d="M8.2 6.4C8.2 4.5 9.9 3 12 3s3.8 1.5 3.8 3.4" fill="none" stroke="#5E8E3E" strokeWidth="1.5"/><path d="M6.4 7h11.2l1.1 12.6a.6.6 0 0 1-.6.65H5.9a.6.6 0 0 1-.6-.65z" fill="#95BF47"/><text x="12" y="16.5" fontSize="8" fontWeight="800" fill="#fff" textAnchor="middle" fontFamily="Hanken Grotesk, system-ui">S</text></svg>);
    case "loom":     return (<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="11" fill="#625DF5"/><g fill="#fff"><circle cx="12" cy="6.5" r="1.3"/><circle cx="12" cy="17.5" r="1.3"/><circle cx="6.5" cy="12" r="1.3"/><circle cx="17.5" cy="12" r="1.3"/><circle cx="8.1" cy="8.1" r="1.3"/><circle cx="15.9" cy="15.9" r="1.3"/><circle cx="8.1" cy="15.9" r="1.3"/><circle cx="15.9" cy="8.1" r="1.3"/></g></svg>);
    case "monday":   return (<svg viewBox="0 0 24 24"><rect x="4" y="7" width="16" height="2.8" rx="1.4" fill="#E2445C"/><rect x="4" y="10.6" width="16" height="2.8" rx="1.4" fill="#FDAB3D"/><rect x="4" y="14.2" width="16" height="2.8" rx="1.4" fill="#00CA72"/></svg>);
    case "ga4":      return (<svg viewBox="0 0 24 24"><rect x="13" y="4" width="6" height="16" rx="3" fill="#F9AB00"/><circle cx="8" cy="16.5" r="3.5" fill="#E8710A"/></svg>);
    case "tenable":  return (<svg viewBox="0 0 24 24"><rect x="2" y="2" width="20" height="20" rx="6" fill="#003B4A"/><circle cx="12" cy="12" r="5" fill="none" stroke="#1BC9C0" strokeWidth="2.4"/></svg>);
    case "vanta":    return (<svg viewBox="0 0 24 24"><rect x="2" y="2" width="20" height="20" rx="6" fill="#0B3B3C"/><path d="M7 7.5l5 9 5-9" fill="none" stroke="#3CE0C4" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round"/></svg>);
    default:         return (<svg viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="6" fill="#0E0E0E"/><text x="12" y="17" fontSize="12" fontWeight="800" fill="#FF0066" textAnchor="middle" fontFamily="Hanken Grotesk, system-ui">Z</text></svg>);
  }
}

// Brand Z mark — black (or light, on dark) Z with an offset magenta shadow.
// Shared across every page. `onDark` flips the Z to paper so it reads on
// dark surfaces. (The favicon is the same mark, baked into zarco-mark.svg.)
function ZMark({ onDark }) {
  const zf = onDark ? "#FAFAF7" : "#0E0E0E";
  const pts = ["26,22 100,22 100,42 26,42", "26,84 100,84 100,104 26,104", "79,42 100,42 47,84 26,84"];
  return (
    <svg viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
      <g fill="#FF0066" transform="translate(7,8)">{pts.map((p, i) => <polygon key={i} points={p} />)}</g>
      <g fill={zf}>{pts.map((p, i) => <polygon key={i} points={p} />)}</g>
    </svg>
  );
}

// Agent faces — minimal flat-vector busts so agents read as colleagues, not
// letter tiles. Muted tones on the dark Console surfaces; one per named agent.
function AgentFace({ who }) {
  const faces = {
    juno: ( // Research · dark bob, plum top
      <svg viewBox="0 0 48 48" aria-hidden="true">
        <circle cx="24" cy="25" r="21" fill="#2E2A33" />
        <path d="M10 48a14 14 0 0 1 28 0z" fill="#7C5CB0" />
        <circle cx="24" cy="21" r="9.5" fill="#E8B98F" />
        <path d="M13.5 21c0-7 4.6-11.5 10.5-11.5S34.5 14 34.5 21c0 1.6-.3 2.8-.8 3.8-.5-4-1.6-6.3-3.2-7.4-2 1.6-8.6 2.2-12.3.6-.9 1.3-1.6 3.6-1.9 6.8-.5-1-.8-2.2-.8-3.8z" fill="#221C26" />
      </svg>
    ),
    ezra: ( // Finance · cropped hair, slate top
      <svg viewBox="0 0 48 48" aria-hidden="true">
        <circle cx="24" cy="25" r="21" fill="#283038" />
        <path d="M10 48a14 14 0 0 1 28 0z" fill="#4A6B8A" />
        <circle cx="24" cy="21" r="9.5" fill="#9C6B47" />
        <path d="M14.5 19.5c.6-6 4.4-9.5 9.5-9.5s8.9 3.5 9.5 9.5c-1.6-2.6-3.4-4-5-4.2-3 1.2-6.8 1.2-9.4 0-1.5.4-3.2 1.7-4.6 4.2z" fill="#15110E" />
      </svg>
    ),
    mara: ( // Support · curls, sage top
      <svg viewBox="0 0 48 48" aria-hidden="true">
        <circle cx="24" cy="25" r="21" fill="#2B3129" />
        <path d="M10 48a14 14 0 0 1 28 0z" fill="#5F7D5C" />
        <circle cx="24" cy="22" r="9" fill="#C98E62" />
        <path d="M24 8.5c7 0 11.5 4.6 11.5 10.4 0 2.4-.7 4-1.8 5.1.3-3.4-.9-5.6-2.6-6.6-1.6 1.2-4.3 1.8-7.1 1.8s-5.5-.6-7.1-1.8c-1.7 1-2.9 3.2-2.6 6.6-1.1-1.1-1.8-2.7-1.8-5.1C12.5 13.1 17 8.5 24 8.5z" fill="#1F1812" />
        <circle cx="13.5" cy="17" r="3.4" fill="#1F1812" /><circle cx="34.5" cy="17" r="3.4" fill="#1F1812" />
      </svg>
    ),
  };
  return faces[who] || faces.juno;
}

window.FloatGlyph = FloatGlyph;
window.ZMark = ZMark;
window.AgentFace = AgentFace;
