/* Il contenitore ora vive nella colonna laterale sotto il riquadro livello */ .bot-container { position: relative; width: 100%; height: 520px; perspective: 1100px; z-index: 30; } /* Il bot è assoluto, si muove su left% */ .bot { position: absolute; width: 520px; height: 520px; bottom: 50px; z-index: 2; transform: translateX(-50%); transform-style: preserve-3d; pointer-events: none; } .bot::before { content: ''; position: absolute; inset: 8% 10% auto 10%; height: 34%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0) 62%); pointer-events: none; z-index: 4; } .bot::after { content: none; } @media (max-width: 768px) { .bot-container { height: 340px; } .bot { width: 370px; height: 370px; } } /* Immagine del bot */ .bot-body { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: normal; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.25)); } /* ── Braccia e bocca: stessa immagine ritagliata con clip-path ── */ .bot-arm-left, .bot-arm-right, .bot-mouth { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: normal; opacity: 0.98; pointer-events: none; } /* --- BRACCIO SINISTRO --- */ /* ritaglia la zona sinistra-centrale dell'immagine dove c'è il braccio */ .bot-arm-left { clip-path: inset(45% 66% 12% 8%); transform-origin: 34% 58%; } .bot-arm-left.idle { animation: arm-l-idle 2.5s ease-in-out infinite; } .bot-arm-left.thinking { animation: arm-l-think 1.2s ease-in-out infinite; } .bot-arm-left.talking { animation: none; transform: rotate(0deg); } .bot-arm-left.gesturing, .bot-arm-left.waving, .bot-arm-left.pointing { animation: arm-l-wave 0.55s ease-in-out infinite; } .bot-arm-left.confused { animation: arm-l-confused 0.4s ease-in-out infinite; } @keyframes arm-l-idle { 0%,100% { transform: rotate(0deg); } 50% { transform: rotate(-7deg); } } @keyframes arm-l-think { 0%,100% { transform: rotate(-5deg); } 50% { transform: rotate(12deg); } } @keyframes arm-l-wave { 0%,100% { transform: rotate(-10deg); } 25% { transform: rotate(14deg); } 75% { transform: rotate(-6deg); } } @keyframes arm-l-confused { 0%,100% { transform: rotate(0deg); } 30% { transform: rotate(10deg); } 70% { transform: rotate(-10deg); } } /* --- BRACCIO DESTRO --- */ .bot-arm-right { clip-path: inset(45% 8% 12% 66%); transform-origin: 66% 58%; } .bot-arm-right.idle { animation: arm-r-idle 2.5s ease-in-out infinite 0.4s; } .bot-arm-right.thinking { animation: arm-r-think 1.2s ease-in-out infinite 0.2s; } .bot-arm-right.talking { animation: none; transform: rotate(0deg); } .bot-arm-right.gesturing, .bot-arm-right.waving, .bot-arm-right.pointing { animation: arm-r-wave 0.55s ease-in-out infinite 0.15s; } .bot-arm-right.confused { animation: arm-r-confused 0.4s ease-in-out infinite 0.1s; } @keyframes arm-r-idle { 0%,100% { transform: rotate(0deg); } 50% { transform: rotate(7deg); } } @keyframes arm-r-think { 0%,100% { transform: rotate(5deg); } 50% { transform: rotate(-12deg); } } @keyframes arm-r-wave { 0%,100% { transform: rotate(10deg); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(6deg); } } @keyframes arm-r-confused { 0%,100% { transform: rotate(0deg); } 30% { transform: rotate(-10deg); } 70% { transform: rotate(10deg); } } /* --- BOCCA --- */ .bot-mouth { clip-path: inset(42% 45% 48% 45%); transform-origin: 50% 50%; mix-blend-mode: normal; opacity: 0.86; filter: saturate(0.72) brightness(0.96); } .bot-mouth.neutral { animation: mouth-idle 2s ease-in-out infinite; } .bot-mouth.thinking { animation: mouth-thinking 1s ease-in-out infinite; } .bot-mouth.happy { animation: mouth-talking 0.3s ease-in-out infinite; } .bot-mouth.confused { animation: mouth-confused 0.5s ease-in-out infinite; } @keyframes mouth-idle { 0%,100% { transform: scaleX(1) scaleY(1); } 50% { transform: scaleX(0.98) scaleY(0.92); } } @keyframes mouth-thinking { 0%,100% { transform: scaleX(0.9) scaleY(0.9); } 50% { transform: scaleX(0.95) scaleY(0.95); } } @keyframes mouth-talking { 0%,100% { transform: scaleY(1) scaleX(1); } 50% { transform: scaleY(1.2) scaleX(1.03); } } @keyframes mouth-confused { 0%,100% { transform: scaleX(0.9) scaleY(0.95); } 50% { transform: scaleX(0.85) scaleY(0.9); } } /* ── Animazioni sull'immagine intera ── */ /* Le animazioni di movimento vanno sul contenitore .bot, cosi tutti i layer (corpo, braccia, bocca) restano sincronizzati. */ /* IDLE: leggero bob su/giu */ .bot.idle { animation: idle-bob 2.5s ease-in-out infinite; } @keyframes idle-bob { 0%, 100% { transform: translateX(-50%) translateY(0) rotateZ(0deg) rotateX(3deg) rotateY(-4deg); } 30% { transform: translateX(-50%) translateY(-10px) rotateZ(1.2deg) rotateX(5deg) rotateY(-2deg); } 70% { transform: translateX(-50%) translateY(-6px) rotateZ(-1.2deg) rotateX(3deg) rotateY(-6deg); } } /* THINKING: oscillazione lenta + inclinazione testa */ .bot.thinking { animation: thinking-tilt 1.2s ease-in-out infinite; } .bot.thinking .bot-body { filter: brightness(0.95) saturate(0.8); } @keyframes thinking-tilt { 0%, 100% { transform: translateX(-50%) rotateZ(-4deg) translateY(0) rotateX(4deg) rotateY(-10deg); } 50% { transform: translateX(-50%) rotateZ(4deg) translateY(-6px) rotateX(6deg) rotateY(6deg); } } /* SPEAKING: bounce energico */ .bot.happy, .bot.gesturing, .bot.waving, .bot.pointing { animation: speaking-bounce 0.5s ease-in-out infinite; } .bot.happy .bot-body, .bot.gesturing .bot-body, .bot.waving .bot-body, .bot.pointing .bot-body { filter: brightness(1.05) saturate(1.2); } @keyframes speaking-bounce { 0%, 100% { transform: translateX(-50%) translateY(0) scale(1) rotateX(4deg) rotateY(-4deg); } 25% { transform: translateX(-50%) translateY(-13px) scale(1.04) rotateZ(2deg) rotateX(6deg) rotateY(-1deg); } 75% { transform: translateX(-50%) translateY(-8px) scale(1.02) rotateZ(-1deg) rotateX(5deg) rotateY(-7deg); } } /* CONFUSED: tremolio laterale */ .bot.confused { animation: confused-shake 0.4s ease-in-out infinite; } .bot.confused .bot-body { filter: hue-rotate(10deg) saturate(0.9); } @keyframes confused-shake { 0%, 100% { transform: translateX(-50%) rotateZ(0deg) rotateX(4deg) rotateY(-4deg); } 20% { transform: translateX(calc(-50% - 5px)) rotateZ(-6deg) rotateX(5deg) rotateY(-8deg); } 40% { transform: translateX(calc(-50% + 5px)) rotateZ(6deg) rotateX(5deg) rotateY(2deg); } 60% { transform: translateX(calc(-50% - 3px)) rotateZ(-4deg) rotateX(4deg) rotateY(-9deg); } 80% { transform: translateX(calc(-50% + 3px)) rotateZ(4deg) rotateX(4deg) rotateY(0deg); } } /* ── Bolle parlanti ── */ .bubble { position: absolute; top: 10px; background: rgba(100, 200, 255, 0.7); border-radius: 50%; animation: floatBubble 1.5s ease-out infinite; } .bubble-1 { width: 14px; height: 14px; right: 10px; animation-delay: 0s; } .bubble-2 { width: 9px; height: 9px; right: 28px; animation-delay: 0.3s; } .bubble-3 { width: 6px; height: 6px; right: 18px; animation-delay: 0.6s; } @keyframes floatBubble { 0% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-60px) scale(0.5); } } /* ── Pallini "sto pensando..." ── */ .think-dots { position: absolute; top: -30px; right: -10px; display: flex; gap: 5px; background: white; border-radius: 20px; padding: 6px 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); } .think-dots span { width: 8px; height: 8px; background: #aaa; border-radius: 50%; animation: dotPulse 1s ease-in-out infinite; } .think-dots span:nth-child(2) { animation-delay: 0.2s; } .think-dots span:nth-child(3) { animation-delay: 0.4s; } @keyframes dotPulse { 0%, 100% { transform: scale(1); background: #ccc; } 50% { transform: scale(1.4); background: #666; } }