:root {
  --bg: #0d0a1c;
  --surface: #17122b;
  --line: #2c2547;
  --text: #f5f2ff;
  --muted: #a9a2c4;
  --accent: #8b5cf6;
  --accent-soft: #b79cff;
  --ink: #0d0a1c;
  --r: 18px;
  --ease: cubic-bezier(.22, .61, .21, 1);
  --pad: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Changa", "Segoe UI", Tahoma, sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, dl, dd { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a, button, select, input, textarea { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

.skip {
  position: absolute; inset-inline-start: 16px; top: -80px; z-index: 30;
  padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--ink); font-weight: 700;
}
.skip:focus { top: 14px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 1320px; margin-inline: auto; padding-inline: max(var(--pad), env(safe-area-inset-left), env(safe-area-inset-right)); }

/* ───── الشريط العلوي ───── */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.top-in { display: flex; align-items: center; gap: 12px; height: 76px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; height: 52px; padding-inline: 6px 20px;
  border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-weight: 700; font-size: 1.05rem; white-space: nowrap;
}
.brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: center 20%; background: var(--surface); }
.nav {
  display: flex; gap: 2px; margin-inline-start: auto; padding: 5px;
  border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.nav a {
  display: inline-flex; align-items: center; height: 40px; padding: 0 20px; border-radius: 999px;
  color: var(--muted); font-size: 1rem; white-space: nowrap;
  transition: color .25s var(--ease), background-color .25s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav { position: relative; isolation: isolate; }
.nav a.is-on { color: #fff; }
/* المؤشر المنزلق: لون مسطّح، والحافة الأمامية تسبق الخلفية فيتمدد ثم يستقر */
.nav-pill {
  position: absolute; z-index: -1; top: 5px; bottom: 5px; left: var(--l, 0px); right: var(--r, 0px);
  border-radius: 999px; background: var(--accent);
  transition: left var(--tl, .5s) cubic-bezier(.3, .7, .2, 1), right var(--tr, .5s) cubic-bezier(.3, .7, .2, 1), opacity .3s;
  opacity: 0;
}
.nav-pill.is-ready { opacity: 1; }
.nav-pill.is-still { transition: none; }
.lang {
  background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--line); border-radius: 999px;
  min-width: 52px; height: 52px; padding: 0 16px; font-size: .9rem; font-weight: 700;
  transition: border-color .25s var(--ease);
}
.lang:hover { border-color: var(--accent-soft); }

/* ───── المقدمة ───── */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 55% at 50% 78%, rgba(124, 77, 255, .30), transparent 70%),
    radial-gradient(circle, rgba(255, 255, 255, .055) 1px, transparent 1.5px) 0 0 / 34px 34px;
}
/* أسفل المقدمة يذوب في خلفية الصفحة: بدون خط فاصل ولا حافة للتوهج */
.hero::after {
  content: ""; position: absolute; inset: auto 0 0; height: clamp(90px, 16vh, 180px); pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
#works { border-top: 0; }
.hero-in {
  position: relative; z-index: 1;
  /* --hf حجم العنوان. الأفاتار يُحسب منه حتى يبقى رأسه داخل الكشيدة في كل المقاسات */
  --hf: clamp(4.5rem, min(15.5vw, 24svh), 16rem);
  height: calc(100svh - 77px); min-height: 540px; padding-block-start: 8px;
}
.hero-head {
  position: relative; z-index: 1; text-align: center;
  font-weight: 700; font-size: var(--hf); line-height: 1.12; letter-spacing: 0;
}
html[lang="en"] .hero-in { --hf: clamp(3rem, min(10vw, 15svh), 10rem); }
html[lang="en"] .hero-head { line-height: 1.02; letter-spacing: -.03em; padding-block-start: .12em; }
/* الإنجليزي بدون كشيدة: الأفاتار ينزل تحت السطرين */
html[lang="en"] .hero-avatar { top: calc(var(--hf) * 2.3 + 8px); height: calc(98% - var(--hf) * 2.3 - 8px); }
.hero-head .line { display: block; overflow: hidden; padding-block: .04em .16em; margin-block: -.04em -.16em; }
.hero-head .line > span { display: block; }
.hero-head .line:nth-child(2) > span {
  background: linear-gradient(180deg, #c9b4ff 0%, #8b5cf6 78%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-avatar {
  position: absolute; z-index: 2; left: 50%; top: calc(8px + var(--hf) * 1.225); translate: -50% 0;
  width: auto; height: calc(var(--hf) * 2.28); max-width: 94vw; object-fit: contain; object-position: center bottom;
  filter: drop-shadow(0 30px 60px rgba(40, 14, 110, .55));
}
.hero-foot {
  position: absolute; z-index: 3; inset-inline: max(var(--pad), 24px); bottom: clamp(20px, 4vh, 44px);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; pointer-events: none;
}
.hero-foot > * { pointer-events: auto; }
.hero-id b { display: block; font-weight: 700; font-size: clamp(1.6rem, 3.2vw, 3rem); line-height: 1.25; }
.hero-id span { display: block; color: var(--accent-soft); font-size: clamp(1rem, 1.6vw, 1.5rem); }
.hero-cta { height: clamp(52px, 4.6vw, 68px); padding-inline: clamp(24px, 2.6vw, 40px); font-size: clamp(1rem, 1.5vw, 1.4rem); gap: 12px; box-shadow: 0 10px 40px rgba(124, 77, 255, .35); }
html[dir="rtl"] .hero-cta svg { transform: scaleX(-1); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 52px; padding: 0 28px; border-radius: 999px;
  font-weight: 700; font-size: 1rem; border: 1px solid transparent;
  transition: background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}
.btn-fill { background: var(--accent); color: #fff; }
.btn-fill:hover { background: #9b72fa; }
.btn-line { border-color: var(--line); }
.btn-line:hover { border-color: var(--text); }

/* حركة الدخول: مرة واحدة عند فتح الصفحة */
@media (prefers-reduced-motion: no-preference) {
  .hero-head .line > span { transform: translateY(110%); animation: rise 1s var(--ease) forwards; }
  .hero-head .line:nth-child(2) > span { animation-delay: .1s; }
  /* دخول مرة واحدة، ثم طفو هادئ مستمر */
  .hero-avatar {
    opacity: 0; transform: translateY(40px); transform-origin: 50% 85%;
    animation: avatar-in 1.1s var(--ease) .3s forwards, avatar-float 7s ease-in-out 1.4s infinite;
  }
  .hero-foot { opacity: 0; animation: fade .8s var(--ease) .8s forwards; }
}
@keyframes rise { to { transform: none; } }
@keyframes fade { to { opacity: 1; } }
@keyframes avatar-in { to { opacity: 1; transform: none; } }
@keyframes avatar-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-9px) rotate(-1.4deg); }
  50% { transform: translateY(-3px) rotate(0.6deg); }
  75% { transform: translateY(-11px) rotate(1.5deg); }
}

/* ───── الأقسام ───── */
.block { padding-block: clamp(64px, 9vw, 128px); border-top: 1px solid var(--line); }
.block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; margin-block-end: clamp(28px, 4vw, 48px); }
h2 { font-weight: 700; font-size: clamp(1.75rem, 3.4vw, 2.75rem); line-height: 1.35; }
html[lang="en"] h2 { letter-spacing: -.02em; line-height: 1.15; }

