// Polished, colourful hero illustrations, richer than the line-art doodles.
// Used in the homepage hero collage so the showcase feels like finished artwork.

const HeroRainbow = ({ className = "" }) => (
  <svg viewBox="0 0 200 200" className={className} xmlns="http://www.w3.org/2000/svg">
    <defs>
      <linearGradient id="hr-sky" x1="0" y1="0" x2="0" y2="1">
        <stop offset="0" stopColor="#EAF6FF"/><stop offset="1" stopColor="#D6ECFB"/>
      </linearGradient>
    </defs>
    <rect x="14" y="14" width="172" height="172" rx="22" fill="url(#hr-sky)"/>
    {/* rainbow arcs */}
    <g fill="none" strokeLinecap="round" strokeWidth="11">
      <path d="M48 150 A52 52 0 0 1 152 150" stroke="#FF8A7A"/>
      <path d="M59 150 A41 41 0 0 1 141 150" stroke="#FFC857"/>
      <path d="M70 150 A30 30 0 0 1 130 150" stroke="#BFE7C9"/>
      <path d="M81 150 A19 19 0 0 1 119 150" stroke="#A8D5F2"/>
    </g>
    {/* clouds */}
    <g>
      <ellipse cx="52" cy="150" rx="22" ry="15" fill="#FFFFFF"/>
      <ellipse cx="40" cy="152" rx="14" ry="11" fill="#FFFFFF"/>
      <ellipse cx="150" cy="150" rx="22" ry="15" fill="#FFFFFF"/>
      <ellipse cx="162" cy="152" rx="13" ry="10" fill="#FFFFFF"/>
      <circle cx="146" cy="148" r="1.8" fill="#1F2A44"/>
      <circle cx="156" cy="148" r="1.8" fill="#1F2A44"/>
      <path d="M148 154 q3 3 6 0" stroke="#1F2A44" strokeWidth="1.6" fill="none" strokeLinecap="round"/>
      <path d="M140 152 q-2 2 0 4" stroke="#F7A8A0" strokeWidth="2.4" fill="none" strokeLinecap="round" opacity="0.7"/>
      <path d="M162 152 q2 2 0 4" stroke="#F7A8A0" strokeWidth="2.4" fill="none" strokeLinecap="round" opacity="0.7"/>
    </g>
    {/* sparkles */}
    <g fill="#FFD24A">
      <path d="M70 50 l2.4 5 5 2.4 -5 2.4 -2.4 5 -2.4 -5 -5 -2.4 5 -2.4z"/>
      <path d="M132 40 l1.8 3.6 3.6 1.8 -3.6 1.8 -1.8 3.6 -1.8 -3.6 -3.6 -1.8 3.6 -1.8z"/>
      <circle cx="100" cy="38" r="2.4"/>
    </g>
  </svg>
);

const HeroRocket = ({ className = "" }) => (
  <svg viewBox="0 0 200 200" className={className} xmlns="http://www.w3.org/2000/svg">
    <defs>
      <linearGradient id="hr-space" x1="0" y1="0" x2="1" y2="1">
        <stop offset="0" stopColor="#5B7CC2"/><stop offset="1" stopColor="#3E5AA0"/>
      </linearGradient>
      <linearGradient id="hr-body" x1="0" y1="0" x2="0" y2="1">
        <stop offset="0" stopColor="#FFFFFF"/><stop offset="1" stopColor="#E4ECF7"/>
      </linearGradient>
    </defs>
    <rect x="14" y="14" width="172" height="172" rx="22" fill="url(#hr-space)"/>
    {/* stars */}
    <g fill="#FFFFFF">
      <circle cx="45" cy="45" r="2.2"/><circle cx="160" cy="55" r="1.8"/>
      <circle cx="150" cy="120" r="2"/><circle cx="50" cy="135" r="1.6"/>
      <circle cx="38" cy="95" r="1.6"/><circle cx="120" cy="35" r="1.6"/>
      <path d="M158 150 l1.5 3 3 1.5 -3 1.5 -1.5 3 -1.5 -3 -3 -1.5 3 -1.5z" fill="#FFD24A"/>
      <path d="M44 70 l1.5 3 3 1.5 -3 1.5 -1.5 3 -1.5 -3 -3 -1.5 3 -1.5z" fill="#FFD24A"/>
    </g>
    {/* rocket */}
    <g transform="rotate(18 100 105)">
      <path d="M100 48 C118 64 124 92 124 116 L76 116 C76 92 82 64 100 48 Z" fill="url(#hr-body)" stroke="#C5D2E6" strokeWidth="2"/>
      <circle cx="100" cy="86" r="11" fill="#A8D5F2" stroke="#5BB0E5" strokeWidth="3"/>
      <circle cx="100" cy="86" r="4.5" fill="#EAF6FF"/>
      <path d="M76 112 L60 128 L60 138 L76 126 Z" fill="#FF8A7A"/>
      <path d="M124 112 L140 128 L140 138 L124 126 Z" fill="#FF8A7A"/>
      <path d="M86 116 h28 v10 a14 14 0 0 1 -28 0 Z" fill="#F26A56"/>
      {/* flame */}
      <path d="M92 130 q8 24 16 0 q-8 14 -16 0Z" fill="#FFC857"/>
      <path d="M96 130 q4 14 8 0 q-4 8 -8 0Z" fill="#FF8A7A"/>
    </g>
  </svg>
);

