/* ── IA Aplicada hero: duo Wall-E / Eve ─────────── */
.ia-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 560px;
  margin-left: auto;
  opacity: 0;
  animation: fadeIn 1s ease 0.5s forwards;
}

/* ── Halos cromáticos de fondo ──────────────────── */
.walle-halo,
.eve-halo {
  position: absolute;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(48px);
}
.walle-halo {
  bottom: -6%; left: -8%;
  background: radial-gradient(circle, rgba(255, 184, 107, 0.30), transparent 65%);
  animation: haloSlow 7s ease-in-out infinite;
}
.eve-halo {
  top: -8%; right: -8%;
  background: radial-gradient(circle, rgba(37, 128, 227, 0.32), transparent 65%);
  animation: haloSlow 7s ease-in-out infinite reverse;
  animation-delay: 1s;
}

/* ── Cielo: estrellas y suelo ───────────────────── */
.stage-floor,
.stage-beam {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.stage-floor { z-index: 1; }
.stage-beam { z-index: 3; }
.floor-line {
  stroke: var(--line-strong);
  stroke-width: 1;
  stroke-dasharray: 2 6;
  opacity: 0.5;
}
.star {
  fill: var(--ink-dim);
  animation: starTwinkle 3s ease-in-out infinite;
}

/* ── Beam diagonal entre los dos ────────────────── */
.beam-path {
  fill: none;
  stroke: url(#iaBeamGradient);
  stroke-width: 1.4;
  stroke-dasharray: 4 6;
  opacity: 0.4;
  animation: dashFlow 1.6s linear infinite;
}
.beam-particle {
  filter: drop-shadow(0 0 6px currentColor);
}

/* ── Wall-E (warm) ──────────────────────────────── */
.walle {
  position: absolute;
  bottom: 5%;
  left: 1%;
  width: 38%;
  z-index: 5;
  animation: walleRumble 4s ease-in-out infinite;
}
.walle-svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 24px rgba(0,0,0,0.5));
  overflow: visible;
}

.walle-treads {
  fill: #1a120b;
  stroke: var(--accent-warm);
  stroke-width: 1.4;
}
.walle-tread-stripes line {
  stroke: var(--accent-warm);
  stroke-width: 1;
  opacity: 0.45;
}
.walle-wheel {
  fill: #0a0e14;
  stroke: var(--accent-warm);
  stroke-width: 1.4;
}

.walle-body {
  fill: #2a1c10;
  stroke: var(--accent-warm);
  stroke-width: 1.6;
}
.walle-line {
  stroke: var(--accent-warm);
  stroke-width: 1;
  opacity: 0.45;
}
.walle-hatch {
  fill: rgba(255, 184, 107, 0.10);
  stroke: var(--accent-warm);
  stroke-width: 1;
}
.walle-stamp {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  fill: var(--accent-warm);
  letter-spacing: -0.5px;
  opacity: 0.9;
}

.walle-arm {
  stroke: var(--accent-warm);
  stroke-width: 2;
  stroke-linecap: round;
}
.walle-hand {
  fill: var(--accent-warm);
}

.walle-head {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: walleLook 6s ease-in-out infinite;
}
.walle-neck {
  fill: var(--accent-warm);
  opacity: 0.75;
}
.walle-head-bar {
  fill: #2a1c10;
  stroke: var(--accent-warm);
  stroke-width: 1.6;
}
.walle-eye-outer {
  fill: #0d0805;
  stroke: var(--accent-warm);
  stroke-width: 1.4;
}
.walle-eye-inner {
  fill: rgba(255, 184, 107, 0.10);
  stroke: var(--accent-warm);
  stroke-width: 0.8;
}
.walle-pupil {
  fill: var(--accent-warm);
  filter: drop-shadow(0 0 4px var(--accent-warm));
  transform-box: fill-box;
  transform-origin: center;
  animation: wallePupil 5s ease-in-out infinite;
}

/* ── Eve (cool) ─────────────────────────────────── */
.eve {
  position: absolute;
  top: 3%;
  right: 1%;
  width: 36%;
  z-index: 5;
  animation: eveLevitate 4.2s ease-in-out infinite;
}
.eve-svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 28px rgba(37,128,227,0.30));
  overflow: visible;
}

.eve-shadow {
  fill: rgba(0, 0, 0, 0.5);
  transform-box: fill-box;
  transform-origin: center;
  animation: shadowBreath 4.2s ease-in-out infinite;
}
.eve-body {
  fill: #f4f7fb;
  stroke: var(--accent);
  stroke-width: 1.2;
}
.eve-faceplate {
  fill: #0d1622;
  stroke: var(--accent);
  stroke-width: 0.8;
}
.eve-eye {
  fill: var(--accent);
  filter: drop-shadow(0 0 5px var(--accent));
  transform-box: fill-box;
  transform-origin: center;
  animation: eveBlink 4.5s ease-in-out infinite;
}
.eve-arm {
  fill: #f4f7fb;
  stroke: var(--accent);
  stroke-width: 1;
  animation: eveArm 3s ease-in-out infinite;
}
.eve-arm:nth-of-type(2) { animation-delay: 1.5s; }
.eve-sparkle {
  stroke: var(--accent);
  stroke-width: 1.2;
  stroke-linecap: round;
  opacity: 0;
  animation: sparkleFlash 3.5s ease-in-out infinite;
  filter: drop-shadow(0 0 4px var(--accent));
}

