/* Darwin Cientista — Corpo inteiro · Conjunto completo de poses
   Estende `darwin-fullbody.jsx` adicionando 5 poses extras.
   Estilo flat-tech: phosphor green (#9FEF00), pele em gradient,
   jaleco escuro, óculos HUD, barba aparada.

   viewBox 200×520. Pés ~500. Mesma escala/cabeça das 3 poses originais.
*/

/* ───────── Defs compartilhados (mesma assinatura do arquivo original
   para que ambos possam coexistir; IDs com prefixo "dbx-" pra não colidir) ───── */
const DarwinXDefs = () => (
  <defs>
    <radialGradient id="dbx-bg" cx="50%" cy="30%" r="80%">
      <stop offset="0%" stopColor="#0d2818"/>
      <stop offset="100%" stopColor="#020806"/>
    </radialGradient>
    <linearGradient id="dbx-skin" x1="0" y1="0" x2="0" y2="1">
      <stop offset="0%" stopColor="#d4a684"/>
      <stop offset="50%" stopColor="#b08560"/>
      <stop offset="100%" stopColor="#7a5638"/>
    </linearGradient>
    <linearGradient id="dbx-skin-arm" x1="0" y1="0" x2="1" y2="0">
      <stop offset="0%" stopColor="#b08560"/>
      <stop offset="60%" stopColor="#9a7350"/>
      <stop offset="100%" stopColor="#6b4830"/>
    </linearGradient>
    <linearGradient id="dbx-coat" x1="0" y1="0" x2="0" y2="1">
      <stop offset="0%" stopColor="#1f2a1c"/>
      <stop offset="100%" stopColor="#080c08"/>
    </linearGradient>
    <linearGradient id="dbx-coat-light" x1="0" y1="0" x2="1" y2="0">
      <stop offset="0%" stopColor="#0a120a"/>
      <stop offset="50%" stopColor="#1a2418"/>
      <stop offset="100%" stopColor="#0a120a"/>
    </linearGradient>
    <linearGradient id="dbx-pants" x1="0" y1="0" x2="0" y2="1">
      <stop offset="0%" stopColor="#14180f"/>
      <stop offset="100%" stopColor="#050806"/>
    </linearGradient>
    <linearGradient id="dbx-lens" x1="0" y1="0" x2="1" y2="1">
      <stop offset="0%" stopColor="#9FEF00" stopOpacity="0.3"/>
      <stop offset="100%" stopColor="#9FEF00" stopOpacity="0.05"/>
    </linearGradient>
    <linearGradient id="dbx-tablet" x1="0" y1="0" x2="0" y2="1">
      <stop offset="0%" stopColor="#0e1a0c"/>
      <stop offset="100%" stopColor="#030604"/>
    </linearGradient>
  </defs>
);

