:root {
    /* Colors - Premium Tech Palette */
    --primary-color: #0f172a;
    /* Deep Navy */
    --secondary-color: #3b82f6;
    /* Electric Blue */
    --accent-color: #06b6d4;
    /* Cyan */
    --text-color: #334155;
    /* Slate 700 */
    --bg-color: #f8fafc;
    /* Slate 50 */
    --white: #ffffff;
    --light-gray: #e2e8f0;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --gradient-accent: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);

    /* Typography */
    --font-main: 'Cairo', sans-serif;
    --h1-size: 3.5rem;
    --h2-size: 2.5rem;
    --h3-size: 1.75rem;
    --body-size: 1rem;

    /* Spacing */
    --container-width: 1200px;
    --section-padding-block: 5rem;
    --section-padding-inline: 2rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

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

/* Utilities */
.container {
    max-width: var(--container-width);
    margin-inline: auto;
    margin-block: 0;
    padding-inline: 1rem;
    padding-block: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-block: 0.875rem;
    padding-inline: 2rem;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.1);
}

.btn-outline {
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    background: transparent;
}

.btn-outline:hover {
    background: var(--secondary-color);
    color: var(--white);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.section-title {
    text-align: center;
    font-size: var(--h2-size);
    color: var(--primary-color);
    margin-block-end: 4rem;
    position: relative;
    font-weight: 800;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 6px;
    background: var(--gradient-accent);
    margin-block-start: 1.5rem;
    margin-inline: auto;
    margin-block-end: 0;
    border-radius: 3px;
}

/* Navbar */
.navbar {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--secondary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    color: var(--primary-color);
}

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

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding-block: 4rem 2rem;
    padding-inline: 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-block-end: 3rem;
}

.footer-col h3 {
    margin-block-end: 1.5rem;
    color: var(--accent-color);
}

.footer-links li {
    margin-block-end: 0.75rem;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.copyright {
    text-align: center;
    padding-block-start: 2rem;
    border-block-start: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* TODO: Implement mobile menu JS */
        position: absolute;
        top: 80px;
        inset-inline-start: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 2rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }

    :root {
        --h1-size: 2.5rem;
        --h2-size: 2rem;
    }
}

