/* SQ-Apps — sqdev.app
   ورقة أنماط واحدة لكل الصفحات، عربيّها وإنجليزيّها. الخطوط مستضافة عندنا
   (لا طلب لخطوط جوجل من متصفّح الزائر)، والصفحة تعمل بلا سكربت إطلاقًا —
   الحركة كلّها CSS: دخولٌ متدرّج عند التحميل، وكشفٌ مع التمرير (لمن يدعمه)،
   وأجسام تسبح في الخلفية، وتفاعلٌ عند اللمس. ومن طلب من نظامه تقليل الحركة
   يُطاع في آخر الملف: كل شيء يظهر ثابتًا، ولا شيء يُخفى. */

@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap;
  src: url(/fonts/ibm-plex-sans-arabic-400-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+2000-206F, U+2070-209F, U+20A0-20BF, U+2190-2BFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap;
  src: url(/fonts/ibm-plex-sans-arabic-400-arabic.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap;
  src: url(/fonts/ibm-plex-sans-arabic-500-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+2000-206F, U+2070-209F, U+20A0-20BF, U+2190-2BFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap;
  src: url(/fonts/ibm-plex-sans-arabic-500-arabic.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap;
  src: url(/fonts/ibm-plex-sans-arabic-600-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+2000-206F, U+2070-209F, U+20A0-20BF, U+2190-2BFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap;
  src: url(/fonts/ibm-plex-sans-arabic-600-arabic.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap;
  src: url(/fonts/ibm-plex-sans-arabic-700-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+2000-206F, U+2070-209F, U+20A0-20BF, U+2190-2BFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap;
  src: url(/fonts/ibm-plex-sans-arabic-700-arabic.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }

:root {
  --bg: #070C18;
  --bg-2: #0C1426;
  --card: rgba(255, 255, 255, 0.04);
  --card-line: rgba(255, 255, 255, 0.09);
  --ink: #EEF3FB;
  --ink-2: #A9B8D0;
  --ink-3: #7C8CA8;
  --brand: #4E7BFF;
  --brand-2: #12C2A0;
  --focus: #8FB0FF;
  --radius: 18px;
  --page: 1080px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --orb-1: rgba(78, 123, 255, 0.34);
  --orb-2: rgba(18, 194, 160, 0.26);
  --shadow: rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F7F9FD;
    --bg-2: #FFFFFF;
    --card: #FFFFFF;
    --card-line: #E2E8F3;
    --ink: #0D1830;
    --ink-2: #435473;
    --ink-3: #6B7C99;
    --brand: #2E5BFF;
    --brand-2: #0C9A80;
    --focus: #2E5BFF;
    --orb-1: rgba(46, 91, 255, 0.16);
    --orb-2: rgba(12, 154, 128, 0.14);
    --shadow: rgba(13, 24, 48, 0.16);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Plex Arabic", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- الخلفية الحيّة ----------
   كرتان مضبّبتان تسبحان ببطء خلف كل شيء. عنصران زائفان على body، فلا يحتاجان
   إلى علامة في أي صفحة، وz-index سالب يضعهما فوق لون الصفحة وتحت محتواها. */
body::before, body::after {
  content: ""; position: fixed; z-index: -1; border-radius: 50%;
  pointer-events: none; filter: blur(64px); will-change: transform;
}
body::before {
  width: 560px; height: 560px; inset-inline-end: -180px; top: -200px;
  background: radial-gradient(circle, var(--orb-1), transparent 66%);
  animation: drift-a 26s ease-in-out infinite alternate;
}
body::after {
  width: 460px; height: 460px; inset-inline-start: -160px; top: 46%;
  background: radial-gradient(circle, var(--orb-2), transparent 66%);
  animation: drift-b 32s ease-in-out infinite alternate;
}
@keyframes drift-a { to { transform: translate(-70px, 90px) scale(1.08); } }
@keyframes drift-b { to { transform: translate(90px, -110px) scale(0.94); } }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 22px; }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .2s; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { line-height: 1.3; letter-spacing: -0.01em; margin: 0 0 12px; }
h1 { font-size: clamp(32px, 5.6vw, 56px); font-weight: 700; line-height: 1.18; }
h2 { font-size: clamp(22px, 3.4vw, 30px); font-weight: 600; margin-top: 8px; }
h3 { font-size: 19px; font-weight: 600; }
p { margin: 0 0 16px; }
strong { font-weight: 600; }

/* ---------- الحركات المشتركة ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: 200% 50%; } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-2) 55%, transparent); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float-a { to { transform: translateY(-16px) rotate(-2deg); } }
@keyframes float-b { to { transform: translateY(-22px) rotate(3deg); } }
@keyframes float-c { to { transform: translateY(-12px) rotate(-4deg); } }

/* نصّ بتدرّج يتنفّس — للسطر الثاني من العنوان. */
.grad {
  background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--brand));
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 7s linear infinite;
}

/* دخول الواجهة عند التحميل، متدرّجًا: كل عنصر بعد الذي قبله بقليل. */
.a1, .a2, .a3, .a4, .a5 { animation: rise .8s var(--ease) both; }
.a1 { animation-delay: .05s; }
.a2 { animation-delay: .16s; }
.a3 { animation-delay: .3s; }
.a4 { animation-delay: .42s; }
.a5 { animation-delay: .34s; }

/* كشف مع التمرير — لمن يدعم خطوط الزمن المبنية على التمرير. في غيره يبقى كل
   شيء ظاهرًا من البداية، لأن القاعدة كلّها داخل @supports. */
@supports (animation-timeline: view()) {
  .reveal { animation: rise .8s var(--ease) both; animation-timeline: view(); animation-range: entry 0% entry 38%; }
  .grid > .reveal:nth-child(2) { animation-range: entry 6% entry 44%; }
  .grid > .reveal:nth-child(3) { animation-range: entry 12% entry 50%; }
  .grid > .reveal:nth-child(4) { animation-range: entry 18% entry 56%; }
}

/* ---------- الرأس ---------- */
header.top {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--card-line);
}
.top .wrap { display: flex; align-items: center; gap: 18px; min-height: 66px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; font-size: 19px;
  color: var(--ink); text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 10px; display: block; transition: transform .4s var(--ease); }
.brand:hover img { transform: rotate(-8deg) scale(1.08); }
nav.links { margin-inline-start: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
nav.links a {
  color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 7px 11px; border-radius: 10px; transition: color .2s, background-color .2s;
}
nav.links a:hover { color: var(--ink); background: var(--card); }
nav.links a.lang { border: 1px solid var(--card-line); color: var(--ink); }

/* يضيق الرأس ويشتدّ ظلّه مع أوّل تمرير — بخطّ زمن التمرير، لا بسكربت. */
@supports (animation-timeline: scroll()) {
  @media (min-width: 721px) {
    header.top { animation: top-shade linear both; animation-timeline: scroll(root); animation-range: 0 160px; }
    .top .wrap { animation: top-shrink linear both; animation-timeline: scroll(root); animation-range: 0 160px; }
  }
}
@keyframes top-shade { to { box-shadow: 0 10px 30px -18px var(--shadow); background: color-mix(in srgb, var(--bg) 92%, transparent); } }
@keyframes top-shrink { to { min-height: 56px; } }

/* ---------- الواجهة ---------- */
.hero { padding: 64px 0 36px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500;
  color: var(--ink-2); border: 1px solid var(--card-line); background: var(--card);
  border-radius: 999px; padding: 6px 14px; margin-bottom: 22px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-2); animation: pulse 2.4s ease-out infinite; }
.hero p.lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--ink-2); max-width: 56ch; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font-weight: 600; font-size: 16px; padding: 12px 20px; border-radius: 13px;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .3s, border-color .25s, background-position .6s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn.primary {
  background: linear-gradient(120deg, var(--brand), var(--brand-2), var(--brand));
  background-size: 220% 100%; color: #fff;
  box-shadow: 0 12px 28px -14px color-mix(in srgb, var(--brand) 70%, transparent);
}
.btn.primary:hover { background-position: 100% 50%; color: #fff; box-shadow: 0 18px 34px -14px color-mix(in srgb, var(--brand) 80%, transparent); }
.btn.ghost { border-color: var(--card-line); color: var(--ink); background: var(--card); }
.btn.ghost:hover { border-color: var(--brand); color: var(--ink); }
.btn .arr { display: inline-block; transition: translate .25s var(--ease); }
.btn:hover .arr { translate: 4px 0; }
[dir="rtl"] .btn:hover .arr { translate: -4px 0; }

/* لوحة المنتجات في الواجهة: ثلاث بطاقات تسبح على مدار يدور ببطء. زينة صرفة،
   مخفيّة عن قارئ الشاشة، وكل ما فيها موجود نصًّا في بطاقات المنتجات تحتها. */
.hero-art { position: relative; height: 380px; }
.hero-art::before {
  content: ""; position: absolute; inset: 8%; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 26%, transparent), transparent 70%);
}
.hero-art::after {
  content: ""; position: absolute; inset: 12%; border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--brand) 45%, var(--card-line));
  animation: spin 48s linear infinite;
}
.tile {
  position: absolute; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 20px 14px; border-radius: 22px;
  background: color-mix(in srgb, var(--bg-2) 82%, transparent);
  border: 1px solid var(--card-line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 30px 50px -28px var(--shadow);
}
.tile .mark { width: 72px; height: 72px; border-radius: 18px; display: grid; place-items: center; overflow: hidden; }
.tile .mark img, .tile .mark svg { width: 100%; height: 100%; display: block; }
.tile .mark svg { padding: 12px; }
.mark-m { background: #FAF7F2; color: #8F4C16; }
.tile .name { font-weight: 600; font-size: 15px; color: var(--ink); }
.tile-m { inset-inline-start: 4%; top: 16%; animation: float-a 6s ease-in-out infinite alternate; }
.tile-k { inset-inline-end: 6%; top: 2%; animation: float-b 7.5s ease-in-out infinite alternate; animation-delay: -2.5s; }
.tile-s { inset-inline-start: 36%; bottom: 4%; animation: float-c 8.5s ease-in-out infinite alternate; animation-delay: -4s; }

/* ---------- الأقسام ---------- */
section { padding: 38px 0; }
.section-head { margin-bottom: 26px; }
.section-head p { color: var(--ink-2); margin: 0; max-width: 70ch; }

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--card-line);
  border-radius: var(--radius); padding: 24px;
  transition: transform .35s var(--ease), border-color .3s, box-shadow .35s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--card-line));
  box-shadow: 0 22px 44px -26px color-mix(in srgb, var(--brand) 60%, var(--shadow));
}
.card h3 { margin-bottom: 6px; }
.card p { color: var(--ink-2); margin-bottom: 12px; }
.card p:last-child { margin-bottom: 0; }

