/* Enhanced Brand Design System */
:root {
    /* Brand Colors */
    --brand-primary: #D84315;
    --brand-secondary: #37474F;
    --brand-accent-1: #FFD600;
    --brand-accent-2: #43A047;
    --brand-accent-3: #fff3e0;
    --brand-bg: #FFFDF7;
    --brand-surface: #fff;
    --brand-text: #222;
    --brand-muted: #B0BEC5;

    /* RGB Values for Opacity */
    --brand-primary-rgb: 211, 47, 47;
    --brand-secondary-rgb: 255, 152, 0;
    --brand-accent-1-rgb: 255, 214, 0;
    --brand-accent-2-rgb: 255, 112, 67;
    --brand-accent-3-rgb: 255, 243, 224;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    --gradient-accent: linear-gradient(135deg, var(--brand-accent-1) 0%, var(--brand-accent-2) 100%);
    --gradient-overlay: linear-gradient(180deg, rgba(var(--brand-primary-rgb), 0.9) 0%, rgba(var(--brand-primary-rgb), 0.7) 100%);

    /* Semantic Colors */
    --text-primary: var(--brand-primary);
    --text-secondary: #4a4a4a;
    --background-light: #f8f9fa;
    --border-color: rgba(20, 20, 71, 0.1);

    /* Typography */
    --font-primary: 'Cairo', 'IBM Plex Sans Arabic', sans-serif;
    --font-secondary: 'IBM Plex Sans Arabic', 'Cairo', sans-serif;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(20, 20, 71, 0.1);
    --shadow-md: 0 4px 8px rgba(20, 20, 71, 0.1);
    --shadow-lg: 0 8px 16px rgba(20, 20, 71, 0.1);
    --shadow-xl: 0 16px 32px rgba(20, 20, 71, 0.1);
}

/* Enhanced Accessibility & UX Variables */
:root {
    /* Color Contrast Ratios Following WCAG 2.1 Guidelines */
    --text-high-contrast: rgba(255, 255, 255, 0.95);
    --text-medium-contrast: rgba(255, 255, 255, 0.87);
    --text-low-contrast: rgba(255, 255, 255, 0.6);

    /* Focus States */
    --focus-ring-color: var(--brand-primary);
    --focus-ring-width: 3px;

    /* Animation Timing */
    --transition-fast: 200ms;
    --transition-medium: 300ms;
    --transition-slow: 500ms;

    /* Spacing Scale */
    --space-unit: 0.25rem;
    --space-xs: calc(var(--space-unit) * 2);
    --space-sm: calc(var(--space-unit) * 4);
    --space-md: calc(var(--space-unit) * 6);
    --space-lg: calc(var(--space-unit) * 8);
    --space-xl: calc(var(--space-unit) * 12);

    /* Motion Safe Preferences */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
            scroll-behavior: auto !important;
        }
    }
}

/* Global Styles */
body {
    font-family: var(--font-primary);
    color: var(--text-primary);
    line-height: 1.6;
    background-color: #f8f9fa;
    opacity: 1 !important;
    visibility: visible !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Typography Enhancements */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

.display-1,
.display-2,
.display-3,
.display-4 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Enhanced Focus States */
*:focus-visible {
    outline: var(--focus-ring-width) solid var(--focus-ring-color);
    outline-offset: 2px;
}

/* Smooth Scrolling with Motion Safe Check */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Enhanced Button States */
.btn {
    position: relative;
    transition: transform var(--transition-medium) ease,
        box-shadow var(--transition-medium) ease;
    will-change: transform;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right,
            rgba(var(--brand-primary-rgb), 0.2),
            rgba(var(--brand-accent-1-rgb), 0.2));
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--transition-medium) ease;
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: translateY(2px);
}

