/* urflix.app — الصفحة الرئيسية (صفحة تحميل التطبيق).
 *
 * طابع منصات البث: واجهة بملء الشاشة فوق جدار ملصقات، وأرقام كبيرة مفرّغة لخطوات التثبيت، وبطاقات بتدرّج داكن، وأسئلة في أشرطة
 * عريضة تنفتح. ملصقات الجدار لأعمال صارت ملكاً عاماً، لا عناوين المكتبة:
 * الصفحة عامة.
 *
 * وصفحات الخصوصية والشروط وحقوق النشر على الملف نفسه (قسمها في آخره).
 *
 * في الكتابة العربية: لا letter-spacing على نص عربي، والأرقام اللاتينية
 * والإصدارات تُغلّف بـ dir="ltr".
 */

:root {
  --bg: #000;
  --surface: #141414;           /* خلفية التطبيق نفسه */
  --bar: #2d2d2d;               /* أشرطة الأسئلة */
  --text: #fff;
  --muted: #b3b3b3;
  --brand: #d81f34;             /* أحمر التطبيق */
  --brand-hover: #e62238;
  --card: linear-gradient(149deg, #1b1f3d 0%, #2b0d17 96%);
  --gap: clamp(56px, 8vw, 96px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(16px, 5vw, 40px);
}

:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 4px; }

/* ─────────── الترويسة ─────────── */

.top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
}
.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
}
.logo { display: inline-flex; }
.logo img { height: clamp(22px, 3vw, 30px); width: auto; display: block; }

.top-cta {
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
  padding: 6px 16px;
  border-radius: 4px;
  transition: background 0.15s;
}
.top-cta:hover { background: var(--brand-hover); }

/* ─────────── الواجهة ─────────── */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(560px, 82svh, 740px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 110px 0 140px;
}

/* على الشاشات العريضة: لوحة بعرض محدود في الوسط وحوافّها السفلى مدوّرة،
 * لا شريط بعرض الشاشة كلها. */
@media (min-width: 1100px) {
  .hero {
    width: min(100% - 64px, 1560px);
    margin-inline: auto;
    border-radius: 0 0 28px 28px;
  }
}

/* جدار الملصقات: مائل قليلاً كأنه رفّ يمتد خلف الصفحة. الملصق بحجم ثابت
 * (لا يكبر مع عرض الشاشة)، والجدار أعرض من اللوحة فلا تظهر حوافّه. */
.wall {
  --t: clamp(86px, 8vw, 138px);
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -2;
  display: grid;
  grid-template-columns: repeat(16, var(--t));
  gap: clamp(8px, 0.8vw, 13px);
  transform: translate(-50%, -50%) rotate(-9deg);
  pointer-events: none;
}
/* ملصقات أعمال صارت ملكاً عاماً (المصادر في README). دورة من 11 خانة على
 * 16 عموداً: كل صف يُزاح خمس خانات، فلا يتكرّر الملصق نفسه في عمود واحد. */
.wall i {
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  background: #141414 center / cover no-repeat;
}
.wall i:nth-child(11n+1) { background-image: url("/assets/classics/nosferatu.jpg"); }
.wall i:nth-child(11n+2) { background-image: url("/assets/classics/the-general.jpg"); }
.wall i:nth-child(11n+3) { background-image: url("/assets/classics/fantomas.jpg"); }
.wall i:nth-child(11n+4) { background-image: url("/assets/classics/caligari.jpg"); }
.wall i:nth-child(11n+5) { background-image: url("/assets/classics/lost-world.jpg"); }
.wall i:nth-child(11n+6) { background-image: url("/assets/classics/perils-of-pauline.jpg"); }
.wall i:nth-child(11n+7) { background-image: url("/assets/classics/potemkin.jpg"); }
.wall i:nth-child(11n+8) { background-image: url("/assets/classics/trip-to-the-moon.jpg"); }
.wall i:nth-child(11n+9) { background-image: url("/assets/classics/nanook.jpg"); }
.wall i:nth-child(11n+10) { background-image: url("/assets/classics/great-train-robbery.jpg"); }
.wall i:nth-child(11n+11) { background-image: url("/assets/classics/the-general.jpg"); }