/* بطاقة منتج: خطّ تدرّج يمتدّ على حافّتها العليا عند التحويم. */
.product { display: flex; flex-direction: column; position: relative; overflow: hidden; }
.product::before {
  content: ""; position: absolute; top: 0; inset-inline: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease);
}
[dir="rtl"] .product::before { transform-origin: right; }
.product:hover::before { transform: scaleX(1); }
.product .head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.product .logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; overflow: hidden; flex: none; }
.product .logo img, .product .logo svg { width: 100%; height: 100%; display: block; }
.product .logo svg { padding: 7px; }
.product .name { font-size: 24px; font-weight: 700; }
.product .latin { color: var(--ink-3); font-size: 15px; font-weight: 500; }
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--card-line); color: var(--ink-2); background: var(--bg-2);
  margin-inline-start: auto;
}
.badge.live { color: var(--brand-2); border-color: color-mix(in srgb, var(--brand-2) 40%, transparent); }
.badge.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-2); animation: pulse 2.4s ease-out infinite; }
ul.facts { list-style: none; margin: 4px 0 18px; padding: 0; }
ul.facts li { color: var(--ink-2); padding-inline-start: 22px; position: relative; margin-bottom: 6px; }
ul.facts li::before {
  content: ""; position: absolute; inset-inline-start: 4px; top: 12px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--brand);
}
.product .links { margin-top: auto; display: flex; gap: 14px; flex-wrap: wrap; font-size: 15px; font-weight: 500; }

