/* General Styles & Animations */
* {
    scroll-behavior: smooth;
}

.gradient-text {
    background: linear-gradient(135deg, #0c7ff2, #3b82f6, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-bg {
    background: linear-gradient(135deg, #0c7ff2, #3b82f6);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(60, 165, 250, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 20px rgba(60, 165, 250, 0);
    }
}

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

.animate-pulse-custom {
    animation: pulse 2s infinite;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.text-shadow {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.card-shadow {
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
}

.backdrop-blur-xl {
    backdrop-filter: blur(20px);
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 2s steps(40, end);
}

.cursor {
    animation: blink 1s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(12, 127, 242, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 15px rgba(12, 127, 242, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(12, 127, 242, 0);
    }
}

.pulse-ring {
    animation: pulse-ring 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

@keyframes float-slow {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(2deg);
    }
    75% {
        transform: translateY(5px) rotate(-2deg);
    }
}

.float-slow {
    animation: float-slow 8s ease-in-out infinite;
}

.glow-text {
    text-shadow: 0 0 10px rgba(12, 127, 242, 0.5), 0 0 20px rgba(12, 127, 242, 0.3);
}

.chat-bubble {
    position: relative;
    background: linear-gradient(135deg, rgba(12, 127, 242, 0.1), rgba(59, 130, 246, 0.05));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(12, 127, 242, 0.2);
}

.chat-bubble::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 30px;
    width: 20px;
    height: 20px;
    background: inherit;
    border-right: 1px solid rgba(12, 127, 242, 0.2);
    border-bottom: 1px solid rgba(12, 127, 242, 0.2);
    transform: rotate(45deg);
    backdrop-filter: blur(10px);
}

.integration-card {
    transition: all 0.3s ease;
}

.integration-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(12, 127, 242, 0.2);
}

.hover-lift-shadow {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift-shadow:hover {
    transform: translateY(-10px) translateZ(20px);
    box-shadow: 0 30px 60px -20px rgba(12, 127, 242, 0.5);
}

/* General Scroll-Triggered Animations (for elements OUTSIDE progressive scroll) */
.fade-in {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-left {
    opacity: 0;
    transform: translateX(-100px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-right {
    opacity: 0;
    transform: translateX(100px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.zoom-in {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.zoom-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger animation for general items (OUTSIDE progressive scroll) */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    /* transition: opacity 0.6s ease-out, transform 0.6s ease-out; */ /* JS or CSS handles this */
}

.stagger-item.visible { /* Applied by general IntersectionObserver */
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out; /* This can be used if general observer adds 'visible' */
}

/* Navbar fix */
.hidden {
    display: none; /* No !important */
}

/* --- Progressive Disclosure Scroll Styles --- */
.scroll-container {
    position: relative;
}

.scroll-section {
    position: relative;
    width: 100%;
}

/* Define scroll-through duration (height) for each section */
#progressive-scroll .scroll-section:nth-child(1) {
    height: 150vh;
}

/* Intro */
#progressive-scroll .scroll-section:nth-child(2) {
    height: 250vh;
}

/* Security */
#progressive-scroll .scroll-section:nth-child(3) {
    height: 250vh;
}

/* AI Brain */
#progressive-scroll .scroll-section:nth-child(4) {
    height: 350vh;
}

/* Memory - longer due to timeline */
#progressive-scroll .scroll-section:nth-child(5) {
    height: 250vh;
}

/* Voice */
#progressive-scroll .scroll-section:nth-child(6) {
    height: 150vh;
}

/* Conclusion */

.scroll-content {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 1; /* Changed to 1 to ensure visibility */
    transform: translateY(0); /* Reset transform */
    z-index: 1; /* Ensure content is above background */
    /* transition: none; */ /* JS handles per-frame animation, so CSS transition is often removed or carefully managed */
}

/* Wrapper for the actual visible content inside .scroll-content for padding, max-width etc. */
.scroll-content > div {
    width: 100%;
    /* max-width: 1152px; /* Example: max-w-6xl from your layout */
    /* padding: 0 1.5rem; /* Example: px-6 */
}

/* Specific initial state for stagger items WITHIN progressive scroll - JS controls animation */
#progressive-scroll .stagger-item {
    opacity: 0;
    transform: translateY(20px); /* Initial JS animation state */
    animation: none !important; /* Override any general stagger CSS animation */
    transition: none !important; /* Override any general stagger CSS transition */
}


/* Backgrounds for progressive disclosure */
.scroll-bg {
    position: absolute;
    inset: 0;
    transition: background-color 1.2s ease; /* Smooth transition for background color changes */
    z-index: 0; /* Behind the content but not negative */
}

.bg-security {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.bg-ai {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
}

.bg-memory {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%);
}

.bg-voice {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.1) 0%, rgba(249, 115, 22, 0.05) 100%);
}