/* ───── الأعمال: سكشن لكل قسم، وكل سكشن شريط أفقي ───── */
.works-title { margin-block-end: clamp(28px, 4vw, 48px); }
.rail-sec { --rail-h: clamp(250px, 27vw, 390px); }
.rail-sec + .rail-sec { margin-block-start: clamp(44px, 6vw, 80px); }
.rail-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-block-end: 20px; }
.rail-head h3 { font-weight: 700; font-size: clamp(1.3rem, 2.2vw, 1.9rem); line-height: 1.4; }
.rail-nav { display: flex; gap: 8px; }
.rail-btn {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text);
  transition: border-color .25s var(--ease), background-color .25s var(--ease), opacity .25s var(--ease);
}
.rail-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent); }
.rail-btn:disabled { opacity: .3; cursor: default; }
html[dir="ltr"] .rail-btn.is-prev svg, html[dir="rtl"] .rail-btn.is-next svg { transform: scaleX(-1); }

.rail {
  display: flex; align-items: flex-start; gap: clamp(14px, 1.6vw, 22px);
  margin-inline: calc(-1 * var(--pad)); padding-inline: var(--pad); scroll-padding-inline: var(--pad);
  overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; cursor: grab; border-radius: 0;
}
.rail::-webkit-scrollbar { display: none; }
.rail.is-dragging { cursor: grabbing; user-select: none; }
.rail.is-dragging .card { pointer-events: none; }

