// illustrations.jsx — Ilustraciones SVG animadas para cada slide.
// Paleta: usa los tokens del slide (pal.deep, pal.warm, pal.warmDeep, pal.bg, pal.soft, pal.abyss).
// Cada ilustración es minimalista, simbólica, con loops suaves de animación.

// ─── Helpers ────────────────────────────────────────────────────────────
const ILLUS_KEYFRAMES = `
@keyframes illusFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes illusFloatSm { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes illusPulse { 0%,100% { opacity: .85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes illusPulseDot { 0%,100% { opacity: .55; r: 2.6; } 50% { opacity: 1; r: 3.4; } }
@keyframes illusGlow { 0%,100% { opacity: .35; } 50% { opacity: .85; } }
@keyframes illusGlowStrong { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes illusFlicker { 0%,100% { opacity: .9; transform: scaleY(1); } 50% { opacity: 1; transform: scaleY(1.08); } }
@keyframes illusDash { to { stroke-dashoffset: -40; } }
@keyframes illusDashSlow { to { stroke-dashoffset: -80; } }
@keyframes illusRise { 0% { transform: translateY(8px); opacity: 0; } 60%,100% { transform: translateY(0); opacity: 1; } }
@keyframes illusFall { 0% { transform: translateY(-8px); opacity: 0; } 60%,100% { transform: translateY(0); opacity: 1; } }
@keyframes illusDrop { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(28px); opacity: .35; } 100% { transform: translateY(40px); opacity: 0; } }
@keyframes illusSpin { to { transform: rotate(360deg); } }
@keyframes illusSway { 0%,100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
@keyframes illusGrow { 0% { transform: scaleY(.5); transform-origin: bottom; } 100% { transform: scaleY(1); transform-origin: bottom; } }
@keyframes illusFadeUp { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes illusFadeDown { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(8px); } }
@keyframes illusDrop { 0% { transform: translateY(-30px); opacity: 0; } 70% { opacity: 1; } 100% { transform: translateY(0); opacity: 1; } }
`;

function IllusStyles() {
  return <style dangerouslySetInnerHTML={{ __html: ILLUS_KEYFRAMES }} />;
}

// Wrapper común — cuadro con fondo y padding consistente
function IllusFrame({ pal, children, viewBox = '0 0 400 280', style }) {
  return (
    <div style={{
      width: '100%', height: '100%',
      borderRadius: 4, overflow: 'hidden',
      background: `radial-gradient(ellipse 120% 80% at 50% 30%, ${pal.deep}10, ${pal.bg} 70%)`,
      border: `1px solid ${pal.soft}`,
      boxShadow: `0 30px 60px ${pal.abyss}1c, 0 8px 20px ${pal.abyss}14`,
      position: 'relative', display: 'flex', alignItems: 'center', justifyContent: 'center',
      ...style,
    }}>
      <IllusStyles />
      <svg viewBox={viewBox} width="100%" height="100%" style={{ display: 'block' }} preserveAspectRatio="xMidYMid meet">
        {children}
      </svg>
    </div>
  );
}

// Variante oscura (para slides con variant="dark")
function IllusFrameDark({ pal, children, viewBox = '0 0 400 280', style }) {
  return (
    <div style={{
      width: '100%', height: '100%',
      borderRadius: 4, overflow: 'hidden',
      background: `radial-gradient(ellipse 120% 80% at 50% 30%, ${pal.deep}88, ${pal.abyss} 80%)`,
      border: `1px solid ${pal.deep}`,
      position: 'relative', display: 'flex', alignItems: 'center', justifyContent: 'center',
      ...style,
    }}>
      <IllusStyles />
      <svg viewBox={viewBox} width="100%" height="100%" style={{ display: 'block' }} preserveAspectRatio="xMidYMid meet">
        {children}
      </svg>
    </div>
  );
}

