/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #000;
    color: #f5f5f7;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Typography */
.text-gradient {
    background: linear-gradient(135deg, #fff 0%, #a1a1a6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #0071e3, #5e5ce6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0077ed, #6e6ce8);
}

/* Selection */
::selection {
    background: rgba(0, 113, 227, 0.3);
    color: #fff;
}

/* Navigation */
.nav-link {
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #86868b;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #f5f5f7;
    background: rgba(255, 255, 255, 0.05);
}

#navbar {
    background: transparent;
    backdrop-filter: blur(0);
}

#navbar.scrolled {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ===== HERO SECTION ENHANCEMENTS ===== */

/* Aurora Gradient Animation */
.aurora-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    filter: blur(80px);
    opacity: 0.6;
}

.aurora {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: screen;
    animation: aurora-drift 20s ease-in-out infinite;
}

.aurora-1 {
    width: 80vw;
    height: 80vw;
    max-width: 600px;
    max-height: 600px;
    background: radial-gradient(circle, rgba(0, 113, 227, 0.4) 0%, transparent 70%);
    top: -20%;
    left: -10%;
    animation-delay: 0s;
}

.aurora-2 {
    width: 60vw;
    height: 60vw;
    max-width: 500px;
    max-height: 500px;
    background: radial-gradient(circle, rgba(94, 92, 230, 0.35) 0%, transparent 70%);
    top: 20%;
    right: -15%;
    animation-delay: -5s;
    animation-duration: 25s;
}

.aurora-3 {
    width: 50vw;
    height: 50vw;
    max-width: 400px;
    max-height: 400px;
    background: radial-gradient(circle, rgba(255, 55, 95, 0.25) 0%, transparent 70%);
    bottom: -10%;
    left: 20%;
    animation-delay: -10s;
    animation-duration: 30s;
}

.aurora-4 {
    width: 40vw;
    height: 40vw;
    max-width: 350px;
    max-height: 350px;
    background: radial-gradient(circle, rgba(48, 209, 88, 0.2) 0%, transparent 70%);
    bottom: 20%;
    right: 10%;
    animation-delay: -15s;
    animation-duration: 22s;
}

@keyframes aurora-drift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(5%, 10%) scale(1.1);
    }
    50% {
        transform: translate(-5%, 5%) scale(0.95);
    }
    75% {
        transform: translate(3%, -5%) scale(1.05);
    }
}

/* Floating Gradient Blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: blob-float 15s ease-in-out infinite;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.3), rgba(94, 92, 230, 0.2));
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(94, 92, 230, 0.25), rgba(255, 55, 95, 0.15));
    top: 40%;
    right: 10%;
    animation-delay: -3s;
    animation-duration: 18s;
}

.blob-3 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, rgba(100, 210, 255, 0.2), rgba(0, 113, 227, 0.15));
    bottom: 15%;
    left: 15%;
    animation-delay: -7s;
    animation-duration: 20s;
}

.blob-4 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, rgba(48, 209, 88, 0.2), rgba(100, 210, 255, 0.15));
    bottom: 30%;
    right: 20%;
    animation-delay: -5s;
    animation-duration: 16s;
}

@keyframes blob-float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

/* Grid Pattern */
.grid-pattern {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 50% at 50% 50%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 80% 50% at 50% 50%, black 20%, transparent 70%);
}

/* Noise Texture Overlay */
.noise-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* Enhanced Particles */
.particles-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particle.enhanced {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    animation: particle-rise 20s infinite ease-in-out;
}

.particle.enhanced::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent);
    border-radius: 50%;
    top: -1.5px;
    left: -1.5px;
}

@keyframes particle-rise {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    5% {
        opacity: 1;
        transform: translateY(95vh) scale(1);
    }
    95% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-10vh) scale(0.5);
        opacity: 0;
    }
}

/* Decorative Rings */
.deco-ring {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    animation: ring-pulse 8s ease-in-out infinite;
}

.ring-1 {
    width: 300px;
    height: 300px;
    top: 15%;
    left: 10%;
    animation-delay: 0s;
}

.ring-2 {
    width: 500px;
    height: 500px;
    top: 30%;
    right: 5%;
    animation-delay: -2s;
}