const HeroBunny = ({ className = "" }) => (
  <svg viewBox="0 0 200 200" className={className} xmlns="http://www.w3.org/2000/svg">
    <rect x="14" y="14" width="172" height="172" rx="22" fill="#FFFDF7"/>
    {/* blanket */}
    <path d="M40 150 q60 -26 120 0 q4 18 -10 22 H50 q-14 -4 -10 -22Z" fill="#A8D5F2"/>
    <path d="M40 150 q60 -26 120 0" fill="none" stroke="#7FBFE8" strokeWidth="2.5"/>
    {/* body */}
    <ellipse cx="100" cy="140" rx="44" ry="28" fill="#F3EDE3"/>
    {/* head */}
    <circle cx="100" cy="104" r="30" fill="#FBF6EE" stroke="#E5DBCB" strokeWidth="2"/>
    {/* ears */}
    <path d="M84 80 C78 50 80 36 88 36 C95 36 94 60 96 80Z" fill="#FBF6EE" stroke="#E5DBCB" strokeWidth="2"/>
    <path d="M116 80 C122 50 120 36 112 36 C105 36 106 60 104 80Z" fill="#FBF6EE" stroke="#E5DBCB" strokeWidth="2"/>
    <path d="M86 74 C82 54 84 44 88 44 C92 44 91 60 92 74Z" fill="#FAD4DA"/>
    <path d="M114 74 C118 54 116 44 112 44 C108 44 109 60 108 74Z" fill="#FAD4DA"/>
    {/* face */}
    <ellipse cx="89" cy="104" rx="3" ry="4" fill="#3A2E26"/>
    <ellipse cx="111" cy="104" rx="3" ry="4" fill="#3A2E26"/>
    <circle cx="90.5" cy="102.5" r="1" fill="#fff"/>
    <circle cx="112.5" cy="102.5" r="1" fill="#fff"/>
    <ellipse cx="78" cy="112" rx="6" ry="4" fill="#FAD4DA" opacity="0.7"/>
    <ellipse cx="122" cy="112" rx="6" ry="4" fill="#FAD4DA" opacity="0.7"/>
    <path d="M97 112 h6 l-3 4Z" fill="#E69AA6"/>
    <path d="M100 116 q-5 5 -10 2 M100 116 q5 5 10 2" fill="none" stroke="#C9B79E" strokeWidth="1.8" strokeLinecap="round"/>
    {/* paws */}
    <ellipse cx="82" cy="150" rx="10" ry="7" fill="#FBF6EE" stroke="#E5DBCB" strokeWidth="2"/>
    <ellipse cx="118" cy="150" rx="10" ry="7" fill="#FBF6EE" stroke="#E5DBCB" strokeWidth="2"/>
    {/* zzz */}
    <g fill="#C9B79E" fontFamily="sans-serif" fontWeight="700">
      <text x="138" y="74" fontSize="13">z</text>
      <text x="146" y="64" fontSize="16">Z</text>
    </g>
  </svg>
);

const HERO_ART = { rainbow: HeroRainbow, rocket: HeroRocket, bunny: HeroBunny };
const HeroArt = ({ name, className }) => {
  const C = HERO_ART[name] || HeroRainbow;
  return <C className={className}/>;
};

Object.assign(window, { HeroRainbow, HeroRocket, HeroBunny, HeroArt });