/* ───────── Cabeça (parametrizável) ─────────
   variants: 'default' (neutro), 'smile' (boca em sorriso), 'flat' (linha reta),
             'frown' (preocupado), 'closed' (olhos fechados),
             'wink' (um olho fechado)
*/
const DarwinXHead = ({
  tilt = 0,
  lookDown = false,
  mouth = "default", // default | smile | flat | frown | closed
  eyes = "open",     // open | closed | wink | look-left | look-right | look-up
  glassesDim = false,// óculos atenuados quando offline
}) => {
  // eye position
  const eyeLeft  = { x: 84, y: 85 };
  const eyeRight = { x: 116, y: 85 };
  if (eyes === "look-left")  { eyeLeft.x -= 1.5; eyeRight.x -= 1.5; }
  if (eyes === "look-right") { eyeLeft.x += 1.5; eyeRight.x += 1.5; }
  if (eyes === "look-up")    { eyeLeft.y -= 1.5; eyeRight.y -= 1.5; }
  if (lookDown)              { eyeLeft.y += 2;   eyeRight.y += 2;   }

  const mouthPath = {
    default: "M94 121 Q100 123 106 121",
    smile:   "M91 120 Q100 128 109 120",
    flat:    "M93 122 L107 122",
    frown:   "M93 124 Q100 119 107 124",
    closed:  "M94 122 Q100 123 106 122",
  }[mouth] || "M94 121 Q100 123 106 121";

  return (
    <g transform={`rotate(${tilt} 100 80)`}>
      {/* glow */}
      <circle cx="100" cy="80" r="44" fill="#9FEF00" opacity={glassesDim ? "0.03" : "0.07"}/>
      {/* head */}
      <ellipse cx="100" cy="80" rx="32" ry="36" fill="url(#dbx-skin)"/>
      {/* skull top shading */}
      <path d="M73 65 Q100 32 127 65 Q123 55 100 48 Q77 55 73 65 Z" fill="#7a5638" opacity="0.3"/>
      {/* highlight */}
      <ellipse cx="93" cy="55" rx="8" ry="11" fill="#e6c4a3" opacity="0.35"/>
      {/* ears */}
      <ellipse cx="68" cy="82" rx="3" ry="6" fill="url(#dbx-skin)"/>
      <ellipse cx="132" cy="82" rx="3" ry="6" fill="url(#dbx-skin)"/>
      {/* eyebrows */}
      {mouth === "frown" ? (
        <>
          <path d="M76 75 Q86 71 95 74 Q90 73 83 73 Q78 73 76 75 Z" fill="#2a1a0a"/>
          <path d="M105 74 Q114 71 124 75 Q122 73 117 73 Q110 73 105 74 Z" fill="#2a1a0a"/>
        </>
      ) : (
        <>
          <path d="M76 73 Q86 69 95 72 Q90 75 83 75 Q78 75 76 73 Z" fill="#2a1a0a"/>
          <path d="M105 72 Q114 69 124 73 Q122 75 117 75 Q110 75 105 72 Z" fill="#2a1a0a"/>
        </>
      )}
      {/* glasses */}
      <g
        stroke={glassesDim ? "#3a5a14" : "#9FEF00"}
        strokeWidth="1.4"
        fill={glassesDim ? "rgba(159,239,0,0.04)" : "url(#dbx-lens)"}
        strokeLinejoin="round"
        opacity={glassesDim ? 0.7 : 1}
      >
        <rect x="74" y="77" width="20" height="13" rx="1.5"/>
        <rect x="106" y="77" width="20" height="13" rx="1.5"/>
      </g>
      <line x1="94" y1="82" x2="106" y2="82" stroke={glassesDim ? "#3a5a14" : "#9FEF00"} strokeWidth="1.4"/>
      <path d="M74 82 L66 80" stroke={glassesDim ? "#3a5a14" : "#9FEF00"} strokeWidth="1.4" fill="none"/>
      <path d="M126 82 L134 80" stroke={glassesDim ? "#3a5a14" : "#9FEF00"} strokeWidth="1.4" fill="none"/>
      {/* HUD micro readout */}
      {!glassesDim && (
        <g fill="#9FEF00" fontFamily="ui-monospace, monospace" fontSize="2.4" opacity="0.9">
          <text x="76" y="82.5">CTR</text>
          <text x="108" y="82.5">CPA</text>
        </g>
      )}
      {/* eyes */}
      {eyes === "closed" ? (
        <>
          <path d="M80 86 Q84 84 88 86" stroke="#0a1408" strokeWidth="1.4" fill="none" strokeLinecap="round"/>
          <path d="M112 86 Q116 84 120 86" stroke="#0a1408" strokeWidth="1.4" fill="none" strokeLinecap="round"/>
        </>
      ) : eyes === "wink" ? (
        <>
          <path d="M80 86 Q84 84 88 86" stroke="#0a1408" strokeWidth="1.4" fill="none" strokeLinecap="round"/>
          <circle cx={eyeRight.x} cy={eyeRight.y} r="1.3" fill="#0a1408"/>
        </>
      ) : (
        <>
          <circle cx={eyeLeft.x}  cy={eyeLeft.y}  r="1.3" fill="#0a1408"/>
          <circle cx={eyeRight.x} cy={eyeRight.y} r="1.3" fill="#0a1408"/>
        </>
      )}
      {/* nose */}
      <path d="M100 95 Q97.5 103 97 108 Q98.5 110 100 110 Q101.5 110 103 108 Q102.5 103 100 95 Z" fill="#9a7050" opacity="0.5"/>
      {/* mustache */}
      <path d="M86 114 Q93 112 100 114 Q107 112 114 114 Q115 117 112 119 Q106 120 100 117 Q94 120 88 119 Q85 117 86 114 Z" fill="#2a1a0a"/>
      {/* mouth */}
      <path d={mouthPath} stroke="#1a0e08" strokeWidth="0.9" fill="none"/>
      {/* beard */}
      <path
        d="M70 105
           Q68 118 72 128
           Q78 138 86 142
           Q94 145 100 145
           Q106 145 114 142
           Q122 138 128 128
           Q132 118 130 105
           Q124 112 116 114
           Q108 116 100 114
           Q92 116 84 114
           Q76 112 70 105 Z"
        fill="#1f1208"
      />
      <g fill="#5a3e28" opacity="0.55">
        <circle cx="78" cy="120" r="0.3"/>
        <circle cx="82" cy="130" r="0.3"/>
        <circle cx="88" cy="138" r="0.3"/>
        <circle cx="100" cy="142" r="0.3"/>
        <circle cx="112" cy="138" r="0.3"/>
        <circle cx="118" cy="130" r="0.3"/>
        <circle cx="122" cy="120" r="0.3"/>
      </g>
      <g fill="#7a6a5a" opacity="0.5">
        <circle cx="80" cy="124" r="0.4"/>
        <circle cx="120" cy="124" r="0.4"/>
      </g>
      {/* neck */}
      <path d="M90 142 L90 156 Q100 161 110 156 L110 142 Z" fill="url(#dbx-skin)"/>
      <path d="M90 156 Q100 161 110 156" stroke="#7a5638" strokeWidth="0.6" fill="none" opacity="0.5"/>
    </g>
  );
};

