/* IAther — Avatares del agente (Orbe · Rostro · Onda · Ferrofluid simbionte) */

.iather-avatar {
	--level: 0;
	--speak: 0;
	--mouth: 0.2;
	--agent-primary: var(--iather-accent, #6c5ce7);
	--agent-secondary: color-mix(in srgb, var(--agent-primary) 42%, #ffffff);
	--agent-glow: color-mix(in srgb, var(--agent-primary) 60%, transparent);
	--agent-bg: transparent;
	--agent-speed-idle: 6s;
	--agent-speed-think: 1.4s;
	--agent-speed-speak: 0.32s;
	--agent-ease: cubic-bezier(0.45, 0.05, 0.25, 1);
	--agent-speak-ease: cubic-bezier(0.22, 1, 0.36, 1);
	width: 112px;
	height: 112px;
	position: relative;
	flex-shrink: 0;
	isolation: isolate;
	overflow: hidden;
	border-radius: 50%;
	transition: opacity 320ms var(--agent-ease), filter 420ms var(--agent-speak-ease), transform 160ms var(--agent-speak-ease);
}

.iather-avatar--speaking {
	transition: transform 120ms var(--agent-speak-ease), filter 160ms var(--agent-speak-ease), opacity 160ms ease;
}

.iather-avatar--speaking:not(.iather-avatar--orb) {
	transform: scale(calc(1 + var(--level) * 0.18));
	filter: drop-shadow(0 0 calc(22px + var(--level) * 48px) color-mix(in srgb, var(--agent-glow) calc(55% + var(--level) * 45%), transparent))
		brightness(calc(1 + var(--level) * 0.12));
}

.iather-avatar--orb.iather-avatar--speaking {
	transform: scale(calc(1 + var(--level) * 0.22));
	filter: brightness(calc(1 + var(--level) * 0.15));
}

.iather-avatar__stage {
	width: 100%;
	height: 100%;
	position: relative;
	display: grid;
	place-items: center;
	z-index: 1;
	overflow: hidden;
	border-radius: 50%;
}

.iather-avatar--hero {
	width: min(280px, 30vw);
	height: min(280px, 30vw);
	min-width: 180px;
	min-height: 180px;
}

.iather-avatar-shell .iather-avatar--hero {
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
}

.iather-avatar--compact {
	width: 64px;
	height: 64px;
}

/* ── Nebulosa etérea (AETHER) ── */
.iather-avatar--orb {
	overflow: hidden;
	border-radius: 50%;
}

.iather-avatar--orb.iather-avatar--idle {
	transform: scale(calc(1 + var(--level, 0) * 0.028));
}

.iather-avatar--orb.iather-avatar--thinking {
	transform: scale(calc(1 + var(--level, 0) * 0.02));
}

.iather-avatar--orb .iather-avatar__stage {
	overflow: hidden;
	border-radius: 50%;
}

.iather-avatar--orb .iather-nebula,
.iather-nebula {
	width: 100%;
	height: 100%;
	margin: 0;
	position: relative;
	overflow: hidden;
	border-radius: 50%;
	-webkit-mask-image: radial-gradient(circle at 50% 48%, #000 0%, #000 40%, rgba(0, 0, 0, 0.62) 54%, transparent 74%);
	mask-image: radial-gradient(circle at 50% 48%, #000 0%, #000 40%, rgba(0, 0, 0, 0.62) 54%, transparent 74%);
}

.iather-nebula::before,
.iather-nebula::after {
	content: '';
	position: absolute;
	border-radius: 50%;
	pointer-events: none;
}

.iather-nebula::before {
	inset: 0;
	background:
		radial-gradient(circle at 42% 38%, color-mix(in srgb, var(--agent-secondary) 28%, transparent), transparent 58%),
		radial-gradient(circle at 62% 68%, color-mix(in srgb, var(--iather-glow2, #7de2d1) 22%, transparent), transparent 62%);
	filter: blur(18px);
	opacity: 0.72;
	animation: iather-nebula-mist-a 9.5s ease-in-out infinite;
}

.iather-nebula::after {
	inset: 6%;
	background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--agent-primary) 18%, transparent), transparent 70%);
	filter: blur(22px);
	opacity: 0.55;
	animation: iather-nebula-mist-b 11s ease-in-out infinite reverse;
}

.iather-nebula__core,
.iather-nebula__ring,
.iather-nebula__spark {
	position: absolute;
	border-radius: 50%;
	pointer-events: none;
}

.iather-nebula__core {
	inset: 8%;
	background:
		radial-gradient(circle at 38% 32%, color-mix(in srgb, var(--iather-avatar-core, var(--iather-glow, #c4b5ff)) 72%, #fff), transparent 52%),
		radial-gradient(circle at 58% 62%, color-mix(in srgb, var(--agent-primary) 48%, transparent), transparent 68%);
	filter: blur(22px);
	opacity: 0.82;
	animation: iather-nebula-drift-core 7.2s ease-in-out infinite;
	will-change: transform, opacity;
}

.iather-nebula__ring {
	inset: 0;
	background:
		radial-gradient(circle at 64% 58%, color-mix(in srgb, var(--iather-avatar-ring, var(--iather-glow2, #7de2d1)) 38%, transparent), transparent 64%),
		radial-gradient(circle at 28% 72%, color-mix(in srgb, var(--agent-primary) 24%, transparent), transparent 58%);
	filter: blur(30px);
	opacity: 0.62;
	animation: iather-nebula-drift-ring 8.8s ease-in-out infinite reverse;
	will-change: transform, opacity;
}

.iather-nebula__spark {
	inset: 18%;
	background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.34), transparent 62%);
	filter: blur(10px);
	opacity: 0.42;
	animation: iather-nebula-drift-spark 5.6s ease-in-out infinite;
}

@keyframes iather-nebula-drift-core {
	0%, 100% { transform: translate(0, 0) scale(0.94) rotate(0deg); opacity: 0.74; }
	33% { transform: translate(-1.5%, 1%) scale(1.05) rotate(-3deg); opacity: 0.92; }
	66% { transform: translate(1%, -1.5%) scale(1.02) rotate(2deg); opacity: 0.82; }
}

@keyframes iather-nebula-drift-ring {
	0%, 100% { transform: translate(0, 0) scale(0.96) rotate(0deg); opacity: 0.52; }
	40% { transform: translate(2%, -1%) scale(1.06) rotate(6deg); opacity: 0.72; }
	70% { transform: translate(-1%, 1.5%) scale(1.02) rotate(-3deg); opacity: 0.6; }
}

@keyframes iather-nebula-drift-spark {
	0%, 100% { transform: translate(0, 0) scale(0.9); opacity: 0.3; }
	50% { transform: translate(-1%, 1%) scale(1.08); opacity: 0.52; }
}

@keyframes iather-nebula-mist-a {
	0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.58; }
	50% { transform: translate(1.5%, -1%) scale(1.06); opacity: 0.78; }
}

@keyframes iather-nebula-mist-b {
	0%, 100% { transform: translate(0, 0) scale(0.98); opacity: 0.42; }
	50% { transform: translate(-1%, 1.5%) scale(1.04); opacity: 0.62; }
}

@keyframes iather-nebula-breathe {
	0%, 100% { transform: translate(0, 0) scale(0.96); opacity: 0.8; }
	50% { transform: translate(0, -1.5%) scale(1.05); opacity: 0.95; }
}

.iather-avatar--orb.iather-avatar--thinking .iather-nebula__core {
	animation: iather-nebula-drift-core 2.2s ease-in-out infinite;
}
.iather-avatar--orb.iather-avatar--thinking .iather-nebula__ring {
	animation: iather-nebula-drift-ring 1.8s ease-in-out infinite reverse;
	opacity: 0.78;
}
.iather-avatar--orb.iather-avatar--thinking .iather-nebula::before {
	animation-duration: 3.2s;
}

.iather-avatar--orb.iather-avatar--speaking,
.iather-avatar--face.iather-avatar--speaking,
.iather-avatar--wave.iather-avatar--speaking,
.iather-avatar--ferrofluid.iather-avatar--speaking {
	transition: transform 320ms var(--agent-speak-ease), filter 380ms var(--agent-speak-ease);
}

.iather-avatar--orb.iather-avatar--speaking .iather-nebula,
.iather-avatar--face.iather-avatar--speaking .iather-neural-face__nebula {
	animation: iather-nebula-speak-breathe 0.55s ease-in-out infinite alternate;
}

.iather-avatar--orb.iather-avatar--speaking .iather-nebula__core,
.iather-avatar--face.iather-avatar--speaking .iather-neural-face__nebula .iather-nebula__core {
	animation: iather-nebula-speak-core 0.72s ease-in-out infinite;
	transform: translate(calc(var(--level) * -6%), calc(var(--level) * 5%)) scale(calc(0.78 + var(--level) * 0.38));
	filter: blur(calc(14px - var(--level) * 10px)) brightness(calc(1 + var(--level) * 0.5));
	opacity: calc(0.7 + var(--level) * 0.3);
}

.iather-avatar--orb.iather-avatar--speaking .iather-nebula__ring,
.iather-avatar--face.iather-avatar--speaking .iather-neural-face__nebula .iather-nebula__ring {
	animation: iather-nebula-speak-ring 0.62s ease-in-out infinite;
	transform: translate(calc(var(--level) * 6%), calc(var(--level) * -5%)) scale(calc(0.84 + var(--level) * 0.32)) rotate(calc(var(--level) * 32deg));
	opacity: calc(0.42 + var(--level) * 0.58);
}

.iather-avatar--orb.iather-avatar--speaking .iather-nebula__spark,
.iather-avatar--face.iather-avatar--speaking .iather-neural-face__nebula .iather-nebula__spark {
	animation: iather-nebula-speak-spark 0.5s ease-in-out infinite alternate;
	opacity: calc(0.4 + var(--level) * 0.6);
	transform: scale(calc(0.82 + var(--level) * 0.32));
}

.iather-avatar--face.iather-avatar--speaking .iather-neural-face__aura {
	opacity: calc(0.58 + var(--level) * 0.42);
	animation: iather-neural-aura-speak 0.65s ease-in-out infinite alternate;
}

.iather-avatar--orb.iather-avatar--speaking .iather-nebula::before {
	animation: iather-nebula-mist-a 1.15s ease-in-out infinite;
	opacity: calc(0.48 + var(--level) * 0.42);
	filter: blur(calc(16px - var(--level) * 6px));
}

.iather-avatar--orb.iather-avatar--speaking .iather-nebula::after {
	animation: iather-nebula-mist-b 1.35s ease-in-out infinite reverse;
	opacity: calc(0.32 + var(--level) * 0.38);
}

@keyframes iather-nebula-speak-breathe {
	from { transform: scale(calc(0.88 + var(--level) * 0.06)); }
	to { transform: scale(calc(1.04 + var(--level) * 0.22)); }
}

@keyframes iather-nebula-speak-core {
	0%, 100% { translate: 0 0; scale: 1; }
	25% { translate: -5.5% 4%; scale: 1.16; }
	75% { translate: 5.5% -4.5%; scale: 1.2; }
}

@keyframes iather-nebula-speak-ring {
	0%, 100% { rotate: 0deg; scale: 1; }
	50% { rotate: 36deg; scale: 1.14; }
}

@keyframes iather-nebula-speak-spark {
	0%, 100% { opacity: 0.42; scale: 0.86; }
	50% { opacity: 0.95; scale: 1.28; }
}

@keyframes iather-nebula-swirl {
	0%, 100% { transform: rotate(0deg) scale(1); }
	50% { transform: rotate(18deg) scale(1.06); }
}

/* Legacy orb aliases hidden */
.iather-orb { display: none; }

.iather-avatar--reduced .iather-nebula__core,
.iather-avatar--reduced .iather-nebula__ring,
.iather-avatar--reduced .iather-nebula__spark {
	animation: none !important;
}

/* ── Rostro neuronal (nodos + nebulosa) ── */
.iather-neural-face {
	width: 100%;
	height: 100%;
	position: relative;
	display: grid;
	place-items: center;
}

.iather-neural-face__nebula {
	position: absolute;
	inset: 4%;
	pointer-events: none;
}

.iather-neural-face__nebula .iather-nebula__core,
.iather-neural-face__nebula .iather-nebula__ring,
.iather-neural-face__nebula .iather-nebula__spark {
	position: absolute;
	inset: 0;
	border-radius: 50%;
}

.iather-avatar--face.iather-avatar--idle .iather-neural-face__nebula .iather-nebula__core {
	animation: iather-nebula-drift-core 5.4s ease-in-out infinite;
}
.iather-avatar--face.iather-avatar--idle .iather-neural-face__nebula .iather-nebula__ring {
	animation: iather-nebula-drift-ring 6.2s ease-in-out infinite reverse;
	opacity: 0.68;
}
.iather-avatar--face.iather-avatar--thinking .iather-neural-face__nebula .iather-nebula__core {
	animation: iather-nebula-drift-core 1.8s ease-in-out infinite;
}
.iather-avatar--face.iather-avatar--thinking .iather-neural-face__nebula .iather-nebula__ring {
	animation: iather-nebula-drift-ring 1.5s ease-in-out infinite reverse;
}

.iather-neural-face__svg {
	width: 100%;
	height: 100%;
	overflow: visible;
	position: relative;
	z-index: 1;
}

.iather-neural-face__aura {
	opacity: 0.55;
	filter: blur(2px);
	transform-origin: center;
	animation: iather-neural-aura-pulse 4.8s ease-in-out infinite;
}

.iather-neural-face__portrait {
	transform-origin: 50px 52px;
}

.iather-neural-face__synapse {
	stroke: color-mix(in srgb, var(--agent-secondary) 55%, var(--agent-primary));
	stroke-width: 0.55;
	stroke-linecap: round;
	opacity: 0;
	stroke-dasharray: 42;
	stroke-dashoffset: 42;
	--iather-edge-delay: calc(var(--iather-edge-i, 0) * 0.03s + 0.4s);
	animation: iather-neural-synapse-draw 1s ease var(--iather-edge-delay) forwards;
}

.iather-neural-face__node {
	fill: var(--agent-primary);
	opacity: 0;
	transform: scale(0);
	transform-box: fill-box;
	transform-origin: center;
	--iather-node-delay: calc(var(--iather-node-i, 0) * 0.042s + 0.08s);
	animation: iather-neural-node-birth 0.9s var(--agent-ease) var(--iather-node-delay) forwards;
}

.iather-neural-face__node--eye {
	fill: color-mix(in srgb, var(--agent-secondary) 40%, var(--agent-primary));
}

.iather-neural-face__node--mouth {
	fill: color-mix(in srgb, #fff 18%, var(--agent-primary));
}

.iather-neural-face__mouth-upper,
.iather-neural-face__mouth-lower {
	fill: none;
	stroke: color-mix(in srgb, var(--agent-secondary) 35%, var(--agent-primary));
	stroke-width: 1.4;
	stroke-linecap: round;
	opacity: 0;
	animation: iather-neural-mouth-reveal 0.7s ease 1.05s forwards;
	transform-box: fill-box;
	transform-origin: 50px 67px;
}

.iather-neural-face__mouth-open {
	fill: color-mix(in srgb, var(--agent-primary) 35%, transparent);
	stroke: none;
	opacity: 0;
	transform-box: fill-box;
	transform-origin: 50px 67px;
	transform: scaleY(0.35);
	animation: iather-neural-mouth-reveal 0.7s ease 1.05s forwards;
}

.iather-avatar--face.iather-avatar--idle .iather-neural-face__portrait {
	animation: iather-neural-idle-float 5.6s ease-in-out infinite;
}
.iather-avatar--face.iather-avatar--idle .iather-neural-face__node--eye {
	animation:
		iather-neural-node-birth 0.9s var(--agent-ease) var(--iather-node-delay) forwards,
		iather-neural-eye-blink 5.8s ease-in-out 1.4s infinite;
}
.iather-avatar--face.iather-avatar--idle .iather-neural-face__synapse {
	animation:
		iather-neural-synapse-draw 1s ease var(--iather-edge-delay) forwards,
		iather-neural-synapse-idle 3.6s ease-in-out 1.6s infinite;
}

.iather-avatar--face.iather-avatar--thinking .iather-neural-face__portrait {
	animation: iather-neural-think-tilt 2.2s ease-in-out infinite;
}
.iather-avatar--face.iather-avatar--thinking .iather-neural-face__synapse {
	opacity: calc(0.45 + var(--level) * 0.35);
	animation: iather-neural-synapse-think 1.1s ease-in-out infinite;
}
.iather-avatar--face.iather-avatar--thinking .iather-neural-face__node {
	animation:
		iather-neural-node-birth 0.9s var(--agent-ease) var(--iather-node-delay) forwards,
		iather-neural-node-think 1.3s ease-in-out calc(var(--iather-node-delay) + 0.9s) infinite;
}
.iather-avatar--face.iather-avatar--thinking .iather-neural-face__node--eye {
	transform: translate(0.8px, -1.2px);
}

.iather-avatar--face.iather-avatar--speaking .iather-neural-face__portrait {
	animation: iather-neural-speak-gesture 0.68s ease-in-out infinite;
}
.iather-avatar--face.iather-avatar--speaking .iather-neural-face__synapse {
	opacity: calc(0.58 + var(--level) * 0.42);
	animation: iather-neural-synapse-speak 0.55s ease-in-out infinite alternate;
}
.iather-avatar--face.iather-avatar--speaking .iather-neural-face__node {
	animation:
		iather-neural-node-birth 0.9s var(--agent-ease) var(--iather-node-delay) forwards,
		iather-neural-node-speak 0.52s ease-in-out infinite alternate;
	animation-delay: var(--iather-node-delay), calc(var(--iather-node-i, 0) * 0.04s);
	filter: drop-shadow(0 0 calc(2px + var(--level) * 6px) color-mix(in srgb, var(--agent-glow) 55%, transparent));
}
.iather-avatar--face.iather-avatar--speaking .iather-neural-face__node--eye {
	animation:
		iather-neural-node-birth 0.9s var(--agent-ease) var(--iather-node-delay) forwards,
		iather-neural-eye-speak 0.48s ease-in-out infinite alternate;
}
.iather-avatar--face.iather-avatar--speaking .iather-neural-face__mouth-open {
	opacity: calc(0.48 + var(--level) * 0.52);
	transform: scaleY(calc(0.5 + var(--mouth) * 2.4));
	animation: iather-neural-mouth-pulse 0.28s ease-in-out infinite alternate;
}
.iather-avatar--face.iather-avatar--speaking .iather-neural-face__mouth-upper {
	opacity: calc(0.58 + var(--level) * 0.42);
	transform: translateY(calc(-1px - var(--mouth) * 3.5px));
}
.iather-avatar--face.iather-avatar--speaking .iather-neural-face__mouth-lower {
	opacity: calc(0.58 + var(--level) * 0.42);
	transform: translateY(calc(1px + var(--mouth) * 4px));
	animation: iather-neural-jaw-talk 0.26s ease-in-out infinite alternate;
}
.iather-avatar--face.iather-avatar--speaking .iather-neural-face__node--mouth {
	transform: scale(calc(1 + var(--mouth) * 0.38));
}

@keyframes iather-neural-node-birth {
	0% { opacity: 0; transform: scale(0); }
	70% { opacity: 1; transform: scale(1.35); }
	100% { opacity: 0.92; transform: scale(1); }
}

@keyframes iather-neural-synapse-draw {
	to { stroke-dashoffset: 0; opacity: 0.55; }
}

@keyframes iather-neural-mouth-reveal {
	to { opacity: 0.75; }
}

@keyframes iather-neural-aura-pulse {
	0%, 100% { opacity: 0.45; transform: scale(1); }
	50% { opacity: 0.72; transform: scale(1.06); }
}

@keyframes iather-neural-idle-float {
	0%, 100% { transform: translate(0, 0) scale(1); }
	50% { transform: translate(0, -1px) scale(1.015); }
}

@keyframes iather-neural-eye-blink {
	0%, 42%, 44%, 100% { opacity: 0.92; }
	43% { opacity: 0.2; }
}

@keyframes iather-neural-synapse-idle {
	0%, 100% { opacity: 0.45; }
	50% { opacity: 0.62; }
}

@keyframes iather-neural-think-tilt {
	0%, 100% { transform: rotate(0deg) translate(0, 0); }
	50% { transform: rotate(-2deg) translate(-1px, -1.5px); }
}

@keyframes iather-neural-synapse-think {
	0%, 100% { stroke-width: 0.55; opacity: 0.45; }
	50% { stroke-width: 0.85; opacity: 0.78; }
}

@keyframes iather-neural-node-think {
	0%, 100% { opacity: 0.85; }
	50% { opacity: 1; filter: brightness(1.25); }
}

@keyframes iather-neural-speak-gesture {
	0%, 100% { transform: rotate(-1.8deg) translate(0, 0) scale(1); }
	50% { transform: rotate(2.2deg) translate(0, -2px) scale(calc(1.02 + var(--level) * 0.04)); }
}

@keyframes iather-neural-aura-speak {
	from { transform: scale(1); opacity: 0.58; filter: blur(2px); }
	to { transform: scale(calc(1.08 + var(--level) * 0.06)); opacity: 0.92; filter: blur(4px); }
}

@keyframes iather-neural-eye-speak {
	from { opacity: 0.82; transform: scale(1); }
	to { opacity: 1; transform: scale(calc(1.08 + var(--level) * 0.06)); }
}

@keyframes iather-neural-synapse-speak {
	from { stroke-width: 0.55; opacity: 0.55; }
	to { stroke-width: 1.15; opacity: 0.95; }
}

@keyframes iather-neural-node-speak {
	from { opacity: 0.82; transform: scale(1); }
	to { opacity: 1; transform: scale(calc(1.12 + var(--level) * 0.08)); }
}

@keyframes iather-neural-mouth-pulse {
	from { transform: scaleY(calc(0.48 + var(--mouth) * 1.8)); }
	to { transform: scaleY(calc(0.68 + var(--mouth) * 2.8)); }
}

@keyframes iather-neural-jaw-talk {
	from { transform: translateY(calc(0.5px + var(--mouth) * 1.5px)); }
	to { transform: translateY(calc(2px + var(--mouth) * 4px)); }
}

/* ── Onda líquida ── */
.iather-wave-svg {
	width: 100%;
	height: 100%;
	overflow: visible;
}

.iather-wave__blob {
	fill: url(#iatherWaveGrad);
	opacity: 0.92;
	transform-origin: center;
	will-change: transform;
}

.iather-wave__bars {
	opacity: 0;
	transition: opacity 320ms var(--agent-ease);
}

.iather-wave__bar {
	fill: var(--agent-primary);
	transform-box: fill-box;
	transform-origin: center bottom;
	opacity: 0.85;
}

.iather-avatar--wave.iather-avatar--idle .iather-wave__blob {
	animation: iather-wave-blob-idle var(--agent-speed-idle) ease-in-out infinite;
}
.iather-avatar--wave.iather-avatar--thinking .iather-wave__blob {
	animation: iather-wave-blob-think var(--agent-speed-think) ease-in-out infinite;
}
.iather-avatar--wave.iather-avatar--thinking .iather-wave__bars,
.iather-avatar--wave.iather-avatar--speaking .iather-wave__bars {
	opacity: 1;
}
.iather-avatar--wave.iather-avatar--thinking .iather-wave__bar {
	animation: iather-wave-bar-think var(--agent-speed-think) ease-in-out infinite;
}
.iather-avatar--wave.iather-avatar--thinking .iather-wave__bar:nth-child(2) { animation-delay: 0.08s; }
.iather-avatar--wave.iather-avatar--thinking .iather-wave__bar:nth-child(3) { animation-delay: 0.16s; }
.iather-avatar--wave.iather-avatar--thinking .iather-wave__bar:nth-child(4) { animation-delay: 0.24s; }
.iather-avatar--wave.iather-avatar--thinking .iather-wave__bar:nth-child(5) { animation-delay: 0.16s; }
.iather-avatar--wave.iather-avatar--thinking .iather-wave__bar:nth-child(6) { animation-delay: 0.08s; }

.iather-avatar--wave.iather-avatar--speaking .iather-wave__blob {
	animation: iather-wave-blob-speak 0.52s ease-in-out infinite alternate;
	opacity: calc(0.72 + var(--level) * 0.28);
	transform: scale(calc(1 + var(--level) * 0.18)) rotate(calc(var(--level) * 8deg));
	transition: transform 100ms var(--agent-speak-ease), opacity 100ms ease;
}
.iather-avatar--wave.iather-avatar--speaking .iather-wave__bar {
	animation: iather-wave-bar-speak 0.3s ease-in-out infinite alternate;
	opacity: calc(0.78 + var(--level) * 0.22);
}
.iather-avatar--wave.iather-avatar--speaking .iather-wave__bar:nth-child(1) { animation-delay: 0s; }
.iather-avatar--wave.iather-avatar--speaking .iather-wave__bar:nth-child(2) { animation-delay: 0.08s; }
.iather-avatar--wave.iather-avatar--speaking .iather-wave__bar:nth-child(3) { animation-delay: 0.16s; }
.iather-avatar--wave.iather-avatar--speaking .iather-wave__bar:nth-child(4) { animation-delay: 0.24s; }
.iather-avatar--wave.iather-avatar--speaking .iather-wave__bar:nth-child(5) { animation-delay: 0.16s; }
.iather-avatar--wave.iather-avatar--speaking .iather-wave__bar:nth-child(6) { animation-delay: 0.08s; }
.iather-avatar--wave.iather-avatar--speaking .iather-wave__bar:nth-child(7) { animation-delay: 0s; }

@keyframes iather-wave-blob-speak {
	from { transform: scale(calc(1 + var(--level) * 0.06)) rotate(-6deg); }
	to { transform: scale(calc(1.12 + var(--level) * 0.14)) rotate(7deg); }
}

@keyframes iather-wave-bar-speak {
	from { transform: scaleY(calc(0.28 + var(--speak) * 0.22)); }
	to { transform: scaleY(calc(0.72 + var(--speak) * 0.85)); }
}

@keyframes iather-wave-blob-idle {
	0%, 100% { transform: scale(1) rotate(0deg); }
	50% { transform: scale(1.05) rotate(2deg); }
}
@keyframes iather-wave-blob-think {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.04); }
}
@keyframes iather-wave-bar-think {
	0%, 100% { transform: scaleY(0.45); }
	50% { transform: scaleY(0.75); }
}

/* Estado reduced / accesible */
.iather-avatar--reduced .iather-neural-face__node {
	opacity: 0.88 !important;
	transform: scale(1) !important;
}
.iather-avatar--reduced .iather-neural-face__synapse {
	stroke-dashoffset: 0 !important;
	opacity: 0.5 !important;
}
.iather-avatar--reduced .iather-neural-face__mouth-upper,
.iather-avatar--reduced .iather-neural-face__mouth-lower,
.iather-avatar--reduced .iather-neural-face__mouth-open {
	opacity: 0.65 !important;
	transform: none !important;
}
.iather-avatar--reduced .iather-orb__core,
.iather-avatar--reduced .iather-orb__halo,
.iather-avatar--reduced .iather-orb__spark,
.iather-avatar--reduced .iather-orb__orbit,
.iather-avatar--reduced .iather-neural-face__nebula .iather-nebula__core,
.iather-avatar--reduced .iather-neural-face__nebula .iather-nebula__ring,
.iather-avatar--reduced .iather-neural-face__nebula .iather-nebula__spark,
.iather-avatar--reduced .iather-neural-face__portrait,
.iather-avatar--reduced .iather-neural-face__node,
.iather-avatar--reduced .iather-neural-face__synapse,
.iather-avatar--reduced .iather-neural-face__mouth-upper,
.iather-avatar--reduced .iather-neural-face__mouth-lower,
.iather-avatar--reduced .iather-neural-face__mouth-open,
.iather-avatar--reduced .iather-face__eye,
.iather-avatar--reduced .iather-wave__blob,
.iather-avatar--reduced .iather-wave__bar {
	animation: none !important;
	transition: opacity 320ms var(--agent-ease) !important;
}

.iather-avatar--reduced.iather-avatar--thinking,
.iather-avatar--reduced.iather-avatar--speaking:not(.iather-avatar--orb) {
	opacity: calc(0.84 + var(--level) * 0.12);
	filter: drop-shadow(0 0 calc(6px + var(--level) * 10px) color-mix(in srgb, var(--agent-glow) 35%, transparent));
}

.iather-avatar--reduced.iather-avatar--orb.iather-avatar--speaking {
	filter: none;
	opacity: calc(0.86 + var(--level) * 0.14);
}

.iather-avatar--reduced.iather-avatar--speaking::before,
.iather-avatar--reduced.iather-avatar--speaking::after {
	display: none;
}

/* ── Ferrofluid simbionte (mancha orgánica) ── */
.iather-avatar--ferrofluid {
	--ferro-base: color-mix(in srgb, var(--iather-avatar-core, #12101c) 72%, #050508);
	--ferro-deep: color-mix(in srgb, var(--ferro-base) 88%, #000);
	--ferro-shine: color-mix(in srgb, var(--iather-avatar-ring, var(--agent-primary)) 55%, #fff);
	--ferro-glow: color-mix(in srgb, var(--agent-primary) 68%, var(--iather-avatar-ring, #7de2d1));
	--blob-glow: 0.15;
	--blob-wave: 0.25;
	--blob-rotate: 0deg;
	overflow: visible;
	background: transparent;
}

.iather-avatar--ferrofluid .iather-avatar__stage {
	overflow: visible;
}

.iather-ferrofluid {
	width: 100%;
	height: 100%;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

.iather-ferrofluid__blob {
	position: relative;
	width: 74%;
	height: 74%;
	border-radius: var(--blob-radius, 42% 58% 55% 45% / 48% 42% 58% 52%);
	transform: translate3d(0, 0, 0) rotate(var(--blob-rotate, 0deg));
	transform-origin: 50% 50%;
	will-change: border-radius, transform, filter;
	transition: none;
	background:
		radial-gradient(ellipse 85% 75% at 28% 22%, color-mix(in srgb, var(--ferro-shine) 38%, transparent), transparent 52%),
		radial-gradient(ellipse 90% 80% at 72% 78%, rgba(0, 0, 0, 0.85), transparent 58%),
		radial-gradient(
			circle at 50% 48%,
			color-mix(in srgb, var(--ferro-glow) calc(12% + var(--level, 0) * 28%), var(--ferro-base)) 0%,
			var(--ferro-deep) 72%,
			#000 100%
		);
	box-shadow:
		inset -4px -8px 18px rgba(0, 0, 0, 0.55),
		inset 3px 4px 14px color-mix(in srgb, var(--ferro-shine) 18%, transparent),
		0 0 calc(8px + var(--blob-glow, 0.15) * 28px) color-mix(in srgb, var(--ferro-glow) calc(30% + var(--blob-glow, 0.15) * 50%), transparent),
		0 calc(4px + var(--level, 0) * 8px) calc(20px + var(--level, 0) * 24px) rgba(0, 0, 0, 0.35);
	filter:
		brightness(calc(0.92 + var(--level, 0) * 0.18 + var(--blob-glow, 0.15) * 0.12))
		saturate(calc(1 + var(--level, 0) * 0.35))
		contrast(calc(1.05 + var(--level, 0) * 0.08));
}

.iather-ferrofluid__blob::after {
	content: '';
	position: absolute;
	inset: calc(-3% - var(--blob-wave, 0.25) * 2%);
	border-radius: var(--blob-radius-edge, var(--blob-radius));
	border: 1px solid color-mix(in srgb, var(--ferro-glow) calc(22% + var(--blob-wave, 0.25) * 45%), transparent);
	box-shadow:
		0 0 calc(4px + var(--blob-wave, 0.25) * 10px) color-mix(in srgb, var(--ferro-glow) calc(18% + var(--blob-wave, 0.25) * 35%), transparent),
		inset 0 0 calc(6px + var(--blob-wave, 0.25) * 8px) color-mix(in srgb, var(--ferro-shine) calc(8% + var(--blob-wave, 0.25) * 18%), transparent);
	opacity: calc(0.2 + var(--blob-wave, 0.25) * 0.55);
	pointer-events: none;
	mix-blend-mode: screen;
}

.iather-ferrofluid__blob-shine {
	position: absolute;
	inset: 8% 14% 38% 10%;
	border-radius: inherit;
	background:
		radial-gradient(ellipse at 35% 30%, rgba(255, 255, 255, 0.42), transparent 55%),
		radial-gradient(ellipse at 68% 42%, color-mix(in srgb, var(--ferro-shine) 28%, transparent), transparent 48%);
	mix-blend-mode: soft-light;
	opacity: calc(0.45 + var(--level, 0) * 0.35);
	pointer-events: none;
}

.iather-ferrofluid__blob-gloss {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background:
		conic-gradient(
			from 210deg at 50% 50%,
			transparent,
			color-mix(in srgb, var(--ferro-glow) calc(8% + var(--level, 0) * 18%), transparent),
			transparent
		);
	opacity: calc(0.35 + var(--level, 0) * 0.45);
	mix-blend-mode: screen;
	pointer-events: none;
	animation: iather-blob-gloss-drift calc(6s + var(--level, 0) * 2s) linear infinite;
}

@keyframes iather-blob-gloss-drift {
	from { rotate: 0deg; }
	to { rotate: 360deg; }
}

.iather-avatar--ferrofluid.iather-avatar--thinking {
	filter: drop-shadow(0 0 calc(10px + var(--level, 0) * 20px) color-mix(in srgb, var(--ferro-glow) 45%, transparent));
}

.iather-avatar--ferrofluid.iather-avatar--speaking {
	filter: drop-shadow(0 0 calc(16px + var(--level) * 42px) color-mix(in srgb, var(--ferro-glow) calc(40% + var(--level) * 50%), transparent))
		brightness(calc(1 + var(--level) * 0.12));
}

.iather-avatar-shell--speaking .iather-avatar--ferrofluid .iather-ferrofluid__blob-shine {
	opacity: calc(0.55 + var(--level, 0) * 0.45);
}

.iather-avatar--reduced .iather-ferrofluid__blob-gloss {
	animation: none !important;
}

.iather-avatar--reduced .iather-ferrofluid__blob {
	border-radius: 46% 54% 52% 48% / 50% 46% 54% 50% !important;
}

.iather-avatar--reduced .iather-ferrofluid__blob::after {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.iather-avatar:not(.iather-avatar--reduced) {
		--agent-speed-idle: 0.01ms;
		--agent-speed-think: 0.01ms;
		--agent-speed-speak: 0.01ms;
	}
}
