:root {
    --ember-pink: #FF6FA3;
    --ember-purple: #8A5CF6;
    --ember-blue: #5B8CFF;
    --ember-bg: #0F0F12;
    --ember-white: #FFFFFF;
    
    --bg-primary: #0F0F12;
    --bg-secondary: #1A1A1F;
    --bg-tertiary: #252530;
    --text-primary: #FFFFFF;
    --text-secondary: #B8B8C0;
    --text-muted: #888892;
    
    --gradient-primary: linear-gradient(135deg, var(--ember-pink), var(--ember-purple));
    --gradient-secondary: linear-gradient(135deg, var(--ember-purple), var(--ember-blue));
    --gradient-hero: linear-gradient(135deg, rgba(255, 111, 163, 0.1), rgba(138, 92, 246, 0.1), rgba(91, 140, 255, 0.1));
    --hero-grid-color: rgba(255,255,255,0.04);
    --hero-grid-color-light: rgba(0,0,0,0.12);
    --hero-grid-size: 40px;
    --hero-grid-opacity: 0.9;
    
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    
    --border-radius-sm: 0.5rem;
    --border-radius-md: 1rem;
    --border-radius-lg: 1.5rem;
    
    --transition-speed: 0.3s;
    --header-height: 80px;
}

[data-theme="light"] {
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F7;
    --bg-tertiary: #E8E8ED;
    --text-primary: #0F0F12;
    --text-secondary: #4A4A52;
    --text-muted: #6E6E78;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    overflow-x: hidden;
}


.container {
    max-width: 1200px;
    margin: 0 auto;
    
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(15, 15, 18, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
    height: var(--header-height);
    max-width: 100%;
}

[data-theme="light"] .header {
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    gap: var(--spacing-md);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Logo image sizing */
.logo-img {
    height: 40px;
    width: auto;
    display: block;
}

@media (max-width: 768px) {
    .logo-img {
        height: 34px;
    }
}

.nav-list {
    
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-speed);
    padding: var(--spacing-xs) 0;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.contact-info {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition-speed);
}

.contact-link:hover {
    color: var(--ember-pink);
}

.contact-text {
    white-space: nowrap;
}

.theme-toggle,
.lang-toggle {
    background: var(--bg-secondary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed);
    color: var(--text-primary);
}

.theme-toggle:hover,
.lang-toggle:hover {
    background: var(--bg-tertiary);
    transform: scale(1.05);
}

.lang-toggle {
    width: auto;
    padding: 0 var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

[data-theme="light"] .sun-icon {
    display: block;
}

[data-theme="light"] .moon-icon {
    display: none;
}

.mobile-menu-toggle {
    display: none;
    position: relative;
    width: 44px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transform-origin: center;
    transition: transform 260ms cubic-bezier(.2,.9,.3,1), opacity 200ms ease, background 200ms ease;
}

.mobile-menu-toggle span:nth-child(1) { transform: translate(-50%, -8px); }
.mobile-menu-toggle span:nth-child(2) { transform: translate(-50%, 0); }
.mobile-menu-toggle span:nth-child(3) { transform: translate(-50%, 8px); }

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translate(-50%, 0) rotate(45deg);
}
.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle.active span:nth-child(3) {
    transform: translate(-50%, 0) rotate(-45deg);
}

.mobile-menu-toggle:focus { outline: 2px solid rgba(0,188,212,0.25); outline-offset: 2px; border-radius: 6px; }

main {
    margin-top: var(--header-height);
}


.hero {
    display: flex;
    min-height: 90vh;
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
}
.hero-content {
    max-width: 800px;
    padding: 0 var(--spacing-md);
    position: relative;
    z-index: 1;
}
.hero-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-primary);
}
/* Improve vertical spacing and avoid clipping on large headings */
/* Slightly taller line-height to prevent glyph clipping in large headings */
.hero-title { line-height: 1.12; }

/* Keep prefix spans vertically centered without changing the typing behaviour */
.hero-title span { display: inline-flex; align-items: center; }