.card {
  flex: none; display: block; width: min(calc(var(--rail-h) * var(--ar, 1)), 84vw); 
  padding: 0; border: 0; background: none; text-align: start;
}
.card-media { position: relative; display: block; width: 100%; overflow: hidden; border-radius: var(--r); background: var(--surface); }
.card-media img, .card-media video { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.card-media video { position: absolute; inset: 0; }
.card:hover .card-media img, .card:hover .card-media video { transform: scale(1.03); }
.card.is-ph { cursor: inherit; }
.card.is-ph .card-media { display: grid; place-items: center; border: 1px solid var(--line); color: #5d5580; }
.card-soon { padding: 8px; text-align: center; font-weight: 700; font-size: clamp(.95rem, 1.5vw, 1.3rem); line-height: 1.3; letter-spacing: .04em; color: #6f66a0; }
.card.is-ph .card-title { color: var(--muted); font-weight: 400; }
.card-badge {
  position: absolute; inset-inline-start: 12px; top: 12px;
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: .78rem; line-height: 1;
}
.card-badge svg { width: 9px; height: 9px; fill: currentColor; }
.card-text { display: block; }
.card-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; font-weight: 700; font-size: 1.05rem; margin-block-start: 12px; line-height: 1.5; overflow: hidden; }
.card-meta { display: block; color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───── العملاء ───── */
.clients {
  display: grid; gap: 16px; direction: ltr;
  margin-inline: calc(-1 * var(--pad));
  -webkit-mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent);
}
.marquee { overflow: hidden; }
.marquee-track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.marquee.is-rev .marquee-track { animation-direction: reverse; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-set { display: flex; gap: 16px; padding-inline-end: 16px; }
.logo-tile {
  flex: none; display: grid; place-items: center; width: 176px; height: 108px; padding: 20px 26px;
  border: 1px solid color-mix(in srgb, var(--accent-soft) 22%, transparent); border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  color: var(--muted); font-weight: 700; text-align: center; direction: rtl;
}
/* عند المرور: تدرّج بنفسجي خفيف يظهر بنعومة فوق البلاطة */
.logo-tile { position: relative; overflow: hidden; transition: border-color .4s var(--ease); }
.logo-tile::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .4s var(--ease);
  background: linear-gradient(135deg, rgba(183, 156, 255, .30), rgba(139, 92, 246, .16) 55%, rgba(139, 92, 246, .04));
}
.logo-tile > * { position: relative; }
.logo-tile img { transition: opacity .4s var(--ease); }
.logo-tile:not(.is-ph):hover { border-color: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.logo-tile:not(.is-ph):hover::before { opacity: 1; }
.logo-tile:not(.is-ph):hover img { opacity: 1; }
.logo-tile.is-ph { color: #4c4470; border-style: dashed; }
.logo-tile.is-ph svg { width: 30px; height: 30px; }
.logo-tile img { max-width: 124px; max-height: 66px; width: auto; height: auto; object-fit: contain; filter: brightness(0) invert(1); opacity: .92; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .marquee { overflow-x: auto; scrollbar-width: none; }
  .marquee-track { animation: none; }
  .marquee-set[aria-hidden] { display: none; }
}

/* ───── آراء العملاء ───── */
.review-sum { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 1rem; line-height: 1.5; }
.review-sum svg { color: #f6b400; flex: none; }
.review-sum b { color: var(--text); font-size: 1.3rem; }
.review-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.review-link {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent-soft) 40%, transparent); background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--text); font-weight: 700; font-size: .95rem;
  transition: background-color .25s var(--ease), border-color .25s var(--ease);
}
.review-link:hover { background: var(--accent); border-color: var(--accent); }
html[dir="rtl"] .review-link svg { transform: scaleX(-1); }
.rail.is-reviews { align-items: stretch; }
.review {
  flex: none; display: flex; flex-direction: column; gap: 16px; width: min(400px, 84vw); padding: 26px;
  border: 1px solid var(--line); border-radius: 22px; background: color-mix(in srgb, var(--surface) 62%, transparent);
  direction: rtl; text-align: right;
}
.review-stars { display: flex; gap: 3px; color: #f6b400; direction: ltr; justify-content: flex-end; }
.review-text { font-size: 1.05rem; line-height: 1.9; }
.review-by { display: flex; align-items: center; gap: 12px; margin-block-start: auto; padding-block-start: 16px; border-top: 1px solid var(--line); }
.review-avatar {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 26%, transparent); color: var(--accent-soft); font-weight: 700; font-size: 1.1rem;
}
.review-by b { display: block; font-weight: 700; line-height: 1.5; unicode-bidi: plaintext; text-align: right; }
.review-by small { display: block; color: var(--muted); font-size: .86rem; line-height: 1.5; unicode-bidi: plaintext; text-align: right; }

/* ───── نبذة ───── */
.about-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(28px, 6vw, 96px); }
.about-text { margin-block-start: 22px; font-size: clamp(1.05rem, 1.5vw, 1.3rem); line-height: 1.95; max-width: 30em; }
html[lang="en"] .about-text { line-height: 1.65; }

/* الصورة: دائرة تذوب أطرافها في الخلفية، حولها هالة بنفسجية وحلقة تدور ببطء عليها نقطة */
.about-photo { position: relative; margin: 0 clamp(8px, 2vw, 28px); width: clamp(230px, 30vw, 400px); aspect-ratio: 1; }
.about-photo[hidden] { display: none; }
.about-photo::before {
  content: ""; position: absolute; inset: -6%; border-radius: 50%;
  background: radial-gradient(circle closest-side, rgba(124, 77, 255, .42), rgba(124, 77, 255, .14) 62%, transparent 100%);
}
.about-photo img {
  position: relative; width: 100%; height: 100%; object-fit: cover; object-position: center 10%; border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle closest-side, #000 74%, transparent 97%);
  mask-image: radial-gradient(circle closest-side, #000 74%, transparent 97%);
}
.about-ring {
  position: absolute; inset: 1%; border-radius: 50%; z-index: 1;
  border: 1.5px solid color-mix(in srgb, var(--accent-soft) 55%, transparent);
}
.about-ring::before, .about-ring::after { content: ""; position: absolute; border-radius: 50%; background: var(--accent-soft); }
.about-ring::before { width: 14px; height: 14px; top: -7px; left: calc(50% - 7px); box-shadow: 0 0 18px var(--accent); }
.about-ring::after { width: 7px; height: 7px; bottom: 12%; left: 7%; opacity: .8; }
.about-badge {
  position: absolute; z-index: 2; bottom: 9%; inset-inline-start: -6%;
  padding: 9px 18px; border-radius: 999px; white-space: nowrap; font-weight: 700; font-size: .95rem; line-height: 1.5;
  border: 1px solid color-mix(in srgb, var(--accent-soft) 40%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.about-badge[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .about-ring { animation: orbit 26s linear infinite; }
  .about-badge { animation: badge-float 6s ease-in-out infinite; }
}
@keyframes orbit { to { rotate: 360deg; } }
@keyframes badge-float { 50% { translate: 0 -7px; } }

.services { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 clamp(16px, 2vw, 32px); margin-block-start: clamp(44px, 6vw, 80px); }
.services li { padding-block: 20px 0; border-top: 1px solid var(--line); }
.services b { display: block; font-weight: 700; font-size: 1.1rem; }
.services span { display: block; color: var(--muted); font-size: .92rem; line-height: 1.6; margin-block-start: 4px; }

/* ───── تواصل ───── */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 7vw, 112px); align-items: start; }
.contact-title { font-size: clamp(2.2rem, 5.4vw, 4.5rem); line-height: 1.25; }
html[lang="en"] .contact-title { line-height: 1.05; letter-spacing: -.03em; }
.contact-lead { color: var(--muted); margin-block-start: 16px; max-width: 26em; }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: 30px; }
.links a {
  display: inline-flex; align-items: center; height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--line); font-size: .95rem; transition: border-color .25s var(--ease);
}
.links a:hover { border-color: var(--text); }

