:root {
  --black: #030303;
  --black-2: #0d0d0e;
  --card: #141414;
  --card-2: #1c191b;
  --line: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --muted: #b8b2b7;
  --pink: #f8c7dc;
  --pink-2: #d7a0b7;
  --pink-dark: rgba(248, 199, 220, 0.14);
  --radius: 32px;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Tajawal", sans-serif;
  background: var(--black);
  color: var(--text);
  overflow-x: hidden;
  font-size: 16px;
}

body.no-scroll {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

.site-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 12%, rgba(248, 199, 220, 0.16), transparent 24%),
    radial-gradient(circle at 12% 40%, rgba(248, 199, 220, 0.08), transparent 25%),
    linear-gradient(180deg, #030303 0%, #070607 55%, #030303 100%);
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  width: min(1120px, calc(100% - 32px));
  margin-top: 16px;
  margin-left: auto;
  margin-right: auto;
  padding: 16px 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(3, 3, 3, 0.74);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  direction: ltr;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: var(--pink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: var(--muted);
  font-weight: 800;
  font-size: 16px;
  transition: 0.25s;
}

.nav-links a:hover {
  color: var(--pink);
}

.menu-toggle {
  display: none;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #111;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--pink);
  border-radius: 8px;
  transition: 0.25s;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

/* General Layout */
.section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 96px 0;
}

.section-head { 
  margin-bottom: 48px; 
  text-align: center; /* إضافة توسيط إجباري للقسم بالكامل */
}

.section-head h2 { 
  font-size: clamp(32px, 6vw, 48px); 
  line-height: 1.2; 
  font-weight: 900; 
  margin-bottom: 16px; 
}

.section-head p { 
  max-width: 680px; 
  color: var(--muted); 
  font-size: clamp(16px, 2vw, 24px); 
  line-height: 1.5; 
  margin: 0 auto; /* توسيط الباراجراف نفسه */
}

.page-title {
  margin-top: 48px;
  text-align: center;
}

/* Hero */
.hero {
  min-height: calc(100vh - 96px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  position: relative;
  padding-top: 64px;
}

.hero-glow {
  position: absolute;
  top: 16%;
  width: 384px;
  height: 128px;
  background: radial-gradient(circle, rgba(248, 199, 220, 0.18), transparent 65%);
  filter: blur(16px);
  pointer-events: none;
}

.small-badge {
  border: 1px solid rgba(248, 199, 220, 0.35);
  background: rgba(248, 199, 220, 0.09);
  color: var(--pink);
  padding: 8px 16px;
  border-radius: 32px;
  font-weight: 800;
  margin-bottom: 32px;
  font-size: 16px;
}

.hero-title {
  min-height: 80px;
  font-size: clamp(40px, 8vw, 64px);
  line-height: 1.2;
  font-weight: 900;
  cursor: pointer;
  letter-spacing: -1px;
  transition: 0.25s;
}

.hero-title:hover {
  color: var(--pink);
  text-shadow: 0 0 24px rgba(248, 199, 220, 0.25);
}

.hero-title.typing::after {
  content: "|";
  color: var(--pink);
  margin-right: 8px;
  animation: blink 0.7s infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-subtitle {
  color: var(--pink);
  font-size: clamp(16px, 2.5vw, 24px);
  font-weight: 800;
  margin-top: 16px;
}

.hero-text {
  max-width: 768px;
  color: var(--muted);
  font-size: clamp(16px, 2.5vw, 24px);
  line-height: 1.5;
  margin: 32px auto 0;
}

.hero-actions {
  width: min(704px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
}

.btn {
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  min-height: 48px; /* تم التصغير من 64px */
  border-radius: 24px; 
  font-size: 16px; 
  font-weight: 800; /* تخفيف سماكة الخط قليلاً لتناسب الحجم الجديد */
  padding: 0 24px; /* تصغير المساحة الجانبية */
  transition: 0.25s; 
  cursor: pointer; 
  border: none;
}

.btn.primary {
  background: var(--pink-2);
  color: #070707;
}

.btn.primary:hover {
  background: var(--pink);
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(248, 199, 220, 0.22);
}

.btn.secondary {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
}

.btn.secondary:hover {
  border-color: var(--pink);
  color: var(--pink);
  transform: translateY(-4px);
}

/* Stats */
.stats-wrap {
  padding-top: 32px;
}

.stats-card {
  width: min(832px, 100%);
  margin: auto;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 65% 10%, rgba(248, 199, 220, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow);
  display: grid;
  gap: 24px;
}

.stat-box {
  border: 1px solid var(--line);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.035);
  padding: 32px;
  text-align: right;
  transition: 0.25s;
}

.stat-box:hover {
  border-color: rgba(248, 199, 220, 0.45);
  transform: translateX(-8px);
}

.stat-box strong {
  display: block;
  color: var(--pink);
  font-size: clamp(64px, 10vw, 88px);
  line-height: 1;
  font-weight: 900;
  margin-bottom: 8px;
}

.stat-box span {
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
}

.stat-box strong span.counter {
  font-size: inherit;
  color: inherit;
}

/* Services Slider */
.slider-shell {
  overflow: hidden;
  padding: 16px 0;
  mask-image: linear-gradient(to left, transparent, #000 8%, #000 92%, transparent);
}

.services-track {
  display: flex;
  gap: 24px;
  width: max-content;
  animation: moveCards 14s linear infinite;
}

.services-track:hover {
  animation-play-state: paused;
}

@keyframes moveCards {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(50%);
  }
}

.service-card {
  width: 352px;
  min-height: 288px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.045);
  padding: 32px;
  box-shadow: var(--shadow);
}

.icon {
  width: 64px;
  height: 64px;
  border-radius: 24px;
  background: rgba(248, 199, 220, 0.14);
  border: 1px solid rgba(248, 199, 220, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 32px;
}

.service-card h3 {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 16px;
}

.service-card p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

/* Cards & Projects */
.cards-grid,
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.info-card,
.project-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 72% 16%, rgba(248, 199, 220, 0.12), transparent 25%),
    rgba(255, 255, 255, 0.04);
  padding: 32px;
  box-shadow: var(--shadow);
  transition: 0.3s ease;
}

.info-card:hover,
.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(248, 199, 220, 0.35);
}