/* ───────── Tronco / pernas (com variantes de postura) ───────── */
const DarwinXTorsoLegs = ({ stance = "center", slouch = false }) => {
  // slouch (offline) — torso droops slightly
  const lLegX = stance === "wide" ? 90 : 92;
  const rLegX = stance === "wide" ? 110 : 108;
  const shoulderY = slouch ? 168 : 165;
  const slouchD = slouch ? 2 : 0;
  return (
    <g>
      {/* coat */}
      <path
        d={`M64 ${shoulderY}
            Q70 ${158 + slouchD} 82 ${156 + slouchD}
            L118 ${156 + slouchD}
            Q130 ${158 + slouchD} 136 ${shoulderY}
            L142 195
            L142 280
            Q138 290 130 292
            L70 292
            Q62 290 58 280
            L64 ${shoulderY} Z`}
        fill="url(#dbx-coat)"
      />
      {/* shirt collar area */}
      <path d={`M82 ${156 + slouchD} L82 170 Q88 180 100 180 Q112 180 118 170 L118 ${156 + slouchD} Z`} fill="#1a2018"/>
      <path d={`M90 ${156 + slouchD} L100 168 L110 ${156 + slouchD} Z`} fill="#0a1408"/>
      <path d={`M90 ${156 + slouchD} L100 168 L110 ${156 + slouchD}`} stroke="#2a342a" strokeWidth="0.6" fill="none"/>
      {/* shirt buttons */}
      <circle cx="100" cy="190" r="1" fill="#3a4a30"/>
      <circle cx="100" cy="210" r="1" fill="#3a4a30"/>
      <circle cx="100" cy="230" r="1" fill="#3a4a30"/>
      {/* lapel seams */}
      <path d={`M82 ${156 + slouchD} L92 230 L90 240`} stroke="#2a3528" strokeWidth="0.8" fill="none" opacity="0.6"/>
      <path d={`M118 ${156 + slouchD} L108 230 L110 240`} stroke="#2a3528" strokeWidth="0.8" fill="none" opacity="0.6"/>
      {/* breast pocket */}
      <rect x="116" y="180" width="18" height="14" rx="0.5" fill="none" stroke="#2a3528" strokeWidth="0.6"/>
      <line x1="120" y1="178" x2="120" y2="186" stroke="#9FEF00" strokeWidth="1.2"/>
      <circle cx="120" cy="177" r="0.8" fill="#9FEF00"/>
      {/* badge */}
      <rect x="118" y="200" width="20" height="6" rx="1" fill="#0a1408" stroke="#9FEF00" strokeWidth="0.5"/>
      <text x="128" y="204.5" textAnchor="middle" fontSize="3.6" fill="#9FEF00" fontFamily="ui-monospace, monospace" fontWeight="600">DARWIN</text>

      {/* belt */}
      <rect x="60" y="278" width="80" height="8" fill="#0a0e08"/>
      <rect x="96" y="280" width="8" height="4" fill="#9FEF00" opacity="0.7"/>
      <rect x="96" y="280" width="8" height="4" fill="none" stroke="#2a3528" strokeWidth="0.5"/>

      {/* pants */}
      <path
        d={`M62 286
            L${lLegX - 8} 480
            L${lLegX + 6} 480
            L99 295
            L101 295
            L${rLegX - 6} 480
            L${rLegX + 8} 480
            L138 286 Z`}
        fill="url(#dbx-pants)"
      />
      <line x1={(lLegX - 1)} y1="300" x2={(lLegX - 1)} y2="475" stroke="#252a1e" strokeWidth="0.5" opacity="0.6"/>
      <line x1={(rLegX + 1)} y1="300" x2={(rLegX + 1)} y2="475" stroke="#252a1e" strokeWidth="0.5" opacity="0.6"/>

      {/* shoes */}
      <ellipse cx={lLegX - 1} cy="492" rx="13" ry="6" fill="#0a0e08"/>
      <ellipse cx={lLegX - 1} cy="490" rx="13" ry="4" fill="#1a1f12"/>
      <path d={`M${lLegX - 12} 492 L${lLegX + 12} 492`} stroke="#9FEF00" strokeWidth="0.6" opacity="0.6"/>
      <ellipse cx={rLegX + 1} cy="492" rx="13" ry="6" fill="#0a0e08"/>
      <ellipse cx={rLegX + 1} cy="490" rx="13" ry="4" fill="#1a1f12"/>
      <path d={`M${rLegX - 12} 492 L${rLegX + 12} 492`} stroke="#9FEF00" strokeWidth="0.6" opacity="0.6"/>
    </g>
  );
};

