// Primitives.jsx — futuristic edition
const HeroBadge = ({ children }) => (
  <div className="cc-hero-badge"><span className="dot" />{children}</div>
);

const Button = ({ children, variant = 'primary', size, href, target, onClick }) => {
  const cls = `cc-btn cc-btn--${variant}${size === 'large' ? ' cc-btn--large' : ''}`;
  if (href) return <a href={href} target={target} rel={target === '_blank' ? 'noopener' : undefined} className={cls} onClick={onClick}>{children}</a>;
  return <button className={cls} onClick={onClick}>{children}</button>;
};

const AppStoreButton = ({ href = '#' }) => (
  <a href={href} target="_blank" rel="noopener" className="cc-app-store-btn">
    <svg viewBox="0 0 24 24" fill="currentColor" width="18" height="18">
      <path d="M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.8-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"/>
    </svg>
    Download on the App Store
  </a>
);

const SectionHeader = ({ eyebrow, title, italic }) => (
  <div className="cc-section-header">
    <span className="cc-section-label">{eyebrow}</span>
    <h2 className="cc-section-title">{title}{italic && <> <em>{italic}</em></>}</h2>
  </div>
);

// Lucide-style line icons
const Icon = ({ name, size = 18, stroke = 1.5 }) => {
  const paths = {
    sparkles: <><path d="M12 3v3M12 18v3M3 12h3M18 12h3M5.5 5.5l2 2M16.5 16.5l2 2M5.5 18.5l2-2M16.5 7.5l2-2"/><circle cx="12" cy="12" r="3"/></>,
    shield: <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>,
    zap: <path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/>,
    users: <><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75"/></>,
    react: <><circle cx="12" cy="12" r="2"/><ellipse cx="12" cy="12" rx="10" ry="4"/><ellipse cx="12" cy="12" rx="10" ry="4" transform="rotate(60 12 12)"/><ellipse cx="12" cy="12" rx="10" ry="4" transform="rotate(120 12 12)"/></>,
    flame: <path d="M8.5 14.5A2.5 2.5 0 0 0 11 17a7 7 0 0 0 7-7c0-3-2-4-2-4-3 4-5 1-5-2-3 1-4 5-4 7 0 1 1 3.5 1.5 3.5z"/>,
    brain: <><path d="M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2z"/><path d="M14.5 2a2.5 2.5 0 0 0-2.5 2.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2z"/></>,
    smartphone: <><rect x="5" y="2" width="14" height="20" rx="2"/><line x1="12" y1="18" x2="12" y2="18"/></>,
    cloud: <path d="M17.5 19a4.5 4.5 0 1 0-1.41-8.78 6 6 0 1 0-11.59 2.06A4 4 0 0 0 6 19h11.5z"/>,
    card: <><rect x="2" y="5" width="20" height="14" rx="2"/><line x1="2" y1="10" x2="22" y2="10"/></>,
    palette: <><circle cx="13.5" cy="6.5" r="0.5"/><circle cx="17.5" cy="10.5" r="0.5"/><circle cx="8.5" cy="7.5" r="0.5"/><circle cx="6.5" cy="12.5" r="0.5"/><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c1 0 1.8-.8 1.8-1.8 0-.5-.2-.9-.5-1.2-.3-.3-.5-.7-.5-1.2 0-1 .8-1.8 1.8-1.8H17c2.8 0 5-2.2 5-5 0-5-4.5-9-10-9z"/></>,
    palette_simple: <><circle cx="12" cy="12" r="9"/><circle cx="9" cy="9" r="1"/><circle cx="15" cy="9" r="1"/><circle cx="9" cy="15" r="1"/><circle cx="15" cy="15" r="1"/></>,
    arrow: <><path d="M5 12h14M13 6l6 6-6 6"/></>
  };
  return (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none"
      stroke="currentColor" strokeWidth={stroke} strokeLinecap="round" strokeLinejoin="round">
      {paths[name] || paths.zap}
    </svg>
  );
};

const Atmospherics = () => (
  <>
    <div className="cc-mesh" aria-hidden="true" />
    <div className="cc-grid" aria-hidden="true" />
    <div className="cc-grain" aria-hidden="true" />
  </>
);

Object.assign(window, { HeroBadge, Button, AppStoreButton, SectionHeader, Icon, Atmospherics });