// ─── 01 PORTADA — Abrazo cálido entre padre e hijo, cruz al fondo ──────
function IllusPortada({ pal }) {
  return (
    <div style={{
      width: '100%', height: '100%',
      borderRadius: 4, overflow: 'hidden',
      background: `radial-gradient(ellipse 95% 75% at 50% 38%, #fbeed1 0%, ${pal.warm}77 16%, ${pal.deep}dd 58%, ${pal.deep} 100%)`,
      border: `1px solid ${pal.deep}`,
      position: 'relative', display: 'flex', alignItems: 'center', justifyContent: 'center',
      aspectRatio: 'auto',
    }}>
      <IllusStyles />
      <svg viewBox="0 0 800 500" width="100%" height="100%" style={{ display: 'block' }} preserveAspectRatio="xMidYMid meet">
        <defs>
          {/* Halo cálido detrás de la cruz */}
          <radialGradient id="ipHalo" cx="50%" cy="38%">
            <stop offset="0%"   stopColor="#ffffff" stopOpacity="1"/>
            <stop offset="14%"  stopColor="#fff4d6" stopOpacity="0.95"/>
            <stop offset="38%"  stopColor={pal.warm} stopOpacity="0.65"/>
            <stop offset="70%"  stopColor={pal.warm} stopOpacity="0.22"/>
            <stop offset="100%" stopColor={pal.warm} stopOpacity="0"/>
          </radialGradient>
          {/* Suelo cálido */}
          <linearGradient id="ipFloor" x1="0" y1="0" x2="0" y2="1">
            <stop offset="0%"   stopColor={pal.warm} stopOpacity="0.32"/>
            <stop offset="100%" stopColor={pal.deep} stopOpacity="0.7"/>
          </linearGradient>
          {/* Rayos */}
          <linearGradient id="ipRay" x1="0.5" y1="0" x2="0.5" y2="1">
            <stop offset="0%"   stopColor="#fff4d6" stopOpacity="0.85"/>
            <stop offset="55%"  stopColor={pal.warm} stopOpacity="0.28"/>
            <stop offset="100%" stopColor={pal.warm} stopOpacity="0"/>
          </linearGradient>
          {/* Color de piel cálido */}
          <linearGradient id="ipSkin" x1="0" y1="0" x2="0" y2="1">
            <stop offset="0%" stopColor="#e8c9a3"/>
            <stop offset="100%" stopColor="#c89876"/>
          </linearGradient>
          {/* Manto del padre */}
          <linearGradient id="ipRobeFather" x1="0" y1="0" x2="0" y2="1">
            <stop offset="0%" stopColor="#3a3550"/>
            <stop offset="100%" stopColor="#1f1c30"/>
          </linearGradient>
          {/* Túnica del hijo (cálida) */}
          <linearGradient id="ipRobeSon" x1="0" y1="0" x2="0" y2="1">
            <stop offset="0%" stopColor={pal.warm} stopOpacity="0.95"/>
            <stop offset="100%" stopColor="#7a4a2e"/>
          </linearGradient>
        </defs>

        {/* HALO grande detrás de la cruz */}
        <ellipse cx="400" cy="180" rx="430" ry="320" fill="url(#ipHalo)"
          style={{ animation: 'illusGlowStrong 5s ease-in-out infinite', transformOrigin: '400px 180px' }}/>

        {/* Rayos de luz emanando de la cruz */}
        <g opacity="0.55">
          <polygon points="400,150 220,500 290,500" fill="url(#ipRay)"
            style={{ animation: 'illusGlow 6s ease-in-out infinite', transformOrigin: '400px 150px' }}/>
          <polygon points="400,150 360,500 440,500" fill="url(#ipRay)"
            style={{ animation: 'illusGlow 6s ease-in-out infinite 1.4s', transformOrigin: '400px 150px' }}/>
          <polygon points="400,150 510,500 580,500" fill="url(#ipRay)"
            style={{ animation: 'illusGlow 6s ease-in-out infinite 2.8s', transformOrigin: '400px 150px' }}/>
        </g>

        {/* CRUZ — silueta nítida sobre el halo */}
        <g style={{ animation: 'illusPulse 5.5s ease-in-out infinite', transformOrigin: '400px 200px' }}>
          <rect x="394" y="80"  width="13" height="220" rx="2" fill="#1a1729" opacity="0.78"/>
          <rect x="350" y="138" width="100" height="12" rx="2" fill="#1a1729" opacity="0.78"/>
          <circle cx="400" cy="144" r="9" fill="#ffffff" opacity="0.95"/>
          <circle cx="400" cy="144" r="16" fill="#fff4d6" opacity="0.5"/>
        </g>

        {/* SUELO cálido */}
        <rect x="0" y="395" width="800" height="105" fill="url(#ipFloor)"/>
        <line x1="40" y1="395" x2="760" y2="395" stroke={pal.warm} strokeOpacity="0.7" strokeWidth="1.5"/>

        {/* ─── ABRAZO — padre e hijo de pie, frente a frente, abrazados ─── */}
        {/* Sombra conjunta */}
        <ellipse cx="400" cy="455" rx="135" ry="9" fill="#0d0b1a" opacity="0.42"/>

        {/* PADRE (más alto, izquierda) — cuerpo de tres-cuartos hacia el centro */}
        <g>
          {/* Pies del padre */}
          <ellipse cx="350" cy="448" rx="18" ry="5" fill="#1a1729"/>
          <ellipse cx="378" cy="450" rx="18" ry="5" fill="#1a1729"/>

          {/* Piernas del padre — túnica larga */}
          <path d="M 326 320 Q 320 380 324 446 L 360 446 Q 366 400 370 350 Q 372 330 372 320 Z"
            fill="url(#ipRobeFather)"/>
          <path d="M 372 320 Q 374 340 378 380 Q 384 420 390 450 L 412 450 Q 412 410 408 360 Q 406 335 402 320 Z"
            fill="url(#ipRobeFather)"/>

          {/* Torso del padre — pecho amplio, postura erguida */}
          <path d="M 318 232 Q 312 252 314 280 L 320 320 Q 326 326 350 326 L 396 326 Q 408 322 408 305 L 406 270 Q 408 248 402 232 Q 388 220 360 220 Q 332 220 318 232 Z"
            fill="url(#ipRobeFather)"/>

          {/* Cuello del padre */}
          <rect x="350" y="208" width="20" height="20" rx="4" fill="url(#ipSkin)"/>

          {/* CABEZA del padre — inclinada hacia el hijo, ligeramente bajada */}
          <g transform="rotate(8 360 198)">
            {/* Cráneo / piel */}
            <ellipse cx="360" cy="190" rx="22" ry="26" fill="url(#ipSkin)"/>
            {/* Oreja */}
            <ellipse cx="340" cy="194" rx="3.5" ry="6" fill="#b8835f"/>
            {/* Cabello (oscuro, corto) */}
            <path d="M 339 178 Q 360 158 382 178 Q 384 192 376 192 L 344 192 Q 336 190 339 178 Z"
              fill="#2a2435"/>
            {/* Cejas */}
            <path d="M 348 188 Q 354 186 360 189" stroke="#2a2435" strokeWidth="1.8" fill="none"/>
            <path d="M 366 189 Q 372 186 378 188" stroke="#2a2435" strokeWidth="1.8" fill="none"/>
            {/* Ojos cerrados (en abrazo, con paz) — líneas suaves */}
            <path d="M 348 196 Q 354 198 360 196" stroke="#1a1729" strokeWidth="1.5" fill="none" strokeLinecap="round"/>
            <path d="M 366 196 Q 372 198 378 196" stroke="#1a1729" strokeWidth="1.5" fill="none" strokeLinecap="round"/>
            {/* Nariz */}
            <path d="M 363 200 Q 365 208 363 212 Q 361 213 360 211" stroke="#a87a55" strokeWidth="1.3" fill="none" strokeLinecap="round"/>
            {/* Boca con sonrisa suave */}
            <path d="M 354 218 Q 360 222 366 218" stroke="#7c4838" strokeWidth="1.8" fill="none" strokeLinecap="round"/>
            {/* Barba/mejilla sombreada */}
            <path d="M 348 210 Q 354 214 360 214 Q 366 214 372 210" stroke="#2a2435" strokeWidth="0.8" fill="none" opacity="0.4"/>
          </g>

          {/* BRAZO del padre rodeando al hijo (atrás de la espalda del hijo) */}
          <path d="M 408 260 Q 460 250 510 285 Q 540 305 530 340 Q 524 360 500 360"
            stroke="url(#ipRobeFather)" strokeWidth="36" fill="none" strokeLinecap="round" opacity="0.95"/>

          {/* Mano del padre apoyada en la espalda del hijo */}
          <ellipse cx="498" cy="358" rx="14" ry="11" fill="url(#ipSkin)"/>
          <path d="M 488 354 Q 498 350 508 354" stroke="#a87a55" strokeWidth="0.8" fill="none"/>

          {/* OTRO brazo del padre — sosteniendo la cabeza del hijo con ternura */}
          <path d="M 320 280 Q 310 320 348 350 Q 380 365 420 365"
            stroke="url(#ipRobeFather)" strokeWidth="32" fill="none" strokeLinecap="round" opacity="0.92"/>
          {/* Mano del padre en la nuca/cabeza del hijo */}
          <ellipse cx="424" cy="336" rx="13" ry="10" fill="url(#ipSkin)" transform="rotate(-15 424 336)"/>
        </g>

        {/* HIJO (más bajo, derecha) — abrazado al padre, cabeza apoyada en su pecho */}
        <g>
          {/* Pies del hijo */}
          <ellipse cx="442" cy="450" rx="13" ry="4" fill="#1a1729"/>
          <ellipse cx="466" cy="452" rx="13" ry="4" fill="#1a1729"/>

          {/* Piernas del hijo (túnica) */}
          <path d="M 428 360 Q 422 410 432 450 L 460 450 Q 468 420 472 380 L 470 360 Z"
            fill="url(#ipRobeSon)"/>
          <path d="M 470 360 Q 468 410 478 450 L 502 450 Q 504 410 498 380 L 492 360 Z"
            fill="url(#ipRobeSon)"/>

          {/* Torso del hijo — cuerpo pegado al padre, ligeramente girado */}
          <path d="M 416 286 Q 410 308 414 332 L 418 365 Q 424 370 446 370 L 488 370 Q 498 365 498 350 L 496 320 Q 498 300 494 286 Q 482 278 460 278 Q 432 278 416 286 Z"
            fill="url(#ipRobeSon)"/>
          {/* Pliegue cálido */}
          <path d="M 420 310 Q 440 308 460 310 Q 480 312 492 308" stroke="#b87044" strokeWidth="1.5" fill="none" opacity="0.55"/>

          {/* BRAZOS del hijo rodeando al padre */}
          {/* Brazo derecho del hijo, cruzando el cuerpo del padre */}
          <path d="M 420 300 Q 380 305 340 295 Q 320 290 314 280"
            stroke="url(#ipRobeSon)" strokeWidth="24" fill="none" strokeLinecap="round"/>
          {/* Mano del hijo aferrada al hombro del padre */}
          <ellipse cx="320" cy="282" rx="12" ry="9" fill="url(#ipSkin)" transform="rotate(15 320 282)"/>

          {/* Brazo izquierdo del hijo — abrazando la cintura del padre */}
          <path d="M 488 310 Q 458 320 412 310"
            stroke="url(#ipRobeSon)" strokeWidth="22" fill="none" strokeLinecap="round" opacity="0.85"/>

          {/* CABEZA del hijo — apoyada en el pecho del padre, ladeada */}
          <g transform="rotate(-22 432 280)">
            {/* Cráneo */}
            <ellipse cx="432" cy="280" rx="18" ry="22" fill="url(#ipSkin)"/>
            {/* Oreja */}
            <ellipse cx="448" cy="282" rx="3" ry="5" fill="#b8835f"/>
            {/* Cabello (más claro, joven, suelto) */}
            <path d="M 416 268 Q 432 252 450 268 Q 452 280 446 280 L 420 280 Q 414 278 416 268 Z"
              fill="#5a3d28"/>
            <path d="M 418 274 Q 425 270 432 272" stroke="#7a5036" strokeWidth="0.8" fill="none" opacity="0.7"/>
            {/* Cejas */}
            <path d="M 423 280 Q 428 278 432 280" stroke="#3a2818" strokeWidth="1.3" fill="none"/>
            {/* Ojos cerrados con paz */}
            <path d="M 421 286 Q 426 288 432 286" stroke="#1a1729" strokeWidth="1.3" fill="none" strokeLinecap="round"/>
            {/* Nariz */}
            <path d="M 434 288 Q 436 294 434 296" stroke="#a87a55" strokeWidth="1" fill="none" strokeLinecap="round"/>
            {/* Boca relajada / sonrisa suave */}
            <path d="M 428 302 Q 432 304 436 302" stroke="#7c4838" strokeWidth="1.4" fill="none" strokeLinecap="round"/>
            {/* Mejilla rosada — calidez */}
            <ellipse cx="442" cy="294" rx="5" ry="3" fill="#e8a888" opacity="0.55"/>
          </g>

          {/* Toque de luz cálida sobre la cabeza del hijo */}
          <ellipse cx="436" cy="258" rx="18" ry="6" fill={pal.warm} opacity="0.55"
            style={{ animation: 'illusGlow 4s ease-in-out infinite', transformOrigin: '436px 258px' }}/>
        </g>

        {/* Chispas / motas de luz alegres alrededor del abrazo */}
        {[
          [240, 240, 0,    2.4],
          [560, 230, 0.7,  2.4],
          [200, 320, 1.2,  2],
          [600, 320, 0.4,  2],
          [180, 200, 1.6,  1.8],
          [620, 190, 0.9,  1.8],
          [300, 180, 0.3,  1.6],
          [510, 170, 1.4,  1.6],
          [150, 380, 2.0,  1.8],
          [660, 380, 0.6,  1.8],
        ].map(([cx, cy, delay, r], i) => (
          <circle key={i} cx={cx} cy={cy} r={r} fill="#fff4d6"
            style={{ animation: `illusPulseDot 2.4s ease-in-out infinite ${delay}s` }}/>
        ))}
      </svg>
    </div>
  );
}