/* ═══════════════════════════════════════════════════════════════
   POSE 4 — WELCOME / OLÁ
   Mão direita levantada acenando (palma aberta, dedos abertos).
   Esquerda relaxada. Cabeça reta, boca em sorriso.
   USO: login, onboarding, splash screen.
   ═══════════════════════════════════════════════════════════════ */
const DarwinWelcome = ({ size = 260 }) => (
  <svg width={size} height={(size * 520) / 200} viewBox="0 0 200 520" xmlns="http://www.w3.org/2000/svg">
    <DarwinXDefs/>
    <DarwinXHead mouth="smile"/>
    <DarwinXTorsoLegs stance="center"/>

    {/* LEFT ARM — relaxed at side */}
    <path
      d="M64 165 Q56 178 54 205 Q52 240 56 270 Q58 285 62 290 L72 288 Q74 270 72 240 Q70 200 68 170 Z"
      fill="url(#dbx-coat)"
    />
    <ellipse cx="64" cy="296" rx="7" ry="5.5" fill="url(#dbx-skin-arm)"/>

    {/* RIGHT ARM — bent up, hand at head height, waving */}
    {/* upper arm */}
    <path
      d="M136 165 Q148 162 158 152 Q166 138 168 122 L156 116 Q150 130 144 142 Q138 152 130 162 Z"
      fill="url(#dbx-coat)"
    />
    {/* forearm raised vertically next to head */}
    <path
      d="M168 122 Q172 100 170 80 L156 78 Q156 100 156 116 Z"
      fill="url(#dbx-coat-light)"
    />
    {/* sleeve cuff */}
    <line x1="156" y1="78" x2="170" y2="80" stroke="#2a3528" strokeWidth="0.8"/>
    {/* open waving hand */}
    <g>
      {/* palm */}
      <ellipse cx="163" cy="70" rx="8" ry="9" fill="url(#dbx-skin-arm)"/>
      {/* fingers spread */}
      <rect x="155" y="55" width="3" height="11" rx="1.4" fill="url(#dbx-skin-arm)" transform="rotate(-12 156.5 60.5)"/>
      <rect x="159" y="52" width="3" height="13" rx="1.4" fill="url(#dbx-skin-arm)" transform="rotate(-4 160.5 58.5)"/>
      <rect x="163" y="52" width="3" height="13" rx="1.4" fill="url(#dbx-skin-arm)"/>
      <rect x="167" y="54" width="3" height="12" rx="1.4" fill="url(#dbx-skin-arm)" transform="rotate(6 168.5 60)"/>
      {/* thumb */}
      <ellipse cx="155" cy="72" rx="2.4" ry="4" fill="url(#dbx-skin-arm)" transform="rotate(-40 155 72)"/>
    </g>

    {/* tiny motion sparkles around hand */}
    <g fill="#9FEF00" opacity="0.85">
      <circle cx="180" cy="60" r="1.2"/>
      <circle cx="148" cy="50" r="0.8" opacity="0.6"/>
      <circle cx="184" cy="78" r="0.8" opacity="0.7"/>
    </g>

    {/* speech-bubble sparkle near chest height */}
    <g opacity="0.9">
      <circle cx="38" cy="190" r="2" fill="#9FEF00"/>
      <text x="38" y="192" fontSize="2.5" fill="#020806" fontFamily="ui-monospace, monospace" fontWeight="700" textAnchor="middle">OI</text>
    </g>
  </svg>
);