.fake-img,
.project-img {
  height: 224px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 72% 28%, rgba(248, 199, 220, 0.22), transparent 18%),
    linear-gradient(135deg, #1a1a1b, #272326);
  margin-bottom: 24px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fake-img span,
.project-img span {
  direction: ltr;
  color: rgba(255, 255, 255, 0.58);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.project-img.has-img img {
  display: block;
}

.project-img.has-img span {
  display: none;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.right-tags {
  justify-content: flex-start;
}

.tags span {
  border: 1px solid rgba(248, 199, 220, 0.28);
  background: rgba(248, 199, 220, 0.13);
  color: var(--pink);
  padding: 8px 16px;
  border-radius: 32px;
  font-weight: 900;
  font-size: 16px;
}

.info-card h3,
.project-card h3 {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.5;
  font-weight: 900;
  margin-bottom: 16px;
  text-align: right;
}

.info-card p,
.project-card p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
  text-align: right;
}

.card-btn {
  margin-top: 24px;
  padding: 16px 24px;
  border-radius: 32px;
  border: 1px solid rgba(248, 199, 220, 0.32);
  background: rgba(248, 199, 220, 0.14);
  color: #fff;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
  transition: 0.25s;
  display: inline-flex;
}

.card-btn:hover {
  background: var(--pink);
  color: #050505;
}

/* Certificates specific tweaks */
.cert-title {
  font-size: 24px !important;
}

.cert-card {
  opacity: 0;
  transform: scale(0.95) translateY(24px) rotateX(-5deg);
  transition: all 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cert-card.animated {
  opacity: 1;
  transform: scale(1) translateY(0) rotateX(0);
}

.center-action {
  text-align: center;
  margin-top: 48px;
}

/* FAQ */
.faq-list {
  width: min(832px, 100%);
  margin: auto;
  display: grid;
  gap: 16px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.045);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  min-height: 80px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: clamp(16px, 3vw, 24px);
  font-weight: 900;
  cursor: pointer;
  text-align: right;
}

.faq-question b {
  color: var(--pink);
  font-size: 32px;
  font-weight: 500;
  transition: 0.25s;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
  padding: 0 32px;
  transition: 0.3s ease;
}

.faq-item.active .faq-answer {
  max-height: 192px;
  padding: 0 32px 24px;
}

.faq-item.active .faq-question b {
  transform: rotate(45deg);
}

/* Contact */
.contact {
  padding-bottom: 48px;
}

.contact-card {
  width: min(832px, 100%);
  margin: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 10% 10%, rgba(248, 199, 220, 0.08), transparent 40%),
    rgba(255, 255, 255, 0.02);
  padding: clamp(32px, 5vw, 64px);
  text-align: right; /* محاذاة لليمين كما في الصورة */
  box-shadow: var(--shadow);
}

.contact-subtitle {
  display: block;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}

.contact-card h2 {
  font-size: clamp(28px, 6vw, 48px);
  font-weight: 900;
  margin-bottom: 16px;
  line-height: 1.3;
}

.contact-card p {
  max-width: 600px;
  color: var(--muted);
  font-size: clamp(16px, 2.5vw, 22px);
  line-height: 1.6;
  margin: 0 0 40px 0;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: flex-start; /* الأزرار تبدأ من اليمين */
}

.contact-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 24px;
  border-radius: 12px; /* زوايا متوسطة الانحناء مطابقة للصورة */
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  font-family: sans-serif;
  direction: ltr; /* لضمان الأيقونة على اليمين والنص على اليسار داخل الزر */
  transition: 0.25s;
}