// ─── 03 RECAP — Dos caminos: solo vs de la mano ─────────────────────────
function IllusRecap({ pal }) {
  return (
    <IllusFrame pal={pal} viewBox="0 0 600 360">
      {/* Línea divisoria suave */}
      <line x1="300" y1="40" x2="300" y2="320" stroke={pal.soft} strokeWidth="1" strokeDasharray="3 5"/>

      {/* IZQ: huérfano caminando solo, sin rumbo */}
      <text x="150" y="50" fill={pal.medium} fontSize="11" letterSpacing="2" textAnchor="middle" fontFamily="ui-monospace, monospace">SOLO</text>
      <path d="M 60 280 Q 150 250 240 290" stroke={pal.medium} strokeWidth="1.5" fill="none" strokeDasharray="3 6" opacity="0.5"/>
      <g style={{ transformOrigin: '150px 240px', animation: 'illusFloatSm 4s ease-in-out infinite' }}>
        <circle cx="150" cy="180" r="11" fill={pal.medium}/>
        <path d="M 150 191 L 150 240 M 150 215 L 135 235 M 150 215 L 165 235 M 150 200 L 132 215 M 150 200 L 168 215" stroke={pal.medium} strokeWidth="2.5" strokeLinecap="round" fill="none"/>
      </g>
      {/* signos de interrogación flotando */}
      <text x="180" y="170" fill={pal.medium} fontSize="22" fontFamily="serif" opacity="0.5" style={{ animation: 'illusFloat 3s ease-in-out infinite' }}>?</text>
      <text x="115" y="140" fill={pal.medium} fontSize="16" fontFamily="serif" opacity="0.4" style={{ animation: 'illusFloat 3.5s ease-in-out infinite .5s' }}>?</text>

      {/* DER: hijo de la mano del Padre, caminando hacia luz */}
      <text x="450" y="50" fill={pal.warmDeep} fontSize="11" letterSpacing="2" textAnchor="middle" fontFamily="ui-monospace, monospace">DE LA MANO</text>
      {/* Sol cálido */}
      <circle cx="540" cy="120" r="38" fill={pal.warm} opacity="0.18" style={{ animation: 'illusGlow 3.5s ease-in-out infinite', transformOrigin: '540px 120px' }}/>
      <circle cx="540" cy="120" r="14" fill={pal.warm} opacity="0.85" style={{ animation: 'illusPulse 3.5s ease-in-out infinite', transformOrigin: '540px 120px' }}/>
      {/* Camino dorado */}
      <path d="M 360 290 Q 450 250 530 130" stroke={pal.warm} strokeWidth="2" fill="none" strokeDasharray="4 6" opacity="0.6" style={{ animation: 'illusDash 6s linear infinite' }}/>
      <g style={{ transformOrigin: '430px 240px', animation: 'illusFloatSm 4s ease-in-out infinite' }}>
        {/* Padre (más alto) */}
        <circle cx="445" cy="170" r="13" fill={pal.deep}/>
        <path d="M 445 183 L 445 245 M 445 215 L 428 240 M 445 215 L 462 240" stroke={pal.deep} strokeWidth="3" strokeLinecap="round" fill="none"/>
        {/* Mano extendida hacia abajo */}
        <path d="M 445 200 L 425 220" stroke={pal.warm} strokeWidth="3" strokeLinecap="round"/>
        {/* Hijo */}
        <circle cx="418" cy="210" r="9" fill={pal.deep}/>
        <path d="M 418 219 L 418 248 M 418 235 L 408 248 M 418 235 L 428 248" stroke={pal.deep} strokeWidth="2.5" strokeLinecap="round" fill="none"/>
      </g>
    </IllusFrame>
  );
}

