/* ==========================================================
   Wahaj v4 — Clean, professional SaaS design
   ========================================================== */

:root {
    --white: #FFFFFF;
    --bg: #FFFFFF;
    --surface: #F8FAFC;
    --surface-2: #F1F5F9;
    --ink: #0F172A;
    --ink-2: #1E293B;
    --text: #334155;
    --muted: #64748B;
    --muted-2: #94A3B8;
    --line: #E2E8F0;
    --line-2: #CBD5E1;

    --primary: #0F766E;
    --primary-hover: #0D5F58;
    --primary-soft: #ECFDF5;
    --accent: #F97316;

    --font: "Cairo", "IBM Plex Sans Arabic", "Inter", system-ui, sans-serif;

    --wrap: 1200px;
    --wrap-tight: 1040px;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 24px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.05);
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.09);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
    font-weight: 400;
    overflow-x: hidden;
}

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 1.5rem; }
.wrap.tight { max-width: var(--wrap-tight); }
.wrap.narrow { max-width: 720px; }

/* ============================================================
   TYPOGRAPHY — conservative, readable
   ============================================================ */
h1, h2, h3, h4 {
    margin: 0 0 0.5em;
    color: var(--ink);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.65rem, 3vw, 2.4rem); font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
h3 { font-size: clamp(1.15rem, 1.6vw, 1.3rem); font-weight: 700; line-height: 1.35; }
h4 { font-size: 1rem; font-weight: 700; }

p { margin: 0 0 1em; color: var(--text); line-height: 1.75; }
.lead { font-size: clamp(1.05rem, 1.3vw, 1.15rem); max-width: 60ch; color: var(--muted); line-height: 1.75; font-weight: 400; }

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.nav-in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 1.1rem;
    gap: 1rem;
}
.brand {
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.brand img { height: 30px; width: auto; display: block; }

.nav nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}
.nav nav a {
    color: var(--ink-2);
    font-size: 0.94rem;
    font-weight: 500;
}
.nav nav a:hover { color: var(--primary); }

.nav-cta {
    background: var(--ink);
    color: #fff !important;
    padding: 0.6rem 1.2rem !important;
    border-radius: 999px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    transition: background 0.2s !important;
}
.nav-cta:hover { background: var(--primary) !important; }

.lang {
    color: var(--muted) !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.lang:hover { color: var(--primary) !important; }

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line-2);
    color: var(--ink);
    width: 42px;
    height: 42px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   HERO — clean 2-column
   ============================================================ */