.contact-links a svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.contact-links a:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--pink);
  color: var(--pink);
}

.footer {
  width: min(1120px, calc(100% - 32px));
  margin: auto;
  padding: 32px 0 64px;
  border-top: 1px solid var(--line);
  color: #8f8a8d;
  text-align: center;
  font-weight: 900;
  font-size: 16px;
}

/* Modal / Full Page Overlay for Projects */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  background: var(--black);
  overflow-y: auto;
}

.modal.show {
  display: block;
  animation: slideUp 0.4s ease forwards;
}

@keyframes slideUp {
  from {
    transform: translateY(48px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 832px;
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(32px, 5vw, 64px) 24px;
}

.modal-header {
  margin-bottom: 48px;
}

.modal-close {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  z-index: 5;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-header span {
  display: inline-flex;
  color: var(--pink);
  border: 1px solid rgba(248, 199, 220, 0.28);
  padding: 8px 16px;
  border-radius: 32px;
  font-weight: 900;
  margin-bottom: 16px;
}

.modal-header h2 {
  font-size: clamp(32px, 7vw, 64px);
  line-height: 1.2;
  margin-bottom: 16px;
  font-weight: 900;
}

.modal-header p {
  color: var(--muted);
  font-size: 24px;
  line-height: 1.5;
}

.modal-gallery {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.gallery-item {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 32px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #1c1c1d, #282327);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item span {
  direction: ltr;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 900;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.gallery-item.has-img img {
  display: block;
}

.gallery-item.has-img span {
  display: none;
}

.modal-link {
  margin-top: 32px;
  width: 100%;
}

/* Responsive Overrides */
@media (max-width: 900px) {
  .navbar {
    margin-top: 16px;
    width: calc(100% - 32px);
  }

  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 16px);
    right: 0;
    left: 0;
    background: rgba(7, 7, 8, 0.96);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 24px;
    display: grid;
    gap: 8px;
    transform: translateY(-16px);
    opacity: 0;
    pointer-events: none;
    transition: 0.25s;
  }

  .nav-links.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-links a {
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.035);
  }

  .section {
    width: calc(100% - 32px);
    padding: 64px 0;
  }

  .hero-actions {
    grid-template-columns: 1fr;
  }

  .cards-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .service-card {
    width: 312px;
  }
}

@media (max-width: 520px) {
  .service-card {
    width: 288px;
    min-height: 256px;
  }
}


/* الأبعاد الدقيقة 720w - 552h (النسبة 720/552) لغلاف المشاريع وصور الـ Modal */
.project-img, .gallery-item {
  width: 100%;
  aspect-ratio: 720 / 552; /* يضبط الطول والعرض تلقائياً بنفس النسبة الدقيقة */
  height: auto;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #1c1c1d, #282327);
}

/* تنسيق زر X للنافذة بحيث يكون ثابت ويلحقك (Fixed) ونفس ستايل الشهادات */
/* تنسيق زر X للنافذة بحيث يكون ثابت بالشاشة ونفس ستايل الموقع الأصلي */
.modal-close {
  position: fixed;
  top: 32px;
  left: 32px; /* لليسار */
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06); /* الثيم الشفاف القديم */
  color: #fff;
  font-size: 32px; /* تكبير الإكس شوي ليكون أوضح */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.3s ease;
  z-index: 9999; /* رقم عالي جداً عشان يغطي على كل الصور وما يختفي */
}

.modal-close:hover {
  background: var(--pink);
  color: #000;
  border-color: var(--pink);
}

/* تنسيق الفريمات الخاصة باسم المشروع وفريق لعبة أرث */
.custom-frame {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(248, 199, 220, 0.2);
  border-radius: 16px;
  padding: 16px 24px;
  min-width: 200px;
}
.custom-frame .frame-label {
  display: block;
  font-size: 14px;
  color: var(--pink);
  margin-bottom: 6px;
  font-weight: 800;
}
.custom-frame .frame-content {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

/* تعديل عرض النافذة المنبثقة لتناسب أبعاد الصور الجيدة */
.modal-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 768px; /* عرض ممتاز يبرز أبعاد 720 */
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(32px, 5vw, 64px) 24px;
}

.brand-logo {
  height: 28px; /* هذا المقاس يعادل حجم الكلمة السابقة تقريباً وتقدرين تزودينه أو تنقصينه براحتك */
  width: auto;
  display: block;
  transition: 0.3s ease;
}

/* تأثير خفيف وجميل عند تمرير الماوس على اللوجو */
.brand:hover .brand-logo {
  transform: scale(1.05);
  opacity: 0.9;
}