/* بطاقة قاعدة: رقم صغير بلون العلامة قبل العنوان. */
.rule { counter-increment: rule; }
.rule h3::before {
  content: counter(rule, decimal-leading-zero); display: block;
  font-size: 13px; font-weight: 600; letter-spacing: .08em; color: var(--brand); margin-bottom: 8px;
}
.grid.four { counter-reset: rule; }

/* جدول المطوّر */
table.facts { width: 100%; border-collapse: collapse; font-size: 15.5px; }
table.facts th, table.facts td {
  text-align: start; padding: 12px 4px; border-bottom: 1px solid var(--card-line); vertical-align: top;
}
table.facts th { color: var(--ink-3); font-weight: 500; width: 40%; }
table.facts tr:last-child th, table.facts tr:last-child td { border-bottom: 0; }

/* ---------- صفحات النصّ ---------- */
.doc { padding: 54px 0 10px; max-width: 76ch; }
.doc h1 { margin-bottom: 8px; }
.doc .updated { color: var(--ink-3); font-size: 15px; margin-bottom: 30px; }
.doc h2 { margin-top: 34px; }
.doc ul, .doc ol { color: var(--ink-2); padding-inline-start: 22px; }
.doc li { margin-bottom: 8px; }
.doc p { color: var(--ink-2); }
.note {
  border: 1px solid var(--card-line); background: var(--card);
  border-radius: var(--radius); padding: 18px 20px; margin: 24px 0;
}
.note p:last-child { margin-bottom: 0; }