.socials { display: flex; gap: 12px; margin-block-start: 22px; padding-block-start: 24px; border-top: 1px solid var(--line); }
.socials:empty, .links:empty { display: none; }
.socials a {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text);
  transition: background-color .25s var(--ease), border-color .25s var(--ease), translate .25s var(--ease);
}
.socials a:hover { background: var(--accent); border-color: var(--accent); translate: 0 -3px; }
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field > span { font-size: .9rem; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; line-height: 1.6; transition: border-color .25s var(--ease);
}
.field select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23a9a2c4' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 18px center; }
html[dir="ltr"] .field select { background-position: right 18px center; }
.field select, .field select option { background-color: var(--surface); color: var(--text); }
.field textarea { resize: vertical; min-height: 120px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field .is-bad { border-color: var(--accent); }
.form .btn { justify-self: start; border: 0; }
.form-note { min-height: 1.6em; font-size: .9rem; color: var(--muted); }

/* ───── التذييل ───── */
.foot { display: flex; justify-content: space-between; gap: 16px; padding-block: 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.foot a:hover { color: var(--text); }

/* ───── نافذة العمل ───── */
.sheet {
  width: min(1120px, calc(100vw - 32px)); max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0; border: 1px solid var(--line); border-radius: 24px;
  background: var(--surface); color: var(--text); overflow: auto;
}
.sheet { overscroll-behavior: contain; }
.sheet.is-tall { width: min(940px, calc(100vw - 32px)); }
.sheet::backdrop { background: rgba(7, 5, 15, .82); }
.sheet[open] { animation: sheet-in .35s var(--ease); }
.sheet[open]::backdrop { animation: fade .35s var(--ease); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px); } }
.sheet-bar { position: sticky; top: 0; height: 0; z-index: 2; }
.sheet-close {
  position: absolute; top: 14px; inset-inline-end: 14px;
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  transition: border-color .25s var(--ease);
}
.sheet-close:hover { border-color: var(--text); }
.sheet-in { display: grid; }
.sheet.is-tall .sheet-in { grid-template-columns: auto minmax(0, 1fr); }
.sheet-media { display: grid; gap: 12px; background: #07050f; }
.sheet.is-tall .sheet-media { align-content: center; }
.sheet-media video, .sheet-media img { width: 100%; height: auto; }
.sheet.is-tall .sheet-media video, .sheet.is-tall .sheet-media img { width: auto; height: auto; max-height: calc(100dvh - 34px); max-width: min(46vw, 440px); }
.sheet-info { padding: clamp(24px, 4vw, 48px); padding-block-start: clamp(64px, 6vw, 76px); align-self: center; }
.sheet:not(.is-tall) .sheet-info { padding-block-start: clamp(24px, 4vw, 40px); }
.sheet-info h3 { font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.35; }
.sheet-info p { color: var(--muted); margin-block-start: 14px; max-width: 34em; }
.facts { margin-block-start: 28px; border-top: 1px solid var(--line); }
.facts div { display: flex; justify-content: space-between; gap: 24px; padding-block: 13px; border-bottom: 1px solid var(--line); font-size: .95rem; }
.facts dt { color: var(--muted); flex: none; }
.facts dd { text-align: end; font-variant-numeric: tabular-nums; }

/* ───── الجوال ───── */
@media (max-width: 1000px) {
}
@media (max-width: 820px) {
  body { font-size: 16px; }
  .nav { display: none; }
  .lang { margin-inline-start: auto; height: 46px; }
  .top-in { height: 68px; }
  .brand { height: 46px; }
  .brand img { width: 34px; height: 34px; }
  /* الجوال: العناصر تحت بعض، والكشيدة أطول (يطوّلها site.js) حتى يطلع الرأس منها */
  .hero-in { --hf: clamp(2.4rem, min(14.2vw, 13svh), 8rem); height: auto; min-height: 0; padding-block: 18px 24px; }
  html[lang="en"] .hero-in { --hf: clamp(2.6rem, min(16vw, 13svh), 6rem); }
  .hero-avatar, html[lang="en"] .hero-avatar {
    position: relative; display: block; left: auto; top: auto; translate: none;
    width: calc(var(--hf) * 4.2); max-width: 84vw; height: auto;
    margin-inline: auto; margin-block-start: calc(var(--hf) * -0.56);
  }
  html[lang="en"] .hero-avatar { width: min(72vw, 340px); margin-block-start: 10px; }
  .hero-foot { position: static; margin-block-start: 18px; }
  .hero-cta svg { width: 18px; height: 18px; }
  .hero-foot { bottom: 22px; inset-inline: var(--pad); }
  .contact { grid-template-columns: 1fr; }
  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px clamp(16px, 4vw, 32px); }
  .sheet.is-tall .sheet-in { grid-template-columns: 1fr; }
  /* العمل العمودي على الشاشات الضيقة: يظهر كاملًا بدون تمرير، والمعلومات تحته */
  .sheet.is-tall .sheet-media { justify-items: center; }
  .sheet.is-tall .sheet-media video, .sheet.is-tall .sheet-media img { width: auto; max-width: 100%; max-height: 74dvh; }
  .sheet-info { padding-block-start: 24px; }
  .sheet-close { background: color-mix(in srgb, var(--bg) 70%, transparent); }
}
@media (max-width: 560px) {
  .rail-sec { --rail-h: 240px; }
  .about-top { grid-template-columns: 1fr; }
  .about-photo { order: -1; width: min(62vw, 260px); margin: 8px auto 28px; }
  .services { grid-template-columns: 1fr; gap: 20px; }
  .rail-btn { width: 42px; height: 42px; }
  .card-title { font-size: 1rem; margin-block-start: 10px; }
  .card-meta { font-size: .82rem; }
  .card-media { border-radius: 14px; }
  .clients { gap: 12px; }
  .marquee-set { gap: 12px; padding-inline-end: 12px; }
  .logo-tile { width: 140px; height: 88px; padding: 16px 20px; border-radius: 14px; }
  .logo-tile img { max-width: 100px; max-height: 54px; }
  .btn { height: 50px; padding: 0 24px; }
  .form .btn { justify-self: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