// ─── 04 MOTIVACIONES — Dos coronas ──────────────────────────────────────
function IllusMotivaciones({ pal }) {
  return (
    <IllusFrame pal={pal} viewBox="0 0 600 360">
      {/* IZQ: corona terrenal que se desvanece */}
      <text x="150" y="60" fill={pal.medium} fontSize="11" letterSpacing="2" textAnchor="middle" fontFamily="ui-monospace, monospace">FAMA DE HOMBRES</text>
      <g style={{ transformOrigin: '150px 200px', animation: 'illusFadeDown 4s ease-in-out infinite alternate' }}>
        {/* Corona */}
        <path d="M 110 200 L 120 160 L 135 185 L 150 155 L 165 185 L 180 160 L 190 200 Z" fill="none" stroke={pal.medium} strokeWidth="2"/>
        <line x1="110" y1="210" x2="190" y2="210" stroke={pal.medium} strokeWidth="2"/>
        <circle cx="120" cy="160" r="3" fill={pal.medium}/>
        <circle cx="150" cy="155" r="3.5" fill={pal.medium}/>
        <circle cx="180" cy="160" r="3" fill={pal.medium}/>
        {/* Mano abajo sosteniéndola */}
        <path d="M 130 230 Q 150 220 170 230 L 170 250 L 130 250 Z" fill={pal.medium} opacity="0.4"/>
      </g>
      {/* Polvo cayendo */}
      <circle cx="120" cy="270" r="2" fill={pal.medium} opacity="0.5" style={{ animation: 'illusFall 3s ease-in infinite' }}/>
      <circle cx="160" cy="285" r="1.5" fill={pal.medium} opacity="0.5" style={{ animation: 'illusFall 3s ease-in infinite .8s' }}/>
      <circle cx="180" cy="275" r="1.5" fill={pal.medium} opacity="0.5" style={{ animation: 'illusFall 3s ease-in infinite 1.4s' }}/>

      {/* DER: corona del Reino con luz */}
      <text x="450" y="60" fill={pal.warmDeep} fontSize="11" letterSpacing="2" textAnchor="middle" fontFamily="ui-monospace, monospace">GLORIA DEL PADRE</text>
      <circle cx="450" cy="180" r="60" fill={pal.warm} opacity="0.15" style={{ animation: 'illusGlow 3s ease-in-out infinite', transformOrigin: '450px 180px' }}/>
      <g style={{ transformOrigin: '450px 200px', animation: 'illusFloatSm 4s ease-in-out infinite' }}>
        <path d="M 410 200 L 420 155 L 435 185 L 450 145 L 465 185 L 480 155 L 490 200 Z" fill={pal.warm} stroke={pal.warmDeep} strokeWidth="2"/>
        <line x1="410" y1="210" x2="490" y2="210" stroke={pal.warmDeep} strokeWidth="2.5"/>
        <circle cx="420" cy="155" r="3.5" fill={pal.warmDeep}/>
        <circle cx="450" cy="145" r="4.5" fill={pal.warmDeep} style={{ animation: 'illusPulseDot 2s ease-in-out infinite' }}/>
        <circle cx="480" cy="155" r="3.5" fill={pal.warmDeep}/>
        {/* Manos abiertas ofreciendo */}
        <path d="M 425 240 Q 450 225 475 240 L 478 260 Q 450 270 422 260 Z" fill={pal.warmDeep} opacity="0.55"/>
      </g>
      {/* Rayos */}
      {[0, 60, 120, 180, 240, 300].map((a, i) => (
        <line key={i} x1="450" y1="180" x2={450 + Math.cos(a * Math.PI / 180) * 90} y2={180 + Math.sin(a * Math.PI / 180) * 90}
          stroke={pal.warm} strokeWidth="1" opacity="0.3" strokeDasharray="2 4" style={{ animation: `illusGlow ${2.5 + i * 0.2}s ease-in-out infinite` }}/>
      ))}
    </IllusFrame>
  );
}

// ─── 05 SANTIDAD — Casa con vela vs candado ─────────────────────────────
function IllusSantidad({ pal }) {
  return (
    <IllusFrame pal={pal} viewBox="0 0 600 360">
      {/* IZQ: candado / cumplimiento */}
      <text x="150" y="60" fill={pal.medium} fontSize="11" letterSpacing="2" textAnchor="middle" fontFamily="ui-monospace, monospace">POR DISCIPLINA</text>
      <g style={{ transformOrigin: '150px 200px', animation: 'illusFloatSm 4s ease-in-out infinite' }}>
        <rect x="118" y="195" width="64" height="55" rx="6" fill="none" stroke={pal.medium} strokeWidth="2.5"/>
        <path d="M 130 195 L 130 175 Q 130 160 150 160 Q 170 160 170 175 L 170 195" fill="none" stroke={pal.medium} strokeWidth="2.5"/>
        <circle cx="150" cy="220" r="5" fill={pal.medium}/>
        <line x1="150" y1="225" x2="150" y2="240" stroke={pal.medium} strokeWidth="2.5"/>
      </g>
      {/* Reloj/ticks alrededor */}
      <text x="150" y="290" fill={pal.medium} fontSize="13" textAnchor="middle" fontFamily="serif" fontStyle="italic" opacity="0.7">cumplir · marcar · temer</text>

      {/* DER: vela en casa cálida */}
      <text x="450" y="60" fill={pal.warmDeep} fontSize="11" letterSpacing="2" textAnchor="middle" fontFamily="ui-monospace, monospace">POR DELEITE</text>
      <g style={{ transformOrigin: '450px 200px' }}>
        {/* Casa silueta */}
        <path d="M 390 250 L 390 200 L 450 150 L 510 200 L 510 250 Z" fill="none" stroke={pal.warmDeep} strokeWidth="2"/>
        <rect x="430" y="210" width="40" height="40" fill={pal.warm} opacity="0.25" style={{ animation: 'illusGlow 3s ease-in-out infinite' }}/>
        {/* Vela dentro */}
        <rect x="446" y="220" width="8" height="22" fill={pal.warmDeep}/>
        <ellipse cx="450" cy="217" rx="3" ry="6" fill={pal.warm} style={{ animation: 'illusFlicker 1.6s ease-in-out infinite', transformOrigin: '450px 220px' }}/>
        <ellipse cx="450" cy="215" rx="1.5" ry="3" fill={pal.bg} opacity="0.85" style={{ animation: 'illusFlicker 1.6s ease-in-out infinite', transformOrigin: '450px 220px' }}/>
        {/* Halo cálido alrededor */}
        <circle cx="450" cy="220" r="50" fill={pal.warm} opacity="0.12" style={{ animation: 'illusGlow 2.4s ease-in-out infinite', transformOrigin: '450px 220px' }}/>
      </g>
      <text x="450" y="290" fill={pal.warmDeep} fontSize="13" textAnchor="middle" fontFamily="serif" fontStyle="italic">no perder el abrazo</text>
    </IllusFrame>
  );
}

