/* =========================================================
   نيبوكود — ملف التنسيق المشترك (عربي + إنجليزي)
   الهوية: حرف «ن» بالخط الكوفي المربّع على شبكة
   ========================================================= */

/* ---------- الألوان والمقاسات ---------- */
:root {
    --page: #EEF1F6;          /* خلفية الصفحة: رمادي مزرق فاتح */
    --paper: #FFFFFF;         /* الأسطح البيضاء */
    --ink: #12223D;           /* لون النص الأساسي (كحلي بدل الأسود) */
    --ink-2: #4E5C76;         /* نص ثانوي */
    --ink-3: #7A869C;         /* نص خافت */
    --line: #D9DFEA;          /* الخطوط والحدود */
    --cobalt: #2443C9;        /* اللون الأساسي للهوية */
    --cobalt-deep: #1A3299;
    --cobalt-soft: #E3E9FB;
    --saffron: #F2B33D;       /* نقطة النون */
    --wa: #1E9E6A;            /* أخضر واتساب الهادئ */

    --display: 'Reem Kufi', 'Alexandria', sans-serif;
    --body: 'Alexandria', sans-serif;

    --wrap: 1160px;
    --gutter: 24px;

    /* متغيرات محفوظة من النسخ السابقة */
    --bg: var(--page);
    --bg-color: var(--page);
    --surface: var(--paper);
    --surface-2: #F6F8FB;
    --text: var(--ink);
    --text-light: var(--ink);
    --muted: var(--ink-2);
    --text-muted: var(--ink-2);
    --primary: var(--cobalt);
    --secondary: var(--cobalt);
    --accent: var(--wa);
    --radius: 14px;
    --radius-sm: 10px;
    --container: var(--wrap);
    --glass-bg: var(--paper);
    --glass-border: var(--line);
    --neon-glow: none;
    --line-strong: #C5CEDD;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--body);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.85;
    color: var(--ink);
    background: var(--page);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
html[lang="en"] body { line-height: 1.7; font-size: 16.5px; }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 4px; }