/* Enhanced Card Interactions */
.card {
    transition: transform var(--transition-medium) cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow var(--transition-medium) ease;
    will-change: transform, box-shadow;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Enhanced Section Transitions */
.section-transition {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slow) ease,
        transform var(--transition-slow) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.section-transition.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero Section */
.hero-section {
    background: var(--gradient-primary);
    color: white;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/images/pattern.svg') repeat;
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-image {
    position: relative;
    z-index: 2;
}

.hero-image .main-image {
    width: 100%;
    height: auto;
    animation: float 6s ease-in-out infinite;
}

.hero-image .floating-image {
    position: absolute;
    width: 80px;
    height: 80px;
}

.hero-image .tech-circle {
    top: 20%;
    right: 10%;
    animation: spin 20s linear infinite;
}

.hero-image .code-element {
    bottom: 20%;
    left: 10%;
    animation: float 4s ease-in-out infinite;
}

/* Animations */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Advanced Animations */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Section Styles */
section {
    position: relative;
    overflow: hidden;
    padding: 100px 0;
    z-index: 1;
}

section:not(.hero-section) {
    background-color: #fff;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

/* Basic scroll behavior */
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    width: 100%;
}

/* Fix for scrolling issues */
html,
body {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Ensure sections are visible */
section {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Advanced Service Cards */
.services-section {
    position: relative;
    overflow: hidden;
    background: linear-gradient(to bottom, rgba(var(--brand-primary-rgb), 0.05), rgba(var(--brand-primary-rgb), 0.02));
}

.service-bg-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-element {
    position: absolute;
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--brand-accent-1), var(--brand-accent-2));
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.1;
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.floating-element:nth-child(1) {
    top: -150px;
    left: -150px;
}

.floating-element:nth-child(2) {
    top: 40%;
    right: -150px;
}

.floating-element:nth-child(3) {
    bottom: -150px;
    left: 40%;
}

.service-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.service-image {
    position: relative;
    height: 250px;
    overflow: hidden;
    background: rgba(var(--brand-primary-rgb), 0.1);
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.01);
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.service-card:hover .service-image img {
    transform: scale(1.1);
}

.service-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.6));
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-card:hover .service-overlay {
    opacity: 1;
}

.service-icon {
    color: white;
    font-size: 2.5rem;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon {
    transform: translateY(0);
}

.service-content {
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.service-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.service-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.service-card-horizontal {
    display: flex;
    flex-direction: row;
}

.service-card-horizontal .service-image {
    width: 40%;
    height: auto;
}

.service-card-horizontal .service-content {
    width: 60%;
}

@media (max-width: 768px) {
    .service-card-horizontal {
        flex-direction: column;
    }

    .service-card-horizontal .service-image,
    .service-card-horizontal .service-content {
        width: 100%;
    }

    .service-card-horizontal .service-image {
        height: 250px;
    }
}

.service-image img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-image img[loading="lazy"].loaded {
    opacity: 1;
}

/* Call to Action */
.cta-wrapper {
    position: relative;
    display: inline-block;
    margin-top: 3rem;
}

.btn-xl {
    padding: 1.25rem 3rem;
    font-size: 1.25rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.btn-gradient-primary {
    background: var(--gradient-primary);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn-gradient-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(var(--brand-primary-rgb), 0.3);
}

.btn-gradient-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.btn-gradient-primary:hover::before {
    transform: translateX(100%);
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .service-card-horizontal .service-image {
        height: 250px;
        border-radius: 20px 20px 0 0;
    }

    .service-title {
        font-size: 1.25rem;
    }

    .service-description {
        font-size: 0.875rem;
    }

    .floating-element {
        width: 200px;
        height: 200px;
    }
}

@media (max-width: 767.98px) {
    .service-image {
        height: 200px;
    }

    .service-content {
        padding: 1.5rem;
    }

    .tech-badge {
        font-size: 0.75rem;
    }

    .btn-xl {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
}

/* About Section */
.about-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.about-feature {
    padding: 1.5rem;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.about-feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Contact Section */
.contact-section {
    background: linear-gradient(135deg, #141447 0%, #0078f0 100%);
    color: #fff;
}

.contact-section .form-control {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.contact-section .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* Fix for modal scrolling */
.modal {
    overflow-y: auto !important;
}

.modal-open {
    overflow: hidden;
    padding-right: 0 !important;
}

/* Fix for AOS animations */
[data-aos] {
    pointer-events: all !important;
}

.aos-animate {
    pointer-events: all !important;
}

/* Responsive Fixes */
@media (max-width: 991.98px) {
    section {
        padding: 60px 0;
    }

    .hero-section {
        min-height: auto;
        padding-top: 120px;
    }
}

@media (max-width: 767.98px) {

    .service-card,
    .about-feature {
        margin-bottom: 30px;
    }

    .section-header {
        margin-bottom: 40px;
    }
}

/* Feature Cards */
.feature-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Portfolio Items */
.portfolio-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
}

.portfolio-item img {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(20, 20, 71, 0.9), transparent);
    padding: var(--spacing-lg);
    color: white;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.portfolio-item:hover .portfolio-overlay {
    transform: translateY(0);
}

/* Enhanced Buttons */
.btn-brand-primary {
    background: var(--gradient-primary);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-brand-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-accent);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.btn-brand-primary:hover::before {
    opacity: 1;
}

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Form Elements */
.form-control {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.form-control:focus {
    border-color: var(--brand-accent-1);
    box-shadow: 0 0 0 0.25rem rgba(var(--brand-accent-1-rgb), 0.25);
    color: white;
}

/* Testimonial Cards */
.testimonial-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.testimonial-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: var(--spacing-md);
    border: 3px solid var(--brand-primary);
}

/* Timeline */
.timeline {
    position: relative;
    padding: var(--spacing-xl) 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: var(--brand-primary);
    transform: translateX(-50%);
}

.timeline-item {
    margin-bottom: var(--spacing-xl);
    position: relative;
}

.timeline-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    position: relative;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
    }

    .timeline::before {
        left: 0;
    }

    .timeline-content {
        margin-left: var(--spacing-lg);
    }
}

@media (max-width: 991.98px) {
    .section-title {
        font-size: 2rem;
    }

    .feature-card,
    .service-card,
    .project-card {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 767.98px) {
    .section-title {
        font-size: 1.75rem;
    }

    .btn-brand-primary {
        width: 100%;
        margin-bottom: 1rem;
    }
}

/* Preloader Styles */
.preloader {
    display: none !important;
}

/* Navbar Glass Effect */
.navbar-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1.2;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 8s ease infinite;
    background-size: 200% 200%;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
}

/* Animated Cards */
.animated-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.animated-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,
            transparent 0%,
            rgba(var(--brand-accent-1-rgb), 0.1) 50%,
            transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animated-card:hover::before {
    transform: translateX(100%);
}

.animated-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Magnetic Buttons */
.btn-magnetic {
    position: relative;
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-magnetic::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
}

.btn-magnetic:hover::before {
    transform: translateX(100%);
    transition: transform 0.6s ease;
}

/* Floating Elements */
.float-element {
    animation: float 6s ease-in-out infinite;
}

/* Text Splitting Animation */
.split-text {
    overflow: hidden;
}

.split-text span {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
}

/* Page Transitions */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--brand-primary);
    z-index: 9999;
    transform: scaleY(0);
    transform-origin: top;
}

/* Scroll Progress */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
    transform-origin: left;
    transform: scaleX(0);
    z-index: 9999;
}

/* Advanced Card Hover Effects */
.hover-card-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.hover-card-3d:hover {
    transform: rotateX(10deg) rotateY(10deg);
}

.hover-card-3d::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mouse-x) var(--mouse-y),
            rgba(255, 255, 255, 0.1) 0%,
            transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.hover-card-3d:hover::after {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .hero-title {
        font-size: 3.5rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }
}

@media (max-width: 767.98px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .animated-card {
        margin-bottom: 2rem;
    }
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Modern Hero Section Styles */
.hero-section {
    position: relative;
    min-height: 100vh;
    background: var(--brand-dark);
    overflow: hidden;
}

/* Dynamic Background */
.hero-background {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-gradient-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(var(--brand-primary-rgb), 0.2),
            rgba(var(--brand-accent-1-rgb), 0.2));
    z-index: 1;
}

.hero-animated-shapes .shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    animation: shapeFloat 20s infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: var(--brand-primary);
    top: -150px;
    right: -150px;
    animation-delay: -5s;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: var(--brand-accent-1);
    bottom: -200px;
    left: -200px;
    animation-delay: -10s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: var(--brand-accent-2);
    top: 50%;
    right: 10%;
    animation-delay: -15s;
}