// ─── 06 DESCANSO — Silla bajo lluvia vs persona bajo árbol ──────────────
function IllusDescanso({ pal }) {
  return (
    <IllusFrame pal={pal} viewBox="0 0 600 360">
      {/* IZQ: silueta vacía + lluvia (vicios) */}
      <text x="150" y="60" fill={pal.medium} fontSize="11" letterSpacing="2" textAnchor="middle" fontFamily="ui-monospace, monospace">FUERA DE DIOS</text>
      {/* Nube */}
      <ellipse cx="150" cy="110" rx="55" ry="14" fill={pal.medium} opacity="0.45"/>
      <ellipse cx="130" cy="105" rx="22" ry="12" fill={pal.medium} opacity="0.45"/>
      <ellipse cx="170" cy="103" rx="20" ry="11" fill={pal.medium} opacity="0.45"/>
      {/* Lluvia */}
      {[0, 1, 2, 3, 4, 5].map(i => (
        <line key={i} x1={110 + i * 16} y1="130" x2={106 + i * 16} y2="160" stroke={pal.medium} strokeWidth="1.5" opacity="0.7"
          style={{ animation: `illusFall ${1.2 + (i % 3) * 0.3}s linear infinite ${i * 0.15}s` }}/>
      ))}
      {/* Vaso/copa simbolizando vicio */}
      <path d="M 130 240 L 138 280 L 162 280 L 170 240 Z" fill={pal.medium} opacity="0.5"/>
      <ellipse cx="150" cy="240" rx="20" ry="4" fill={pal.medium} opacity="0.7"/>

      {/* DER: persona reclinada bajo árbol con luz pulsante */}
      <text x="450" y="60" fill={pal.warmDeep} fontSize="11" letterSpacing="2" textAnchor="middle" fontFamily="ui-monospace, monospace">EN LA PRESENCIA</text>
      {/* Sol cálido */}
      <circle cx="510" cy="110" r="22" fill={pal.warm} opacity="0.85" style={{ animation: 'illusPulse 3.5s ease-in-out infinite', transformOrigin: '510px 110px' }}/>
      <circle cx="510" cy="110" r="36" fill={pal.warm} opacity="0.2" style={{ animation: 'illusGlow 3.5s ease-in-out infinite', transformOrigin: '510px 110px' }}/>
      {/* Árbol */}
      <g style={{ transformOrigin: '420px 250px', animation: 'illusSway 5s ease-in-out infinite' }}>
        <rect x="416" y="200" width="8" height="60" fill={pal.warmDeep}/>
        <circle cx="420" cy="190" r="38" fill={pal.warmDeep} opacity="0.85"/>
        <circle cx="402" cy="180" r="22" fill={pal.warmDeep} opacity="0.7"/>
        <circle cx="438" cy="180" r="22" fill={pal.warmDeep} opacity="0.7"/>
      </g>
      {/* Persona reclinada */}
      <ellipse cx="455" cy="265" rx="35" ry="5" fill={pal.deep} opacity="0.3"/>
      <path d="M 430 260 Q 460 250 490 260 L 488 268 Q 460 264 432 268 Z" fill={pal.deep}/>
      <circle cx="492" cy="252" r="8" fill={pal.deep}/>
    </IllusFrame>
  );
}

// ─── 07 PRÓJIMO — Plantas: una en sombra, dos creciendo juntas ──────────
function IllusProjimo({ pal }) {
  return (
    <IllusFrame pal={pal} viewBox="0 0 600 360">
      {/* IZQ: planta marchitándose, sombra de la otra */}
      <text x="150" y="60" fill={pal.medium} fontSize="11" letterSpacing="2" textAnchor="middle" fontFamily="ui-monospace, monospace">SÍNDROME DE CAÍN</text>
      {/* Planta envidiosa (la grande, da sombra) */}
      <g style={{ transformOrigin: '110px 280px' }}>
        <rect x="106" y="180" width="3" height="100" fill={pal.medium}/>
        <ellipse cx="95" cy="200" rx="14" ry="6" fill={pal.medium} opacity="0.7" transform="rotate(-25 95 200)"/>
        <ellipse cx="125" cy="195" rx="14" ry="6" fill={pal.medium} opacity="0.7" transform="rotate(25 125 195)"/>
        <ellipse cx="100" cy="220" rx="12" ry="5" fill={pal.medium} opacity="0.6" transform="rotate(-30 100 220)"/>
      </g>
      {/* Planta marchita debajo de la sombra */}
      <g style={{ transformOrigin: '180px 280px', animation: 'illusFadeDown 5s ease-in-out infinite alternate' }}>
        <path d="M 180 280 Q 178 250 175 240" stroke={pal.medium} strokeWidth="2" fill="none" opacity="0.5"/>
        <ellipse cx="172" cy="248" rx="6" ry="3" fill={pal.medium} opacity="0.4" transform="rotate(40 172 248)"/>
        <ellipse cx="178" cy="240" rx="5" ry="2.5" fill={pal.medium} opacity="0.4" transform="rotate(-30 178 240)"/>
      </g>
      {/* Suelo */}
      <line x1="60" y1="282" x2="240" y2="282" stroke={pal.medium} strokeWidth="1.5"/>

      {/* DER: dos plantas creciendo juntas hacia el sol */}
      <text x="450" y="60" fill={pal.warmDeep} fontSize="11" letterSpacing="2" textAnchor="middle" fontFamily="ui-monospace, monospace">HONRA · HERMANDAD</text>
      <circle cx="450" cy="115" r="20" fill={pal.warm} opacity="0.85" style={{ animation: 'illusPulse 3s ease-in-out infinite', transformOrigin: '450px 115px' }}/>
      <circle cx="450" cy="115" r="35" fill={pal.warm} opacity="0.18" style={{ animation: 'illusGlow 3s ease-in-out infinite', transformOrigin: '450px 115px' }}/>
      <g style={{ transformOrigin: '420px 280px', animation: 'illusSway 4s ease-in-out infinite' }}>
        <path d="M 420 280 L 420 180" stroke={pal.warmDeep} strokeWidth="2.5" fill="none"/>
        <ellipse cx="408" cy="200" rx="13" ry="6" fill={pal.warmDeep} opacity="0.85" transform="rotate(-20 408 200)"/>
        <ellipse cx="432" cy="195" rx="13" ry="6" fill={pal.warmDeep} opacity="0.85" transform="rotate(20 432 195)"/>
        <ellipse cx="412" cy="220" rx="11" ry="5" fill={pal.warmDeep} opacity="0.7" transform="rotate(-25 412 220)"/>
      </g>
      <g style={{ transformOrigin: '480px 280px', animation: 'illusSway 4s ease-in-out infinite .8s' }}>
        <path d="M 480 280 L 480 195" stroke={pal.warm} strokeWidth="2.5" fill="none"/>
        <ellipse cx="468" cy="215" rx="13" ry="6" fill={pal.warm} opacity="0.85" transform="rotate(-20 468 215)"/>
        <ellipse cx="492" cy="210" rx="13" ry="6" fill={pal.warm} opacity="0.85" transform="rotate(20 492 210)"/>
      </g>
      <line x1="370" y1="282" x2="540" y2="282" stroke={pal.warmDeep} strokeWidth="1.5"/>
    </IllusFrame>
  );
}

