/* ===================================
   Context.ai - Premium AI Agent SaaS
   Clean, Minimalist, Enterprise-Grade
   =================================== */

:root {
    /* Primary Blue Palette */
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-200: #bfdbfe;
    --blue-300: #93c5fd;
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-800: #1e40af;
    --blue-900: #1e3a8a;
    
    /* Neutral Palette */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Accent Colors */
    --green-500: #10b981;
    --purple-500: #8b5cf6;
    --red-500: #ef4444;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    --gradient-subtle: linear-gradient(180deg, rgba(59, 130, 246, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
    --gradient-hero: linear-gradient(135deg, #ffffff 0%, #f9fafb 50%, #eff6ff 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-blue: 0 10px 25px -5px rgba(59, 130, 246, 0.25);
    --shadow-float: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    
    /* Spacing */
    --spacing: 8px;
}

/* ===================================
   Reset & Base
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
    background: var(--white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   Navigation
   =================================== */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
    padding: calc(var(--spacing) * 2.5) 0;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 calc(var(--spacing) * 4);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing) * 1.5);
    cursor: pointer;
    text-decoration: none;
}

.logo-brain {
    transition: transform 0.3s ease;
}

.logo:hover .logo-brain {
    transform: rotate(15deg) scale(1.05);
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing) * 4);
}

.nav-links a {
    color: var(--gray-600);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--blue-600);
}

.btn-nav-cta {
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-blue);
}

.btn-nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -10px rgba(59, 130, 246, 0.4);
}

/* ===================================
   Hero Section
   =================================== */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: calc(var(--spacing) * 15) calc(var(--spacing) * 4) calc(var(--spacing) * 10);
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: calc(var(--spacing) * 10);
    align-items: center;
    position: relative;
    z-index: 2;
}

/* ===================================
   Hero Content
   =================================== */

.hero-content {
    max-width: 600px;
}

.hero-title {
    font-size: 58px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--gray-900);
    margin-bottom: calc(var(--spacing) * 3);
    letter-spacing: -0.03em;
}

.highlight-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
}

.hero-subtitle {
    font-size: 19px;
    line-height: 1.7;
    color: var(--gray-600);
    margin-bottom: calc(var(--spacing) * 4);
    font-weight: 400;
}

.hero-highlight {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing) * 1.5);
    background: var(--blue-50);
    border: 1px solid var(--blue-200);
    padding: calc(var(--spacing) * 2) calc(var(--spacing) * 3);
    border-radius: 12px;
    margin-bottom: calc(var(--spacing) * 5);
    color: var(--blue-700);
    font-size: 15px;
    font-weight: 600;
}

.hero-highlight svg {
    color: var(--blue-500);
    flex-shrink: 0;
}

.hero-actions {
    display: flex;
    gap: calc(var(--spacing) * 2);
    margin-bottom: calc(var(--spacing) * 3);
}

.how-it-works-link {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--spacing) * 1);
    color: var(--blue-600);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: calc(var(--spacing) * 5);
    transition: all 0.3s ease;
}

.how-it-works-link:hover {
    gap: calc(var(--spacing) * 1.5);
    color: var(--blue-700);
}

.how-it-works-link svg {
    transition: transform 0.3s ease;
}

.how-it-works-link:hover svg {
    transform: translateX(4px);
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: calc(var(--spacing) * 1.5);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-blue);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 35px -10px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: var(--white);
    color: var(--blue-600);
    border: 2px solid var(--blue-200);
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: calc(var(--spacing) * 1.5);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--blue-50);
    border-color: var(--blue-300);
}

.hero-meta {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing) * 2);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing) * 1.5);
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 500;
}

.meta-item svg {
    flex-shrink: 0;
}