@keyframes shapeFloat {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(50px, 50px) rotate(90deg);
    }

    50% {
        transform: translate(0, 100px) rotate(180deg);
    }

    75% {
        transform: translate(-50px, 50px) rotate(270deg);
    }
}

/* Animated Badge */
.animated-badge {
    position: relative;
    display: inline-flex;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    overflow: hidden;
}

.badge-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
}

.badge-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    animation: badgeGlow 2s infinite;
}

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

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

/* Dynamic Title */
.hero-title {
    line-height: 1.2;
}

.title-line {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.typed-text::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Interactive CTA Buttons */
.magnetic-button {
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transform: translateZ(0);
    transition: transform 0.3s ease;
}

.button-content {
    position: relative;
    z-index: 1;
}

.button-glow {
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle at center,
            rgba(var(--brand-primary-rgb), 0.5),
            transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.magnetic-button:hover .button-glow {
    opacity: 1;
}

.btn-outline-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    overflow: hidden;
}

.button-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Animated Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
}

.stat-item {
    position: relative;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

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

.stat-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--brand-primary);
}

.stat-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--brand-primary);
    width: 0;
    transition: width 1.5s ease;
}

/* Tech Stack */
.tech-stack {
    margin-top: 3rem;
}

.tech-stack-title {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1rem;
}