// ─── 08 ERRORES — Vasija rota: piedras (acusar) vs hilos dorados (kintsugi) ─
function IllusErrores({ pal }) {
  return (
    <IllusFrame pal={pal} viewBox="0 0 600 360">
      {/* IZQ: vasija rota con piedras cayendo */}
      <text x="150" y="60" fill={pal.medium} fontSize="11" letterSpacing="2" textAnchor="middle" fontFamily="ui-monospace, monospace">ACUSAR</text>
      <g style={{ transformOrigin: '150px 220px' }}>
        {/* Vasija con grietas */}
        <path d="M 110 200 Q 110 175 130 175 L 170 175 Q 190 175 190 200 L 190 270 Q 150 280 110 270 Z" fill="none" stroke={pal.medium} strokeWidth="2"/>
        {/* Grietas */}
        <line x1="140" y1="175" x2="135" y2="270" stroke={pal.medium} strokeWidth="1"/>
        <line x1="160" y1="180" x2="170" y2="270" stroke={pal.medium} strokeWidth="1"/>
        <line x1="125" y1="220" x2="140" y2="240" stroke={pal.medium} strokeWidth="1"/>
      </g>
      {/* Piedras cayendo */}
      {[0, 1, 2, 3].map(i => (
        <circle key={i} cx={120 + i * 20} cy="290" r={3 + (i % 2)} fill={pal.medium} opacity="0.6"
          style={{ animation: `illusFall ${1.6 + i * 0.2}s ease-in infinite ${i * 0.4}s` }}/>
      ))}

      {/* DER: vasija con hilos dorados (kintsugi) */}
      <text x="450" y="60" fill={pal.warmDeep} fontSize="11" letterSpacing="2" textAnchor="middle" fontFamily="ui-monospace, monospace">RESTAURAR</text>
      <g style={{ transformOrigin: '450px 220px', animation: 'illusFloatSm 4s ease-in-out infinite' }}>
        <path d="M 410 200 Q 410 175 430 175 L 470 175 Q 490 175 490 200 L 490 270 Q 450 280 410 270 Z" fill={pal.warm} fillOpacity="0.18" stroke={pal.warmDeep} strokeWidth="2"/>
        {/* Hilos dorados que unen */}
        <path d="M 440 175 Q 435 200 440 230 Q 445 260 440 275" stroke={pal.warm} strokeWidth="2.5" fill="none" strokeLinecap="round" style={{ animation: 'illusGlowStrong 2.5s ease-in-out infinite' }}/>
        <path d="M 460 178 Q 470 210 465 250 Q 462 270 462 275" stroke={pal.warm} strokeWidth="2.5" fill="none" strokeLinecap="round" style={{ animation: 'illusGlowStrong 2.5s ease-in-out infinite .4s' }}/>
        <path d="M 425 220 Q 440 235 460 230" stroke={pal.warm} strokeWidth="2" fill="none" strokeLinecap="round" style={{ animation: 'illusGlowStrong 2.5s ease-in-out infinite .8s' }}/>
        {/* Brillos */}
        <circle cx="440" cy="200" r="2" fill={pal.warm} style={{ animation: 'illusPulseDot 1.8s ease-in-out infinite' }}/>
        <circle cx="465" cy="225" r="2" fill={pal.warm} style={{ animation: 'illusPulseDot 1.8s ease-in-out infinite .6s' }}/>
        <circle cx="448" cy="255" r="2" fill={pal.warm} style={{ animation: 'illusPulseDot 1.8s ease-in-out infinite 1.2s' }}/>
      </g>
    </IllusFrame>
  );
}

// ─── 09 AUTORIDAD — Mano del padre protegiendo a hija de enchufe ────────
function IllusAutoridad({ pal }) {
  return (
    <IllusFrame pal={pal} viewBox="0 0 600 360">
      {/* IZQ: rebelde cambiando de iglesias / puerta giratoria */}
      <text x="150" y="60" fill={pal.medium} fontSize="11" letterSpacing="2" textAnchor="middle" fontFamily="ui-monospace, monospace">INDEPENDENCIA</text>
      <g style={{ transformOrigin: '150px 200px', animation: 'illusSpin 8s linear infinite' }}>
        <line x1="150" y1="160" x2="150" y2="240" stroke={pal.medium} strokeWidth="2"/>
        <line x1="110" y1="200" x2="190" y2="200" stroke={pal.medium} strokeWidth="2"/>
        <rect x="115" y="170" width="30" height="25" fill={pal.medium} opacity="0.3"/>
        <rect x="155" y="170" width="30" height="25" fill={pal.medium} opacity="0.3"/>
        <rect x="115" y="205" width="30" height="25" fill={pal.medium} opacity="0.3"/>
        <rect x="155" y="205" width="30" height="25" fill={pal.medium} opacity="0.3"/>
      </g>
      <circle cx="150" cy="200" r="5" fill={pal.medium}/>
      <text x="150" y="280" fill={pal.medium} fontSize="13" textAnchor="middle" fontFamily="serif" fontStyle="italic" opacity="0.7">nunca permanece</text>

      {/* DER: protección — mano grande del Padre, niña pequeña, enchufe */}
      <text x="450" y="60" fill={pal.warmDeep} fontSize="11" letterSpacing="2" textAnchor="middle" fontFamily="ui-monospace, monospace">DISCIPLINA · AMOR</text>
      {/* Enchufe peligroso */}
      <rect x="500" y="220" width="35" height="45" fill={pal.medium} opacity="0.3" stroke={pal.medium} strokeWidth="1.5"/>
      <circle cx="510" cy="240" r="2.5" fill={pal.medium}/>
      <circle cx="525" cy="240" r="2.5" fill={pal.medium}/>
      {/* Chispitas */}
      <circle cx="517" cy="215" r="1.5" fill={pal.warm} style={{ animation: 'illusPulseDot 1s ease-in-out infinite' }}/>
      <circle cx="522" cy="210" r="1" fill={pal.warm} style={{ animation: 'illusPulseDot 1s ease-in-out infinite .3s' }}/>

      {/* Mano grande del padre interponiéndose */}
      <g style={{ transformOrigin: '450px 230px', animation: 'illusFloatSm 3s ease-in-out infinite' }}>
        <path d="M 380 200 Q 410 195 460 215 Q 480 225 485 245 L 478 252 Q 440 240 410 235 L 380 240 Z" fill={pal.warmDeep}/>
        {/* Halo cálido */}
        <ellipse cx="430" cy="230" rx="55" ry="20" fill={pal.warm} opacity="0.18" style={{ animation: 'illusGlow 2.5s ease-in-out infinite' }}/>
      </g>

      {/* Niña pequeña (sombra) */}
      <circle cx="395" cy="245" r="8" fill={pal.deep}/>
      <path d="M 395 253 L 395 280 M 395 268 L 388 278 M 395 268 L 402 278" stroke={pal.deep} strokeWidth="2" strokeLinecap="round" fill="none"/>
    </IllusFrame>
  );
}