/* ═══════════════════════════════════════════════════════════════
   POSE 5 — SITTING / SENTADO
   Sentado em um banco/stool, mãos no colo segurando tablet.
   Postura mais informal. USO: onboarding intro, contar uma história.
   ═══════════════════════════════════════════════════════════════ */
const DarwinSitting = ({ size = 260 }) => (
  <svg width={size} height={(size * 520) / 200} viewBox="0 0 200 520" xmlns="http://www.w3.org/2000/svg">
    <DarwinXDefs/>
    <DarwinXHead/>

    {/* ── Torso sentado ── */}
    <g>
      {/* coat (slightly hunched, shorter visible) */}
      <path
        d="M64 165
           Q70 158 82 156
           L118 156
           Q130 158 136 165
           L144 220
           Q148 270 144 310
           Q140 318 130 320
           L70 320
           Q60 318 56 310
           Q52 270 56 220
           L64 165 Z"
        fill="url(#dbx-coat)"
      />
      {/* collar area */}
      <path d="M82 156 L82 170 Q88 180 100 180 Q112 180 118 170 L118 156 Z" fill="#1a2018"/>
      <path d="M90 156 L100 168 L110 156 Z" fill="#0a1408"/>
      {/* buttons */}
      <circle cx="100" cy="190" r="1" fill="#3a4a30"/>
      <circle cx="100" cy="210" r="1" fill="#3a4a30"/>
      <circle cx="100" cy="230" r="1" fill="#3a4a30"/>
      {/* badge */}
      <rect x="118" y="200" width="20" height="6" rx="1" fill="#0a1408" stroke="#9FEF00" strokeWidth="0.5"/>
      <text x="128" y="204.5" textAnchor="middle" fontSize="3.6" fill="#9FEF00" fontFamily="ui-monospace, monospace" fontWeight="600">DARWIN</text>
    </g>

    {/* ── Thighs (horizontal — sentado) ── */}
    <g>
      {/* left thigh going right (from torso) — slightly down */}
      <path
        d="M58 300
           Q56 320 60 340
           L150 360
           Q160 360 162 350
           L162 320
           Q150 312 100 308
           Q72 305 58 300 Z"
        fill="url(#dbx-pants)"
      />
      {/* knee + calf going down — bent 90° */}
      <path
        d="M150 360
           L154 480
           L172 480
           L170 360
           Q160 360 150 360 Z"
        fill="url(#dbx-pants)"
      />
      <path
        d="M120 360
           L118 480
           L136 480
           L138 360
           Z"
        fill="url(#dbx-pants)"
      />
      {/* pant crease */}
      <line x1="161" y1="365" x2="163" y2="475" stroke="#252a1e" strokeWidth="0.5" opacity="0.6"/>
      <line x1="127" y1="365" x2="129" y2="475" stroke="#252a1e" strokeWidth="0.5" opacity="0.6"/>

      {/* shoes — pointing forward (toward viewer) */}
      <ellipse cx="127" cy="492" rx="14" ry="6" fill="#0a0e08"/>
      <ellipse cx="127" cy="490" rx="14" ry="4" fill="#1a1f12"/>
      <ellipse cx="161" cy="492" rx="14" ry="6" fill="#0a0e08"/>
      <ellipse cx="161" cy="490" rx="14" ry="4" fill="#1a1f12"/>
    </g>

    {/* ── Stool / banco ── */}
    <g>
      {/* seat under thighs */}
      <ellipse cx="100" cy="328" rx="58" ry="6" fill="#0a0e08" opacity="0.9"/>
      {/* legs of stool — two visible */}
      <rect x="62" y="328" width="3" height="150" fill="#0a0e08"/>
      <rect x="135" y="328" width="3" height="150" fill="#0a0e08"/>
      {/* crossbar */}
      <line x1="65" y1="420" x2="135" y2="420" stroke="#0a0e08" strokeWidth="1.6"/>
      {/* phosphor accent on stool */}
      <line x1="42" y1="328" x2="158" y2="328" stroke="#9FEF00" strokeWidth="0.6" opacity="0.4"/>
    </g>

    {/* ── Arms on lap holding tablet ── */}
    {/* left upper arm */}
    <path
      d="M64 165 Q58 180 60 215 Q64 250 72 280 L82 282 Q80 250 78 220 Q76 185 70 168 Z"
      fill="url(#dbx-coat)"
    />
    {/* left forearm reaching toward lap */}
    <path
      d="M72 280 Q76 295 86 305 L100 308 L102 296 Q90 290 82 282 Z"
      fill="url(#dbx-coat-light)"
    />
    <ellipse cx="102" cy="310" rx="6" ry="5" fill="url(#dbx-skin-arm)"/>

    {/* right upper arm */}
    <path
      d="M136 165 Q142 180 140 215 Q136 250 128 280 L118 282 Q120 250 122 220 Q124 185 130 168 Z"
      fill="url(#dbx-coat)"
    />
    {/* right forearm reaching toward lap */}
    <path
      d="M128 280 Q124 295 114 305 L100 308 L98 296 Q110 290 118 282 Z"
      fill="url(#dbx-coat-light)"
    />
    <ellipse cx="98" cy="310" rx="6" ry="5" fill="url(#dbx-skin-arm)"/>

    {/* tablet on lap */}
    <g>
      <rect x="74" y="304" width="52" height="32" rx="3" fill="url(#dbx-tablet)" stroke="#9FEF00" strokeWidth="0.6"/>
      <rect x="77" y="307" width="46" height="26" fill="#020604"/>
      <text x="80" y="313" fontSize="2.8" fill="#9FEF00" fontFamily="ui-monospace, monospace" fontWeight="700">DARWIN · ONBOARDING</text>
      {/* 3 dots progress */}
      <circle cx="92" cy="324" r="1.4" fill="#9FEF00"/>
      <circle cx="100" cy="324" r="1.4" fill="#9FEF00" opacity="0.4"/>
      <circle cx="108" cy="324" r="1.4" fill="#9FEF00" opacity="0.4"/>
      <line x1="80" y1="330" x2="120" y2="330" stroke="#9FEF00" strokeWidth="0.3" opacity="0.5"/>
    </g>
  </svg>
);