/* ── Tags bajo los bots ─────────────────────────── */
.bot-tag {
  display: block;
  margin-top: 8px;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  opacity: 0.8;
}
.walle-tag { color: var(--accent-warm); }
.eve-tag { color: var(--accent); }

/* ── Conversación central ───────────────────────── */
.chat-stack {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 52%;
  display: flex; flex-direction: column;
  gap: 8px;
  z-index: 4;
  pointer-events: none;
}
.chat-bubble {
  display: flex; flex-direction: column; gap: 3px;
  padding: 7px 11px;
  border-radius: 10px;
  background: rgba(10, 14, 20, 0.88);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  font-family: var(--mono);
  opacity: 0;
  transform: translateY(8px);
  animation: bubbleSlot 10s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.bubble-walle {
  align-self: flex-start;
  max-width: 86%;
  border-left: 2px solid var(--accent-warm);
}
.bubble-eve {
  align-self: flex-end;
  max-width: 86%;
  border-right: 2px solid var(--accent);
}
.bubble-tag {
  font-size: 8px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.bubble-walle .bubble-tag { color: var(--accent-warm); }
.bubble-eve   .bubble-tag { color: var(--accent); }
.bubble-text {
  font-size: 11px;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

/* ── Telemetría flotante ────────────────────────── */
.ia-telemetry {
  position: absolute;
  font-family: var(--mono);
  font-size: 10px;
  pointer-events: none;
  z-index: 6;
  animation: floatGentle 8s ease-in-out infinite;
}
.ia-telemetry .tag {
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 3px;
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(4px);
}
.ia-telemetry.t-a { bottom: 6%; right: -2%; animation-delay: 1s; }
.ia-telemetry.t-a .tag { color: var(--accent-warm); }
.ia-telemetry.t-b { top: 4%; left: -2%; animation-delay: 3s; }
.ia-telemetry.t-b .tag { color: var(--accent); }

/* ── Placeholder de módulos pendientes ──────────── */
.modules-note {
  margin-top: 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-dim);
  border-top: 1px dashed var(--line-strong);
  padding-top: 16px;
}
.placeholder-tag {
  display: inline-block;
  font-family: var(--mono); font-size: 10px;
  color: var(--accent-warm);
  border: 1px solid rgba(255, 184, 107, 0.4);
  background: rgba(255, 184, 107, 0.08);
  padding: 2px 8px;
  border-radius: 3px;
  margin-right: 8px;
  text-transform: uppercase; letter-spacing: 0.08em;
  vertical-align: middle;
}

/* ── Keyframes ──────────────────────────────────── */
@keyframes haloSlow {
  0%, 100% { transform: scale(1);    opacity: 0.7; }
  50%      { transform: scale(1.12); opacity: 1;   }
}
@keyframes starTwinkle {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 1;    }
}
@keyframes walleRumble {
  0%, 100% { transform: translateY(0)    rotate(0deg); }
  25%      { transform: translateY(-1px) rotate(-0.4deg); }
  75%      { transform: translateY(1px)  rotate(0.4deg);  }
}
@keyframes walleLook {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(8deg); }
  55%      { transform: rotate(-4deg); }
  80%      { transform: rotate(6deg); }
}
@keyframes wallePupil {
  0%, 100% { transform: translate(0, 0); }
  25%      { transform: translate(2px, -1px); }
  55%      { transform: translate(-1px, 1px); }
  80%      { transform: translate(2px, 0); }
}
@keyframes eveLevitate {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@keyframes shadowBreath {
  0%, 100% { opacity: 0.5; transform: scaleX(1);    }
  50%      { opacity: 0.2; transform: scaleX(0.75); }
}
@keyframes eveBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  94%, 98%      { transform: scaleY(0.12); }
}
@keyframes eveArm {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
@keyframes sparkleFlash {
  0%, 40%, 100% { opacity: 0; transform: scale(0.5); }
  50%, 65%      { opacity: 1; transform: scale(1.2); }
}
@keyframes bubbleSlot {
  0%, 3%    { opacity: 0; transform: translateY(8px); }
  6%, 22%   { opacity: 1; transform: translateY(0);   }
  26%, 100% { opacity: 0; transform: translateY(-4px);}
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 960px) {
  .ia-stage { max-width: min(400px, 88vw); margin: 0 auto; }
  .chat-stack { width: 60%; }
  .chat-bubble { padding: 6px 9px; }
  .bubble-text { font-size: 10px; }
  .bubble-tag  { font-size: 7px; }
  .bot-tag     { font-size: 9px; }
  .ia-telemetry { font-size: 9px; }
}
@media (max-width: 640px) {
  .ia-stage { max-width: min(320px, 90vw); }
  .chat-stack { width: 66%; }
  .bubble-text { font-size: 9px; }
}
@media (max-width: 420px) {
  .ia-stage { max-width: 280px; }
  .ia-telemetry.t-a, .ia-telemetry.t-b { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .walle, .eve,
  .walle-head, .walle-pupil,
  .eve-eye, .eve-arm, .eve-sparkle, .eve-shadow,
  .walle-halo, .eve-halo,
  .star, .beam-path,
  .chat-bubble, .ia-telemetry {
    animation: none !important;
  }
  .chat-bubble { opacity: 1; transform: none; }
}