// ─── 10 ABBA — Globos de palabra: úsame baja gris, Abba sube dorado ─────
function IllusAbba({ pal }) {
  return (
    <IllusFrameDark pal={pal} viewBox="0 0 600 360">
      {/* Centro: corazón / persona */}
      <circle cx="300" cy="180" r="45" fill={pal.warm} opacity="0.18" style={{ animation: 'illusGlow 3s ease-in-out infinite', transformOrigin: '300px 180px' }}/>
      <path d="M 300 200 Q 280 175 280 165 Q 280 152 295 152 Q 300 152 300 162 Q 300 152 305 152 Q 320 152 320 165 Q 320 175 300 200 Z" fill={pal.warm} style={{ animation: 'illusPulse 1.8s ease-in-out infinite', transformOrigin: '300px 175px' }}/>

      {/* Palabra "úsame" cayendo gris */}
      <g style={{ transformOrigin: '170px 100px', animation: 'illusFall 4s ease-in infinite' }}>
        <rect x="120" y="80" width="100" height="32" rx="16" fill={pal.deep} opacity="0.55"/>
        <text x="170" y="101" fill={pal.bg} opacity="0.7" fontSize="14" textAnchor="middle" fontFamily="serif" fontStyle="italic">"úsame"</text>
      </g>
      <g style={{ transformOrigin: '160px 290px', animation: 'illusFall 4s ease-in infinite 1.5s' }}>
        <rect x="110" y="270" width="120" height="30" rx="15" fill={pal.deep} opacity="0.55"/>
        <text x="170" y="290" fill={pal.bg} opacity="0.6" fontSize="13" textAnchor="middle" fontFamily="serif" fontStyle="italic">"no soy digno"</text>
      </g>

      {/* Palabra "Abba" subiendo dorada */}
      <g style={{ transformOrigin: '440px 240px', animation: 'illusRise 4s ease-out infinite' }}>
        <rect x="400" y="220" width="90" height="36" rx="18" fill={pal.warm}/>
        <text x="445" y="244" fill={pal.abyss} fontSize="18" textAnchor="middle" fontFamily="serif" fontStyle="italic" fontWeight="600">"Abba"</text>
      </g>
      <g style={{ transformOrigin: '440px 100px', animation: 'illusRise 4s ease-out infinite 1.5s' }}>
        <rect x="395" y="80" width="120" height="32" rx="16" fill={pal.warm} opacity="0.85"/>
        <text x="455" y="101" fill={pal.abyss} fontSize="13" textAnchor="middle" fontFamily="serif" fontStyle="italic" fontWeight="600">"soy tu hijo"</text>
      </g>

      {/* Líneas conectoras al centro */}
      <line x1="220" y1="100" x2="280" y2="170" stroke={pal.medium} strokeWidth="1" strokeDasharray="2 4" opacity="0.4"/>
      <line x1="395" y1="240" x2="320" y2="190" stroke={pal.warm} strokeWidth="1.5" strokeDasharray="2 4" opacity="0.7"/>
    </IllusFrameDark>
  );
}

// ─── 11 HERENCIA — Moneda en bolsa pequeña vs semilla → árbol con frutos ─
function IllusHerencia({ pal }) {
  return (
    <IllusFrame pal={pal} viewBox="0 0 600 360">
      {/* IZQ: bolsa con moneda — salario */}
      <text x="150" y="60" fill={pal.medium} fontSize="11" letterSpacing="2" textAnchor="middle" fontFamily="ui-monospace, monospace">SALARIO</text>
      <g style={{ transformOrigin: '150px 220px' }}>
        <path d="M 115 210 L 120 195 L 180 195 L 185 210 Q 195 230 185 260 Q 175 280 150 280 Q 125 280 115 260 Q 105 230 115 210 Z" fill={pal.medium} opacity="0.4" stroke={pal.medium} strokeWidth="1.5"/>
        <text x="150" y="245" fill={pal.medium} fontSize="22" textAnchor="middle" fontFamily="serif" fontWeight="600">$</text>
      </g>
      {/* Moneda cayendo */}
      <circle cx="150" cy="170" r="6" fill={pal.medium} opacity="0.7" style={{ animation: 'illusFall 2.5s ease-in infinite', transformOrigin: '150px 170px' }}/>
      <text x="150" y="305" fill={pal.medium} fontSize="13" textAnchor="middle" fontFamily="serif" fontStyle="italic" opacity="0.7">pequeño · finito</text>

      {/* DER: semilla → árbol con frutos sobre el mundo */}
      <text x="450" y="60" fill={pal.warmDeep} fontSize="11" letterSpacing="2" textAnchor="middle" fontFamily="ui-monospace, monospace">HERENCIA</text>
      {/* Globo */}
      <circle cx="450" cy="285" r="25" fill={pal.warmDeep} opacity="0.25"/>
      <circle cx="450" cy="285" r="25" fill="none" stroke={pal.warmDeep} strokeWidth="1.5"/>
      <path d="M 432 280 Q 445 285 460 282 M 438 295 Q 450 290 465 295" stroke={pal.warmDeep} strokeWidth="1" fill="none" opacity="0.7"/>
      {/* Árbol creciendo */}
      <g style={{ transformOrigin: '450px 260px', animation: 'illusSway 5s ease-in-out infinite' }}>
        <rect x="447" y="200" width="6" height="60" fill={pal.warmDeep}/>
        <circle cx="450" cy="180" r="32" fill={pal.warmDeep} opacity="0.6"/>
        <circle cx="430" cy="170" r="20" fill={pal.warmDeep} opacity="0.5"/>
        <circle cx="470" cy="170" r="20" fill={pal.warmDeep} opacity="0.5"/>
        {/* Frutos cálidos */}
        <circle cx="437" cy="175" r="4" fill={pal.warm} style={{ animation: 'illusPulseDot 2s ease-in-out infinite' }}/>
        <circle cx="465" cy="170" r="4" fill={pal.warm} style={{ animation: 'illusPulseDot 2s ease-in-out infinite .4s' }}/>
        <circle cx="450" cy="160" r="4" fill={pal.warm} style={{ animation: 'illusPulseDot 2s ease-in-out infinite .8s' }}/>
        <circle cx="445" cy="190" r="3.5" fill={pal.warm} style={{ animation: 'illusPulseDot 2s ease-in-out infinite 1.2s' }}/>
      </g>
      {/* Sol */}
      <circle cx="525" cy="105" r="14" fill={pal.warm} opacity="0.85" style={{ animation: 'illusPulse 3s ease-in-out infinite', transformOrigin: '525px 105px' }}/>
      <circle cx="525" cy="105" r="24" fill={pal.warm} opacity="0.18" style={{ animation: 'illusGlow 3s ease-in-out infinite', transformOrigin: '525px 105px' }}/>
    </IllusFrame>
  );
}