/* ===================================
   Hero Visual - AI Brain
   =================================== */

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ai-brain-container {
    position: relative;
    width: 550px;
    height: 550px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.brain-core {
    width: 400px;
    height: 400px;
    filter: drop-shadow(0 10px 40px rgba(59, 130, 246, 0.3));
    animation: brainFloat 6s ease-in-out infinite;
}

@keyframes brainFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

/* Neural Network Nodes Animation */
.node {
    animation: nodePulse 3s ease-in-out infinite;
}

.node-1 { animation-delay: 0s; }
.node-2 { animation-delay: 0.2s; }
.node-3 { animation-delay: 0.4s; }
.node-4 { animation-delay: 0.6s; }
.node-5 { animation-delay: 0.8s; }
.node-6 { animation-delay: 1s; }
.node-7 { animation-delay: 1.2s; }
.node-8 { animation-delay: 1.4s; }

@keyframes nodePulse {
    0%, 100% { opacity: 0.6; r: 8px; }
    50% { opacity: 1; r: 10px; }
}

/* Connection Lines Animation */
.connection {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: connectionFlow 4s ease-in-out infinite;
}

.connection-1 { animation-delay: 0s; }
.connection-2 { animation-delay: 0.3s; }
.connection-3 { animation-delay: 0.6s; }
.connection-4 { animation-delay: 0.9s; }
.connection-5 { animation-delay: 1.2s; }
.connection-6 { animation-delay: 1.5s; }
.connection-7 { animation-delay: 1.8s; }
.connection-8 { animation-delay: 2.1s; }

@keyframes connectionFlow {
    0% { stroke-dashoffset: 100; opacity: 0.2; }
    50% { stroke-dashoffset: 0; opacity: 0.6; }
    100% { stroke-dashoffset: -100; opacity: 0.2; }
}

/* Core Node Pulsing */
.core-node {
    animation: corePulse 2s ease-in-out infinite;
}

@keyframes corePulse {
    0%, 100% { r: 35px; opacity: 0.9; }
    50% { r: 38px; opacity: 1; }
}

.core-ring {
    animation: ringExpand 3s ease-in-out infinite;
}

.core-ring-inner {
    animation: ringExpand 3s ease-in-out infinite 0.5s;
}

@keyframes ringExpand {
    0%, 100% { r: 25px; opacity: 0.3; }
    50% { r: 30px; opacity: 0.5; }
}

/* Particles Animation */
.particle {
    animation: particleMove 4s ease-in-out infinite;
}

.particle-1 { animation-delay: 0s; }
.particle-2 { animation-delay: 1s; }
.particle-3 { animation-delay: 2s; }
.particle-4 { animation-delay: 3s; }

@keyframes particleMove {
    0% { opacity: 0; transform: translate(0, 0); }
    25% { opacity: 1; }
    50% { opacity: 0.5; transform: translate(100px, 100px); }
    100% { opacity: 0; transform: translate(200px, 200px); }
}

/* ===================================
   Floating Dashboard Cards
   =================================== */

.dashboard-float {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.float-card {
    position: absolute;
    background: var(--white);
    border-radius: 12px;
    padding: calc(var(--spacing) * 2.5);
    box-shadow: var(--shadow-float);
    border: 1px solid var(--gray-200);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    animation: floatUpDown 4s ease-in-out infinite;
}

.float-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.25);
}

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

/* KPI Card */
.kpi-card {
    min-width: 180px;
    animation-delay: 0s;
}

.card-label {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 600;
    margin-bottom: calc(var(--spacing) * 1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: calc(var(--spacing) * 1);
    line-height: 1;
}

.card-trend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
}

.card-trend.positive {
    color: var(--green-500);
}

/* Chart Card */
.chart-card {
    min-width: 200px;
    animation-delay: 0.5s;
}

.mini-chart {
    margin-top: calc(var(--spacing) * 1.5);
    height: 60px;
}

.mini-chart svg {
    width: 100%;
    height: 100%;
}

/* Comparables Card */
.comparable-card {
    min-width: 200px;
    animation-delay: 1s;
}

.comparable-list {
    margin-top: calc(var(--spacing) * 1.5);
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing) * 1);
}

.comparable-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(var(--spacing) * 1) calc(var(--spacing) * 1.5);
    background: var(--gray-50);
    border-radius: 6px;
}

.comparable-name {
    font-size: 13px;
    color: var(--gray-700);
    font-weight: 600;
}

.comparable-match {
    font-size: 13px;
    color: var(--blue-600);
    font-weight: 700;
}

/* Map Card */
.map-card {
    min-width: 180px;
    animation-delay: 1.5s;
}

.mini-map {
    margin-top: calc(var(--spacing) * 1.5);
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
}