.wrap, .container { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ---------- الهيدر ---------- */
.site-header {
    position: sticky; top: 0; z-index: 40;
    background: rgba(238, 241, 246, 0.9);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.nav { display: flex; align-items: center; gap: 28px; height: 76px; }

.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand img, .brand svg { width: 40px; height: 40px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-family: var(--body); font-weight: 700; font-size: 1.22rem; letter-spacing: -0.3px; direction: ltr; }
.brand-text small { font-family: var(--display); font-size: 0.82rem; color: var(--ink-3); }
html[lang="en"] .brand-text small { font-family: var(--display); }
.brand-mark { display: none; }   /* محفوظ من النسخة السابقة */

.nav-links { display: flex; gap: 26px; list-style: none; margin-inline-start: auto; }
.nav-links a { font-size: 0.95rem; color: var(--ink-2); padding: 6px 0; }
.nav-links a:hover { color: var(--ink); }

.nav-cta { display: flex; align-items: center; gap: 10px; }
.lang {
    font-size: 0.9rem; font-weight: 500; color: var(--ink);
    border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; background: var(--paper);
}
.lang:hover { border-color: var(--ink-3); }
.menu-btn {
    display: none; width: 42px; height: 42px; border-radius: 9px;
    border: 1px solid var(--line); background: var(--paper); color: var(--ink);
    cursor: pointer; font-size: 1.15rem;
}

/* ---------- الأزرار ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--body); font-weight: 500; font-size: 0.97rem;
    padding: 13px 22px; border-radius: 9px; border: 1px solid transparent;
    cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-deep); }
.btn-ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { filter: brightness(0.95); }
.btn-sm { padding: 9px 16px; font-size: 0.9rem; }

/* ---------- الشاشة الرئيسية ---------- */
.hero { padding: 72px 0 88px; }
.hero-grid {
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 64px; align-items: center;
}
.hero h1 {
    font-family: var(--display); font-weight: 700;
    font-size: clamp(2.4rem, 5.2vw, 4.1rem); line-height: 1.3; letter-spacing: 0;
    margin-bottom: 26px; max-width: 13ch;
}
html[lang="en"] .hero h1 { line-height: 1.12; letter-spacing: -1px; max-width: 14ch; }
.hero .lead { font-size: 1.12rem; color: var(--ink-2); max-width: 34rem; margin-bottom: 36px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* شبكة الكوفي المربّع */
.kufic { position: relative; }
.kufic-grid {
    display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px;
    aspect-ratio: 1; width: 100%; max-width: 420px; margin-inline: auto;
    padding: 22px; background: var(--paper); border-radius: 20px;
    box-shadow: 0 1px 0 var(--line), 0 30px 60px -36px rgba(18, 34, 61, 0.35);
}
.kufic-grid i { display: block; border-radius: 3px; background: #F1F3F8; }
.kufic-grid i.on { background: var(--cobalt); }
.kufic-grid i.dot { background: var(--saffron); }
.kufic-caption { max-width: 420px; margin: 16px auto 0; font-size: 0.86rem; color: var(--ink-3); }

/* لحظة الحركة الوحيدة في الصفحة: امتلاء الحرف عند التحميل */
.kufic-grid.animate i.on, .kufic-grid.animate i.dot { animation: fill .45s cubic-bezier(.2,.7,.2,1) both; }
@keyframes fill { from { background: #F1F3F8; transform: scale(.6); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .kufic-grid.animate i.on, .kufic-grid.animate i.dot { animation: none; }
    html { scroll-behavior: auto; }
}

/* ---------- بيانات المنشأة ---------- */
.facts { background: var(--paper); border-block: 1px solid var(--line); }
.facts dl {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px; padding-block: 26px;
}
.facts dt { font-size: 0.84rem; color: var(--ink-3); margin-bottom: 2px; }
.facts dd { font-weight: 600; font-size: 0.98rem; }

/* ---------- عناوين الأقسام ---------- */
.block { padding: 112px 0; }
.block-head { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 48px; margin-bottom: 64px; align-items: end; }
.block-head h2, .section-title {
    font-family: var(--display); font-weight: 700;
    font-size: clamp(1.9rem, 3.4vw, 2.75rem); line-height: 1.35;
}
html[lang="en"] .block-head h2 { line-height: 1.15; letter-spacing: -0.6px; }
.block-head p { color: var(--ink-2); max-width: 36rem; }

/* ---------- الخدمات: قائمة نصية بعمودين ---------- */
.services {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 72px; row-gap: 0; list-style: none;
}
.services li { padding: 26px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 10.5rem 1fr; gap: 20px; }
.services h3 { font-weight: 600; font-size: 1.05rem; line-height: 1.6; }
.services p { color: var(--ink-2); font-size: 0.97rem; }
.service, .num { all: unset; }   /* محفوظة من النسخة السابقة */

/* ---------- منصة واتساب ---------- */
.platform-band { background: var(--cobalt-soft); }
.platform {
    display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 64px; align-items: center;
}
.status {
    display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; font-weight: 500;
    color: var(--cobalt-deep); margin-bottom: 18px;
}
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--saffron); }
.badge-soon { display: none; }   /* محفوظ من النسخة السابقة */
.platform h2 { font-family: var(--display); font-size: clamp(1.9rem, 3.4vw, 2.7rem); line-height: 1.35; margin-bottom: 18px; }
html[lang="en"] .platform h2 { line-height: 1.15; letter-spacing: -0.6px; }
.platform-copy > p { color: var(--ink-2); margin-bottom: 26px; max-width: 34rem; }
.check-list { list-style: none; display: grid; gap: 12px; margin-bottom: 32px; }
.check-list li { position: relative; padding-inline-start: 28px; }
.check-list li::before {
    content: ''; position: absolute; inset-inline-start: 2px; top: 0.72em;
    width: 12px; height: 7px; border-inline-start: 2px solid var(--wa); border-bottom: 2px solid var(--wa);
    transform: rotate(-45deg); transform-origin: center;
}
html[dir="rtl"] .check-list li::before { transform: rotate(-45deg) scaleX(-1); }
.note { font-size: 0.86rem; color: var(--ink-2); margin-top: 20px; max-width: 32rem; }
.platform-cards, .p-card { display: none; }   /* محفوظة من النسخة السابقة */

/* نافذة صندوق المحادثات */
.app {
    background: var(--paper); border-radius: 16px; overflow: hidden;
    box-shadow: 0 1px 0 rgba(18,34,61,.06), 0 40px 70px -40px rgba(18, 34, 61, 0.45);
}
.app-top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 0.85rem;
}
.app-top b { font-weight: 600; }
.numbers { display: flex; gap: 6px; }
.numbers span { font-size: 0.75rem; padding: 3px 9px; border-radius: 6px; background: #F1F3F8; color: var(--ink-2); }
.numbers span.on { background: var(--cobalt); color: #fff; }
.app-body { display: grid; grid-template-columns: 170px minmax(0, 1fr); min-height: 340px; }
.threads { border-inline-end: 1px solid var(--line); }
.thread { padding: 12px 14px; font-size: 0.8rem; border-bottom: 1px solid #F0F2F6; }
.thread b { display: flex; justify-content: space-between; font-weight: 600; font-size: 0.84rem; }
.thread b em { font-style: normal; font-weight: 400; color: var(--ink-3); font-size: 0.72rem; }
.thread span { color: var(--ink-3); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread.active { background: #F5F7FC; box-shadow: inset 3px 0 0 var(--cobalt); }
html[dir="rtl"] .thread.active { box-shadow: inset -3px 0 0 var(--cobalt); }
.convo { display: flex; flex-direction: column; background: #F7F8FA; }
.convo-head { padding: 11px 16px; background: var(--paper); border-bottom: 1px solid var(--line); font-size: 0.82rem; display: flex; justify-content: space-between; }
.convo-head span { color: var(--ink-3); }
.msgs { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 8px; justify-content: flex-end; }
.msg { max-width: 80%; padding: 8px 12px 6px; border-radius: 10px; font-size: 0.83rem; line-height: 1.6; }
.msg small { display: block; font-size: 0.68rem; color: var(--ink-3); margin-top: 2px; }
.msg.in { background: var(--paper); align-self: flex-start; box-shadow: 0 1px 0 var(--line); }
.msg.out { background: #DDF3E8; align-self: flex-end; }
.compose { margin: 0 14px 14px; padding: 10px 12px; border-radius: 9px; background: var(--paper); border: 1px solid var(--line); font-size: 0.8rem; color: var(--ink-3); }

/* ---------- أعمالنا ---------- */
.work { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.glass-panel, .project-card {
    background: var(--paper); border-radius: 18px; padding: 40px;
    border: 1px solid var(--line);
}
.project-top { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.project-logo {
    width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
    font-family: var(--display); font-weight: 700; font-size: 1.35rem; color: #fff; flex-shrink: 0;
}
.project-logo.brinq { background: #12223D; }
.project-logo.hala { background: var(--cobalt); }
.project-title { font-family: var(--display); font-size: 1.55rem; font-weight: 700; line-height: 1.3; }
.project-title small { display: block; font-family: var(--body); font-size: 0.85rem; font-weight: 400; color: var(--ink-3); }
.project-header { display: contents; }    /* محفوظ من النسخة السابقة */
.project-tag { display: none; }           /* محفوظ من النسخة السابقة */
.project-desc { color: var(--ink-2); margin-bottom: 22px; }
.project-features { list-style: none; display: grid; gap: 8px; margin-bottom: 26px; }
.project-features li { position: relative; padding-inline-start: 20px; font-size: 0.96rem; }
.project-features li::before {
    content: ''; position: absolute; inset-inline-start: 0; top: 0.78em;
    width: 7px; height: 7px; background: var(--cobalt); border-radius: 1px;
}
.project-link { font-weight: 500; color: var(--cobalt); border-bottom: 1px solid currentColor; padding-bottom: 1px; direction: ltr; display: inline-block; }
.project-link:hover { color: var(--cobalt-deep); }
.grid-cards { display: grid; }    /* محفوظ من النسخة السابقة */

.stack { margin-top: 44px; color: var(--ink-2); font-size: 0.97rem; }
.stack b { color: var(--ink); font-weight: 600; }
.tech-stack, .tech-badge { display: inline; }  /* محفوظة من النسخة السابقة */

/* ---------- طريقة العمل (تسلسل حقيقي فالترقيم مقصود) ---------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; list-style: none; counter-reset: step; }
.step { counter-increment: step; }
.step::before {
    content: counter(step); display: grid; place-items: center;
    width: 36px; height: 36px; border-radius: 9px; margin-bottom: 18px;
    background: var(--paper); border: 1px solid var(--line);
    font-family: var(--display); font-weight: 700; color: var(--cobalt);
}
.step h3, .step h4 { font-size: 1.08rem; font-weight: 600; margin-bottom: 6px; }
.step p { color: var(--ink-2); font-size: 0.96rem; }

/* ---------- التواصل ---------- */
.contact-band { background: var(--ink); color: #fff; border-radius: 22px; padding: 64px; }
.contact-grid, .contact { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 56px; align-items: start; }
.contact-band h2 { font-family: var(--display); font-size: clamp(1.9rem, 3.4vw, 2.6rem); line-height: 1.35; margin-bottom: 14px; }
html[lang="en"] .contact-band h2 { line-height: 1.15; letter-spacing: -0.6px; }
.contact-band p { color: #B9C3D6; margin-bottom: 30px; max-width: 30rem; }
.mail-big { font-size: clamp(1.2rem, 2.4vw, 1.6rem); font-weight: 600; color: #fff; border-bottom: 2px solid var(--saffron); padding-bottom: 2px; direction: ltr; display: inline-block; word-break: break-all; }
.contact-band .btn-primary { background: #fff; color: var(--ink); margin-top: 26px; }
.contact-band .btn-primary:hover { background: var(--cobalt-soft); }
.info-list { list-style: none; }
.info-list li { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,0.12); font-size: 0.95rem; }
.info-list li:last-child { border-bottom: 0; }
.info-list span { color: #8E9BB3; }
.info-list b { font-weight: 500; text-align: end; }
.contact-card, .footer-content, .contact-email-btn, .direct-email { all: unset; }   /* محفوظة من النسخة السابقة */

/* ---------- الفوتر ---------- */
footer, .site-footer { padding: 64px 0 36px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr)); gap: 40px; padding-bottom: 40px; border-bottom: 1px solid var(--line); }
.footer-grid p { color: var(--ink-2); font-size: 0.93rem; max-width: 22rem; margin-top: 16px; }
.footer-grid h3, .footer-grid h5 { font-size: 0.93rem; font-weight: 600; margin-bottom: 12px; }
.footer-grid ul { list-style: none; display: grid; gap: 6px; }
.footer-grid ul a { color: var(--ink-2); font-size: 0.93rem; }
.footer-grid ul a:hover { color: var(--ink); }
.copyright { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; padding-top: 24px; font-size: 0.86rem; color: var(--ink-3); }

/* ---------- الصفحات القانونية ---------- */
.legal-page { padding: 64px 0 24px; }
.legal-page .container, .legal-page .wrap { max-width: 820px; }
.legal-card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 56px 64px; }
.legal-page h1 { font-family: var(--display); font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.3; margin-bottom: 6px; }
.legal-page .updated { display: block; color: var(--ink-3); font-size: 0.9rem; margin-bottom: 36px; }
.legal-page h2 { font-size: 1.18rem; font-weight: 600; margin: 38px 0 10px; }
.legal-page p, .legal-page li { color: #33425D; }
.legal-page p { margin-bottom: 14px; }
.legal-page ul, .legal-page ol { padding-inline-start: 22px; margin-bottom: 14px; display: grid; gap: 6px; }
.legal-page a { color: var(--cobalt); border-bottom: 1px solid rgba(36,67,201,.3); }
.legal-page .box { background: #F5F7FB; border-radius: 12px; padding: 22px 24px; margin-top: 18px; }
.legal-page .box p:last-child { margin-bottom: 0; }
.back { display: inline-block; margin-bottom: 22px; font-size: 0.92rem; color: var(--ink-2); }
.back:hover { color: var(--ink); }

/* ---------- محفوظة من النسخ السابقة (لم تعد مستخدمة) ---------- */
.background-animation, .grid-overlay, .legal-strip, .preview, .stats, .eyebrow { display: none; }
.reveal, .reveal.active { opacity: 1; transform: none; }

/* ---------- التجاوب ---------- */
@media (max-width: 1020px) {
    .hero-grid, .platform, .contact-grid, .contact, .block-head { grid-template-columns: minmax(0, 1fr); }
    .hero-grid { gap: 48px; }
    .kufic-grid { max-width: 340px; }
    .facts dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .services { column-gap: 40px; }
    .services li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .block-head { gap: 14px; margin-bottom: 44px; }
    .contact-band { padding: 48px 36px; }
}
@media (max-width: 760px) {
    :root { --gutter: 16px; }
    body { font-size: 16px; }
    .nav { height: 66px; gap: 12px; }
    .menu-btn { display: block; }
    .nav-links {
        display: none; position: absolute; top: 66px; inset-inline: 0;
        flex-direction: column; gap: 0; margin: 0;
        background: var(--page); border-bottom: 1px solid var(--line); padding: 6px var(--gutter) 14px;
    }
    .nav-links.open { display: flex; }
    .nav-links a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
    .nav-cta { margin-inline-start: auto; }
    .nav-cta .btn-primary { display: none; }
    .hero { padding: 40px 0 64px; }
    .block { padding: 76px 0; }
    .services, .work, .steps, .footer-grid { grid-template-columns: minmax(0, 1fr); }
    .app-body { grid-template-columns: minmax(0, 1fr); }
    .threads { display: none; }
    .glass-panel, .project-card { padding: 28px 22px; }
    .contact-band { padding: 36px 22px; border-radius: 16px; }
    .info-list li { flex-direction: column; gap: 0; }
    .info-list b { text-align: start; }
    .legal-card { padding: 32px 20px; border-radius: 14px; }
    .facts dl { gap: 18px; }
}