/* ═══════════════════════════════════════════════════════════════
   POSE 6 — ALERT / APONTANDO PRA CIMA
   Mão direita levantada com dedo indicador apontando.
   Sobrancelha levantada, expressão atenta. USO: warning, alerta, atenção.
   ═══════════════════════════════════════════════════════════════ */
const DarwinAlert = ({ size = 260 }) => (
  <svg width={size} height={(size * 520) / 200} viewBox="0 0 200 520" xmlns="http://www.w3.org/2000/svg">
    <DarwinXDefs/>
    <DarwinXHead tilt={-2} mouth="flat"/>
    <DarwinXTorsoLegs stance="center"/>

    {/* LEFT ARM — bent, hand on hip-ish */}
    <path
      d="M64 165 Q54 180 52 210 Q52 240 60 260 L75 258 Q78 235 76 205 Q72 175 64 165 Z"
      fill="url(#dbx-coat)"
    />
    <path
      d="M60 260 Q58 275 68 280 L88 278 L88 268 Q78 264 75 258 Z"
      fill="url(#dbx-coat-light)"
    />
    <ellipse cx="92" cy="280" rx="6.5" ry="5" fill="url(#dbx-skin-arm)"/>

    {/* RIGHT ARM — raised vertically, index finger pointing up */}
    {/* upper arm */}
    <path
      d="M136 165 Q150 158 158 142 Q162 124 158 108 L146 108 Q146 124 144 138 Q140 152 130 162 Z"
      fill="url(#dbx-coat)"
    />
    {/* forearm */}
    <path
      d="M158 108 Q160 88 158 68 L146 68 Q146 90 146 108 Z"
      fill="url(#dbx-coat-light)"
    />
    <line x1="146" y1="68" x2="158" y2="68" stroke="#2a3528" strokeWidth="0.8"/>

    {/* hand pointing up — fist with index extended */}
    <g>
      {/* fist */}
      <ellipse cx="152" cy="58" rx="7" ry="7" fill="url(#dbx-skin-arm)"/>
      {/* knuckles texture */}
      <path d="M146 56 Q152 53 158 56" stroke="#7a5638" strokeWidth="0.4" fill="none" opacity="0.5"/>
      {/* index finger pointing straight up */}
      <rect x="150" y="36" width="4" height="20" rx="1.6" fill="url(#dbx-skin-arm)"/>
      {/* thumb resting */}
      <ellipse cx="146" cy="56" rx="2" ry="3.5" fill="url(#dbx-skin-arm)" transform="rotate(-20 146 56)"/>
    </g>

    {/* alert exclamation node above finger */}
    <g>
      <circle cx="152" cy="22" r="6" fill="#FACC15" opacity="0.95"/>
      <circle cx="152" cy="22" r="6" fill="none" stroke="#FACC15" strokeWidth="1" opacity="0.4">
        <animate attributeName="r" values="6;12;6" dur="1.6s" repeatCount="indefinite"/>
        <animate attributeName="opacity" values="0.5;0;0.5" dur="1.6s" repeatCount="indefinite"/>
      </circle>
      <text x="152" y="25" fontSize="7" fill="#0a0808" fontFamily="ui-monospace, monospace" fontWeight="700" textAnchor="middle">!</text>
    </g>
  </svg>
);