/* Floating elements within progressive scroll */
.floating-element {
    position: absolute; /* Relative to its .scroll-section */
    z-index: 0; /* Above .scroll-bg but can be below main text if needed */
    animation: float 6s ease-in-out infinite; /* Re-using your float animation */
}

/* Security bars animation */
@keyframes fillBar {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.security-bar { /* Initial state */
    width: 0;
    height: 100%; /* Or specific height */
    background-color: #4ade80; /* Example color, adjust as needed */
    border-radius: 9999px; /* pill shape */
    transition: width 0.3s ease-out;
}

.security-bar.active {
    animation: fillBar 1.2s ease-out forwards;
}

/* Security image enhancements */
.security-fortress-image {
    filter: contrast(1.1) brightness(0.95);
    transition: transform 0.3s ease;
}

.security-fortress-image:hover {
    transform: scale(1.02);
}

/* Other global styles from your original file that are not animations or layout for progressive scroll */
.lisa-glow {
    box-shadow: 0 0 40px rgba(12, 127, 242, 0.4), 0 0 80px rgba(12, 127, 242, 0.2);
}

@keyframes orb-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.orb-float {
    animation: orb-float 20s ease-in-out infinite;
}

/* Video fade mask removed - not used in current implementation */

/* Fix navbar z-index to be above progressive scroll */
header {
    z-index: 100001 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background-color: #111418 !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
}

/* Ensure main content doesn't hide behind header */
main {
    padding-top: 64px; /* Height of header */
}

/* Transform 3D for Lisa avatar */
.transform-3d {
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateY(-5deg);
    transition: transform 0.3s ease;
}

.transform-3d:hover {
    transform: perspective(1000px) rotateY(5deg) scale(1.05);
}

/* AI network image enhancements */
.ai-network-image {
    filter: brightness(1.2) contrast(1.1);
    transition: transform 0.3s ease;
    position: absolute !important;
    z-index: 10 !important;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Ensure the container has proper dimensions */
.aspect-square {
    position: relative;
    width: 100%;
}

.aspect-square::before {
    content: "";
    display: block;
    padding-bottom: 100%; /* Creates 1:1 aspect ratio */
}

.aspect-square > * {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.ai-network-image:hover {
    transform: scale(1.02);
}

/* AI model indicators animation */
.ai-model-indicator {
    transition: all 0.3s ease;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.ai-model-indicator:hover {
    background-color: rgba(168, 85, 247, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

@keyframes model-pulse {
    0%, 100% {
        border-color: rgba(168, 85, 247, 0.3);
    }
    50% {
        border-color: rgba(168, 85, 247, 0.6);
    }
}

.scroll-content[data-section="3"] .ai-model-indicator {
    animation: model-pulse 3s ease-in-out infinite;
}

.scroll-content[data-section="3"] .ai-model-indicator:nth-child(1) {
    animation-delay: 0s;
}

.scroll-content[data-section="3"] .ai-model-indicator:nth-child(2) {
    animation-delay: 0.5s;
}

.scroll-content[data-section="3"] .ai-model-indicator:nth-child(3) {
    animation-delay: 1s;
}

.scroll-content[data-section="3"] .ai-model-indicator:nth-child(4) {
    animation-delay: 1.5s;
}