/* تعتيم: أغمق عند الأطراف وفي الأعلى والأسفل، فيُقرأ العنوان فوق أي ملصق. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.35) 30%, rgba(0, 0, 0, 0.45) 65%, #000 100%),
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.8) 75%);
}

.hero-inner { max-width: 720px; }

h1 {
  margin: 0 auto 14px;
  font-size: clamp(34px, 5.6vw, 60px);
  line-height: 1.22;
  font-weight: 700;
  text-wrap: balance;
}

.lede {
  margin: 0 auto 26px;
  font-size: clamp(17px, 2vw, 22px);
  color: #e8e8e8;
  max-width: 34ch;
  text-wrap: balance;
}

.ready { margin: 0 0 16px; font-size: clamp(15px, 1.6vw, 18px); color: #e8e8e8; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 28px;
  border-radius: 4px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 600;
  transition: background 0.15s;
}
.btn:hover { background: var(--brand-hover); }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn .size { font-size: 0.72em; font-weight: 400; opacity: 0.8; }

.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
.facts li {
  font-size: 13.5px;
  color: #d6d6d6;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 12px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

/* القوس الأحمر في أسفل الواجهة */
.arc {
  position: absolute;
  inset: auto -20% -1px -20%;
  height: clamp(70px, 9vw, 120px);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  border-top: 3px solid transparent;
  background:
    linear-gradient(#000, #000) padding-box,
    linear-gradient(90deg, rgba(216, 31, 52, 0) 8%, #8c1222 26%, #ff3b52 50%, #8c1222 74%, rgba(216, 31, 52, 0) 92%) border-box;
  z-index: 1;
}
.arc::before {
  content: "";
  position: absolute;
  inset: -40px 18% auto 18%;
  height: 60px;
  background: radial-gradient(ellipse at 50% 100%, rgba(216, 31, 52, 0.45), transparent 70%);
  filter: blur(8px);
  pointer-events: none;
}

/* ─────────── الأقسام ─────────── */

section { padding-block: calc(var(--gap) / 2); }
section + section { padding-top: calc(var(--gap) / 3); }
.hero + section { padding-top: 8px; }

h2 {
  margin: 0 0 18px;
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 600;
  line-height: 1.4;
}

.sub { margin: -8px 0 22px; color: var(--muted); max-width: 60ch; }

/* ─────────── الخطوات بالأرقام الكبيرة ─────────── */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2vw, 24px);
  padding: 0;
  margin: 0;
  list-style: none;
}
/* الرقم فوق بطاقته، وأسفله يدخل حافّتها: لا يغطّي سطراً من النص. */
.step { display: flex; flex-direction: column; }
.step .n {
  display: block;
  font-size: clamp(96px, 10vw, 140px);
  line-height: 1;
  font-weight: 700;
  color: #000;
  -webkit-text-stroke: 2px #6b6b6b;
  margin: 0 18px -0.3em;
  position: relative;
  z-index: 1;
  user-select: none;
}
.step .card { flex: 1; padding-top: 0.75em; }
.step .card h3 { padding-top: 14px; }

.card {
  position: relative;
  background: var(--card);
  border-radius: 14px;
  padding: 22px 22px 24px;
  overflow: hidden;
}
.card h3 { margin: 0 0 8px; font-size: clamp(18px, 1.8vw, 22px); font-weight: 600; line-height: 1.4; }
.card p { margin: 0; color: #c9c9d1; font-size: 15px; }
.card .hint { margin-top: 10px; font-size: 13.5px; color: #9a9aa6; }

/* ─────────── الأسباب ─────────── */

.reasons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 1.6vw, 18px);
}
.reasons .card { padding-bottom: 76px; min-height: 230px; }
.reasons .card svg {
  position: absolute;
  inset: auto auto 20px 20px;
  width: 48px;
  height: 48px;
}

/* ─────────── التلفاز ─────────── */