.mini-map svg {
    width: 100%;
    height: 100%;
}

/* Narrative Card */
.narrative-card {
    min-width: 200px;
    animation-delay: 0s;
}

.card-icon {
    margin-bottom: calc(var(--spacing) * 1);
}

.card-progress {
    margin-top: calc(var(--spacing) * 1.5);
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* Story Structure Card */
.story-card {
    min-width: 240px;
    animation-delay: 0.5s;
}

.story-flow {
    margin-top: calc(var(--spacing) * 1.5);
    display: flex;
    align-items: center;
    gap: 8px;
}

.flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.flow-step.active .step-number {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.step-label {
    font-size: 10px;
    color: var(--gray-600);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.flow-arrow {
    color: var(--gray-400);
    font-size: 14px;
    margin: 0 2px;
}

/* Information Sources Card */
.sources-card {
    min-width: 220px;
    animation-delay: 1s;
}

.sources-list {
    margin-top: calc(var(--spacing) * 1.5);
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing) * 1);
}

.source-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: calc(var(--spacing) * 1) calc(var(--spacing) * 1.5);
    background: var(--gray-50);
    border-radius: 6px;
}

.source-name {
    flex: 1;
    font-size: 13px;
    color: var(--gray-700);
    font-weight: 600;
}

.source-status {
    font-size: 14px;
    color: var(--green-500);
    font-weight: 700;
}

/* Key Message Card */
.message-card {
    max-width: 280px;
    animation-delay: 2s;
}

.message-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: calc(var(--spacing) * 1.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.message-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--gray-700);
    font-weight: 500;
}

/* Presentation Ready Card */
.ready-card {
    min-width: 180px;
    animation-delay: 2.5s;
    display: flex;
    align-items: center;
    gap: calc(var(--spacing) * 2);
}

.ready-icon svg {
    display: block;
}

.ready-content {
    flex: 1;
}

.ready-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.ready-label {
    font-size: 11px;
    color: var(--green-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Legacy Insight Card (keep for compatibility) */
.insight-card {
    max-width: 280px;
    animation-delay: 2s;
}

.insight-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: calc(var(--spacing) * 1.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.insight-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--gray-700);
    font-style: italic;
}

/* Time Saved Card */
.time-card {
    min-width: 160px;
    display: flex;
    align-items: center;
    gap: calc(var(--spacing) * 2);
    animation-delay: 2.5s;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.time-icon {
    font-size: 32px;
}

.time-saved {
    display: flex;
    flex-direction: column;
}

.time-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--blue-600);
    line-height: 1;
}

.time-label {
    font-size: 12px;
    color: var(--gray-600);
    font-weight: 600;
    text-transform: uppercase;
}

/* ===================================
   Background Elements
   =================================== */

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    overflow: hidden;
}

.bg-gradient-1 {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    animation: gradientFloat 20s ease-in-out infinite;
}

.bg-gradient-2 {
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(147, 197, 253, 0.08) 0%, transparent 70%);
    animation: gradientFloat 25s ease-in-out infinite reverse;
}

@keyframes gradientFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, -50px) scale(1.1); }
}

.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(to right, rgba(59, 130, 246, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 1200px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: calc(var(--spacing) * 6);
    }
    
    .hero-content {
        max-width: 700px;
        text-align: center;
        margin: 0 auto;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .hero-meta {
        align-items: center;
    }
    
    .ai-brain-container {
        width: 450px;
        height: 450px;
    }
    
    .brain-core {
        width: 350px;
        height: 350px;
    }
    
    .float-card {
        display: none;
    }
}

@media (max-width: 768px) {
    .nav-links a {
        display: none;
    }
    
    .hero {
        padding: calc(var(--spacing) * 12) calc(var(--spacing) * 3) calc(var(--spacing) * 8);
    }
    
    .hero-title {
        font-size: 38px;
    }
    
    .hero-subtitle {
        font-size: 17px;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .ai-brain-container {
        width: 320px;
        height: 320px;
    }
    
    .brain-core {
        width: 280px;
        height: 280px;
    }
}

/* ===================================
   Accessibility
   =================================== */

.keyboard-navigation *:focus {
    outline: 2px solid var(--blue-600);
    outline-offset: 4px;
    border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}