/* ============================================================
   Bizia — Brand mark & wordmark
   Abstract: connected nodes ascending to a launch spark.
   ============================================================ */
(function () {
  // Icon-only mark. Rounded tile + node network rising to a spark.
  function BiziaMark({ size = 36, radius, plain = false, glow = false }) {
    const r = radius != null ? radius : size * 0.28;
    const id = React.useMemo(() => 'bzm' + Math.random().toString(36).slice(2, 7), []);
    return React.createElement('svg', {
      width: size, height: size, viewBox: '0 0 48 48', fill: 'none',
      style: { display: 'block', filter: glow ? 'drop-shadow(0 8px 18px rgba(91,92,255,0.45))' : 'none' },
    },
      React.createElement('defs', null,
        React.createElement('linearGradient', { id: id + 'g', x1: '0', y1: '0', x2: '1', y2: '1' },
          React.createElement('stop', { offset: '0', stopColor: '#6E6FFF' }),
          React.createElement('stop', { offset: '0.55', stopColor: '#5B5CFF' }),
          React.createElement('stop', { offset: '1', stopColor: '#12B8A6' }),
        ),
        React.createElement('linearGradient', { id: id + 's', x1: '0', y1: '1', x2: '1', y2: '0' },
          React.createElement('stop', { offset: '0', stopColor: '#FFFFFF', stopOpacity: '0.95' }),
          React.createElement('stop', { offset: '1', stopColor: '#E9FBF7', stopOpacity: '0.9' }),
        ),
      ),
      plain ? null : React.createElement('rect', { x: 0, y: 0, width: 48, height: 48, rx: r, fill: 'url(#' + id + 'g)' }),
      // connecting paths (launch trajectory)
      React.createElement('path', {
        d: 'M14 34 L21 24 L29 27 L35 15',
        stroke: plain ? 'url(#' + id + 'g)' : 'url(#' + id + 's)',
        strokeWidth: 2.4, strokeLinecap: 'round', strokeLinejoin: 'round', opacity: 0.92,
      }),
      // nodes
      React.createElement('circle', { cx: 14, cy: 34, r: 2.7, fill: plain ? '#5B5CFF' : '#fff' }),
      React.createElement('circle', { cx: 21, cy: 24, r: 2.4, fill: plain ? '#12B8A6' : '#E9FBF7' }),
      React.createElement('circle', { cx: 29, cy: 27, r: 2.4, fill: plain ? '#5B5CFF' : '#fff' }),
      // spark (launch point) — 4-point star
      React.createElement('path', {
        d: 'M35 8 L36.7 13.3 L42 15 L36.7 16.7 L35 22 L33.3 16.7 L28 15 L33.3 13.3 Z',
        fill: plain ? '#FFB454' : '#FFD79A',
      }),
    );
  }

  // Full horizontal logo: mark + wordmark (+ optional "by Brandsap")
  function BiziaLogo({ size = 30, showByline = false, mono = false, onClick, style }) {
    const markSize = size * 1.28;
    return React.createElement('div', {
      onClick, style: {
        display: 'inline-flex', alignItems: 'center', gap: size * 0.42,
        cursor: onClick ? 'pointer' : 'default', userSelect: 'none', ...style,
      },
    },
      React.createElement(BiziaMark, { size: markSize }),
      React.createElement('div', { style: { display: 'flex', flexDirection: 'column', lineHeight: 1 } },
        React.createElement('span', {
          style: {
            fontSize: size, fontWeight: 680, letterSpacing: '-0.03em',
            color: mono ? '#fff' : 'var(--text)',
          },
        }, 'Bizia'),
        showByline ? React.createElement('span', {
          style: {
            fontSize: size * 0.34, fontWeight: 600, letterSpacing: '0.08em',
            textTransform: 'uppercase', color: 'var(--muted)', marginTop: size * 0.12,
          },
        }, 'by Brandsap') : null,
      ),
    );
  }

  window.BiziaMark = BiziaMark;
  window.BiziaLogo = BiziaLogo;
})();