/* ═══════════════════════════════════════════════════════════════
   POSE 7 — CELEBRATE / V DE VITÓRIA
   Ambos braços levantados em V, mãos abertas. Sorriso largo.
   USO: success, achievement, milestone, conversion.
   ═══════════════════════════════════════════════════════════════ */
const DarwinCelebrate = ({ size = 260 }) => (
  <svg width={size} height={(size * 520) / 200} viewBox="0 0 200 520" xmlns="http://www.w3.org/2000/svg">
    <DarwinXDefs/>
    <DarwinXHead mouth="smile"/>
    <DarwinXTorsoLegs stance="wide"/>

    {/* LEFT ARM — up & out (diagonal up-left) */}
    {/* upper arm */}
    <path
      d="M64 165 Q50 158 38 142 Q28 124 24 106 L36 100 Q42 118 50 130 Q60 144 70 156 Z"
      fill="url(#dbx-coat)"
    />
    {/* forearm */}
    <path
      d="M24 106 Q20 82 22 60 L34 58 Q34 84 36 100 Z"
      fill="url(#dbx-coat-light)"
    />
    <line x1="22" y1="60" x2="34" y2="58" stroke="#2a3528" strokeWidth="0.8"/>
    {/* left hand */}
    <g>
      <ellipse cx="28" cy="50" rx="8" ry="9" fill="url(#dbx-skin-arm)"/>
      <rect x="22" y="34" width="3" height="11" rx="1.4" fill="url(#dbx-skin-arm)" transform="rotate(-15 23.5 39.5)"/>
      <rect x="26" y="32" width="3" height="13" rx="1.4" fill="url(#dbx-skin-arm)" transform="rotate(-5 27.5 38.5)"/>
      <rect x="30" y="32" width="3" height="13" rx="1.4" fill="url(#dbx-skin-arm)" transform="rotate(5 31.5 38.5)"/>
      <rect x="34" y="34" width="3" height="11" rx="1.4" fill="url(#dbx-skin-arm)" transform="rotate(15 35.5 39.5)"/>
      <ellipse cx="20" cy="52" rx="2.4" ry="4" fill="url(#dbx-skin-arm)" transform="rotate(-45 20 52)"/>
    </g>

    {/* RIGHT ARM — up & out (diagonal up-right) */}
    <path
      d="M136 165 Q150 158 162 142 Q172 124 176 106 L164 100 Q158 118 150 130 Q140 144 130 156 Z"
      fill="url(#dbx-coat)"
    />
    <path
      d="M176 106 Q180 82 178 60 L166 58 Q166 84 164 100 Z"
      fill="url(#dbx-coat-light)"
    />
    <line x1="178" y1="60" x2="166" y2="58" stroke="#2a3528" strokeWidth="0.8"/>
    <g>
      <ellipse cx="172" cy="50" rx="8" ry="9" fill="url(#dbx-skin-arm)"/>
      <rect x="163" y="34" width="3" height="11" rx="1.4" fill="url(#dbx-skin-arm)" transform="rotate(-15 164.5 39.5)"/>
      <rect x="167" y="32" width="3" height="13" rx="1.4" fill="url(#dbx-skin-arm)" transform="rotate(-5 168.5 38.5)"/>
      <rect x="171" y="32" width="3" height="13" rx="1.4" fill="url(#dbx-skin-arm)" transform="rotate(5 172.5 38.5)"/>
      <rect x="175" y="34" width="3" height="11" rx="1.4" fill="url(#dbx-skin-arm)" transform="rotate(15 176.5 39.5)"/>
      <ellipse cx="180" cy="52" rx="2.4" ry="4" fill="url(#dbx-skin-arm)" transform="rotate(45 180 52)"/>
    </g>

    {/* confetti / sparkles */}
    <g fill="#9FEF00">
      <circle cx="50" cy="80" r="1.6"/>
      <circle cx="148" cy="78" r="1.4"/>
      <circle cx="60" cy="120" r="1" opacity="0.7"/>
      <circle cx="146" cy="118" r="1.2" opacity="0.7"/>
      <circle cx="80" cy="40" r="1" opacity="0.6"/>
      <circle cx="118" cy="38" r="1.2" opacity="0.6"/>
      <rect x="100" y="20" width="2" height="2" transform="rotate(45 101 21)"/>
      <rect x="60" y="60" width="2" height="2" transform="rotate(45 61 61)"/>
      <rect x="142" y="58" width="2" height="2" transform="rotate(45 143 59)"/>
    </g>
    <g stroke="#9FEF00" strokeWidth="0.8" fill="none" opacity="0.7">
      <path d="M44 58 L48 54"/>
      <path d="M158 56 L162 52"/>
      <path d="M104 14 L108 10"/>
    </g>
  </svg>
);

