// icons.jsx   small icon set used across the site (stroke-based, currentColor)

const Icon = ({ name, size = 20, ...rest }) => {
  const s = { width: size, height: size, display: 'block', flexShrink: 0 };
  const common = {
    viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor',
    strokeWidth: 1.6, strokeLinecap: 'round', strokeLinejoin: 'round',
    style: s, 'aria-hidden': true, ...rest,
  };
  switch (name) {
    case 'arrow':
      return <svg {...common}><path d="M5 12h14M13 6l6 6-6 6"/></svg>;
    case 'sparkle':
      return <svg {...common}><path d="M12 3v6M12 15v6M3 12h6M15 12h6M6.5 6.5l4 4M13.5 13.5l4 4M17.5 6.5l-4 4M10.5 13.5l-4 4"/></svg>;
    case 'cube':
      return <svg {...common}><path d="M12 3l8.5 4.5v9L12 21l-8.5-4.5v-9L12 3z"/><path d="M3.5 7.5L12 12l8.5-4.5M12 12v9"/></svg>;
    case 'bolt':
      return <svg {...common}><path d="M13 2L4 14h7l-1 8 9-12h-7l1-8z"/></svg>;
    case 'shield':
      return <svg {...common}><path d="M12 3l8 3v5c0 5-3.5 9-8 10-4.5-1-8-5-8-10V6l8-3z"/><path d="M9 12l2 2 4-4"/></svg>;
    case 'layers':
      return <svg {...common}><path d="M12 3l9 5-9 5-9-5 9-5z"/><path d="M3 13l9 5 9-5M3 17l9 5 9-5"/></svg>;
    case 'message':
      return <svg {...common}><path d="M4 6a2 2 0 012-2h12a2 2 0 012 2v9a2 2 0 01-2 2h-6l-4 4v-4H6a2 2 0 01-2-2V6z"/></svg>;
    case 'mail':
      return <svg {...common}><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3 7l9 6 9-6"/></svg>;
    case 'mic':
      return <svg {...common}><rect x="9" y="3" width="6" height="12" rx="3"/><path d="M5 11a7 7 0 0014 0M12 18v3"/></svg>;
    case 'doc':
      return <svg {...common}><path d="M14 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V8l-5-5z"/><path d="M14 3v5h5M9 13h6M9 17h4"/></svg>;
    case 'pie':
      return <svg {...common}><path d="M12 3v9h9a9 9 0 11-9-9z"/><path d="M14 3a7 7 0 017 7"/></svg>;
    case 'gear':
      return <svg {...common}><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.7 1.7 0 00.3 1.8l.1.1a2 2 0 11-2.8 2.8l-.1-.1a1.7 1.7 0 00-1.8-.3 1.7 1.7 0 00-1 1.5V21a2 2 0 11-4 0v-.1a1.7 1.7 0 00-1-1.5 1.7 1.7 0 00-1.8.3l-.1.1a2 2 0 11-2.8-2.8l.1-.1a1.7 1.7 0 00.3-1.8 1.7 1.7 0 00-1.5-1H3a2 2 0 110-4h.1a1.7 1.7 0 001.5-1 1.7 1.7 0 00-.3-1.8l-.1-.1a2 2 0 112.8-2.8l.1.1a1.7 1.7 0 001.8.3h.1a1.7 1.7 0 001-1.5V3a2 2 0 114 0v.1a1.7 1.7 0 001 1.5 1.7 1.7 0 001.8-.3l.1-.1a2 2 0 112.8 2.8l-.1.1a1.7 1.7 0 00-.3 1.8v.1a1.7 1.7 0 001.5 1H21a2 2 0 110 4h-.1a1.7 1.7 0 00-1.5 1z"/></svg>;
    case 'download':
      return <svg {...common}><path d="M12 3v12M7 10l5 5 5-5M4 21h16"/></svg>;
    case 'external':
      return <svg {...common}><path d="M9 5h10v10M19 5L9 15M5 9v10h10"/></svg>;
    case 'check':
      return <svg {...common}><path d="M4 12l5 5L20 6"/></svg>;
    case 'menu':
      return <svg {...common}><path d="M4 7h16M4 12h16M4 17h16"/></svg>;
    case 'x':
      return <svg {...common}><path d="M6 6l12 12M18 6L6 18"/></svg>;
    case 'star':
      return <svg {...common}><path d="M12 3l2.7 6 6.3.5-4.8 4 1.5 6.3L12 16.7 6.3 19.8l1.5-6.3-4.8-4 6.3-.5L12 3z"/></svg>;
    case 'building':
      return <svg {...common}><path d="M3 21h18M5 21V5a2 2 0 012-2h10a2 2 0 012 2v16M9 8h.01M13 8h.01M9 12h.01M13 12h.01M9 16h.01M13 16h.01"/></svg>;
    case 'scale':
      return <svg {...common}><path d="M12 3v18M6 6h12M5 14l-2-6h6l-2 6a3 3 0 11-2 0zM19 14l-2-6h6l-2 6a3 3 0 11-2 0z"/></svg>;
    case 'wallet':
      return <svg {...common}><path d="M3 7a2 2 0 012-2h13l3 4v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"/><circle cx="17" cy="13" r="1.2"/></svg>;
    case 'compass':
      return <svg {...common}><circle cx="12" cy="12" r="9"/><path d="M14.5 9.5L13 13l-3.5 1.5L11 11l3.5-1.5z"/></svg>;
    case 'rocket':
      return <svg {...common}><path d="M5 19s-1-3 1-6c3-4 8-9 14-10-1 6-6 11-10 14-3 2-6 1-6 1l1.5-1.5M9 15l-3 3M5 14l-2 7 7-2"/></svg>;
    case 'globe':
      return <svg {...common}><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a14 14 0 010 18 14 14 0 010-18z"/></svg>;
    case 'phone':
      return <svg {...common}><path d="M5 4h4l2 5-2.5 1.5a11 11 0 005 5L15 13l5 2v4a2 2 0 01-2 2A16 16 0 013 6a2 2 0 012-2z"/></svg>;
    case 'linkedin':
      return <svg viewBox="0 0 24 24" fill="currentColor" style={s} aria-hidden><path d="M4.98 3.5C4.98 4.88 3.87 6 2.5 6S0 4.88 0 3.5 1.12 1 2.5 1s2.48 1.12 2.48 2.5zM.22 8h4.56V24H.22V8zm7.4 0h4.37v2.18h.06c.61-1.15 2.1-2.36 4.32-2.36 4.62 0 5.47 3.04 5.47 7v9.18h-4.56v-8.14c0-1.94-.03-4.43-2.7-4.43-2.7 0-3.11 2.11-3.11 4.29V24H7.62V8z"/></svg>;
    case 'play':
      return <svg {...common}><polygon points="6,3 21,12 6,21" fill="currentColor" stroke="none"/></svg>;
    default:
      return null;
  }
};

window.Icon = Icon;
