/* ==================== Animated AIIIN Robo (logo + chatbot + hero) ==================== */
/* Reusable robot avatar. Wrap markup in .robo-frame--{lg|sm|xs} to scale. */

.robo-frame {
    --robo-scale: 1;
    position: relative;
    display: inline-flex;
    width: 120px;
    height: 151px;
    flex: 0 0 auto;
    line-height: 0;
    vertical-align: middle;
}

.robo-scale {
    position: absolute;
    top: 0;
    left: 0;
    width: 120px;
    height: 151px;
    transform: scale(var(--robo-scale));
    transform-origin: top left;
}

.robo-frame--lg { --robo-scale: 1; width: 120px; height: 151px; }
.robo-frame--sm { --robo-scale: 0.38; width: 45.6px; height: 57.38px; }
.robo-frame--xs { --robo-scale: 0.25; width: 30px; height: 37.75px; }

.ai-robo {
    position: relative;
    width: 120px;
    cursor: default;
    filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.4));
    animation: roboFloat 4s ease-in-out infinite;
    outline: none;
}

.ai-robo[role="button"] { cursor: pointer; }

.ai-robo:focus-visible .robo-head {
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.6), inset 0 -8px 18px rgba(79, 70, 229, 0.25), inset 0 8px 18px rgba(255, 255, 255, 0.65);
}

@keyframes roboFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.robo-antenna {
    position: relative;
    width: 3px;
    height: 16px;
    margin: 0 auto;
    background: linear-gradient(#e0e7ff, #a5b4fc);
    border-radius: 3px;
}

.robo-antenna-tip {
    position: absolute;
    top: -9px;
    left: 50%;
    width: 13px;
    height: 13px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: #f472b6;
    box-shadow: 0 0 10px #f472b6, 0 0 20px rgba(244, 114, 182, 0.7);
    animation: roboTipPulse 1.6s ease-in-out infinite;
}

@keyframes roboTipPulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
    50% { transform: translateX(-50%) scale(0.75); opacity: 0.7; }
}

.robo-head {
    position: relative;
    width: 110px;
    height: 96px;
    margin: 0 auto;
    border-radius: 30px 30px 34px 34px;
    background: linear-gradient(160deg, #eef2ff, #c7d2fe 45%, #a5b4fc);
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 -8px 18px rgba(79, 70, 229, 0.25), inset 0 8px 18px rgba(255, 255, 255, 0.7);
}

.robo-ear {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 30px;
    transform: translateY(-50%);
    border-radius: 8px;
    background: linear-gradient(160deg, #c7d2fe, #818cf8);
    box-shadow: inset 0 0 6px rgba(255, 255, 255, 0.6);
}

.robo-ear.left { left: -14px; }
.robo-ear.right { right: -14px; }

.robo-face {
    position: absolute;
    inset: 15px 13px 13px;
    border-radius: 22px;
    background: radial-gradient(circle at 50% 30%, #1e293b, #0f172a 72%);
    box-shadow: inset 0 0 18px rgba(99, 102, 241, 0.6);
    overflow: hidden;
}

.robo-brow {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 11px;
}

.robo-brow span {
    width: 16px;
    height: 3px;
    border-radius: 3px;
    background: rgba(165, 243, 252, 0.7);
    transform: rotate(-8deg);
}

.robo-brow span:last-child { transform: rotate(8deg); }

.robo-eyes {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 5px;
}

.robo-eye {
    position: relative;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 40%, #cffafe, #22d3ee 55%, #0891b2);
    box-shadow: 0 0 10px #22d3ee, 0 0 22px rgba(34, 211, 238, 0.6);
    animation: roboBlink 5s ease-in-out infinite;
}

.robo-eye::after {
    content: '';
    position: absolute;
    inset: -5px -6px auto -6px;
    height: 8px;
    border-top: 2px solid rgba(165, 243, 252, 0.6);
    border-radius: 50%;
}

.robo-eye i {
    position: absolute;
    top: 5px;
    left: 6px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
}

@keyframes roboBlink {
    0%, 92%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.12); }
}

.robo-cheeks {
    display: flex;
    justify-content: space-between;
    padding: 0 6px;
    margin-top: 2px;
}

.robo-cheeks span {
    width: 9px;
    height: 5px;
    border-radius: 50%;
    background: rgba(244, 114, 182, 0.55);
    filter: blur(1px);
}

.robo-mouth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 16px;
    margin-top: 3px;
}

.robo-mouth span {
    width: 4px;
    height: 4px;
    border-radius: 3px;
    background: #f472b6;
    opacity: 0.9;
    transition: height 0.12s ease;
}

.robo-mouth span:nth-child(3) { height: 8px; width: 5px; }

.ai-robo.is-speaking .robo-mouth span {
    animation: roboTalk 0.35s ease-in-out infinite alternate;
}

.ai-robo.is-speaking .robo-mouth span:nth-child(2) { animation-delay: 0.1s; }
.ai-robo.is-speaking .robo-mouth span:nth-child(3) { animation-delay: 0.2s; }
.ai-robo.is-speaking .robo-mouth span:nth-child(4) { animation-delay: 0.1s; }
.ai-robo.is-speaking .robo-mouth span:nth-child(5) { animation-delay: 0.15s; }

@keyframes roboTalk {
    from { height: 3px; }
    to { height: 11px; }
}

.ai-robo.is-speaking .robo-eye {
    animation: roboEyeGlow 0.6s ease-in-out infinite alternate;
}

@keyframes roboEyeGlow {
    from { box-shadow: 0 0 10px #22d3ee, 0 0 20px rgba(34, 211, 238, 0.5); }
    to { box-shadow: 0 0 16px #67e8f9, 0 0 30px rgba(34, 211, 238, 0.95); }
}

.robo-neck {
    width: 28px;
    height: 9px;
    margin: 0 auto;
    border-radius: 0 0 6px 6px;
    background: linear-gradient(#818cf8, #6366f1);
}

.robo-body {
    position: relative;
    width: 74px;
    height: 30px;
    margin: 0 auto;
    border-radius: 15px 15px 12px 12px;
    background: linear-gradient(160deg, #c7d2fe, #818cf8);
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.robo-led {
    position: absolute;
    top: 9px;
    left: 50%;
    width: 10px;
    height: 10px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: #22d3ee;
    box-shadow: 0 0 10px #22d3ee;
    animation: roboTipPulse 1.8s ease-in-out infinite;
}

.robo-wave {
    position: absolute;
    top: 58px;
    left: 50%;
    width: 70px;
    height: 70px;
    border: 2px solid rgba(34, 211, 238, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
    pointer-events: none;
}

.ai-robo.is-speaking .robo-wave {
    animation: roboWave 1.6s ease-out infinite;
}

.ai-robo.is-speaking .robo-wave.wave-2 { animation-delay: 0.4s; }
.ai-robo.is-speaking .robo-wave.wave-3 { animation-delay: 0.8s; }

@keyframes roboWave {
    0% { opacity: 0.8; transform: translate(-50%, -50%) scale(0.5); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(2.4); }
}

@media (prefers-reduced-motion: reduce) {
    .ai-robo,
    .robo-antenna-tip,
    .robo-eye,
    .robo-led,
    .ai-robo.is-speaking .robo-mouth span,
    .ai-robo.is-speaking .robo-wave {
        animation: none !important;
    }
}
