:root{
  --void:#070b14;
  --bg:#0c1424;
  --surface:#121b30;
  --surface2:#182238;
  --line:#22304c;
  --blue:#3672ff;
  --blue-bright:#6ea1ff;
  --blue-deep:#12295c;
  --text:#eaf0ff;
  --text-dim:#8695b7;
  --text-faint:#4e5c7c;
  --notif:#ff5c7a;
}

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

html{scroll-behavior:smooth;}

body{
  background:var(--bg);
  color:var(--text);
  font-family:'Cairo', sans-serif;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}

a{text-decoration:none; color:inherit;}
h1,h2,h3{font-family:'Tajawal', sans-serif;}
img{display:block;}

.wrap{
  max-width:1180px;
  margin:0 auto;
  padding:0 32px;
}

/* ============ NAVBAR ============ */
.navbar{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(12,20,36,0.75);
  backdrop-filter:blur(16px);
  border-bottom:1px solid var(--line);
}
.navbar .wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  direction: rtl;
  height:74px;
}
.brand{
  display:flex;
  align-items:center;
  gap:11px;
}
.brand-mark{
  width:36px; height:36px;
  border-radius:11px;
  background:linear-gradient(150deg,var(--blue),#1a3fb0);
  display:flex; align-items:center; justify-content:center;
}
.brand-mark span{
  font-family:'Tajawal', sans-serif;
  font-weight:900;
  font-size:16px;
  color:#fff;
}
.brand-name{
  font-family:'Tajawal', sans-serif;
  font-weight:800;
  font-size:16.5px;
}
.nav-links{
  display:flex;
  align-items:center;
  gap:38px;
}
.nav-links a{
  font-size:13.5px;
  font-weight:600;
  color:var(--text-dim);
  transition:color .2s ease;
  position:relative;
}
.nav-links a:hover{color:var(--text);}
.nav-links a.active{color:var(--text);}
.nav-links a.active::after{
  content:'';
  position:absolute;
  bottom:-24px; left:0; right:0;
  height:2px;
  background:var(--blue-bright);
  border-radius:2px;
}

/* Hamburger toggle — hidden on desktop, shown on mobile */
.nav-toggle{
  display:none;
  border:none;
  background:none;
  cursor:pointer;
}

/* ============ HERO (استعادة التصميم الأصلي + إصلاح الدائرة اللانهائية) ============ */
.hero {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.hero-rows {
  position: relative;
  height: 500px;
  display: flex;
  flex-direction: column;
  gap: 16px; /* التباعد الرأسي الأصلي */
  padding: 16px 0;
  direction: ltr; /* مهم جداً: لضمان استقرار حركة الشريط من الطرفين بدون فراغ RTL */
}

.poster-row {
  overflow: hidden;
  width: 100%;
  position: relative;
}

.poster-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.poster-track .poster-set {
  display: flex;
  gap: 16px;
  padding-inline-end: 16px;
  flex-shrink: 0;
}

.poster {
  position: relative;
  width: 160px;
  height: 224px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: radial-gradient(120% 120% at 30% 12%, var(--surface2) 0%, var(--surface) 60%, var(--surface2) 100%);
}

.poster::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238695b7' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='18' height='18' rx='3'/><circle cx='8.5' cy='8.5' r='1.5'/><path d='M21 15l-5-5L5 21'/></svg>") center / 22px 22px no-repeat;
  opacity: .5;
}

.poster img {
  position: relative;
  width: 100%; 
  height: 100%;
  object-fit: cover;
  display: block;
}

/* حركة الـ Rows المستقلة دائرية دون توقف */
.track-a {
  animation: infinite-loop-left 40s linear infinite;
}

.track-b {
  animation: infinite-loop-right 50s linear infinite;
}

/* Row 1: يزحف لليسار بمقدار مجموعة كاملة (1760px) ثم يعود لـ 0 بدون ملاحظة */
@keyframes infinite-loop-left {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-1760px, 0, 0);
  }
}

