/* Common Works — icons + diagram motif. Exposed on window. */

const Arrow = ({ className = "arr", size = 16 }) => (
  <svg className={className} width={size} height={size} viewBox="0 0 16 16" fill="none" aria-hidden="true">
    <path d="M3 8h9M8.5 4l4 4-4 4" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round" />
  </svg>
);

const Plus = ({ size = 14 }) => (
  <svg width={size} height={size} viewBox="0 0 14 14" fill="none" aria-hidden="true">
    <path d="M7 2v10M2 7h10" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
  </svg>
);

const LinkedIn = ({ size = 18 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
    <path d="M4.98 3.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zM3 9h4v12H3zM10 9h3.8v1.7h.05c.53-1 1.83-2.05 3.77-2.05 4.03 0 4.78 2.65 4.78 6.1V21h-4v-5.4c0-1.29-.02-2.95-1.8-2.95-1.8 0-2.08 1.4-2.08 2.85V21H10z" />
  </svg>
);

const Github = ({ size = 18 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
    <path d="M12 2C6.48 2 2 6.58 2 12.25c0 4.53 2.87 8.37 6.84 9.73.5.1.68-.22.68-.49l-.01-1.7c-2.78.62-3.37-1.22-3.37-1.22-.46-1.18-1.11-1.5-1.11-1.5-.91-.64.07-.62.07-.62 1 .07 1.53 1.06 1.53 1.06.9 1.57 2.36 1.12 2.94.86.09-.67.35-1.12.63-1.38-2.22-.26-4.55-1.14-4.55-5.07 0-1.12.39-2.03 1.03-2.75-.1-.26-.45-1.3.1-2.7 0 0 .84-.28 2.75 1.05A9.4 9.4 0 0 1 12 6.84c.85 0 1.71.12 2.51.34 1.91-1.33 2.75-1.05 2.75-1.05.55 1.4.2 2.44.1 2.7.64.72 1.03 1.63 1.03 2.75 0 3.94-2.34 4.81-4.57 5.06.36.32.68.94.68 1.9l-.01 2.82c0 .27.18.59.69.49A10.02 10.02 0 0 0 22 12.25C22 6.58 17.52 2 12 2z" />
  </svg>
);

const Check = ({ size = 22 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" aria-hidden="true">
    <path d="M5 12.5l4.5 4.5L19 7" stroke="#EDEAE0" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
  </svg>
);

const Upload = ({ size = 26 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" aria-hidden="true">
    <path d="M12 16V4m0 0L7.5 8.5M12 4l4.5 4.5M5 17v2a1 1 0 001 1h12a1 1 0 001-1v-2"
      stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
  </svg>
);

const Mail = ({ size = 18 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" aria-hidden="true">
    <rect x="3" y="5" width="18" height="14" rx="1.5" stroke="currentColor" strokeWidth="1.5" />
    <path d="M4 7l8 6 8-6" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
  </svg>
);

/* thesis -> plan -> deploy diagram motif (simple geometry only) */
const Motif = () => (
  <svg className="motif" viewBox="0 0 300 230" fill="none" aria-hidden="true">
    {/* vertical spine */}
    <line className="ln" x1="34" y1="34" x2="34" y2="196" />
    {/* branches */}
    <line className="ln" x1="34" y1="46" x2="250" y2="46" />
    <line className="ln" x1="34" y1="115" x2="250" y2="115" />
    <line className="ln" x1="34" y1="184" x2="250" y2="184" />

    {/* nodes */}
    <circle className="nd-fill" cx="34" cy="46" r="6" />
    <circle className="nd" cx="34" cy="115" r="6" />
    <circle className="nd" cx="34" cy="184" r="6" />

    {/* end markers */}
    <rect className="nd-fill pulse" x="244" y="40" width="12" height="12" rx="1" />
    <rect className="nd" x="244" y="109" width="12" height="12" rx="1" />
    <rect className="nd" x="244" y="178" width="12" height="12" rx="1" />

    <text x="48" y="38">Underwrite</text>
    <text x="186" y="38" textAnchor="end" fill="#1B3A2F">Thesis</text>
    <text x="48" y="107">Plan</text>
    <text x="186" y="107" textAnchor="end">Blueprint</text>
    <text x="48" y="176">Deploy</text>
    <text x="186" y="176" textAnchor="end">Capability</text>
  </svg>
);

const Share = ({ size = 16 }) => (
  <svg width={size} height={size} viewBox="0 0 16 16" fill="none" aria-hidden="true">
    <path d="M8 11V3M5 6l3-3 3 3M2 11v3h12v-3" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round" />
  </svg>
);

Object.assign(window, { Arrow, Plus, LinkedIn, Github, Mail, Check, Upload, Motif, Share });