/* ═══════════════════════════════════════════════════════════════
   POSE 8 — OFFLINE / SLEEPING / DIM
   Cabeça caída, óculos atenuados, postura ligeiramente curvada.
   USO: offline, maintenance, "Darwin descansando".
   ═══════════════════════════════════════════════════════════════ */
const DarwinOffline = ({ size = 260 }) => (
  <svg width={size} height={(size * 520) / 200} viewBox="0 0 200 520" xmlns="http://www.w3.org/2000/svg">
    <DarwinXDefs/>
    <DarwinXHead tilt={6} lookDown eyes="closed" mouth="closed" glassesDim/>
    <DarwinXTorsoLegs stance="center" slouch/>

    {/* LEFT ARM — drooping at side */}
    <path
      d="M64 168 Q56 182 54 215 Q52 250 58 280 Q62 295 66 300 L78 298 Q76 280 78 250 Q80 210 74 175 Z"
      fill="url(#dbx-coat)"
      opacity="0.85"
    />
    <ellipse cx="70" cy="306" rx="7" ry="5.5" fill="url(#dbx-skin-arm)" opacity="0.7"/>

    {/* RIGHT ARM — drooping at side */}
    <path
      d="M136 168 Q146 182 148 215 Q150 250 144 280 Q140 295 136 300 L124 298 Q126 280 124 250 Q122 210 128 175 Z"
      fill="url(#dbx-coat)"
      opacity="0.85"
    />
    <ellipse cx="130" cy="306" rx="7" ry="5.5" fill="url(#dbx-skin-arm)" opacity="0.7"/>

    {/* Z's floating */}
    <g fill="#9FEF00" opacity="0.6" fontFamily="ui-monospace, monospace" fontWeight="700">
      <text x="148" y="62" fontSize="10">z</text>
      <text x="158" y="48" fontSize="14">z</text>
      <text x="174" y="32" fontSize="18">z</text>
    </g>

    {/* offline indicator dot — gray below */}
    <g>
      <circle cx="100" cy="430" r="4" fill="#1a2418"/>
      <circle cx="100" cy="430" r="2" fill="#56636e"/>
    </g>
  </svg>
);

Object.assign(window, {
  DarwinWelcome,
  DarwinSitting,
  DarwinAlert,
  DarwinCelebrate,
  DarwinOffline,
});
