/* ============================================
   OpenClaw Architecture Site — Animations
   ============================================ */

/* Pulse dot for badge */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.5); }
}

/* Fade in message (chat) */
@keyframes fadeInMsg {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scroll Reveal */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}
.scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.15s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.2s; }
.scroll-reveal:nth-child(5) { transition-delay: 0.25s; }
.scroll-reveal:nth-child(6) { transition-delay: 0.3s; }

/* Float animation for lobster */
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-12px) rotate(2deg); }
    66% { transform: translateY(-6px) rotate(-2deg); }
}
.lobster-float {
    animation: float 6s ease-in-out infinite;
    display: inline-block;
}

/* Glow pulse */
@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 20px var(--accent-glow); }
    50% { box-shadow: 0 0 40px var(--accent-glow), 0 0 60px rgba(249, 115, 22, 0.15); }
}
.glow-animated {
    animation: glow-pulse 3s ease infinite;
}

/* Data flow */
@keyframes data-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}
.data-flow-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    background-size: 200% 100%;
    animation: data-flow 2s linear infinite;
}

/* Typing cursor */
@keyframes blink-cursor {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
.typing-cursor::after {
    content: '▌';
    color: var(--accent);
    animation: blink-cursor 1s step-end infinite;
    margin-left: 2px;
}

/* Spin */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.spin { animation: spin 4s linear infinite; }

/* Shimmer for loading */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.shimmer {
    background: linear-gradient(
        90deg,
        transparent 25%,
        rgba(249, 115, 22, 0.1) 50%,
        transparent 75%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Count up */
@keyframes countPulse {
    from { transform: scale(1.2); opacity: 0.5; }
    to { transform: scale(1); opacity: 1; }
}
.count-animated {
    animation: countPulse 0.3s ease;
}

/* Orb drift */
@keyframes orb-drift-1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(30px, -20px); }
    50% { transform: translate(-20px, 30px); }
    75% { transform: translate(20px, 20px); }
}
@keyframes orb-drift-2 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-20px, 30px); }
    50% { transform: translate(30px, -10px); }
    75% { transform: translate(-10px, -20px); }
}
@keyframes orb-drift-3 {
    0%, 100% { transform: translate(-50%, -50%); }
    33% { transform: translate(-45%, -55%); }
    66% { transform: translate(-55%, -45%); }
}
.orb-1 { animation: orb-drift-1 20s ease-in-out infinite; }
.orb-2 { animation: orb-drift-2 15s ease-in-out infinite; }
.orb-3 { animation: orb-drift-3 12s ease-in-out infinite; }

/* Step progress bar */
@keyframes step-progress {
    from { width: 0%; }
    to { width: 100%; }
}
.loop-step.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    height: 2px;
    background: var(--accent);
    animation: step-progress 5s linear;
}
.loop-step { position: relative; overflow: hidden; }

/* Slide in from right/left */
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}
.slide-right { animation: slideInRight 0.5s ease; }
.slide-left { animation: slideInLeft 0.5s ease; }

/* Connection line animation (multi-agent) */
@keyframes conn-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}
.conn-line { animation: conn-pulse 2s ease infinite; }

/* Stagger children animation */
.stagger-in > * {
    opacity: 0;
    transform: translateY(12px);
    animation: fadeInMsg 0.4s ease forwards;
}
.stagger-in > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-in > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-in > *:nth-child(8) { animation-delay: 0.4s; }

/* Hover lift for cards */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* Focus ring */
.tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Smooth section transitions */
.section {
    transition: opacity 0.6s ease;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .scroll-reveal { opacity: 1; transform: none; }
}