/* ---------- التذييل ---------- */
footer.bottom { border-top: 1px solid var(--card-line); margin-top: 46px; padding: 34px 0 54px; }
footer.bottom .wrap { display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; }
footer.bottom a { color: var(--ink-2); text-decoration: none; font-size: 15px; }
footer.bottom a:hover { color: var(--ink); text-decoration: underline; }
footer.bottom .cols { display: flex; gap: 18px; flex-wrap: wrap; }
footer.bottom small { color: var(--ink-3); font-size: 14px; display: block; }

/* ---------- الواجهة على الشاشات الضيّقة ---------- */
@media (max-width: 860px) {
  .hero { padding-top: 44px; }
  .hero-grid { grid-template-columns: 1fr; gap: 18px; }
  .hero-art { height: 250px; margin-top: 6px; }
  .hero-art::before { inset: 4% 18%; }
  .hero-art::after { inset: 8% 22%; }
  .tile { padding: 12px 14px 10px; border-radius: 18px; gap: 7px; }
  .tile .mark { width: 54px; height: 54px; border-radius: 14px; }
  .tile .mark svg { padding: 9px; }
  .tile .name { font-size: 13.5px; }
  .tile-m { inset-inline-start: 8%; top: 14%; }
  .tile-k { inset-inline-end: 10%; top: 0; }
  .tile-s { inset-inline-start: 38%; bottom: 0; }
}

/* ---------- الرأس على الجوّال ----------
   على شاشة ضيّقة لا يتّسع الرأس لسطر واحد، فيُكتب صفًّا صفًّا:
     الأوّل: الاسم في أوّل السطر وزرّ اللغة في آخره،
     الثاني: روابط الأقسام موزّعة بالتساوي على العرض.
   `display: contents` تُذيب عنصر nav فتصير روابطه أبناء الشريط نفسه — وبها
   وحدها يمكن لزرّ اللغة أن يصعد إلى سطر الاسم وهو في مكانه من HTML. */
@media (max-width: 720px) {
  .top .wrap { min-height: 0; padding-block: 8px; column-gap: 8px; row-gap: 4px; }

  nav.links { display: contents; }

  /* الهامش التلقائي على الاسم لا على زرّ اللغة: الزرّ يحمل dir="ltr" لأن نصّه
     إنجليزي، فـ inline-start فيه هو يساره هو — لا يسار الصفحة. والاسم يرث اتجاه
     الصفحة، فهامشه الخلفيّ يدفع ما بعده إلى آخر السطر في الاتجاهين معًا. */
  .brand { order: 0; font-size: 18px; margin-inline-end: auto; }
  .brand img { width: 30px; height: 30px; }

  nav.links a.lang { order: 1; }

  /* فاصل السطر: عنصر بلا ارتفاع يملأ العرض، فيدفع ما بعده إلى سطر جديد. */
  .top .wrap::after { content: ""; order: 2; flex-basis: 100%; height: 0; }

  nav.links a:not(.lang) {
    order: 3; flex: 1 1 auto; text-align: center;
    padding: 7px 6px; font-size: 14.5px; white-space: nowrap;
  }
}

@media (max-width: 380px) {
  .brand { font-size: 17px; gap: 9px; }
  nav.links a:not(.lang) { padding: 7px 3px; font-size: 14px; }
  nav.links a.lang { padding: 6px 9px; font-size: 14px; }
}

/* ---------- من طلب تقليل الحركة ----------
   لا دخول ولا سباحة ولا دوران ولا كشف: كل شيء في مكانه الأخير من أوّل لحظة.
   والانتقالات عند التحويم تبقى فورية. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .a1, .a2, .a3, .a4, .a5, .reveal { opacity: 1; transform: none; }
  .grad { animation: none; }
}