.tv-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.tv-copy p { color: #d6d6d6; font-size: clamp(16px, 1.6vw, 19px); margin: 0 0 18px; }
.tv-copy ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.tv-copy li { padding-inline-start: 18px; position: relative; color: var(--muted); }
.tv-copy li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.75em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
}
.tv-copy li strong { color: #fff; font-weight: 600; display: block; }

.tv {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  padding: 7% 7% 0;
  background: var(--surface);
  border: 10px solid #1e1e1e;
  box-shadow: 0 30px 80px -20px rgba(216, 31, 52, 0.35);
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 12px;
}
.tv::after {
  content: "";
  position: absolute;
  inset: auto 38% -10px;
  height: 10px;
  background: #1e1e1e;
}
.tv .code-box { text-align: center; padding: 6% 0 4%; }
.tv .code-box p { margin: 0 0 8px; color: var(--muted); font-size: clamp(11px, 1.2vw, 14px); }
.tv .code {
  font-family: "Archivo", "IBM Plex Sans Arabic", sans-serif;
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #fff;
}
.tv .tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tv .tiles i { aspect-ratio: 16 / 10; border-radius: 4px; background: linear-gradient(150deg, #33495f, #0b1117); }
.tv .tiles i:nth-child(2) { background: linear-gradient(150deg, #6b1222, #1a0508); }
.tv .tiles i:nth-child(3) { background: linear-gradient(150deg, #92520f, #201003); }
.tv .tiles i:nth-child(4) { background: linear-gradient(150deg, #2c3184, #0a0b22); }
.tv .tiles i:first-child { outline: 2px solid #fff; outline-offset: 2px; }

/* ─────────── الأسئلة ─────────── */

.faq { display: grid; gap: 8px; }
.faq details { background: var(--bar); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(18px, 2.2vw, 24px);
  font-size: clamp(17px, 2vw, 23px);
  line-height: 1.4;
  transition: background 0.15s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { background: #414141; }
.faq summary svg { width: clamp(26px, 3vw, 36px); height: clamp(26px, 3vw, 36px); flex: none; transition: transform 0.2s; }
.faq details[open] summary svg { transform: rotate(45deg); }
.faq details > div {
  border-top: 1px solid #000;
  padding: clamp(18px, 2.2vw, 24px);
  font-size: clamp(16px, 1.7vw, 20px);
  line-height: 1.75;
  color: #e8e8e8;
}
.faq details > div p { margin: 0; }
.faq details > div p + p { margin-top: 12px; }

/* ─────────── الختام ─────────── */

.closing { text-align: center; padding-block: calc(var(--gap) / 2) var(--gap); }
.closing p { margin: 0 0 16px; font-size: clamp(16px, 1.7vw, 19px); color: #e8e8e8; }

/* ─────────── التذييل ─────────── */

footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-block: 44px 28px;
  color: var(--muted);
  font-size: 14px;
}
/* الشعار وسطر عن التطبيق، ثم مجموعتا الروابط */
.foot {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px 40px;
  align-items: start;
}
.foot-brand .logo img { height: 22px; }
.foot-brand p { margin: 12px 0 0; max-width: 30ch; }
.foot nav { display: grid; gap: 10px; align-content: start; }
.foot h3 { margin: 0 0 4px; color: #fff; font-size: 14.5px; font-weight: 600; }
.foot nav a { text-decoration: none; width: fit-content; }
.foot nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.foot-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
}

/* ─────────── صفحات الخصوصية والشروط وحقوق النشر ─────────── */

.top.page { position: static; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }

/* بعرض الصفحة نفسه، فيبدأ النص من حيث يبدأ الشعار؛ والأسطر لا تطول عن حدّ القراءة. */
.doc { padding-block: clamp(36px, 6vw, 64px) var(--gap); }
.doc > * { max-width: 780px; }
.doc h1 {
  margin: 0 0 6px;
  font-size: clamp(30px, 4.4vw, 44px);
  line-height: 1.25;
  text-align: start;
}
.doc .updated { margin: 0 0 clamp(24px, 4vw, 40px); color: var(--muted); font-size: 14px; }
.doc h2 { margin: clamp(28px, 4vw, 40px) 0 10px; font-size: clamp(19px, 2vw, 23px); }
.doc p { margin: 0 0 12px; color: #d6d6d6; font-size: 16.5px; }
.doc ul { margin: 0 0 12px; padding-inline-start: 20px; color: #d6d6d6; font-size: 16.5px; }
.doc li { margin-bottom: 8px; }
.doc li::marker { color: var(--brand); }
.doc strong { color: #fff; font-weight: 600; }
.doc a { color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--brand); }
.doc a:hover { color: var(--brand-hover); }

/* صندوق بارز: نفس شريط الأسئلة في الصفحة الرئيسية */
.note-box {
  background: var(--bar);
  border-radius: 8px;
  padding: clamp(18px, 2.4vw, 24px);
  margin: 0 0 8px;
}
.note-box p:last-child { margin-bottom: 0; }

/* صفحة حقوق النشر: الجزء الإنجليزي بعد العربي، بخط فاصل */
.lang-jump { margin-inline-start: 10px; font-size: 13px; }
.en {
  margin-top: clamp(36px, 5vw, 56px);
  padding-top: clamp(28px, 4vw, 40px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}
.doc .en-title { margin-top: 0; font-size: clamp(26px, 3.4vw, 34px); }

/* ─────────── الشاشات الصغيرة ─────────── */

@media (max-width: 960px) {
  .steps { grid-template-columns: 1fr; gap: 10px; }
  .step .n { font-size: 96px; }
  .reasons { grid-template-columns: repeat(2, 1fr); }
  .tv-grid { grid-template-columns: 1fr; }
  .tv { max-width: 560px; }
}

@media (max-width: 600px) {
  .top .wrap { min-height: 68px; }
  .hero { padding: 104px 0 120px; min-height: 640px; }
  .wall { --t: 92px; grid-template-columns: repeat(8, var(--t)); }
  .btn { width: 100%; }
  .foot { grid-template-columns: 1fr 1fr; }

  /* الهاتف: أقل نص. ما يُكتب للشاشة الكبيرة (سطر ثانٍ، معلومات إضافية،
   * رسمة التلفاز) يُخفى، والبطاقات تكتفي بالأيقونة والعنوان. */
  .wide-only { display: none !important; }
  .steps { gap: 2px; }
  .step .n { font-size: 72px; }
  .card .hint { display: none; }
  .reasons { grid-template-columns: 1fr 1fr; gap: 10px; }
  .reasons .card { min-height: 0; padding: 16px 14px 62px; }
  .reasons .card h3 { font-size: 16px; margin: 0; }
  .reasons .card p { display: none; }
  .reasons .card svg { width: 34px; height: 34px; inset: auto auto 14px 14px; }
  .foot-brand { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .faq summary svg { transition: none; }
}