/* Row 2: يبدأ مُزاحاً لليسار بـ -1760px ويزحف لليمين نحو 0 ثم يعود لـ -1760px */
@keyframes infinite-loop-right {
  0% {
    transform: translate3d(-1760px, 0, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

/* الـ Gradient Shadow الأصلي كاملاً */
.hero-shade {
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  pointer-events: none;
  background: linear-gradient(to top, var(--bg) 6%, rgba(12,20,36,0.78) 34%, rgba(12,20,36,0.28) 55%, transparent 72%);
}

.hero-bottom {
  position: relative;
  z-index: 2;
  margin-top: -200px;
  padding-bottom: 128px;
  direction: rtl; /* إعادة الاتجاه للغة العربية للنصوص */
}
.hero-content{
  max-width:540px;
  text-align:start;
}
.hero-logo{
  display:flex;
  align-items:center;
  gap:13px;
  margin-bottom:22px;
}
.hero-mark{
  width:52px; height:52px;
  border-radius:16px;
  background:linear-gradient(150deg,var(--blue),#1a3fb0);
  display:flex; align-items:center; justify-content:center;
}
.hero-mark span{
  font-family:'Tajawal', sans-serif;
  font-weight:900;
  font-size:22px;
  color:#fff;
}
.hero-wordmark{
  font-family:'Tajawal', sans-serif;
  font-weight:800;
  font-size:30px;
}
.hero-tagline{
  font-size:20px;
  font-weight:700;
  line-height:1.6;
  margin-bottom:14px;
}
.hero-desc{
  font-size:14px;
  line-height:1.9;
  color:var(--text-dim);
  margin-bottom:34px;
}
.hero-actions{
  display:flex;
  align-items:center;
  gap:14px;
}

.btn-wrapper {
  position: relative;
  display: inline-flex;
}

.badge-new {
  position: absolute;
  top: -9px;
  right: 10px;
  background: linear-gradient(135deg, #ff3b30, #dc2626);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  z-index: 10;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  white-space: nowrap;
  letter-spacing: 0.2px;
  animation: badge-pulse 2s infinite ease-in-out;
}

@keyframes badge-pulse {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-2px) scale(1.04);
  }
}

.btn{
  display:inline-flex;
  align-items:center;
  gap:9px;
  font-size:13.5px;
  font-weight:700;
  padding:14px 26px;
  border-radius:14px;
  cursor:pointer;
  transition:transform .15s ease;
  white-space:nowrap;
}
.btn svg{width:16px; height:16px;}
.btn-primary{
  background:linear-gradient(135deg,var(--blue),#1e4fd6);
  color:#fff;
}
.btn-primary:hover{
  background-color: #1a3fb0;
  cursor: pointer;
}
.btn-secondary{
  background:var(--surface);
  color:var(--text);
  border:1px solid var(--line);
}

/* ============ FEATURES ============ */
.section{padding:90px 0;}
.section-head{
  text-align:center;
  margin-bottom:52px;
}
.section-tag{
  display:inline-block;
  font-family:'JetBrains Mono', monospace;
  font-size:11px;
  font-weight:600;
  color:var(--blue-bright);
  background:rgba(54,114,255,0.12);
  border:1px solid rgba(110,161,255,0.25);
  padding:6px 14px;
  border-radius:20px;
  margin-bottom:16px;
}
.section-title{
  font-weight:800;
  font-size:28px;
  margin-bottom:10px;
}
.section-sub{
  color:var(--text-dim);
  font-size:14px;
}

.feature-grid{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:20px;
}
.feature-card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:20px;
  padding:28px 24px;
  position:relative;
  overflow:hidden;
  transition:border-color .25s ease, transform .25s ease;
}
.feature-card:hover{
  border-color:rgba(110,161,255,0.35);
  transform:translateY(-4px);
}
.feature-card::before{
  content:'';
  position:absolute;
  top:-40px; left:-40px;
  width:120px; height:120px;
  background:radial-gradient(circle, rgba(54,114,255,0.14), transparent 70%);
}
.feature-icon{
  position:relative;
  width:46px; height:46px;
  border-radius:14px;
  background:rgba(54,114,255,0.14);
  display:flex; align-items:center; justify-content:center;
  margin-bottom:20px;
}
.feature-icon svg{width:21px; height:21px; stroke:var(--blue-bright);}
.feature-title{
  position:relative;
  font-family:'Tajawal', sans-serif;
  font-weight:700;
  font-size:15.5px;
  margin-bottom:9px;
}
.feature-desc{
  position:relative;
  font-size:12.5px;
  line-height:1.8;
  color:var(--text-dim);
}

/* ============ SCREENSHOTS ============ */
.screenshots-section{
  background:
    radial-gradient(ellipse 700px 400px at 50% 0%, rgba(54,114,255,0.08), transparent 65%),
    var(--void);
  padding:100px 0 120px;
}
.screens-row{
  display:flex;
  align-items:flex-end;
  justify-content:center;
  gap:26px;
}
.phone{
  position:relative;
  width:230px;
  height:470px;
  background:linear-gradient(180deg,#0e1830,#080e1c);
  border-radius:32px;
  padding:9px;
  box-shadow:0 50px 90px -30px rgba(0,0,0,0.7), inset 0 0 0 1px rgba(255,255,255,0.04);
  flex-shrink:0;
}
.phone.mid{
  width:252px;
  height:516px;
  z-index:2;
}
.phone-notch{
  position:absolute;
  top:9px; left:50%;
  transform:translateX(-50%);
  width:70px; height:16px;
  background:#080e1c;
  border-radius:12px;
  z-index:5;
}
.phone-screen{
  position:relative;
  width:100%; height:100%;
  background:var(--surface);
  border-radius:24px;
  overflow:hidden;
}
.phone-screen img{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:cover;
  display:block;
}

/* ============ FOOTER ============ */
footer{
  border-top:1px solid var(--line);
  padding:36px 0;
}
footer .wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  flex-wrap:wrap;
}
.footer-copy{
  font-size:12px;
  color:var(--text-faint);
}
.footer-social{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:12px;
}
.footer-social a{
  width:38px; height:38px;
  border-radius:11px;
  background:var(--surface);
  border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center;
  color:var(--text-dim);
  transition:color .2s ease, border-color .2s ease, background .2s ease;
}
.footer-social a:hover{
  color:var(--text);
  border-color:rgba(110,161,255,0.4);
  background:var(--surface2);
}
.footer-social svg{width:15px; height:15px;}
.footer-links{
  display:flex;
  gap:24px;
}
.footer-links a{
  font-size:12px;
  color:var(--text-dim);
}
.footer-links a:hover{color:var(--text);}

/* ============ ERROR PAGE ============ */
.error-section{
  min-height:calc(100vh - 74px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:80px 0;
  background:
    radial-gradient(ellipse 700px 400px at 50% 20%, rgba(54,114,255,0.10), transparent 65%),
    var(--void);
}
.error-card{
  max-width:520px;
  width:100%;
  text-align:center;
  padding:56px 40px;
  position:relative;
  overflow:hidden;
}
.error-code{
  position:relative;
  font-family:'JetBrains Mono', monospace;
  font-weight:600;
  font-size:88px;
  line-height:1;
  letter-spacing:2px;
  background:linear-gradient(135deg,var(--blue-bright),var(--blue));
  -webkit-background-clip:text;
  background-clip:text;
  -webkit-text-fill-color:transparent;
  margin-bottom:10px;
}
.error-title{
  position:relative;
  font-size:22px;
  font-weight:800;
  margin-bottom:12px;
}
.error-desc{
  position:relative;
  font-size:14px;
  line-height:1.9;
  color:var(--text-dim);
  margin-bottom:32px;
}
.error-actions{
  position:relative;
  display:flex;
  justify-content:center;
}

/* ============ MOBILE NAV (dropdown menu) ============ */
@media (max-width: 768px){
  .navbar .wrap{
    position:relative;
  }
  .nav-toggle{
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    gap:5px;
    width:42px; height:42px;
    border-radius:11px;
    background:var(--surface);
    border:1px solid var(--line);
    transition:border-color .2s ease, background .2s ease;
    order:-1;
  }
  .nav-toggle:hover{
    border-color:rgba(110,161,255,0.4);
    background:var(--surface2);
  }
  .nav-toggle span{
    width:18px; height:2px;
    background:var(--text);
    border-radius:2px;
    transition:transform .25s ease, opacity .25s ease;
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(1){transform:translateY(7px) rotate(45deg);}
  .nav-toggle[aria-expanded="true"] span:nth-child(2){opacity:0;}
  .nav-toggle[aria-expanded="true"] span:nth-child(3){transform:translateY(-7px) rotate(-45deg);}

  .navbar .nav-links{
    position:absolute;
    top:100%; left:0; right:0;
    flex-direction:column;
    align-items:stretch;
    gap:0;
    background:rgba(12,20,36,0.97);
    backdrop-filter:blur(16px);
    border-bottom:1px solid var(--line);
    box-shadow:0 30px 40px -20px rgba(0,0,0,0.6);
    max-height:0;
    overflow:hidden;
    transition:max-height .35s ease;
  }
  .navbar .nav-links.open{
    max-height:260px;
  }
  .navbar .nav-links a{
    padding:16px 32px;
    font-size:15px;
  }
  .navbar .nav-links a:hover{color:var(--text);}
  .navbar .nav-links a.active{
    color:var(--text);
    background:rgba(54,114,255,0.12);
  }
  .navbar .nav-links a.active::after{display:none;}
}

@media (max-width: 960px){
  .nav-links{gap:20px;}
  .hero-rows{height:390px; gap:12px; padding:12px 0;}
  .poster{width:128px; height:180px;}
  .hero-bottom{margin-top:-140px; padding-bottom:96px;}
  .hero-content{
    max-width:560px;
    margin:0 auto;
    text-align:center;
  }
  .hero-logo{justify-content:center;}
  .hero-actions{justify-content:center;}
  .feature-grid{grid-template-columns:repeat(2,1fr);}
  .screens-row{flex-wrap:wrap;}
  .phone.mid{order:-1; width:220px; height:450px;}
}

@media (max-width: 560px){
  .feature-grid{grid-template-columns:1fr;}
  .hero-rows{height:320px; gap:10px; padding:10px 0;}
  .poster{width:104px; height:146px;}
  .hero-bottom{margin-top:-100px; padding-bottom:80px;}
  .hero-actions{flex-wrap:wrap;}
  .hero-actions .btn{
    padding:11px 18px;
    font-size:12.5px;
    border-radius:12px;
  }
  .hero-actions .btn svg{width:14px; height:14px;}
  .error-card{padding:44px 24px;}
  .error-code{font-size:64px;}
}

@media (prefers-reduced-motion: reduce){
  .poster-track{animation:none;}
}