/* The typing element must remain inline-block so overflow:hidden works for the typing animation */
.hero-title .typing { display: inline-block; vertical-align: middle; line-height: 1.12; padding: 5px; box-sizing: content-box; -webkit-font-smoothing:antialiased; }

/* Slight, smaller nudge for Arabic prefix if needed */
.hero-title .prefix.ar { transform: translateY(0.03em); }
.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 25px;
    color: var(--text-secondary);
}
.hero-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}  
.left-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 50%;
}
.right-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 50%;
    position: relative;
    z-index: 1;
}

/* subtle grid overlay for hero (pure CSS) */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: var(--hero-grid-opacity);
    background-image:
        repeating-linear-gradient(to right, var(--hero-grid-color) 0px, var(--hero-grid-color) 1px, transparent 1px, transparent var(--hero-grid-size)),
        repeating-linear-gradient(to bottom, var(--hero-grid-color) 0px, var(--hero-grid-color) 1px, transparent 1px, transparent var(--hero-grid-size));
    background-size: var(--hero-grid-size) var(--hero-grid-size), var(--hero-grid-size) var(--hero-grid-size);
    mix-blend-mode: overlay;
}

/* light theme variant */
[data-theme="light"] .hero::before {
    background-image:
        repeating-linear-gradient(to right, rgba(0,0,0,0.18) 0px, rgba(0,0,0,0.18) 1px, transparent 1px, transparent var(--hero-grid-size)),
        repeating-linear-gradient(to bottom, rgba(0,0,0,0.18) 0px, rgba(0,0,0,0.18) 1px, transparent 1px, transparent var(--hero-grid-size));
    opacity: 0.95;
}

/* Support pages that use a separate hero wrapper `.hero-background` */
.hero-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.hero-background::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: var(--hero-grid-opacity);
    background-image:
        repeating-linear-gradient(to right, var(--hero-grid-color) 0px, var(--hero-grid-color) 1px, transparent 1px, transparent var(--hero-grid-size)),
        repeating-linear-gradient(to bottom, var(--hero-grid-color) 0px, var(--hero-grid-color) 1px, transparent 1px, transparent var(--hero-grid-size));
    background-size: var(--hero-grid-size) var(--hero-grid-size), var(--hero-grid-size) var(--hero-grid-size);
    mix-blend-mode: overlay;
}

/* light theme variant for hero-background */
[data-theme="light"] .hero-background::before {
    background-image:
        repeating-linear-gradient(to right, rgba(0,0,0,0.18) 0px, rgba(0,0,0,0.18) 1px, transparent 1px, transparent var(--hero-grid-size)),
        repeating-linear-gradient(to bottom, rgba(0,0,0,0.18) 0px, rgba(0,0,0,0.18) 1px, transparent 1px, transparent var(--hero-grid-size));
    opacity: 0.95;
}

@media (prefers-reduced-motion: reduce) {
    .hero-background::before {
        background-position: 0 0;
        transition: none;
    }
}

/* On very small screens keep a subtler, sparser grid rather than hiding completely */
@media (max-width: 480px) {
    :root { --hero-grid-size: 56px; }
    .hero::before,
    .hero-background::before {
        opacity: 0.18; /* much lighter */
        background-size: var(--hero-grid-size) var(--hero-grid-size), var(--hero-grid-size) var(--hero-grid-size);
        mix-blend-mode: multiply;
        pointer-events: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero::before {
        background-position: 0 0;
        transition: none;
    }
}
.right-section img {
    max-width: 100%;
    height: auto;
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--border-radius-md);
    transition: all var(--transition-speed);
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--ember-white);
    box-shadow: 0 4px 15px rgba(255, 111, 163, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 111, 163, 0.4);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--ember-purple);
}

.btn-outline:hover {
    background: var(--ember-purple);
    color: var(--ember-white);
}

.section {
    padding: var(--spacing-xl) 0;
}

/* Reveal on scroll defaults */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    will-change: opacity, transform;
}

