/* === CSS Variables (Dark Theme - Default) === */
/* Triadic palette: Narcissus Gold (Digital), Violet (Dev), Teal (Ops) */
:root,
[data-theme="dark"] {
    --narcissus: #f4c430;
    --narcissus-light: #f7d560;
    --violet: #7c3aed;
    --violet-light: #a78bfa;
    --teal: #0d9488;
    --teal-light: #2dd4bf;
    --green: #10b981;
    --bg-primary: #0a0a0f;
    --bg-secondary: #11111a;
    --bg-card: #181824;
    --bg-card-hover: #1f1f2e;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(124, 58, 237, 0.12);
    --border-hover: rgba(13, 148, 136, 0.3);
    --gradient-main: linear-gradient(135deg, #7c3aed, #0d9488);
    --gradient-accent: linear-gradient(135deg, #0d9488, #f4c430);
    --gradient-brand: linear-gradient(135deg, #7c3aed, #0d9488, #f4c430);
    --gradient-hero: radial-gradient(ellipse at 20% 50%, rgba(124, 58, 237, 0.07) 0%, transparent 50%), radial-gradient(ellipse at 80% 20%, rgba(13, 148, 136, 0.06) 0%, transparent 50%), radial-gradient(ellipse at 50% 80%, rgba(244, 196, 48, 0.04) 0%, transparent 40%), var(--bg-primary);
    --shadow-card: 0 4px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(13, 148, 136, 0.08);
    --shadow-hover: 0 8px 48px rgba(124, 58, 237, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --font-main: 'Inter', sans-serif;
    --font-ar: 'Zain', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Light Theme === */
[data-theme="light"] {
    --bg-primary: #fafbfc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: rgba(124, 58, 237, 0.08);
    --border-hover: rgba(13, 148, 136, 0.2);
    --gradient-hero: radial-gradient(ellipse at 20% 50%, rgba(124, 58, 237, 0.04) 0%, transparent 50%), radial-gradient(ellipse at 80% 20%, rgba(13, 148, 136, 0.04) 0%, transparent 50%), radial-gradient(ellipse at 50% 80%, rgba(244, 196, 48, 0.03) 0%, transparent 40%), var(--bg-primary);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 40px rgba(13, 148, 136, 0.04);
    --shadow-hover: 0 8px 48px rgba(124, 58, 237, 0.06);
}

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

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

body[data-lang="ar"] {
    font-family: var(--font-ar);
}

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

a {
    text-decoration: none;
    color: var(--teal-light);
    transition: var(--transition);
}

a:hover {
    color: var(--teal);
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
    position: relative;
}

.btn-primary {
    background: var(--gradient-main);
    color: #fff;
    box-shadow: 0 4px 20px rgba(13, 148, 136, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(13, 148, 136, 0.35);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border);
    backdrop-filter: blur(4px);
}

.btn-outline:hover {
    border-color: var(--teal);
    color: var(--teal-light);
    box-shadow: 0 0 20px rgba(13, 148, 136, 0.1);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* === Navbar === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 18px 0;
    transition: var(--transition);
    background: transparent;
}

.navbar.scrolled {
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

[data-theme="light"] .navbar.scrolled {
    background: rgba(250, 251, 252, 0.9);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-img {
    height: 38px;
    width: auto;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.logo-text .text-dev {
    color: var(--violet);
}

.logo-text .text-ops {
    color: var(--teal);
}

.logo-text .text-digital {
    color: var(--narcissus);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 36px;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.88rem;
    letter-spacing: 0.3px;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-main);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-ar);
    transition: var(--transition);
}

.lang-toggle:hover {
    border-color: var(--teal);
    color: var(--teal-light);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: var(--transition);
}

.theme-toggle:hover {
    border-color: var(--teal);
    color: var(--teal-light);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
}

/* Logo Banner */
.logo-block {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.logo-banner {
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    line-height: 1.2;
}

.logo-banner-ar {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    font-family: var(--font-ar);
    text-align: center;
    word-spacing: 120%;
    line-height: 1.6;
}

/* === RTL Adjustments === */
[dir="rtl"] .hero-content {
    direction: rtl;
}

[dir="rtl"] .terminal-body {
    direction: ltr;
    text-align: left;
}

[dir="rtl"] .service-card,
[dir="rtl"] .about-content,
[dir="rtl"] .section-header,
[dir="rtl"] .contact-form-wrapper,
[dir="rtl"] .info-card {
    text-align: right;
}

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

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

[dir="rtl"] .nav-links a::after {
    left: auto;
    right: 0;
}

[dir="rtl"] .info-card h4,
[dir="rtl"] .info-card a,
[dir="rtl"] .info-card p {
    margin-left: 0;
    margin-right: 58px;
}

[dir="rtl"] .footer-bottom {
    direction: rtl;
}

/* === Hero === */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background: var(--gradient-hero);
    padding: 120px 0 80px;
    overflow: hidden;
}

.hero-bg-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: var(--teal);
    top: -150px;
    right: -100px;
    opacity: 0.07;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: var(--violet);
    bottom: -100px;
    left: -100px;
    opacity: 0.06;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: var(--narcissus);
    top: 40%;
    left: 40%;
    opacity: 0.04;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    background: rgba(13, 148, 136, 0.08);
    border: 1px solid rgba(13, 148, 136, 0.2);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--teal-light);
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.gradient-text {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 36px;
    max-width: 520px;
    line-height: 1.8;
}

.hero-cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Terminal Window */
.terminal-window {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    background: rgba(18, 18, 26, 0.6);
    border-bottom: 1px solid var(--border);
}

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

.dot.red { background: #ef4444; }
.dot.yellow { background: #eab308; }
.dot.green { background: #22c55e; }

.terminal-title {
    margin-left: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.terminal-body {
    padding: 24px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.84rem;
    line-height: 2.1;
}

.terminal-body .prompt {
    color: var(--teal);
}

.terminal-body .cmd {
    color: var(--violet-light);
}

.terminal-body .output {
    color: var(--green);
    padding-left: 16px;
}

[data-theme="light"] .terminal-window {
    background: #0f172a;
    border-color: rgba(139, 92, 246, 0.2);
}

[data-theme="light"] .terminal-header {
    background: #1e293b;
    border-bottom-color: #334155;
}

[data-theme="light"] .terminal-body {
    color: #e2e8f0;
}

[data-theme="light"] .terminal-body .cursor {
    color: #e2e8f0;
}

.terminal-body .cursor {
    animation: blink 1s infinite;
    color: var(--teal);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* === Services === */
.services {
    padding: 120px 0;
    background: var(--bg-secondary);
    position: relative;
}

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

.section-badge {
    display: inline-block;
    background: rgba(13, 148, 136, 0.06);
    border: 1px solid rgba(13, 148, 136, 0.15);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--teal);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 2.6rem;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: -0.5px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.7;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-main);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

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

.service-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-main);
    border-radius: 12px;
    margin-bottom: 22px;
    font-size: 1.2rem;
    color: #fff;
}

.service-card h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.service-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* === About === */
.about {
    padding: 120px 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-content .section-badge {
    margin-bottom: 16px;
}

.about-content h2 {
    font-size: 2.4rem;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.about-content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 0.95rem;
    line-height: 1.8;
}

.about-stats {
    display: flex;
    gap: 24px;
    margin-top: 32px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 148, 136, 0.08);
    border: 1px solid rgba(13, 148, 136, 0.12);
    border-radius: 10px;
    color: var(--teal);
    font-size: 0.9rem;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Tech Stack */
.tech-stack {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.tech-item:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.tech-item i {
    font-size: 1.4rem;
    color: var(--teal);
}

.tech-item span {
    font-weight: 500;
    font-size: 0.88rem;
}

/* === Contact === */
.contact {
    padding: 120px 0;
    background: var(--bg-secondary);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
}

.contact-form-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 44px;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-status {
    margin-top: 16px;
    padding: 12px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.9rem;
    display: none;
}

.form-status.success {
    display: block;
    background: rgba(16, 185, 129, 0.1);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.form-status.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Contact Info */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    transition: var(--transition);
}

.info-card:hover {
    border-color: var(--border-hover);
}

.info-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-main);
    border-radius: 12px;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}

.info-card h4 {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    margin-left: 60px;
    margin-top: -24px;
    margin-bottom: 4px;
}

.info-card a,
.info-card p {
    margin-left: 60px;
    display: block;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.social-link {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: var(--transition);
}

.social-link:hover {
    border-color: var(--teal);
    color: var(--teal-light);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

/* === Footer === */
.footer {
    padding: 48px 0 28px;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo {
    height: 30px;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 42px;
}

.footer-links {
    display: flex;
    gap: 28px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.footer-copyright {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.fc-en {
    font-weight: 600;
    direction: ltr;
}

.fc-ar {
    font-family: var(--font-ar);
    font-weight: 700;
    direction: rtl;
}

.fc-divider {
    color: var(--narcissus);
    font-weight: 300;
}

.fc-dot {
    color: var(--teal);
    margin: 0 4px;
}

.footer-rights,
.footer-location {
    font-size: 0.74rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}


/* === Responsive === */
@media (max-width: 992px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .hero h1 {
        font-size: 2.6rem;
    }
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 24px;
        gap: 16px;
        border-bottom: 1px solid var(--border);
        backdrop-filter: blur(20px);
    }
    .nav-links.active {
        display: flex;
    }
    .nav-toggle {
        display: block;
    }
    .hero {
        padding: 100px 0 60px;
    }
    .hero h1 {
        font-size: 2.2rem;
        letter-spacing: -0.5px;
    }
    .services-grid {
        grid-template-columns: 1fr;
    }
    .about-stats {
        flex-direction: column;
    }
    .tech-stack {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero-cta {
        flex-direction: column;
    }
    .btn {
        text-align: center;
        justify-content: center;
    }
    .footer-content {
        flex-direction: column;
        gap: 16px;
    }
    .section-header h2 {
        font-size: 2rem;
    }
    .about-content h2 {
        font-size: 1.8rem;
    }
}