.tech-stack-grid {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.tech-item {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tech-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

.tech-item::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 5px;
    font-size: 0.8rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tech-item:hover::before {
    opacity: 1;
}

/* Interactive 3D Visual */
.hero-visual {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scene-container {
    position: relative;
    width: 400px;
    height: 400px;
}

.rotating-sphere {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: sphereRotate 20s linear infinite;
}

.sphere-core {
    width: 100px;
    height: 100px;
    background: var(--brand-primary);
    border-radius: 50%;
    box-shadow: 0 0 50px rgba(var(--brand-primary-rgb), 0.5);
}

.sphere-orbit {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: orbitRotate 10s linear infinite;
}

.orbit-particle {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--brand-accent-1);
    border-radius: 50%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

@keyframes sphereRotate {
    to {
        transform: rotate(360deg);
    }
}

@keyframes orbitRotate {
    to {
        transform: rotate(-360deg);
    }
}

/* Tech Elements */
.tech-elements {
    position: absolute;
    inset: 0;
}

.tech-element {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    animation: elementFloat 5s infinite;
    animation-delay: calc(var(--index) * -1s);
}

@keyframes elementFloat {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, -20px);
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.scroll-indicator:hover {
    opacity: 1;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid white;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    padding-top: 10px;
}

.wheel {
    width: 4px;
    height: 8px;
    background: white;
    border-radius: 2px;
    animation: scrollWheel 1.5s infinite;
}

@keyframes scrollWheel {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(15px);
        opacity: 0;
    }
}

/* Quick Navigation */
.quick-nav {
    position: relative;
    z-index: 10;
    padding: 2rem 0;
    background: linear-gradient(to bottom, var(--brand-dark), transparent);
}

.quick-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.quick-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
}

.quick-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
}