.reveal.active,
.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin: 10px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.feature-card {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    transition: all var(--transition-speed);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-md);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    color: var(--ember-white);
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.feature-description {
    color: var(--text-secondary);
    line-height: 1.7;
}

.section-cta {
    text-align: center;
    margin-top: var(--spacing-lg);
}

.footer {
    background: var(--bg-secondary);
    padding: 20px 20px;
    margin-top: var(--spacing-xl);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-logo {
    margin-bottom: var(--spacing-sm);
}

.footer-description {
    color: var(--text-secondary);
    line-height: 1.7;
}

.footer-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.footer-links,
.footer-contact {
    list-style: none;
}

.footer-links li,
.footer-contact li {
    margin-bottom: var(--spacing-xs);
}

.footer-links a,
.footer-contact a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.footer-links a:hover,
.footer-contact a:hover {
    color: var(--ember-pink);
}

.social-links {
    display: flex;
    gap: var(--spacing-sm);
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all var(--transition-speed);
}

.social-links a:hover {
    background: var(--gradient-primary);
    color: var(--ember-white);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--bg-tertiary);
    color: var(--text-muted);
}

@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-primary);
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-speed);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .nav.active {
        max-height: 400px;
    }
    
    .nav-list {
        flex-direction: column;
        padding: var(--spacing-md);
        gap: 0;
    }
    
    .nav-list li {
        width: 100%;
        border-bottom: 1px solid var(--bg-tertiary);
    }

    .mobile-menu-toggle:hover span,
    .mobile-menu-toggle:focus span { background: var(--ember-pink); }
    
    .nav-link {
        display: block;
        padding: var(--spacing-sm);
    }
    
    .contact-info {
        display: none;
    }
    
    .header-actions {
        gap: var(--spacing-xs);
    }
    
    .contact-text {
        display: none;
    }
    
    .hero {
        min-height: 80vh;
        display: block;
        
    }
    .hero .left-section{
        margin: auto;
        text-align: center;
    }
    .hero .right-section{
        margin: auto;
        margin-top: var(--spacing-lg);
        max-width: 80%;
    }
    
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
    }
}

/* Responsive improvements for secondary pages */
@media (max-width: 1024px) {
    /* make multi-column grids more compact on large tablets */
    .services-grid,
    .pricing-grid,
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }

    .service-card,
    .pricing-card,
    .testimonial-card {
        padding: calc(var(--spacing-md) * 0.75);
    }

    .page-hero-content,
    .hero-content {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .contact-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .contact-form-container,
    .contact-info-container {
        width: 100%;
    }
}
@media (max-width: 1200px) {
    /* further adjustments for smaller tablets */
    .contact-text {
        display: none;
    }
}
@media (max-width: 768px) {
    /* stack everything on smaller tablets / phones */
    .services-grid,
    .pricing-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .service-card,
    .pricing-card,
    .testimonial-card {
        padding: var(--spacing-md);
    }

    /* Contact form: full-width inputs and stacked layout */
    .contact-grid {
        display: block;
    }

    .contact-form-container,
    .contact-info-container {
        width: 100%;
        margin-bottom: var(--spacing-md);
    }

    .contact-form .form-group {
        margin-bottom: 1rem;
    }

    .contact-form input,
    .contact-form textarea,
    .contact-form select {
        width: 100%;
        box-sizing: border-box;
        padding: 0.8rem;
    }

    /* Reduce hero height and text size for smaller devices */
    .hero {
        min-height: 60vh;
        padding-top: 30px;
    }

    .hero-title {
        font-size: clamp(1.8rem, 7vw, 2.8rem);
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    /* final small-screen tweaks */
    .services-grid,
    .pricing-grid,
    .testimonials-grid {
        gap: calc(var(--spacing-sm) / 2);
    }

    .page-hero-content,
    .hero-content {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .footer-bottom {
        font-size: 0.85rem;
    }

    .header-content {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        gap: var(--spacing-xs);
    }
    .left-section {
        max-width: 100%;   
    }
}