// ─── 13 CIERRE — Mesa con velas encendiéndose una a una ─────────────────
function IllusCierre({ pal }) {
  return (
    <IllusFrame pal={pal} viewBox="0 0 600 360">
      {/* Mesa */}
      <ellipse cx="300" cy="245" rx="200" ry="22" fill={pal.warmDeep} opacity="0.85"/>
      <ellipse cx="300" cy="245" rx="200" ry="22" fill="none" stroke={pal.warmDeep} strokeWidth="1.5"/>
      <line x1="160" y1="255" x2="155" y2="320" stroke={pal.warmDeep} strokeWidth="2"/>
      <line x1="440" y1="255" x2="445" y2="320" stroke={pal.warmDeep} strokeWidth="2"/>

      {/* Sillas alrededor (siluetas) */}
      <rect x="80" y="240" width="20" height="60" rx="2" fill={pal.deep} opacity="0.4"/>
      <rect x="500" y="240" width="20" height="60" rx="2" fill={pal.deep} opacity="0.4"/>

      {/* Velas (4 — se encienden secuencialmente) */}
      {[
        { x: 200, delay: 0 },
        { x: 270, delay: 0.6 },
        { x: 340, delay: 1.2 },
        { x: 410, delay: 1.8 },
      ].map((v, i) => (
        <g key={i}>
          {/* Halo cálido */}
          <circle cx={v.x} cy="200" r="28" fill={pal.warm} opacity="0.18"
            style={{ animation: `illusGlow 2.4s ease-in-out infinite ${v.delay}s` }}/>
          {/* Cuerpo de vela */}
          <rect x={v.x - 5} y="210" width="10" height="32" fill={pal.bg} stroke={pal.warmDeep} strokeWidth="1"/>
          {/* Mecha */}
          <line x1={v.x} y1="208" x2={v.x} y2="204" stroke={pal.warmDeep} strokeWidth="1.5"/>
          {/* Llama */}
          <ellipse cx={v.x} cy="200" rx="3.5" ry="7" fill={pal.warm}
            style={{ animation: `illusFlicker 1.4s ease-in-out infinite ${v.delay}s`, transformOrigin: `${v.x}px 207px` }}/>
          <ellipse cx={v.x} cy="198" rx="1.5" ry="4" fill={pal.bg} opacity="0.85"
            style={{ animation: `illusFlicker 1.4s ease-in-out infinite ${v.delay}s`, transformOrigin: `${v.x}px 207px` }}/>
        </g>
      ))}

      {/* Texto inferior */}
      <text x="300" y="340" fill={pal.warmDeep} fontSize="12" textAnchor="middle" fontFamily="serif" fontStyle="italic" letterSpacing="1">una mesa abierta · sin máscaras</text>
    </IllusFrame>
  );
}

// ─── 14 DECLARACIÓN — Cadenas cayendo + corona descendiendo ─────────────
function IllusDeclaracion({ pal }) {
  return (
    <IllusFrameDark pal={pal} viewBox="0 0 600 360">
      {/* Halo central */}
      <circle cx="300" cy="180" r="100" fill={pal.warm} opacity="0.18" style={{ animation: 'illusGlow 3s ease-in-out infinite', transformOrigin: '300px 180px' }}/>
      <circle cx="300" cy="180" r="50" fill={pal.warm} opacity="0.35" style={{ animation: 'illusPulse 3s ease-in-out infinite', transformOrigin: '300px 180px' }}/>

      {/* Corona descendiendo */}
      <g style={{ transformOrigin: '300px 180px', animation: 'illusDrop 4s ease-out infinite' }}>
        <path d="M 250 175 L 262 130 L 280 165 L 300 120 L 320 165 L 338 130 L 350 175 Z" fill={pal.warm} stroke={pal.warmDeep} strokeWidth="2"/>
        <line x1="250" y1="185" x2="350" y2="185" stroke={pal.warmDeep} strokeWidth="2.5"/>
        <circle cx="262" cy="130" r="3.5" fill={pal.warmDeep}/>
        <circle cx="300" cy="120" r="4.5" fill={pal.warmDeep}/>
        <circle cx="338" cy="130" r="3.5" fill={pal.warmDeep}/>
      </g>

      {/* Cabeza inclinada */}
      <ellipse cx="300" cy="225" rx="22" ry="26" fill={pal.deep}/>

      {/* Cadenas rotas cayendo */}
      <g style={{ transformOrigin: '180px 280px', animation: 'illusFall 3.5s ease-in infinite' }}>
        <circle cx="180" cy="270" r="6" fill="none" stroke={pal.medium} strokeWidth="2" opacity="0.6"/>
        <circle cx="180" cy="282" r="6" fill="none" stroke={pal.medium} strokeWidth="2" opacity="0.6"/>
        <circle cx="180" cy="294" r="6" fill="none" stroke={pal.medium} strokeWidth="2" opacity="0.6"/>
      </g>
      <g style={{ transformOrigin: '420px 290px', animation: 'illusFall 3.5s ease-in infinite .8s' }}>
        <circle cx="420" cy="280" r="6" fill="none" stroke={pal.medium} strokeWidth="2" opacity="0.6"/>
        <circle cx="420" cy="292" r="6" fill="none" stroke={pal.medium} strokeWidth="2" opacity="0.6"/>
        <circle cx="420" cy="304" r="6" fill="none" stroke={pal.medium} strokeWidth="2" opacity="0.6"/>
      </g>

      {/* Rayos */}
      {[20, 70, 110, 160, 200, 250, 290, 340].map((a, i) => (
        <line key={i} x1="300" y1="180" x2={300 + Math.cos(a * Math.PI / 180) * 130} y2={180 + Math.sin(a * Math.PI / 180) * 130}
          stroke={pal.warm} strokeWidth="1.2" opacity="0.45" strokeDasharray="3 5"
          style={{ animation: `illusGlow ${2.5 + (i % 3) * 0.4}s ease-in-out infinite ${i * 0.15}s` }}/>
      ))}
    </IllusFrameDark>
  );
}

// Export
Object.assign(window, {
  IllusPortada, IllusRecap, IllusMotivaciones, IllusSantidad,
  IllusDescanso, IllusProjimo, IllusErrores, IllusAutoridad,
  IllusAbba, IllusHerencia, IllusCierre, IllusDeclaracion,
});