.hero {
    padding-block: clamp(4rem, 8vh, 6rem);
    background: var(--bg);
    position: relative;
    overflow: hidden;
}
.hero-centered {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
    padding-block: 2rem;
}
.hero-centered .hero-badge { margin-inline: auto; margin-bottom: 1.75rem; }
.hero-centered h1 { margin: 0 auto 1.5rem; max-width: 20ch; }
.hero-centered .lead { margin: 0 auto 2.25rem; max-width: 56ch; }
.hero-centered .actions { justify-content: center; }
.hero-meta {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
    flex-wrap: wrap;
    justify-content: center;
}
.hero-meta-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.hero-meta-item strong { color: var(--ink); font-weight: 800; }
.hero-meta .stars { color: #F59E0B; }
.hero-meta-sep { color: var(--line-2); }

/* ============================================================
   TRUST — client logos strip
   ============================================================ */
.trust {
    padding-block: 2.5rem;
    background: var(--surface);
    border-block: 1px solid var(--line);
}
.trust .wrap {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    flex-wrap: wrap;
    justify-content: center;
}
.trust .label {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}
.trust .logos {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}
.trust .logos span {
    color: var(--muted-2);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    font-family: system-ui, sans-serif;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.trust .logos span:hover { opacity: 1; color: var(--ink); }

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
    padding-block: clamp(4rem, 10vh, 6rem);
    position: relative;
}
.section.alt { background: var(--surface); }
.section.dark { background: var(--ink); color: #fff; }
.section.dark h2, .section.dark h3, .section.dark h4 { color: #fff; }
.section.dark p { color: rgba(255,255,255,0.75); }

.section-head {
    text-align: center;
    max-width: 620px;
    margin: 0 auto 3.5rem;
}
.section-head .badge {
    display: inline-block;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.section.dark .section-head .badge { background: rgba(255,255,255,0.1); color: #fff; }
.section-head h2 { margin-bottom: 0.75rem; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }
.section.dark .section-head p { color: rgba(255,255,255,0.75); }

/* ============================================================
   SERVICES — clean grid of cards
   ============================================================ */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
.service-card {
    display: block;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.75rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    position: relative;
}
.service-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}
.service-card .card-num {
    display: inline-block;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}
.service-card h3 { color: var(--ink); margin: 0 0 0.6rem; font-size: 1.2rem; }
.service-card p { color: var(--muted); margin: 0 0 1.25rem; font-size: 0.95rem; line-height: 1.65; }
.service-card .card-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
    transition: gap 0.2s;
}
.service-card:hover .card-arrow { gap: 0.7rem; }

/* ============================================================
   PROCESS — 4 step timeline
   ============================================================ */
.process-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    position: relative;
}
.process-step {
    padding: 0 1.5rem;
    text-align: center;
    position: relative;
}
.process-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 30px;
    inset-inline-end: 0;
    width: 100%;
    height: 2px;
    background: repeating-linear-gradient(90deg, var(--line-2) 0 4px, transparent 4px 10px);
    z-index: 0;
}
html[dir="rtl"] .process-step:not(:last-child)::after { inset-inline-end: -50%; }
html[dir="ltr"] .process-step:not(:last-child)::after { inset-inline-start: 50%; }
.process-step .step-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0 auto 1.25rem;
    position: relative;
    z-index: 1;
    border: 4px solid var(--surface);
}
.section:not(.alt) .process-step .step-circle { border-color: #fff; }
.process-step h3 { color: var(--ink); margin-bottom: 0.5rem; font-size: 1.05rem; }
.process-step p { color: var(--muted); margin: 0; font-size: 0.92rem; line-height: 1.6; }

/* ============================================================
   FEATURED WORK — clean tiles
   ============================================================ */
.work-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.work-item {
    display: block;
    text-decoration: none;
    color: inherit;
}
.work-thumb {
    aspect-ratio: 4/3;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
    transition: transform 0.3s;
    background: var(--surface-2);
}
.work-thumb::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary) 0%, #059669 100%);
}
.work-thumb.thumb-2::before { background: linear-gradient(135deg, #0EA5E9 0%, #1E40AF 100%); }
.work-thumb.thumb-3::before { background: linear-gradient(135deg, #F59E0B 0%, #B45309 100%); }
.work-thumb.thumb-4::before { background: linear-gradient(135deg, #EC4899 0%, #BE185D 100%); }
.work-thumb.thumb-5::before { background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%); }
.work-thumb.thumb-6::before { background: linear-gradient(135deg, #EF4444 0%, #B91C1C 100%); }
.work-thumb .thumb-mark {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255,255,255,0.9);
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -0.03em;
}
.work-item:hover .work-thumb { transform: translateY(-4px); }
.work-info { padding-block: 0.5rem; }
.work-info .tag {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}
.work-info h3 {
    font-size: 1.15rem;
    color: var(--ink);
    margin: 0;
    font-weight: 700;
}

/* ============================================================
   STATS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    text-align: center;
}
.section.alt .stat-card { background: #fff; }
.stat-card .num {
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}
.stat-card .lbl { color: var(--muted); font-size: 0.9rem; font-weight: 500; }

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.testi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.testi-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.section.alt .testi-card { background: #fff; }
.testi-card .stars {
    color: #F59E0B;
    font-size: 1rem;
    letter-spacing: 0.05em;
}
.testi-card .quote {
    color: var(--ink-2);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
    flex: 1;
}
.testi-author {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}
.testi-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    flex-shrink: 0;
}
.testi-info h4 { margin: 0; font-size: 0.95rem; color: var(--ink); font-weight: 700; }
.testi-info span { color: var(--muted); font-size: 0.82rem; }

/* ============================================================
   FAQ
   ============================================================ */
.faq-list {
    display: grid;
    gap: 0.85rem;
    max-width: 780px;
    margin: 0 auto;
}
.faq-item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s;
}
.section.alt .faq-item { background: #fff; }
.faq-item[open] { border-color: var(--primary); }
.faq-item summary {
    cursor: pointer;
    padding: 1.15rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--ink);
    list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    font-size: 1.5rem;
    color: var(--muted);
    font-weight: 400;
    line-height: 1;
    transition: transform 0.3s;
    flex-shrink: 0;
}
.faq-item[open] summary::after { content: "−"; color: var(--primary); }
.faq-item .faq-answer {
    padding: 0 1.5rem 1.25rem;
    color: var(--text);
    line-height: 1.7;
    font-size: 0.98rem;
}

/* ============================================================
   FINAL CTA
   ============================================================ */
.cta-final {
    padding-block: clamp(4rem, 10vh, 6rem);
    background: var(--ink);
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta-final::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center top, rgba(15, 118, 110, 0.25) 0%, transparent 60%);
}
.cta-final > * { position: relative; z-index: 1; }
.cta-final h2 {
    color: #fff;
    max-width: 20ch;
    margin: 0 auto 1rem;
}
.cta-final p { color: rgba(255,255,255,0.75); max-width: 50ch; margin: 0 auto 2rem; font-size: 1.05rem; }
.cta-final .actions { justify-content: center; }
.cta-final .actions .meta { color: rgba(255,255,255,0.75); }

/* ============================================================
   FORMS
   ============================================================ */
.form { display: grid; gap: 1.1rem; margin-top: 1.5rem; max-width: 560px; }
.form label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
    color: var(--ink);
    font-size: 0.9rem;
}
.form input, .form select, .form textarea {
    font: inherit;
    font-weight: 400;
    padding: 0.75rem 0.9rem;
    background: #fff;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    color: var(--ink);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form input:focus, .form select:focus, .form textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
}
.form textarea { resize: vertical; min-height: 110px; }
.form .btn { width: fit-content; }

.notice {
    background: var(--primary-soft);
    border-inline-start: 3px solid var(--primary);
    color: var(--primary);
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    font-weight: 500;
}
.errors {
    background: #FEF2F2;
    border-inline-start: 3px solid #DC2626;
    color: #B91C1C;
    padding: 0.9rem 1.4rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    list-style: none;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding-block: 3.5rem 1.5rem;
}
.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 1.5rem;
}
.footer-brand-block .brand { color: var(--ink); font-size: 1.4rem; }
.footer-brand-block p { color: var(--muted); font-size: 0.95rem; max-width: 320px; margin-top: 1rem; }
.footer-social { display: flex; gap: 0.5rem; margin-top: 1.25rem; }
.footer-social a {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--line-2);
    display: grid; place-items: center;
    color: var(--muted);
    transition: all 0.2s;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
}
.footer-social a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.footer-col h4 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 1.1rem;
    font-weight: 700;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.footer-col ul a { color: var(--ink-2); font-size: 0.93rem; }
.footer-col ul a:hover { color: var(--primary); }

.footer-bot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    font-size: 0.85rem;
    padding-top: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.footer-bot p { margin: 0; color: inherit; }

/* Mobile menu */
.nav-mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    top: 68px;
    background: #fff;
    z-index: 99;
    padding: 2rem 1.5rem;
}
.nav-mobile-menu.open { display: flex; flex-direction: column; gap: 1.2rem; }
.nav-mobile-menu a {
    color: var(--ink);
    font-size: 1.2rem;
    font-weight: 600;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
    .hero-grid { grid-template-columns: 1fr; gap: 3rem; }
    .hero-text { text-align: center; }
    .hero-text h1 { margin-inline: auto; }
    .hero-text .lead { margin-inline: auto; }
    .actions { justify-content: center; }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .work-grid { grid-template-columns: repeat(2, 1fr); }
    .testi-grid { grid-template-columns: 1fr; }
    .process-grid { grid-template-columns: repeat(2, 1fr); gap: 3rem 1rem; }
    .process-step::after { display: none !important; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-top { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .footer-brand-block { grid-column: span 2; }
    .footer-bot { justify-content: center; text-align: center; }
    .nav nav { display: none; }
    .nav-toggle { display: flex; }
}
@media (max-width: 640px) {
    .services-grid, .work-grid, .stats-grid { grid-template-columns: 1fr; }
    .actions { flex-direction: column; align-items: stretch; width: 100%; }
    .actions .btn { justify-content: center; }
    .footer-top { grid-template-columns: 1fr; }
    .footer-brand-block { grid-column: span 1; }
    .hero-visual { max-width: 340px; }
    .hv-main .big-num { font-size: 3.2rem; }
}
