.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    z-index: 10001;
    width: 0;
    transition: width 0.1s;
}

/* Dynamic Color Animation */
@property --primary-color {
  syntax: '<color>';
  initial-value: #6C63FF;
  inherits: true;
}

@keyframes colorShift {
    0% { --primary-color: #6C63FF; } /* Purple */
    25% { --primary-color: #00D2D3; } /* Cyan */
    50% { --primary-color: #FF6B6B; } /* Soft Coral */
    75% { --primary-color: #4831D4; } /* Deep Blue */
    100% { --primary-color: #6C63FF; }
}

:root {
  /* Color Palette */
  --primary-color: #6C63FF; /* Modern Purple */
  --secondary-color: #2F2E41; /* Dark Grey/Blue */
  --accent-color: #00D2D3; /* Cyan/Teal for highlights */
  --text-color: #333333;
  --bg-color: #FFFFFF;
  --light-bg: #F9F9FF;
  --glass-bg: rgba(255, 255, 255, 0.9);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);

  /* Typography */
  --font-main: "Outfit", sans-serif;

  /* Spacing */
  --section-padding: 100px 10%;
  
  /* Cinematic Glows */
  --glow-primary: rgba(108, 99, 255, 0.4);
  --glass-border: rgba(255, 255, 255, 0.1);
  
  animation: colorShift 15s infinite alternate ease-in-out;
}

/* Dynamic Color Grading Animation */
@property --hue-rotate {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes colorCycle {
    0% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(30deg); }
    100% { filter: hue-rotate(0deg); }
}

body {
    animation: colorShift 15s infinite alternate ease-in-out; /* Global color shift */
    transition: filter 0.5s ease;
}

/* Page Blur for Language Transition */
.lang-changing {
    filter: blur(10px);
    pointer-events: none;
}

/* Code Syntax Highlighting */
.code-keyword { color: #ff79c6; font-weight: bold; } /* Pink */
.code-class { color: #f1fa8c; } /* Yellow */
.code-string { color: #50fa7b; } /* Green */
.code-function { color: #8be9fd; } /* Cyan */
.code-property { color: #bd93f9; } /* Purple */
.code-operator { color: #ff79c6; }
.code-comment { color: #6272a4; font-style: italic; }
.code-bracket { color: #f8f8f2; }


* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  border: none;
  outline: none;
  scroll-behavior: smooth;
  font-family: var(--font-main);
}

body {
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
    position: relative;
    cursor: none; /* Hide default cursor */
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; 
    background: radial-gradient(#ffffff, #e6e6ff); 
}

/* --- Custom Cursor --- */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid var(--primary-color);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

body:hover .cursor-outline {
    opacity: 1;
}

/* Hover Enlarge Effect */
body.hovering .cursor-outline {
    width: 70px;
    height: 70px;
    background-color: rgba(108, 99, 255, 0.1);
    border-color: transparent;
}

/* Header & Navbar */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 10%;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.logo {
  font-size: 2rem;
  font-weight: 700;
  color: var(--secondary-color);
  cursor: pointer;
}

.logo .dot {
  color: var(--primary-color);
}

.nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
  align-items: center;
}

.nav-links li a {
  font-size: 1.1rem;
  color: var(--secondary-color);
  font-weight: 500;
  transition: 0.3s;
}

.nav-links li a:hover,
.nav-links li a.active {
  color: var(--primary-color);
}

.hamburger {
  display: none;
  font-size: 1.5rem;
  color: var(--secondary-color);
  cursor: pointer;
  z-index: 1001;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  padding: 12px 28px;
  background: var(--primary-color);
  color: #fff !important;
  border-radius: 5px;
  font-weight: 600;
  transition: 0.3s ease;
  box-shadow: 0 5px 15px rgba(108, 99, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(108, 99, 255, 0.4);
}

.btn-secondary {
  display: inline-block;
  padding: 12px 28px;
  background: transparent;
  color: var(--secondary-color);
  border: 2px solid var(--secondary-color);
  border-radius: 5px;
  font-weight: 600;
  transition: 0.3s ease;
  margin-left: 15px;
}

.btn-secondary:hover {
  background: var(--secondary-color);
  color: #fff;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  padding: var(--section-padding);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--light-bg);
}

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

.greeting {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 10px;
  display: block;
}

.hero-title {
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--secondary-color);
  margin-bottom: 15px;
}

.hero-subtitle {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 20px;
}

.hero-subtitle .typing-text {
  color: var(--primary-color);
  border-right: 2px solid var(--primary-color);
  padding-right: 5px;
  animation: blink 0.7s infinite;
}

@keyframes blink {
  0%, 100% { border-color: transparent; }
  50% { border-color: var(--primary-color); }
}

.hero-description {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 30px;
  line-height: 1.6;
}

/* Code Visual in Hero */
.hero-visual {
  position: relative;
  width: 450px;
  height: 350px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.code-block {
  width: 100%;
  background: #1e1e1e;
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: perspective(1000px) rotateY(-10deg) rotateX(5deg);
  transition: transform 0.5s ease;
}

.code-block:hover {
  transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.code-header {
  background: #2d2d2d;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-dots {
  display: flex;
  gap: 8px;
}

.lang-switcher {
    display: flex;
    gap: 10px;
}

.lang-tab {
    font-size: 0.7rem;
    font-weight: 700;
    color: #666;
    cursor: pointer;
    transition: 0.3s;
    padding: 2px 5px;
    border-radius: 3px;
    border: 1px solid transparent;
}

.lang-tab:hover {
    color: #fff;
}

.lang-tab.active {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.code-header .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.code-header .red {
  background: #ff5f56;
}
.code-header .yellow {
  background: #ffbd2e;
}
.code-header .green {
  background: #27c93f;
}

.code-body {
  padding: 20px;
  color: #d4d4d4;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 1rem;
}

.code-body pre {
  white-space: pre-wrap;
}


/* General Section Styling */
.section {
    padding: var(--section-padding);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 60px;
    color: var(--secondary-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.light-bg {
    background: var(--light-bg);
}

/* About Section */
.about-container {
    display: flex;
    align-items: center;
    gap: 50px;
}

.about-img {
    flex: 1;
    text-align: center;
}

.about-text {
    flex: 1;
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.about-text p {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 30px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.skill-item {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-item i {
    color: var(--primary-color);
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: #fff;
    padding: 40px 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: 0.3s;
}

.service-card:hover {
    transform: translateY(-10px);
}

.service-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.service-card p {
    color: #666;
    line-height: 1.6;
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    text-align: center;
}

.stat-item {
    padding: 20px;
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: inline-block;
}

.stat-plus, .stat-percent {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--secondary-color);
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Process Section */
.process-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.process-step {
    padding: 30px;
    background: #fff;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
    transition: 0.3s;
}

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

.step-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    font-size: 1.5rem;
    box-shadow: 0 5px 15px var(--glow-primary);
}

.process-step h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.process-step p {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
}

/* Testimonials Section */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.testimonial-card {
    background: #fff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
    transition: 0.3s;
}

.testimonial-card:hover {
    box-shadow: 0 20px 40px rgba(108, 99, 255, 0.1);
}

.testimonial-content p {
    font-style: italic;
    font-size: 1.1rem;
    color: #555;
    line-height: 1.7;
    margin-bottom: 25px;
    position: relative;
}

.testimonial-content p::before {
    content: '"';
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.1;
    position: absolute;
    top: -20px;
    left: -20px;
}

.testimonial-info h4 {
    font-size: 1.2rem;
    color: var(--secondary-color);
}

.testimonial-info span {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* Portfolio Section */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.portfolio-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    height: 300px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    transition: 0.5s;
}

.portfolio-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 45px rgba(0,0,0,0.2);
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(108, 99, 255, 0.85); /* fallback */
    background: linear-gradient(to bottom, rgba(108, 99, 255, 0.8), rgba(47, 46, 65, 0.9));
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(20px);
    transition: 0.4s ease;
    color: #fff;
}

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

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

.portfolio-overlay h3 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.portfolio-overlay p {
    font-size: 1rem;
    font-weight: 300;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.portfolio-overlay a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background: #fff;
    color: var(--primary-color);
    border-radius: 50%;
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.portfolio-overlay a:hover {
    transform: scale(1.1) rotate(45deg);
    background: var(--accent-color);
    color: #fff;
}

/* Contact Section */
.contact-container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    padding: 60px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255,255,255,0.5);
}

.contact-form .input-group {
    margin-bottom: 20px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--primary-color);
}

.contact-form textarea {
    height: 150px;
    resize: none;
}

.contact-form button {
    width: 100%;
    cursor: pointer;
}

/* Footer */
.footer {
    background: var(--secondary-color);
    color: #fff;
    padding: 50px 10% 20px;
    text-align: center;
}

.footer-content h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.footer-content p {
    font-size: 1rem;
    margin-bottom: 20px;
    color: #ddd;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    line-height: 40px;
    transition: 0.3s;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-5px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    font-size: 0.9rem;
    color: #bbb;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .header {
        padding: 20px 5%;
    }
    .hero {
        padding: 100px 5% 50px;
        flex-direction: column-reverse;
        justify-content: center;
        text-align: center;
        gap: 50px;
    }
    .hero-content {
        max-width: 100%;
    }
    .hero-visual {
        width: 100%;
        max-width: 400px;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        right: 0;
        width: 100%;
        background: var(--glass-bg);
        padding: 20px;
        box-shadow: 0 10px 10px rgba(0,0,0,0.1);
        z-index: 1000;
    }

    .nav-links.nav-active {
        display: flex;
    }
    .hamburger {
        display: block;
    }
    .about-container {
        flex-direction: column;
        text-align: center;
    }
    .skills-grid {
        justify-content: center;
    }
}


/* Motion Blur Reveal Animation */
.blur-reveal {
    opacity: 0;
    filter: blur(20px);
    transform: translateY(50px) scale(0.95);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1); /* Elegant easing */
    will-change: opacity, filter, transform;
}

.blur-reveal.active {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
}

/* Stagger delays for grid items */
.portfolio-item:nth-child(1) { transition-delay: 0.1s; }
.portfolio-item:nth-child(2) { transition-delay: 0.3s; }
.portfolio-item:nth-child(3) { transition-delay: 0.5s; }

.service-card:nth-child(1) { transition-delay: 0.1s; }
.service-card:nth-child(2) { transition-delay: 0.3s; }
.service-card:nth-child(3) { transition-delay: 0.5s; }

/* --- RTL Support --- */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .hero-content,
[dir="rtl"] .about-text,
[dir="rtl"] .contact-form,
[dir="rtl"] .footer-content,
[dir="rtl"] .section-title,
[dir="rtl"] .stats-grid,
[dir="rtl"] .service-card,
[dir="rtl"] .testimonial-content,
[dir="rtl"] .process-step {
    text-align: right;
}

[dir="rtl"] .nav-links {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-links li {
    margin-left: initial;
    margin-right: 30px;
}

[dir="rtl"] .hero-btns {
    justify-content: flex-start;
    flex-direction: row-reverse;
}

[dir="rtl"] .social-links {
    justify-content: flex-end;
}

[dir="rtl"] .contact-info-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .contact-info-item i {
    margin-right: initial;
    margin-left: 15px;
}

[dir="rtl"] .lang-switcher {
    direction: ltr; /* Language codes remain LTR */
}

[dir="rtl"] .code-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .hamburger {
    right: initial;
    left: 20px;
}

@media (max-width: 991px) {
    [dir="rtl"] .nav-links {
        right: initial;
        left: 0;
        text-align: right;
    }
}
