:root {
  --primary: #6C5CE7;
  --primary-dark: #4A3FBF;
  --primary-light: #A29BFE;
  --accent: #FDCB6E;
  --accent-dark: #E8A94A;
  --success: #00B894;

  --bg: #FAF9FE;
  --surface: #FFFFFF;
  --surface-alt: #F4F2FC;
  --text: #1A1625;
  --text-muted: #6E6A7C;
  --outline: #E2DFF0;
  --shadow: 0 8px 30px rgba(108, 92, 231, .12);

  --radius: 20px;
  --max: 1080px;
}

:root[data-theme="dark"] {
  --bg: #12101B;
  --surface: #1C1929;
  --surface-alt: #242035;
  --text: #F2F0FA;
  --text-muted: #A9A4BD;
  --outline: #322D47;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Kufi Arabic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.85;
  font-size: 16px;
  transition: background .25s, color .25s;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--outline);
}
.header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--text-muted); font-size: 15px; padding: 8px 12px; border-radius: 10px;
}
.nav a:hover { background: var(--surface-alt); color: var(--text); text-decoration: none; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--outline);
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--surface-alt); }

@media (max-width: 680px) {
  .nav a.hide-sm { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; text-align: center; }
.hero-icon {
  width: 112px; height: 112px; border-radius: 28px;
  box-shadow: var(--shadow); margin: 0 auto 24px; display: block;
}
.hero h1 { font-size: clamp(30px, 6vw, 48px); line-height: 1.3; margin-bottom: 14px; }
.hero h1 .grad {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead {
  max-width: 640px; margin: 0 auto 28px; color: var(--text-muted); font-size: clamp(16px, 2.4vw, 19px);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 30px; border-radius: 16px; font-size: 17px; font-weight: 700;
  border: 0; cursor: pointer; font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; box-shadow: 0 10px 26px rgba(108, 92, 231, .38);
  transition: transform .15s, box-shadow .15s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(108, 92, 231, .45); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--outline); }
.btn-ghost:hover { background: var(--surface-alt); }

.hero-meta {
  margin-top: 18px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px;
  color: var(--text-muted); font-size: 14px;
}
.hero-meta .pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--outline);
  padding: 4px 14px; border-radius: 999px;
}
.hero-note { margin-top: 12px; color: var(--text-muted); font-size: 13px; }

/* ---------- Sections ---------- */
section { padding: 56px 0; scroll-margin-top: 64px; }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(24px, 4.2vw, 34px); margin-bottom: 8px; }
.section-head p { color: var(--text-muted); max-width: 560px; margin: 0 auto; }

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

