/** CRAiD social media — shared chrome bits */
function LogoMark({ size = 40, color = '#EC16F5' }) {
  return (
    <svg width={size} height={size} viewBox="0 0 192 192" fill="none" aria-label="CRAiD mark">
      <path d="M9.18 101.5L79.24 31.45l10.73 10.73L19.92 112.24zM96.37 25.24c-2.1-2.1-3.19-4.6-3.27-7.56-.06-2.91.92-5.37 2.93-7.38 2-2 4.47-2.98 7.38-2.92 2.94.09 5.46 1.18 7.56 3.27 2.09 2.1 3.16 4.6 3.22 7.52.09 2.94-.87 5.42-2.88 7.43-2 2.01-4.48 2.97-7.42 2.88-2.92-.05-5.42-1.13-7.52-3.22z" fill={color} />
      <path d="M150.42 53.1l-70.05 70.05-10.73-10.73L139.69 42.37zM63.23 129.37c2.1 2.1 3.19 4.6 3.27 7.56.06 2.91-.92 5.37-2.93 7.38-2 2-4.47 2.98-7.38 2.92-2.94-.09-5.46-1.18-7.56-3.27-2.09-2.1-3.16-4.6-3.22-7.52-.09-2.94.87-5.42 2.88-7.43 2-2.01 4.48-2.97 7.42-2.88 2.92.05 5.42 1.13 7.52 3.22z" fill={color} />
      <path d="M81.18 173.5l70.05-70.05 10.73 10.73L91.92 184.24zM168.37 97.24c-2.1-2.1-3.19-4.6-3.27-7.56-.06-2.91.92-5.37 2.93-7.38 2-2 4.47-2.98 7.38-2.92 2.94.09 5.46 1.18 7.56 3.27 2.09 2.1 3.16 4.6 3.22 7.52.09 2.94-.87 5.42-2.88 7.43-2 2.01-4.48 2.97-7.42 2.88-2.92-.05-5.42-1.13-7.52-3.22z" fill={color} />
    </svg>
  );
}

/** Pulsing pill eyebrow */
function Eyebrow({ text = 'Design Consultancy for the Agentic Era', scheme = 'light', size = 'md' }) {
  const dark = scheme === 'dark';
  const padY = size === 'lg' ? 12 : size === 'sm' ? 6 : 9;
  const padX = size === 'lg' ? 24 : size === 'sm' ? 14 : 20;
  const font = size === 'lg' ? 14 : size === 'sm' ? 11 : 12;
  return (
    <div style={{
      display: 'inline-flex', alignItems: 'center', gap: 10,
      padding: `${padY}px ${padX}px`, borderRadius: 9999,
      background: dark ? 'rgba(255,255,255,0.08)' : 'rgba(255,255,255,0.65)',
      border: `1px solid ${dark ? 'rgba(255,255,255,0.18)' : 'var(--border)'}`,
      backdropFilter: 'blur(10px)',
    }}>
      <span style={{ width: 8, height: 8, borderRadius: '50%', background: 'var(--primary)' }} />
      <span style={{
        fontSize: font, fontWeight: 400, letterSpacing: '0.1em', textTransform: 'uppercase',
        color: dark ? 'rgba(255,255,255,0.85)' : 'var(--fg-muted)',
      }}>{text}</span>
    </div>
  );
}

/** Canvas frame — fixed design size; used by every social template */
function SocialCanvas({ w, h, children, style, label, bg = 'var(--bg)' }) {
  return (
    <div data-screen-label={label} style={{
      position: 'relative', width: w, height: h, overflow: 'hidden',
      background: bg, fontFamily: 'var(--font-sans)', color: 'var(--fg)',
      ...style,
    }}>{children}</div>
  );
}

/** Reusable hero background stack (gradient + cloud + radial pink) */
function HeroStack({ dark = false, intensity = 1 }) {
  return (
    <>
      <div style={{ position: 'absolute', inset: 0, background: dark
        ? 'linear-gradient(180deg, #0b1214 0%, #131F22 55%, #1a2530 100%)'
        : 'var(--grad-hero-vertical)' }} />
      <div style={{
        position: 'absolute', inset: 0,
        backgroundImage: 'url(../assets/cloud-bg.png)',
        backgroundSize: 'cover', backgroundPosition: 'center',
        opacity: dark ? 0.18 * intensity : 0.24 * intensity,
        mixBlendMode: dark ? 'screen' : 'normal',
      }} />
      <div style={{
        position: 'absolute', inset: 0,
        background: `radial-gradient(ellipse at 70% 45%, rgba(236,22,245,${dark ? 0.28 : 0.18}) 0%, transparent 55%)`,
      }} />
    </>
  );
}

Object.assign(window, { LogoMark, Eyebrow, SocialCanvas, HeroStack });
