/* =====================================================
   B11 Creative — الهوية الكحلية (الإصدار 3)
   الخط: Changa | الألوان: كحلي + أزرق، والأحمر لزر التواصل فقط
   الملف مكتوب بخصائص منطقية (start/end) ليعمل للعربية والإنجليزية معًا
   ===================================================== */

/* ── الخطوط (محلية داخل مجلد fonts) ─────────────────── */
@font-face {
  font-family: 'Changa';
  font-style: normal; font-display: swap; font-weight: 200 800;
  src: url('../fonts/changa-arabic-wght-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC;
}
@font-face {
  font-family: 'Changa';
  font-style: normal; font-display: swap; font-weight: 200 800;
  src: url('../fonts/changa-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('../fonts/montserrat-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ── الألوان والمقاسات — غيّرها من هنا ──────────────── */
:root {
  --ink:      #0A1130;   /* كحلي عميق: خلفية الأقسام الداكنة */
  --ink-2:    #0E1840;   /* درجة أفتح قليلًا للتناوب بين الأقسام */
  --ink-3:    #060A20;   /* أسفل الصفحة */
  --navy:     #283E84;   /* كحلي الهوية */
  --blue:     #4C83EE;   /* أزرق الهوية المتوسط */
  --logo:     #0035BA;   /* أزرق الشعار */
  --paper:    #F3F5FB;   /* خلفية القسم الفاتح */
  --red:      #D9161C;   /* لزر التواصل الرئيسي فقط */
  --red-2:    #F0262C;
  --text:     #FFFFFF;
  --muted:    #B4BEDD;
  --line:     rgba(255,255,255,.13);
  --ink-text: #0A1130;
  --ink-muted:#4A557A;
  --ink-line: rgba(10,17,48,.14);
  --display:  'Changa', 'Segoe UI', Tahoma, sans-serif;
  --body:     'Changa', 'Segoe UI', Tahoma, sans-serif;
  --wrap:     1240px;
  --gutter:   clamp(20px, 5vw, 64px);
  --header-h: 72px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
}

/* ── الأساس ─────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.8;
  background: var(--ink);
  color: var(--text);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
ul, ol { list-style: none; }
button, a { touch-action: manipulation; }

:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 4px; }
.on-paper :focus-visible { outline-color: var(--logo); }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.mark { display: block; fill: currentColor; }

h1, h2, h3, h4 { font-family: var(--display); line-height: 1.3; }
h2 { font-size: clamp(1.9rem, 3.2vw, 2.75rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }

/* ── الأزرار ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 26px;
  border-radius: 8px; border: 1px solid transparent;
  font-family: var(--display); font-size: 1.05rem; font-weight: 600; line-height: 1.3;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: transform 140ms var(--ease-out), background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--red); color: #fff; }
.btn-ghost { border-color: rgba(255,255,255,.38); color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--red-2); }
  .btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); }
}

/* ── الشريط العلوي ───────────────────────────────────── */
#header {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 1000;
  height: var(--header-h);
  transition: background-color 300ms ease, box-shadow 300ms ease;
}
#header.scrolled {
  background: rgba(10,17,48,.92);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.header-in { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.logo { display: flex; align-items: center; gap: 12px; color: #fff; }
.logo .mark { height: 40px; width: auto; aspect-ratio: 410.8 / 617.14; }
.logo-text { display: flex; flex-direction: column; line-height: 1.25; }
.logo-text .lc { font-family: 'Montserrat', var(--display); font-size: .78rem; font-weight: 700; letter-spacing: .32em; }
.logo-text .lt { font-size: .72rem; color: var(--muted); }

#nav { display: flex; align-items: center; gap: clamp(16px, 2.2vw, 30px); }
#nav a { position: relative; padding-block: 6px; font-size: 1rem; font-weight: 500; color: var(--muted); transition: color 200ms ease; }
#nav a::after {
  content: ''; position: absolute; inset-block-end: 0; inset-inline: 0; height: 2px;
  background: var(--blue); transform: scaleX(0);
  transition: transform 260ms var(--ease-out);
}
#nav a.active { color: #fff; }
#nav a.active::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) {
  #nav a:hover { color: #fff; }
}

.header-end { display: flex; align-items: center; gap: 18px; }
.lang { display: flex; align-items: center; gap: 8px; font-family: 'Montserrat', var(--display); font-size: .85rem; font-weight: 700; }
.lang .on { color: #fff; }
.lang .off { color: var(--muted); transition: color 200ms ease; }
.lang .sep { color: var(--line); }
@media (hover: hover) and (pointer: fine) { .lang .off:hover { color: #fff; } }

.hamburger { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; flex-direction: column; gap: 6px; background: none; border: 0; cursor: pointer; }
.hamburger span { display: block; width: 24px; height: 2px; background: #fff; border-radius: 2px; transition: transform 240ms var(--ease-out), opacity 160ms ease; }
.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ── الواجهة الرئيسية ────────────────────────────────── */
#hero {
  position: relative; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding-block: calc(var(--header-h) + 40px) 64px;
  background: var(--ink);
}
.hero-media { position: absolute; inset: 0; background: url('../images/hero.jpg') center / cover no-repeat; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; pointer-events: none; }

/* الطبقة الكحلية فوق الفيديو، وفيها نافذة على شكل الشعار يظهر منها الفيديو صافيًا */
.hero-veil { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-veil--tall { display: none; }
.veil-edge path { fill: none; stroke: #fff; stroke-opacity: .6; stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 0; }

.hero-inner { position: relative; z-index: 2; }
.hero-copy { max-width: 660px; }
.hero-title { font-size: clamp(2.5rem, 5.4vw, 4.75rem); font-weight: 800; line-height: 1.28; letter-spacing: 0; margin-block-end: 22px; }
.hero-line { display: block; overflow: hidden; padding-block: .08em .12em; margin-block: -.08em -.12em; }
.hero-line-in { display: block; }
.hero-desc { max-width: 34em; font-size: clamp(1.05rem, 1.35vw, 1.25rem); line-height: 1.85; color: #DCE3F7; margin-block-end: 32px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-block-end: 30px; }
.hero-contacts { display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 1rem; color: #DCE3F7; }
.hero-contacts a { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; }
.hero-contacts i { color: var(--blue); font-size: .95rem; }
@media (hover: hover) and (pointer: fine) { .hero-contacts a:hover { color: #fff; } }

/* حالة ما قبل الحركة — تُفعَّل فقط حين يعمل JavaScript والحركة مسموحة */
.js-motion .hero-copy { visibility: hidden; }
.js-motion .veil-cut { opacity: 0; }

/* ── الأقسام: هيكل مشترك ─────────────────────────────── */
.section { padding-block: clamp(72px, 9vw, 128px); }
.section--ink2 { background: var(--ink-2); }
.section--paper { background: var(--paper); color: var(--ink-text); }
.section--navy { background: var(--navy); }

.split { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 2.6fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.split-head { position: sticky; inset-block-start: calc(var(--header-h) + 32px); }
.sec-head { margin-block-end: clamp(32px, 4vw, 56px); }
.sec-note { margin-block-start: 10px; max-width: 40em; color: var(--muted); font-size: 1rem; }

/* ── الخدمات ─────────────────────────────────────────── */
.svc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 4vw, 56px); }
.svc { display: grid; grid-template-columns: 48px 1fr; gap: 4px 18px; padding-block: 26px; border-block-start: 1px solid var(--line); align-content: start; }
.svc i { grid-row: span 2; align-self: start; margin-block-start: 6px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 10px; background: rgba(76,131,238,.14); color: #8DB2FF; font-size: 1.15rem; }
.svc p { color: var(--muted); font-size: 1rem; line-height: 1.75; }

/* ── لماذا B11 (القسم الفاتح) ───────────────────────── */
.why-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px) clamp(24px, 4vw, 56px); }
.why { padding-block-start: 22px; border-block-start: 2px solid var(--logo); }
.why i { color: var(--logo); font-size: 1.5rem; margin-block-end: 14px; }
.why h3 { color: var(--ink-text); margin-block-end: 6px; }
.why p { color: var(--ink-muted); font-size: 1rem; line-height: 1.75; }

/* ── الأعمال (شريط منزلق) ───────────────────────────── */
#portfolio { overflow: hidden; }
.slider-wrap { overflow: hidden; direction: ltr; }
.p-track { display: flex; gap: 18px; direction: ltr; transition: transform 600ms var(--ease-out); }
.p-card { flex: 0 0 calc(25% - 13.5px); position: relative; border-radius: 6px; overflow: hidden; }
.p-img { position: relative; padding-block-start: 118%; overflow: hidden; }
.p-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease-out); }
.p-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(6,10,32,.94) 0%, rgba(6,10,32,.25) 55%, transparent 100%); }
.p-info { position: absolute; inset-inline: 0; inset-block-end: 0; padding: 20px 18px; }
.p-info h3 { margin-block-end: 2px; }
.p-info p { color: #DCE3F7; font-size: .95rem; line-height: 1.6; }
@media (hover: hover) and (pointer: fine) { .p-card:hover .p-photo { transform: scale(1.05); } }

.p-dots { display: flex; justify-content: center; gap: 10px; margin-block-start: 30px; direction: ltr; }
.p-dot { width: 10px; height: 10px; padding: 0; border-radius: 5px; border: 1px solid var(--muted); background: transparent; cursor: pointer; transition: width 300ms var(--ease-out), background-color 200ms ease, border-color 200ms ease; }
.p-dot.on { width: 30px; background: var(--blue); border-color: var(--blue); }

/* ── منهجية العمل (تسلسل حقيقي من ست خطوات) ─────────── */
.steps-track { position: relative; height: 2px; background: var(--line); margin-block-end: 34px; }
.steps-fill { position: absolute; inset: 0; background: var(--blue); }
[dir="rtl"] .steps-fill { transform-origin: right center; }
[dir="ltr"] .steps-fill { transform-origin: left center; }
.steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(16px, 2vw, 32px); }
.step-num { display: block; font-family: 'Montserrat', var(--display); font-size: 2.1rem; font-weight: 700; line-height: 1; color: var(--blue); margin-block-end: 14px; font-variant-numeric: tabular-nums; }
.step h3 { font-size: 1.1rem; margin-block-end: 6px; }
.step p { color: var(--muted); font-size: .95rem; line-height: 1.7; }

/* ── قراءات نرشّحها ─────────────────────────────────── */
.reads { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.read { display: flex; flex-direction: column; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.05); transition: background-color 200ms ease, transform 300ms var(--ease-out); }
.read-img { position: relative; padding-block-start: 60%; overflow: hidden; }
.read-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.read-body { display: flex; flex-direction: column; gap: 12px; padding: 18px 18px 20px; flex: 1; }
.read-body h3 { font-size: 1.08rem; line-height: 1.6; }
.read-src { display: inline-flex; align-items: center; gap: 8px; margin-block-start: auto; color: var(--muted); font-size: .9rem; direction: ltr; align-self: flex-start; }
.read-src i { font-size: .75rem; }
@media (hover: hover) and (pointer: fine) { .read:hover { background: rgba(255,255,255,.09); transform: translateY(-4px); } }

/* ── القطاعات ───────────────────────────────────────── */
.sectors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sector { display: flex; flex-direction: column; gap: 14px; padding: 8px clamp(16px, 2.4vw, 32px); border-inline-start: 1px solid var(--line); }
.sector:first-child { border-inline-start: 0; padding-inline-start: 0; }
.sector i { color: #8DB2FF; font-size: 1.7rem; }

/* ── شريط التواصل ───────────────────────────────────── */
.contact-band { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.contact-band h2 { font-size: clamp(2.1rem, 4vw, 3.25rem); font-weight: 800; }
.contact-band p { margin-block-start: 12px; max-width: 30em; color: #DCE3F7; }
.contact-actions { display: flex; flex-direction: column; gap: 14px; }
.contact-actions .btn { justify-content: flex-start; }
.contact-actions .btn span[dir="ltr"] { unicode-bidi: isolate; }

/* ── أسفل الصفحة ────────────────────────────────────── */
footer { background: var(--ink-3); }
.footer-main { display: grid; grid-template-columns: minmax(240px, 1.3fr) repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px); padding-block: 64px 48px; }
.f-brand .logo .mark { height: 56px; }
.f-desc { margin-block-start: 18px; max-width: 26em; color: var(--muted); font-size: .98rem; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: 20px; }
.socials a { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); transition: color 200ms ease, border-color 200ms ease, background-color 200ms ease; }
@media (hover: hover) and (pointer: fine) { .socials a:hover { color: #fff; border-color: var(--blue); background: rgba(76,131,238,.16); } }

.f-col h4 { font-size: 1.05rem; font-weight: 600; margin-block-end: 16px; }
.f-col ul { display: flex; flex-direction: column; gap: 4px; }
.f-col li a, .f-ci { display: inline-flex; align-items: center; gap: 12px; min-height: 36px; color: var(--muted); font-size: .98rem; transition: color 200ms ease; }
.f-ci i { color: var(--blue); width: 16px; text-align: center; }
.f-contact { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
@media (hover: hover) and (pointer: fine) { .f-col li a:hover, a.f-ci:hover { color: #fff; } }

.footer-bottom { border-block-start: 1px solid var(--line); padding-block: 20px; text-align: center; color: var(--muted); font-size: .9rem; }

/* ── زر العودة للأعلى ───────────────────────────────── */
#scrollTop {
  position: fixed; inset-block-end: 24px; inset-inline-end: 24px; z-index: 500;
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(10,17,48,.85); color: #fff;
  cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity 200ms ease, transform 200ms var(--ease-out), background-color 200ms ease;
}
#scrollTop.show { opacity: 1; pointer-events: auto; }
#scrollTop:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { #scrollTop:hover { background: var(--navy); } }

/* ── تقليل الحركة ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-video { display: none; }          /* تظهر الصورة الثابتة بدل الفيديو */
  .p-track, .p-photo, .read, .btn { transition: none; }
}

/* ── الشاشات المتوسطة ───────────────────────────────── */
@media (max-width: 1100px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 40px; }
  .footer-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── الجوال واللوحي ─────────────────────────────────── */
@media (max-width: 899px) {
  #nav {
    display: none; position: fixed; inset-block-start: var(--header-h); inset-inline: 0;
    max-height: calc(100vh - var(--header-h)); max-height: calc(100dvh - var(--header-h)); overflow-y: auto; overscroll-behavior: contain;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 24px; background: rgba(10,17,48,.98);
    border-block-end: 1px solid var(--line);
  }
  #nav.open { display: flex; }
  #nav a { padding-block: 14px; font-size: 1.1rem; border-block-end: 1px solid var(--line); }
  #nav a::after { display: none; }
  .hamburger { display: flex; }
  #header.nav-open { background: rgba(10,17,48,.98); }

  .hero-veil--wide { display: none; }
  .hero-veil--tall { display: block; }
  #hero { align-items: flex-end; min-height: max(100svh, 780px); padding-block-end: 44px; }
  /* على الجوال يُحصر الفيديو في أعلى الواجهة لتقع أضواء المدينة خلف نافذة الشعار */
  .hero-media { inset-block-end: auto; height: 62%; }
  .hero-cta .btn { flex: 1 1 100%; }

  .split { grid-template-columns: 1fr; gap: 28px; }
  .split-head { position: static; }
  .svc-list { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-card { flex: 0 0 calc(50% - 9px); }
  .sectors { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
  .sector:nth-child(odd) { border-inline-start: 0; padding-inline-start: 0; }
  .contact-band { grid-template-columns: 1fr; }
}
@media (max-width: 479px) {
  .logo-text .lt { display: none; }
  .why-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-card { flex: 0 0 calc(85% - 9px); }
  .footer-main { grid-template-columns: 1fr; }
}

/* اتجاه تمدد خط القائمة حسب اللغة */
[dir="rtl"] #nav a::after { transform-origin: right center; }
[dir="ltr"] #nav a::after { transform-origin: left center; }