.card {
  background: var(--surface); border: 1px solid var(--outline);
  border-radius: var(--radius); padding: 24px;
  transition: transform .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card .ico {
  width: 48px; height: 48px; border-radius: 14px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: var(--surface-alt);
}
.card h3 { font-size: 18px; margin-bottom: 6px; }
.card p { color: var(--text-muted); font-size: 15px; line-height: 1.75; }

/* ---------- Formats ---------- */
.formats { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.chip {
  padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: 15px;
  color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.chip.mp3 { background: #6C5CE7; }
.chip.aac { background: #00B894; }
.chip.wav { background: #0984E3; }
.chip.flac { background: #E17055; }
.chip.ogg { background: #E84393; }

/* ---------- Steps ---------- */
.steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: s; }
.step {
  background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius);
  padding: 24px; position: relative; counter-increment: s;
}
.step::before {
  content: counter(s); position: absolute; top: -14px; right: 20px;
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.step h3 { font-size: 17px; margin-bottom: 6px; }
.step p { color: var(--text-muted); font-size: 15px; }

/* ---------- Trust band ---------- */
.trust {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-radius: 28px; padding: 40px 28px; text-align: center;
}
.trust h2 { font-size: clamp(22px, 4vw, 30px); margin-bottom: 10px; }
.trust p { opacity: .92; max-width: 620px; margin: 0 auto 20px; }
.trust .btn-ghost { background: rgba(255, 255, 255, .15); color: #fff; border-color: rgba(255, 255, 255, .35); }
.trust .btn-ghost:hover { background: rgba(255, 255, 255, .25); }

/* ---------- Install help ---------- */
details {
  background: var(--surface); border: 1px solid var(--outline); border-radius: 16px;
  padding: 16px 20px; margin-bottom: 12px;
}
summary { cursor: pointer; font-weight: 700; }
details p, details ol { color: var(--text-muted); margin-top: 10px; font-size: 15px; }
details ol { padding-inline-start: 22px; }

/* ---------- Requirements ---------- */
.req { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.req div {
  background: var(--surface); border: 1px solid var(--outline); border-radius: 14px;
  padding: 12px 18px; font-size: 15px;
}
.req b { color: var(--primary); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--outline); padding: 32px 0 40px; margin-top: 24px; }
.footer .container {
  display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between;
  color: var(--text-muted); font-size: 14px;
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--primary); }

/* ---------- Privacy page ---------- */
.doc { padding: 48px 0 24px; max-width: 780px; margin: 0 auto; }
.doc h1 { font-size: clamp(28px, 5vw, 38px); margin-bottom: 8px; }
.doc .updated { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.doc h2 { font-size: 21px; margin: 32px 0 10px; color: var(--primary-dark); }
:root[data-theme="dark"] .doc h2 { color: var(--primary-light); }
.doc p { margin-bottom: 12px; color: var(--text); }
.doc ul { padding-inline-start: 24px; margin-bottom: 12px; }
.doc li { margin-bottom: 6px; }
.doc .callout {
  background: var(--surface-alt); border: 1px solid var(--outline);
  border-inline-start: 4px solid var(--success); border-radius: 14px;
  padding: 16px 20px; margin: 20px 0;
}
.doc table {
  width: 100%; border-collapse: collapse; margin: 14px 0 20px; font-size: 15px;
  background: var(--surface); border-radius: 12px; overflow: hidden;
}
.doc th, .doc td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--outline); vertical-align: top; }
.doc th { background: var(--surface-alt); }
.table-wrap { overflow-x: auto; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Download cards ---------- */
.dl-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); max-width: 900px; margin: 0 auto; }
.dl-card {
  position: relative; background: var(--surface); border: 1px solid var(--outline);
  border-radius: var(--radius); padding: 28px 22px 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.dl-card h3 { font-size: 19px; }
.dl-card p { color: var(--text-muted); font-size: 14.5px; line-height: 1.7; flex: 1; }
.dl-card .btn { width: 100%; margin-top: 8px; }
.dl-card.recommended { border: 2px solid var(--primary); box-shadow: var(--shadow); }
.dl-size { font-weight: 700; font-size: 22px; color: var(--primary); margin-top: 6px; }
.badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #1A1625; font-size: 13px; font-weight: 700;
  padding: 3px 14px; border-radius: 999px; white-space: nowrap;
}
.dl-help { text-align: center; color: var(--text-muted); font-size: 14px; max-width: 620px; margin: 24px auto 0; }

/* ================= Phone frame ================= */
.phone {
  position: relative;
  width: 100%;
  aspect-ratio: 360 / 751;
  background: #0d0b14;
  border-radius: 34px;
  padding: 9px;
  box-shadow:
    0 0 0 1.5px #2b2740,
    0 22px 50px rgba(30, 20, 80, .28),
    0 6px 14px rgba(30, 20, 80, .18);
}
.phone::before {                       /* كاميرا أمامية */
  content: ""; position: absolute; top: 15px; left: 50%; transform: translateX(-50%);
  width: 9px; height: 9px; border-radius: 50%; background: #05040a; z-index: 2;
  box-shadow: inset 0 0 0 1.5px #1c1830;
}
.phone-screen {
  width: 100%; height: 100%;
  border-radius: 26px; overflow: hidden;
  background: #131019;
}
.phone-screen picture, .phone-screen img { display: block; width: 100%; height: 100%; }
.phone-screen img { object-fit: cover; object-position: top center; }

/* ================= Hero: text + phones ================= */
.hero-grid { display: block; }
.hero-visual { position: relative; margin: 44px auto 0; width: min(76vw, 330px); }
.hero-visual .phone-main { position: relative; z-index: 2; }
.hero-visual .phone-back { display: none; }

@media (min-width: 900px) {
  .hero { padding: 72px 0 56px; text-align: start; }
  .hero-grid {
    display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 48px;
  }
  .hero-icon { margin: 0 0 22px; }
  .hero p.lead { margin: 0 0 28px; }
  .hero-meta { justify-content: flex-start; }
  .hero-visual { margin: 0; width: 100%; max-width: 440px; justify-self: center; height: 560px; }
  .hero-visual .phone { width: 250px; position: absolute; }
  .hero-visual .phone-main { top: 0; inset-inline-start: 30px; }
  .hero-visual .phone-back {
    display: block; top: 58px; inset-inline-end: 0; z-index: 1;
    transform: rotate(6deg); opacity: .96;
  }
  .hero-visual::before {                /* هالة خلف الهاتفين */
    content: ""; position: absolute; inset: 8% -6% 4%;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--primary) 30%, transparent), transparent 72%);
    z-index: 0; filter: blur(8px);
  }
}

/* ================= Screenshots gallery ================= */
.screens { padding-inline: 0; background: var(--surface-alt); }
.shots-track {
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 10px 0 30px;
  scrollbar-width: thin; scrollbar-color: var(--primary-light) transparent;
}
.shots-track:focus-visible { outline: 3px solid var(--primary-light); outline-offset: -3px; }
.shots-row {
  display: flex; gap: 22px; width: max-content; min-width: 100%;
  padding-inline: max(20px, calc((100vw - var(--max)) / 2 + 20px));
}
.shot {
  flex: 0 0 auto; width: 232px; scroll-snap-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 0;
}
.shot-btn {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in;
  border-radius: 34px; transition: transform .2s;
}
.shot-btn:hover { transform: translateY(-4px); }
.shot-btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
.shot figcaption { text-align: center; display: flex; flex-direction: column; gap: 4px; padding: 0 6px; }
.shot figcaption b { font-size: 16px; }
.shot figcaption span { font-size: 13.5px; color: var(--text-muted); line-height: 1.7; }

@media (min-width: 700px) { .shot { width: 250px; } }

/* ================= Lightbox ================= */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 8, 18, .86); backdrop-filter: blur(6px);
  padding: 24px; cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: min(92vw, 460px); max-height: calc(100vh - 64px); margin-top: 40px; width: auto; height: auto;
  border-radius: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.lightbox-close {
  position: absolute; top: 6px; inset-inline-start: 8px;
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 20px; cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .26); }
html.no-scroll { overflow: hidden; }

/* الوضع المظلم: ظلال أخف */
:root[data-theme="dark"] .phone { box-shadow: 0 0 0 1.5px #3a3556, 0 22px 50px rgba(0, 0, 0, .55); }
:root[data-theme="dark"] .screens { background: color-mix(in srgb, var(--surface) 70%, var(--bg)); }
