body {
    font-family: 'Inter', sans-serif;
    background-color: #f9fafb;
    overflow-x: hidden;
    color: #111827;
}

body.font-arabic {
    font-family: 'Almarai', sans-serif;
}

/* Force Almarai for Arabic specific elements */
.font-almarai-force {
    font-family: 'Almarai', sans-serif !important;
}

/* Grainy Background Effect */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Meteor Canvas - Scoped to Hero */
#meteor-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Typography adjustments */
body.font-arabic h1,
body.font-arabic h2,
body.font-arabic h3,
body.font-arabic h4 {
    line-height: 1.5 !important;
}

body.font-arabic .hero-title {
    line-height: 1.3 !important;
}

body.font-arabic p {
    line-height: 1.9;
}

/* Utilities */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Custom Network Animation */
.network-node {
    position: absolute;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
}

.network-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
    height: 2px;
    transform-origin: left center;
    z-index: 5;
}

.pulse-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(252, 211, 77, 0.5);
    animation: ripple 3s infinite cubic-bezier(0, 0, 0.2, 1);
    box-sizing: border-box;
}

@keyframes ripple {
    0% {
    transform: scale(1);
    opacity: 1;
    }

    100% {
    transform: scale(3);
    opacity: 0;
    }
}

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-100 {
    transition-delay: 100ms;
}

.delay-200 {
    transition-delay: 200ms;
}

.delay-300 {
    transition-delay: 300ms;
}

/* Loader Styles */
#loader-overlay {
    position: fixed;
    inset: 0;
    background-color: #f9fafb;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-out, visibility 0.8s;
}

/* Chemical Flask Animation */
.chemical-flask {
    width: 80px;
    height: 80px;
    border: 4px solid black;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.liquid {
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ccfbf1 0%, #d8b4fe 100%);
    animation: fillUp 2s ease-in-out forwards;
}

.liquid::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: wave 2s infinite linear;
}

.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    bottom: 0;
    animation: bubbleRise 2s infinite ease-in;
}

@keyframes fillUp {
    0% {
    bottom: -100%;
    }

    50% {
    bottom: -20%;
    }

    100% {
    bottom: 0%;
    }
}

@keyframes wave {
    0% {
    transform: translateX(-50%) skew(0deg, -5deg);
    }

    50% {
    transform: translateX(0%) skew(0deg, 5deg);
    }

    100% {
    transform: translateX(-50%) skew(0deg, -5deg);
    }
}

@keyframes bubbleRise {
    0% {
    transform: translateY(0) scale(0.5);
    opacity: 0;
    }

    50% {
    opacity: 1;
    }

    100% {
    transform: translateY(-80px) scale(1.2);
    opacity: 0;
    }
}

/* Marquee Animations */
.animate-marquee {
    animation: marquee 25s linear infinite;
}

.animate-marquee2 {
    animation: marquee2 25s linear infinite;
}

@keyframes marquee {
    0% {
    transform: translateX(0%);
    }

    100% {
    transform: translateX(-100%);
    }
}

@keyframes marquee2 {
    0% {
    transform: translateX(100%);
    }

    100% {
    transform: translateX(0%);
    }
}