.quick-nav-icon {
    font-size: 1.5rem;
    color: var(--brand-primary);
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .scene-container {
        width: 300px;
        height: 300px;
    }

    .tech-elements {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .hero-title {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .quick-nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Logo Styles */
.logo {
    max-width: 100%;
    /* يجعل الشعار يتناسب مع عرض الحاوية */
    height: auto;
    /* يحافظ على نسبة الطول إلى العرض */
}

/* ضبط حجم الهيدر */
.navbar {
    height: 80px;
    /* يمكنك ضبط الارتفاع حسب الحاجة */
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ضبط الشعار */
.navbar .logo {
    position: absolute;
    top: 50%;
    left: 10px;
    /* يمكنك ضبط المسافة من اليسار */
    transform: translateY(-50%);
    max-height: 150px;
    /* يحدد أقصى ارتفاع للشعار */
    width: auto;
    /* يحافظ على التناسب */
}

/* تجاوب مع الأجهزة المحمولة */
@media (max-width: 768px) {
    .navbar {
        height: 70px;
        /* تقليل ارتفاع الهيدر للهواتف */
    }

    .navbar .logo {
        max-height: 140px;
        /* تقليل حجم الشعار للهواتف */
        right: 7px;
        /* تقليل المسافة من اليسار */
    }
}

/* Enhanced Brand Design System */
:root {
    /* Brand Colors */
    --brand-primary: #D84315;
    --brand-secondary: #37474F;
    --brand-accent-1: #FFD600;
    --brand-accent-2: #43A047;
    --brand-accent-3: #fff3e0;

    /* RGB Values for Opacity */
    --brand-primary-rgb: 211, 47, 47;
    --brand-secondary-rgb: 255, 152, 0;
    --brand-accent-1-rgb: 255, 214, 0;
    --brand-accent-2-rgb: 255, 112, 67;
    --brand-accent-3-rgb: 255, 243, 224;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    --gradient-accent: linear-gradient(135deg, var(--brand-accent-1) 0%, var(--brand-accent-2) 100%);
    --gradient-overlay: linear-gradient(180deg, rgba(var(--brand-primary-rgb), 0.9) 0%, rgba(var(--brand-primary-rgb), 0.7) 100%);

    /* Semantic Colors */
    --text-primary: var(--brand-primary);
    --text-secondary: #4a4a4a;
    --background-light: #f8f9fa;
    --border-color: rgba(20, 20, 71, 0.1);

    /* Typography */
    --font-primary: 'Cairo', 'IBM Plex Sans Arabic', sans-serif;
    --font-secondary: 'IBM Plex Sans Arabic', 'Cairo', sans-serif;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(20, 20, 71, 0.1);
    --shadow-md: 0 4px 8px rgba(20, 20, 71, 0.1);
    --shadow-lg: 0 8px 16px rgba(20, 20, 71, 0.1);
    --shadow-xl: 0 16px 32px rgba(20, 20, 71, 0.1);
}

/* Enhanced Accessibility & UX Variables */
:root {
    /* Color Contrast Ratios Following WCAG 2.1 Guidelines */
    --text-high-contrast: rgba(255, 255, 255, 0.95);
    --text-medium-contrast: rgba(255, 255, 255, 0.87);
    --text-low-contrast: rgba(255, 255, 255, 0.6);

    /* Focus States */
    --focus-ring-color: var(--brand-primary);
    --focus-ring-width: 3px;

    /* Animation Timing */
    --transition-fast: 200ms;
    --transition-medium: 300ms;
    --transition-slow: 500ms;

    /* Spacing Scale */
    --space-unit: 0.25rem;
    --space-xs: calc(var(--space-unit) * 2);
    --space-sm: calc(var(--space-unit) * 4);
    --space-md: calc(var(--space-unit) * 6);
    --space-lg: calc(var(--space-unit) * 8);
    --space-xl: calc(var(--space-unit) * 12);

    /* Motion Safe Preferences */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
            scroll-behavior: auto !important;
        }
    }
}

/* Global Styles */
body {
    font-family: var(--font-primary);
    color: var(--text-primary);
    line-height: 1.6;
    background-color: #f8f9fa;
    opacity: 1 !important;
    visibility: visible !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Typography Enhancements */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

.display-1,
.display-2,
.display-3,
.display-4 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Enhanced Focus States */
*:focus-visible {
    outline: var(--focus-ring-width) solid var(--focus-ring-color);
    outline-offset: 2px;
}

/* Smooth Scrolling with Motion Safe Check */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Enhanced Button States */
.btn {
    position: relative;
    transition: transform var(--transition-medium) ease,
        box-shadow var(--transition-medium) ease;
    will-change: transform;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right,
            rgba(var(--brand-primary-rgb), 0.2),
            rgba(var(--brand-accent-1-rgb), 0.2));
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--transition-medium) ease;
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: translateY(2px);
}

/* Enhanced Card Interactions */
.card {
    transition: transform var(--transition-medium) cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow var(--transition-medium) ease;
    will-change: transform, box-shadow;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Enhanced Section Transitions */
.section-transition {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slow) ease,
        transform var(--transition-slow) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.section-transition.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Basic scroll behavior */
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    width: 100%;
}

html,
body {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

section {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Navbar Glass Effect */
.navbar-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* تحجيم الهيدر */
.navbar {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* الشعار داخل التدفق الطبيعي (بدلاً من absolute) */
.navbar .logo {
    max-height: 50px;
    width: auto;
    /* يحافظ على التناسب */
}

/* تفعيل تحسين واجهة المستخدم للروابط في الـ Navbar */
.navbar-nav .nav-link {
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    transition: color var(--transition-medium) ease;
}

.navbar-nav .nav-link:hover {
    color: var(--brand-secondary);
    text-decoration: underline;
}

/* تمييز الزر */
.nav-cta .btn {
    margin-right: 1rem;
    /* يمكنك ضبط الهوامش حسب الحاجة */
    box-shadow: var(--shadow-sm);
}

/* زر الاستشارة المجانية بتدرج ملون */
.btn-brand-primary {
    background: var(--gradient-primary);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-brand-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-accent);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.btn-brand-primary:hover::before {
    opacity: 1;
}

/* تخفيف ارتفاع الهيدر على الشاشات الصغيرة */
@media (max-width: 768px) {
    .navbar {
        height: 70px;
    }

    .navbar .logo {
        max-height: 40px;
    }
}

/* يمكنك الإبقاء على بقية الأكواد دون تغيير كبير، مع تحسينات على قابلية الاستخدام */
.services-section {
    position: relative;
    overflow: hidden;
    background: linear-gradient(to bottom, rgba(var(--brand-primary-rgb), 0.05), rgba(var(--brand-primary-rgb), 0.02));
}

/* ... بقية الأكواد كما لديك تمامًا ... */

/* في حال أردت الإبقاء على التحسينات التي أضفتها في الأسفل يمكنك نسخها كما هي */
/* ... بقية الأكواد (Animations, Hero Sections, Cards, إلخ) ... */