*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: hsl(240 15% 6%);
  color: #fff;
  font-family: 'Tajawal', 'Inter', system-ui, sans-serif;
  direction: rtl;
  min-height: 100vh;
}

.en { font-family: 'Inter', system-ui, sans-serif; direction: ltr; display: inline-block; }

a { color: inherit; text-decoration: none; }

.container {
  width: min(1120px, 100% - 40px);
  margin-inline: auto;
}

.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  transition: background 0.25s ease, box-shadow 0.25s ease, backdrop-filter 0.25s ease;
}

.site-header.is-scrolled {
  background: rgba(11, 10, 20, 0.72);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.brand-mark {
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 1.05rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  opacity: 0.9;
  font-weight: 500;
}

.nav-links a:hover { opacity: 1; color: var(--color-accent); }

.btn-gradient {
  border: 0;
  cursor: pointer;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  box-shadow: 0 10px 30px rgba(155, 93, 229, 0.35);
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 120px 0 90px;
  background: radial-gradient(900px 500px at 20% 10%, rgba(155, 93, 229, 0.35), transparent 60%),
              radial-gradient(700px 400px at 80% 30%, rgba(0, 180, 216, 0.28), transparent 55%),
              hsl(240 15% 6%);
}

.hero-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(199, 125, 255, 0.35), transparent 60%);
  filter: blur(2px);
  animation: spin 18s linear infinite;
  top: 40%;
  left: 15%;
  transform: translate(-50%, -50%);
  opacity: 0.55;
}

.hero-glow.second {
  width: 360px;
  height: 360px;
  left: 80%;
  top: 55%;
  animation-duration: 24s;
  animation-direction: reverse;
  background: radial-gradient(circle, rgba(0, 180, 216, 0.35), transparent 60%);
}

@keyframes spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.95rem;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  line-height: 1.15;
  margin: 14px 0 12px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.8;
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.stat {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat strong { font-size: 1.25rem; display: block; }
.stat span { color: rgba(255, 255, 255, 0.65); font-size: 0.9rem; }

.profile {
  justify-self: center;
  width: min(320px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(155, 93, 229, 0.45);
  box-shadow: 0 20px 80px rgba(0, 180, 216, 0.18);
  overflow: hidden;
  background: linear-gradient(145deg, rgba(155, 93, 229, 0.25), rgba(0, 180, 216, 0.12));
}

.profile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section {
  padding: 72px 0;
}

.section.alt {
  background: hsl(245 18% 8%);
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 10px;
}

.section-sub {
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 28px;
  max-width: 60ch;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
}

.card {
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(155, 93, 229, 0.08), rgba(0, 180, 216, 0.05));
  border: 1px solid rgba(155, 93, 229, 0.2);
}

.card h3 { margin-top: 0; }

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 900px) {
  .services-grid { grid-template-columns: 1fr; }
}

.service-card {
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(155, 93, 229, 0.08), rgba(0, 180, 216, 0.05));
  border: 1px solid rgba(155, 93, 229, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 50px rgba(155, 93, 229, 0.18);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1000px) {
  .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .projects-grid { grid-template-columns: 1fr; }
}

.project-card {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(155, 93, 229, 0.22);
}

.project-thumb {
  height: 150px;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  background: linear-gradient(135deg, rgba(155, 93, 229, 0.35), rgba(0, 180, 216, 0.25));
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
}

.project-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-body .btn-ghost {
  align-self: flex-start;
  margin-top: auto;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 18px;
}

@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
}

form .field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

input, textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  padding: 10px 12px;
  font: inherit;
}

textarea { min-height: 120px; resize: vertical; }

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.socials a {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
}

.site-footer {
  padding: 40px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: hsl(240 15% 6%);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.muted { color: rgba(255, 255, 255, 0.55); }

/* ظاهر دائماً — الاعتماد على opacity:0 كان يخفي كل الصفحة إذا تعطل تحميل rovira.js أو الـ IntersectionObserver */
.fade-up {
  opacity: 1;
  transform: translateY(0);
}

.alert {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 180, 216, 0.12);
  margin: 10px 0;
}

.alert.error {
  border-color: rgba(255, 120, 120, 0.35);
  background: rgba(255, 120, 120, 0.08);
}

/* صفحة تفاصيل العمل — أيقونات تحميل كبيرة */
.download-platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.download-platform-grid--compact {
  grid-template-columns: 1fr;
}

@media (min-width: 520px) {
  .download-platform-grid--compact {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

.download-platform-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 22px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

a.download-platform-card {
  color: inherit;
  cursor: pointer;
}

a.download-platform-card:hover,
.download-platform-card--android:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 180, 216, 0.45);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.download-platform-card--ios .download-platform-card__icon {
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.35), rgba(155, 93, 229, 0.25));
}

.download-platform-card--android .download-platform-card__icon {
  background: linear-gradient(145deg, rgba(61, 220, 132, 0.28), rgba(0, 180, 216, 0.2));
}

.download-platform-card--desktop .download-platform-card__icon {
  background: linear-gradient(145deg, rgba(0, 180, 216, 0.3), rgba(199, 125, 255, 0.22));
}

.download-platform-card__icon {
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
}

.download-platform-card__icon svg {
  width: 48px;
  height: 48px;
}

.download-platform-card__title {
  margin: 4px 0 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.download-platform-card__hint {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.35;
}

.download-platform-card__cta {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
  background: linear-gradient(120deg, var(--color-primary), var(--color-accent));
  color: #0b0a14;
  border: none;
  box-shadow: 0 8px 28px rgba(155, 93, 229, 0.25);
}

.download-platform-card__cta--block {
  width: 100%;
  box-sizing: border-box;
}

.download-platform-apk-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  width: 100%;
  display: grid;
  gap: 8px;
}

.download-platform-apk-list a {
  text-decoration: none;
}

.download-platform-aside h2 {
  font-size: 1.25rem;
}

.project-highlights {
  margin: 0;
  padding: 0 18px 0 0;
  display: grid;
  gap: 8px;
  color: rgba(255, 255, 255, 0.85);
}

.project-gallery {
  margin-top: 14px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.project-gallery img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.project-gallery__controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 10px;
}