/* Hero Section */
.hero {
    padding-block: 160px 100px;
    padding-inline: 0;
    background: linear-gradient(to bottom, #f8fafc, #e2e8f0);
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: var(--h1-size);
    line-height: 1.1;
    margin-block-end: 1.5rem;
    color: var(--primary-color);
    font-weight: 800;
}

.hero-text p {
    font-size: 1.25rem;
    color: #64748b;
    margin-block-end: 2.5rem;
    max-width: 500px;
    margin-inline: auto;
}

.hero-btns {
    display: flex;
    gap: 1rem;
}

.hero-image {
    flex: 1;
    position: relative;
}

.hero-image img {
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

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

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

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

.service-card {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f1f5f9;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--secondary-color);
}

.service-card .icon {
    font-size: 3rem;
    margin-block-end: 1.5rem;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-block-end: 1rem;
    color: var(--primary-color);
}

.service-card p {
    color: #64748b;
    margin-block-end: 1.5rem;
}

.learn-more {
    color: var(--secondary-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.learn-more:hover {
    gap: 0.75rem;
}

/* Why Us */
.why-us {
    background-color: var(--white);
}

.why-us-content {
    display: flex;
    gap: 4rem;
    align-items: center;
}

.why-text {
    flex: 1;
}

.feature-list li {
    margin-block-end: 2rem;
}

.feature-list strong {
    display: block;
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-block-end: 0.5rem;
}

.why-stats {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.stat-item {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.stat-item .number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin-block-end: 0.5rem;
}

.stat-item .label {
    color: #64748b;
    font-weight: 500;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color), #1e293b);
    color: white;
    text-align: center;
    padding-block: 6rem;
    padding-inline: 1rem;
}

.cta-section h2 {
    color: white;
    font-size: 2.5rem;
    margin-block-end: 1.5rem;
}

.cta-section p {
    font-size: 1.25rem;
    color: #cbd5e1;
    margin-block-end: 2.5rem;
    max-width: 600px;
    margin-inline: auto;
}

/* Responsive Home */
@media (max-width: 968px) {
    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        padding-block-start: 2rem;
    }

    .hero-text p {
        margin-inline: auto;
    }

    .hero-btns {
        justify-content: center;
    }

    .why-us-content {
        flex-direction: column;
    }
}

/* Inner Pages Header */
.page-header {
    background-color: var(--primary-color);
    color: white;
    padding-block: 160px 80px;
    padding-inline: 0;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    margin-block-end: 1rem;
}

.page-header p {
    font-size: 1.25rem;
    color: #cbd5e1;
    max-width: 600px;
    margin-inline: auto;
    margin-block: 0;
}

/* Services Page */
.service-detail {
    padding-block: 6rem;
    padding-inline: 0;
    display: flex;
    align-items: center;
    gap: 4rem;
    border-block-end: 1px solid #e2e8f0;
}

.service-detail:last-child {
    border-block-end: none;
}

.service-detail.reverse {
    flex-direction: row-reverse;
}

.service-content {
    flex: 1;
}

.service-content h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-block-end: 1.5rem;
}

.service-features {
    margin-block-start: 2rem;
}

.service-features li {
    margin-block-end: 0.75rem;
    padding-inline-start: 1.5rem;
    position: relative;
}

/* RTL Specific for Checkmark */
[dir="rtl"] .service-features li::before {
    inset-inline-end: 0;
    inset-inline-start: auto;
}

[dir="ltr"] .service-features li::before {
    inset-inline-start: 0;
    inset-inline-end: auto;
}

.service-features li::before {
    content: '✓';
    color: var(--secondary-color);
    position: absolute;
    font-weight: bold;
}

.service-image {
    flex: 1;
}

.service-image img {
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Portfolio Page */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 3rem;
}

.project-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-image img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.project-info {
    padding: 2rem;
}

.project-info h3 {
    font-size: 1.5rem;
    margin-block-end: 0.5rem;
    color: var(--primary-color);
}

.project-info .category {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    margin-block-end: 1rem;
}

.btn-text {
    color: var(--primary-color);
    font-weight: 600;
    margin-block-start: 1rem;
    display: inline-block;
}

.btn-text:hover {
    color: var(--secondary-color);
}

/* About Page */
.about-grid {
    display: flex;
    gap: 4rem;
    align-items: center;
    margin-block-end: 4rem;
}

.about-text {
    flex: 1;
}

.about-image {
    flex: 1;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-block-start: 3rem;
}

.team-member {
    text-align: center;
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.team-member img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-inline: auto;
    margin-block: 0 1.5rem;
    object-fit: cover;
    border: 4px solid #f1f5f9;
}

.team-member h3 {
    margin-block-end: 0.5rem;
    color: var(--primary-color);
}

.team-member p {
    color: var(--secondary-color);
    font-weight: 500;
}

/* Contact Page */
.contact-wrapper {
    display: flex;
    gap: 4rem;
}

.contact-info {
    flex: 1;
}

.contact-form-container {
    flex: 1;
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.info-item {
    display: flex;
    gap: 1.5rem;
    margin-block-end: 2rem;
}

.info-item .icon {
    font-size: 1.5rem;
    background: #eff6ff;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.info-item h3 {
    font-size: 1.1rem;
    margin-block-end: 0.25rem;
    color: var(--primary-color);
}

.map-placeholder img {
    border-radius: 12px;
    margin-block-start: 2rem;
}

.form-group {
    margin-block-end: 1.5rem;
}

.form-group label {
    display: block;
    margin-block-end: 0.5rem;
    font-weight: 500;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Responsive Inner Pages */
@media (max-width: 968px) {

    .service-detail,
    .service-detail.reverse,
    .about-grid,
    .contact-wrapper {
        flex-direction: column;
    }

    .service-image,
    .about-image {
        order: -1;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

/* RTL Overrides */
[dir="rtl"] .learn-more .arrow {
    transform: rotate(180deg);
}

[dir="rtl"] .section-title {
    /* text-align: center is fine */
}

[dir="rtl"] .why-text .section-title,
[dir="rtl"] .about-text .section-title {
    text-align: right !important;
    margin-inline-end: 0 !important;
    margin-inline-start: auto !important;
}

[dir="rtl"] .section-title::after {
    /* Center alignment is default, if specific alignment needed: */
}

[dir="rtl"] .why-text .section-title::after,
[dir="rtl"] .about-text .section-title::after {
    margin-inline-end: 0;
    margin-inline-start: auto;
}

[dir="rtl"] .contact-info {
    text-align: right;
}

[dir="rtl"] .form-group label {
    text-align: right;
}