.ring-3 {
    width: 200px;
    height: 200px;
    bottom: 20%;
    left: 25%;
    animation-delay: -4s;
}

@keyframes ring-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.1;
    }
}

/* Animated Gradient Text */
.animated-gradient-text {
    background: linear-gradient(
        90deg,
        #0071e3 0%,
        #5e5ce6 25%,
        #ff375f 50%,
        #5e5ce6 75%,
        #0071e3 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 6s linear infinite;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Hero Badge */
.hero-badge {
    animation: badge-fade 0.8s ease-out forwards;
    animation-delay: 0.2s;
}

@keyframes badge-fade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Stats */
.hero-stats {
    animation: stats-fade 0.8s ease-out forwards;
    animation-delay: 0.6s;
}

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

.stat-value {
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

@keyframes stats-fade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Primary CTA Button with Shine */
.cta-primary {
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cta-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
}

.cta-primary:hover::before {
    left: 100%;
}

.cta-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 40px rgba(255, 255, 255, 0.15);
}

/* Scroll Mouse Animation */
.scroll-mouse {
    width: 24px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    position: relative;
}

.scroll-wheel {
    width: 4px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll-wheel 2s ease-in-out infinite;
}

@keyframes scroll-wheel {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateX(-50%) translateY(10px);
        opacity: 0.3;
    }
}

/* Corner Decorations */
.corner-decoration {
    position: absolute;
    width: 100px;
    height: 100px;
    pointer-events: none;
    opacity: 0.15;
}

.corner-decoration.top-left {
    top: 80px;
    left: 40px;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.corner-decoration.top-right {
    top: 80px;
    right: 40px;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.corner-decoration.bottom-left {
    bottom: 80px;
    left: 40px;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.corner-decoration.bottom-right {
    bottom: 80px;
    right: 40px;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

/* Scroll Indicator Animation */
.scroll-indicator {
    animation: bounce-soft 2s ease-in-out infinite;
}

@keyframes bounce-soft {
    0%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    50% {
        transform: translateY(-5px) translateX(-50%);
    }
}

/* Glass Cards */
.glass-card {
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
    border-color: rgba(0, 113, 227, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -15px rgba(0, 113, 227, 0.2);
}

/* Chart Cards */
.chart-card {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.25rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-card:hover {
    border-color: rgba(0, 113, 227, 0.25);
}

/* Chart Filters */
.chart-filter {
    padding: 0.625rem 1.25rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #86868b;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-filter:hover {
    color: #f5f5f7;
    border-color: rgba(255, 255, 255, 0.2);
}

.chart-filter.active {
    color: #000;
    background: #f5f5f7;
    border-color: transparent;
}

/* Stat Cards */
.stat-card {
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card:hover {
    border-color: rgba(0, 113, 227, 0.2);
    transform: scale(1.02);
}

.stat-number {
    font-family: 'SF Pro Display', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #0071e3, #5e5ce6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Feature Cards */
.feature-card {
    background: rgba(20, 20, 20, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: rgba(20, 20, 20, 0.6);
    border-color: rgba(0, 113, 227, 0.2);
}

/* Insight Cards */
.insight-card {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.insight-card:hover {
    transform: translateY(-8px);
    border-color: rgba(0, 113, 227, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Team Cards */
.team-card {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.team-card:hover {
    transform: translateY(-12px);
    border-color: rgba(0, 113, 227, 0.3);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.5);
}

/* Table */
#tableBody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

#tableBody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Plotly Overrides */
.js-plotly-plot .plotly .modebar {
    background: transparent !important;
}

.js-plotly-plot .plotly .modebar-btn {
    color: #86868b !important;
}

.js-plotly-plot .plotly .modebar-btn:hover {
    color: #f5f5f7 !important;
}

/* Back to Top */
#backToTop {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#backToTop.visible {
    opacity: 1;
    visibility: visible;
}

/* Scroll Indicator */
.scroll-indicator {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-10px) translateX(-50%);
    }
    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

/* Reveal Animations */
.reveal-section {
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-section.revealed {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Chart Section Animation */
.chart-section {
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.chart-section.revealed {
    opacity: 1 !important;
    transform: translateY(0);
}

/* Mobile Menu */
#mobileMenu {
    transition: all 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .stat-number {
        font-size: 2rem;
    }

    .hero-title {
        font-size: 2.5rem !important;
    }

    .hero-label {
        font-size: 0.75rem;
    }

    /* Hero Responsive */
    .aurora-container {
        filter: blur(60px);
        opacity: 0.4;
    }

    .blob {
        display: none;
    }

    .deco-ring {
        display: none;
    }

    .corner-decoration {
        width: 50px;
        height: 50px;
    }

    .corner-decoration.top-left,
    .corner-decoration.top-right {
        top: 70px;
    }

    .corner-decoration.bottom-left,
    .corner-decoration.bottom-right {
        bottom: 70px;
    }

    .hero-stats {
        gap: 1rem;
    }

    .stat-item .stat-value {
        font-size: 1.75rem;
    }
}

@media (max-width: 640px) {
    .stat-number {
        font-size: 1.5rem;
    }

    .chart-card {
        border-radius: 1rem;
    }

    /* Hero Mobile */
    .hero-badge span {
        font-size: 0.7rem;
        padding: 6px 12px;
    }

    .hero-title {
        font-size: 2rem !important;
        line-height: 1.1 !important;
    }

    .hero-desc {
        font-size: 0.9rem !important;
    }

    .hero-stats {
        flex-direction: column;
        gap: 0.75rem;
    }

    .stat-divider {
        display: none !important;
    }

    .hero-cta {
        width: 100%;
    }

    .hero-cta a {
        width: 100%;
        justify-content: center;
    }

    .corner-decoration {
        display: none;
    }

    .grid-pattern {
        background-size: 40px 40px;
    }
}

/* Light Mode */
body.light-mode {
    background: #f5f5f7;
    color: #1d1d1f;
}

body.light-mode .glass-card,
body.light-mode .chart-card,
body.light-mode .stat-card,
body.light-mode .insight-card,
body.light-mode .team-card,
body.light-mode .feature-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .nav-link {
    color: #6e6e73;
}

body.light-mode .nav-link:hover {
    color: #1d1d1f;
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode #navbar.scrolled {
    background: rgba(245, 245, 247, 0.8);
}

body.light-mode .text-gradient {
    background: linear-gradient(135deg, #1d1d1f 0%, #6e6e73 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

body.light-mode .text-dark-secondary {
    color: #6e6e73 !important;
}

body.light-mode .text-dark-tertiary {
    color: #86868b !important;
}

/* Light Mode Hero Adjustments */
body.light-mode .aurora-container {
    opacity: 0.4;
}

body.light-mode .aurora-1 {
    background: radial-gradient(circle, rgba(0, 113, 227, 0.3) 0%, transparent 70%);
}

body.light-mode .aurora-2 {
    background: radial-gradient(circle, rgba(94, 92, 230, 0.25) 0%, transparent 70%);
}

body.light-mode .aurora-3 {
    background: radial-gradient(circle, rgba(255, 55, 95, 0.2) 0%, transparent 70%);
}

body.light-mode .aurora-4 {
    background: radial-gradient(circle, rgba(48, 209, 88, 0.15) 0%, transparent 70%);
}

body.light-mode .blob {
    opacity: 0.3;
}

body.light-mode .grid-pattern {
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
}

body.light-mode .noise-overlay {
    opacity: 0.02;
}

body.light-mode .particle.enhanced {
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

body.light-mode .deco-ring {
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .corner-decoration {
    border-color: rgba(0, 0, 0, 0.1);
    opacity: 0.2;
}

body.light-mode .stat-value {
    background: linear-gradient(135deg, #1d1d1f 0%, #6e6e73 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-mode .scroll-mouse {
    border-color: rgba(0, 0, 0, 0.3);
}

body.light-mode .scroll-wheel {
    background: rgba(0, 0, 0, 0.5);
}

body.light-mode .cta-primary {
    background: linear-gradient(135deg, #1d1d1f 0%, #333336 100%);
}

body.light-mode .cta-primary span {
    color: #fff !important;
}

body.light-mode .hero-badge span {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Focus States */
*:focus-visible {
    outline: 2px solid #0071e3;
    outline-offset: 2px;
}

/* Print */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }
}