/* ---------- Reset & Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Palette inspired by the Moon Ventures logo */
  --bg-deep:      #04060f;
  --bg-night:     #0a0f24;
  --bg-card:      #0f1633;
  --bg-card-2:    #131b3d;
  --line:         rgba(120, 160, 255, 0.12);
  --line-strong:  rgba(120, 160, 255, 0.28);

  --royal:        #1e6bff;      /* primary royal blue */
  --royal-soft:   #3d86ff;
  --azure:        #4cc9ff;      /* lighter accent */
  --moon:         #e8f1ff;      /* near-white */
  --text:         #e6ecff;
  --text-dim:     #9aa6c7;
  --text-mute:    #6b7693;

  --grad-primary: linear-gradient(135deg, #1e6bff 0%, #4cc9ff 100%);
  --grad-soft:    linear-gradient(135deg, rgba(30,107,255,0.18) 0%, rgba(76,201,255,0.08) 100%);
  --grad-text:    linear-gradient(135deg, #ffffff 0%, #9bd0ff 60%, #4cc9ff 100%);

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 24px;

  --shadow-glow: 0 20px 60px -20px rgba(30, 107, 255, 0.45);
  --shadow-card: 0 10px 30px -15px rgba(0, 0, 0, 0.6);

  --font-en: 'Sora', 'Inter', system-ui, -apple-system, sans-serif;
  --font-ar: 'Tajawal', 'Cairo', system-ui, -apple-system, sans-serif;

  --container: 1240px;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-en);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

body[dir=\"rtl\"] { font-family: var(--font-ar); }
body[dir=\"rtl\"] h1, body[dir=\"rtl\"] h2, body[dir=\"rtl\"] h3,
body[dir=\"rtl\"] h4, body[dir=\"rtl\"] h5, body[dir=\"rtl\"] h6 {
  font-family: var(--font-ar);
  letter-spacing: 0;
}

/* Global starfield + nebula glow background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% -10%, rgba(30,107,255,0.22), transparent 50%),
    radial-gradient(ellipse at 90% 0%, rgba(76,201,255,0.12), transparent 45%),
    radial-gradient(ellipse at 50% 100%, rgba(30,107,255,0.10), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 130px 90px, rgba(255,255,255,0.45), transparent),
    radial-gradient(1px 1px at 250px 200px, rgba(255,255,255,0.5), transparent),
    radial-gradient(2px 2px at 400px 80px, rgba(180,210,255,0.5), transparent),
    radial-gradient(1px 1px at 520px 260px, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 680px 150px, rgba(255,255,255,0.55), transparent);
  background-repeat: repeat;
  background-size: 800px 400px;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
  animation: drift 120s linear infinite;
}

@keyframes drift {
  from { background-position: 0 0; }
  to   { background-position: 800px 400px; }
}

main, header, footer { position: relative; z-index: 1; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-en);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--moon);
}
h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }

p { color: var(--text-dim); }

a { color: var(--azure); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--moon); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 110px 0; position: relative; }
.section-sm { padding: 70px 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--azure);
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(30,107,255,0.08);
  backdrop-filter: blur(10px);
}
.eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--azure);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--azure);
}

.gradient-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.section-title {
  margin: 18px 0 18px;
  max-width: 800px;
}
.section-sub {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 720px;
  margin-bottom: 56px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease,
              background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 70px -20px rgba(76,201,255,0.65);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--moon);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  background: rgba(76,201,255,0.08);
  border-color: var(--azure);
  color: var(--moon);
}
.btn .arrow {
  transition: transform 0.25s ease;
}
.btn:hover .arrow { transform: translateX(4px); }
body[dir=\"rtl\"] .btn:hover .arrow { transform: translateX(-4px); }
body[dir=\"rtl\"] .btn .arrow { transform: scaleX(-1); }

/* ---------- Navbar ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: background 0.3s ease, padding 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(4, 6, 15, 0.82);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom-color: var(--line);
  padding: 12px 0;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--moon);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}
.brand img {
  width: 42px; height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(76,201,255,0.35));
}
.brand-text { line-height: 1; }
.brand-text small {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-mute);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 4px;
}

.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
  align-items: center;
}
.nav-links a {
  color: var(--text-dim);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  position: relative;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-links a:hover { color: var(--moon); background: rgba(76,201,255,0.06); }
.nav-links a.active {
  color: var(--moon);
  background: rgba(30,107,255,0.14);
}

.nav-actions { display: flex; align-items: center; gap: 10px; }

.lang-toggle {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--moon);
  padding: 9px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lang-toggle:hover { background: rgba(76,201,255,0.08); border-color: var(--azure); }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  width: 44px; height: 44px;
  cursor: pointer;
  color: var(--moon);
  align-items: center;
  justify-content: center;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 60px;
  align-items: center;
}
.hero h1 {
  margin: 22px 0 22px;
}
.hero h1 .accent {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p.lead {
  font-size: 1.12rem;
  color: var(--text-dim);
  max-width: 560px;
  margin-bottom: 36px;
}
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  gap: 36px;
  margin-top: 56px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}
.hero-stats .stat strong {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--moon);
  letter-spacing: -0.02em;
}
.hero-stats .stat span {
  display: block;
  font-size: 0.82rem;
  color: var(--text-mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* Hero visual — orbiting moon */
.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.orb {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 50%;
  animation: spin 30s linear infinite;
}
.orb::before {
  content: '';
  position: absolute;
  top: -4px; left: 50%;
  width: 8px; height: 8px;
  background: var(--azure);
  border-radius: 50%;
  box-shadow: 0 0 16px var(--azure);
}
.orb.o1 { inset: 0; }
.orb.o2 { inset: 12%; animation-duration: 22s; animation-direction: reverse; border-color: var(--line-strong); }
.orb.o3 { inset: 26%; animation-duration: 16s; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-logo {
  position: relative;
  width: 70%;
  filter: drop-shadow(0 30px 60px rgba(30,107,255,0.55));
  animation: float 7s ease-in-out infinite;
  mix-blend-mode: screen;
}
.brand img { mix-blend-mode: screen; }
.split-visual img { mix-blend-mode: screen; }

@keyframes float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-14px); }
}

/* ---------- Service Cards ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.service-card {
  position: relative;
  padding: 36px 30px;
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-card-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-soft);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.service-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card), 0 20px 50px -20px rgba(30,107,255,0.35);
}
.service-card:hover::before { opacity: 1; }
.service-card > * { position: relative; z-index: 1; }

.service-icon {
  width: 60px; height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-primary);
  border-radius: 16px;
  margin-bottom: 22px;
  color: #fff;
  box-shadow: 0 12px 30px -10px rgba(30,107,255,0.6);
}
.service-icon svg { width: 28px; height: 28px; }

.service-card h3 { margin-bottom: 12px; }
.service-card p { font-size: 0.95rem; }

.service-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--azure);
  margin-bottom: 14px;
}

.service-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--moon);
}
.service-link .arrow { transition: transform 0.2s ease; }
.service-link:hover .arrow { transform: translateX(4px); }
body[dir=\"rtl\"] .service-link .arrow { transform: scaleX(-1); }
body[dir=\"rtl\"] .service-link:hover .arrow { transform: scaleX(-1) translateX(4px); }

/* ---------- Why / Features ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 50px;
}
.feature {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 22, 51, 0.55);
  backdrop-filter: blur(8px);
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.feature:hover { border-color: var(--line-strong); transform: translateY(-4px); }
.feature .num {
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
  display: block;
}
.feature h4 { font-size: 1.05rem; margin-bottom: 6px; color: var(--moon); }
.feature p { font-size: 0.88rem; color: var(--text-dim); margin: 0; }

/* ---------- About / Split ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  align-items: center;
}
.split-visual {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, var(--bg-card), var(--bg-card-2));
  display: flex;
  align-items: center;
  justify-content: center;
}
.split-visual img {
  width: 70%;
  filter: drop-shadow(0 30px 60px rgba(30,107,255,0.5));
  animation: float 8s ease-in-out infinite;
}

.values-list { list-style: none; margin-top: 30px; }
.values-list li {
  display: flex;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.values-list li:last-child { border-bottom: 0; }
.values-list .check {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.8rem;
}
.values-list h4 { font-size: 1.02rem; margin-bottom: 4px; }
.values-list p { font-size: 0.9rem; margin: 0; }

/* ---------- Portfolio ---------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 220px;
  gap: 18px;
}
.portfolio-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--bg-card), var(--bg-card-2));
  cursor: pointer;
  transition: transform 0.35s ease, border-color 0.35s ease;
  display: flex;
  align-items: flex-end;
  padding: 24px;
}
.portfolio-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  transition: opacity 0.35s ease, transform 0.6s ease;
}
.portfolio-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(4,6,15,0.85) 100%);
  pointer-events: none;
}
.portfolio-item:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.portfolio-item:hover img { opacity: 0.8; transform: scale(1.06); }
.portfolio-meta { position: relative; z-index: 1; color: var(--moon); }
.portfolio-meta .tag {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--azure);
  margin-bottom: 8px;
  display: block;
}
.portfolio-meta h3 { font-size: 1.2rem; }

.p-span-2 { grid-column: span 2; }
.p-span-3 { grid-column: span 3; }
.p-span-4 { grid-column: span 4; }
.p-row-2  { grid-row: span 2; }

/* ---------- CTA Block ---------- */
.cta-block {
  position: relative;
  text-align: center;
  padding: 80px 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(30,107,255,0.35), transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(76,201,255,0.18), transparent 55%),
    linear-gradient(180deg, var(--bg-card), var(--bg-card-2));
}
.cta-block h2 { margin-bottom: 16px; }
.cta-block p { max-width: 600px; margin: 0 auto 32px; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 50px;
}
.contact-info { padding-top: 14px; }
.contact-info ul { list-style: none; margin-top: 28px; }
.contact-info li {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.contact-info li:last-child { border-bottom: 0; }
.contact-info .ico {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(30,107,255,0.14);
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--azure);
}
.contact-info .ico svg { width: 20px; height: 20px; }
.contact-info h4 { font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-mute); font-weight: 600; }
.contact-info p { color: var(--moon); font-size: 1rem; margin: 4px 0 0; }

.contact-form {
  padding: 40px;
  background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { margin-bottom: 18px; }
.form-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 14px 16px;
  background: rgba(4,6,15,0.5);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--royal-soft);
  background: rgba(4,6,15,0.75);
}
.form-field textarea { resize: vertical; min-height: 140px; }
.form-field .err {
  display: none;
  margin-top: 6px;
  font-size: 0.8rem;
  color: #ff6b8b;
}
.form-field.invalid input,
.form-field.invalid textarea { border-color: #ff6b8b; }
.form-field.invalid .err { display: block; }

.form-status {
  display: none;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
}
.form-status.success {
  display: block;
  background: rgba(40, 200, 140, 0.12);
  border: 1px solid rgba(40, 200, 140, 0.4);
  color: #6deec0;
}
.form-status.error {
  display: block;
  background: rgba(255, 90, 120, 0.12);
  border: 1px solid rgba(255, 90, 120, 0.4);
  color: #ff9eb0;
}

/* ---------- Page Header (inner pages) ---------- */
.page-head {
  padding: 180px 0 80px;
  text-align: center;
  position: relative;
}
.page-head h1 { margin: 18px 0 14px; }
.page-head p { max-width: 640px; margin: 0 auto; color: var(--text-dim); }
.breadcrumb {
  display: inline-flex;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-mute);
  margin-bottom: 12px;
}
.breadcrumb a { color: var(--text-mute); }
.breadcrumb a:hover { color: var(--azure); }

/* ---------- Footer ---------- */
.footer {
  background: linear-gradient(180deg, transparent 0%, rgba(10,15,36,0.9) 30%, rgba(4,6,15,1) 100%);
  border-top: 1px solid var(--line);
  padding: 80px 0 30px;
  position: relative;
  z-index: 1;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 50px;
  margin-bottom: 50px;
}
.footer h5 {
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--moon);
  margin-bottom: 22px;
  font-weight: 600;
}
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 10px; }
.footer ul a {
  color: var(--text-dim);
  font-size: 0.93rem;
  transition: color 0.2s ease;
}
.footer ul a:hover { color: var(--azure); }
.footer .brand-block p {
  font-size: 0.9rem;
  margin-top: 16px;
  max-width: 340px;
}

.socials {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.socials a {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: color 0.25s ease, border-color 0.25s ease,
              background 0.25s ease, transform 0.25s ease;
}
.socials a:hover {
  color: var(--moon);
  border-color: var(--royal-soft);
  background: rgba(30,107,255,0.14);
  transform: translateY(-3px);
}
.socials svg { width: 18px; height: 18px; }

.footer-bottom {
  padding-top: 26px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-mute);
}

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-grid, .split, .contact-grid { grid-template-columns: 1fr; gap: 50px; }
  .hero-visual { max-width: 460px; margin: 0 auto; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .portfolio-grid { grid-template-columns: repeat(4, 1fr); }
  .p-span-3 { grid-column: span 2; }
  .p-span-4 { grid-column: span 4; }
}

@media (max-width: 720px) {
  .section { padding: 80px 0; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 70px; left: 16px; right: 16px;
    flex-direction: column;
    background: rgba(10, 15, 36, 0.96);
    backdrop-filter: blur(16px);
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    padding: 14px;
  }
  .nav-links.open a { width: 100%; }
  .nav-toggle { display: inline-flex; }
  .services-grid, .feature-grid, .footer-grid { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 180px; }
  .p-span-2, .p-span-3, .p-span-4 { grid-column: span 2; }
  .p-row-2 { grid-row: span 1; }
  .form-row { grid-template-columns: 1fr; }
  .hero { padding-top: 130px; }
  .hero-stats { flex-wrap: wrap; gap: 22px; }
  .contact-form { padding: 28px 22px; }
  .page-head { padding: 140px 0 60px; }
}

/* RTL specific tweaks */
body[dir=\"rtl\"] .breadcrumb { direction: rtl; }
body[dir=\"rtl\"] .footer-bottom { direction: rtl; }
body[dir=\"rtl\"] .hero-stats { direction: rtl; }

body[dir="rtl"] input,
body[dir="rtl"] textarea {
  text-align: right;
}
/* Footer contact info alignment for RTL */
body[dir="rtl"] .footer ul li {
  text-align: right;
}
/* Footer link hover with underline */
.footer ul a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Active footer link */
.footer ul a.footer-active {
  color: var(--azure);
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(4, 6, 15, 0.88);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 44px 36px;
  position: relative;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  transform: translateY(20px);
  transition: transform 0.35s ease;
}
.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(15, 22, 51, 0.8);
  color: var(--moon);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}
.modal-close:hover {
  background: rgba(255, 90, 120, 0.2);
  border-color: #ff6b8b;
  color: #ff9eb0;
}

.modal h3 {
  font-size: 1.6rem;
  margin-bottom: 20px;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-dim);
}

body[dir="rtl"] .modal-close {
  right: auto;
  left: 16px;
}

/* ---------- Team ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 50px;
}

.team-card {
  text-align: center;
  padding: 40px 28px;
  background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.team-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card), 0 20px 50px -20px rgba(30,107,255,0.35);
}

.team-photo {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 22px;
  border: 3px solid var(--line-strong);
  background: var(--bg-card-2);
}

.team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-card h3 {
  font-size: 1.15rem;
  margin-bottom: 6px;
  color: var(--moon);
}

.team-role {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--azure);
  margin-bottom: 12px;
}

.team-card p {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0;
}

@media (max-width: 720px) {
  .team-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Intl Tel Input Overrides ---------- */
.iti {
  width: 100%;
}

.iti__flag {
  background-image: url("https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/23.0.12/img/flags.png") !important;
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .iti__flag {
    background-image: url("https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/23.0.12/img/flags@2x.png") !important;
  }
}

.iti__country-list {
  background: var(--bg-card) !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 12px !important;
}

.iti__country {
  color: var(--text) !important;
}

.iti__country.iti__highlight {
  background: rgba(30,107,255,0.14) !important;
}

.iti__divider {
  border-color: var(--line) !important;
}

.iti__selected-dial-code {
  color: var(--text) !important;
}

/* ---------- Loading Screen ---------- */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(ellipse at center, #0a0f24 0%, #04060f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-container {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* القمر اللي بيدور */
.moon-orbit {
  position: absolute;
  inset: -40px;
  animation: orbit 3s linear infinite;
}

.moon {
  width: 24px;
  height: 24px;
  background: radial-gradient(circle at 40% 40%, #ffffff, #c8dfff);
  border-radius: 50%;
  box-shadow: 
    0 0 20px rgba(200, 220, 255, 0.8),
    0 0 60px rgba(140, 180, 255, 0.4),
    0 0 100px rgba(100, 150, 255, 0.2),
    inset -4px -2px 6px rgba(0,0,0,0.3);
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

@keyframes orbit {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* اللوجو */
.loader-logo {
  position: relative;
  z-index: 2;
  animation: logo-reveal 1.2s ease-out 0.3s both;
}

.loader-logo img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(76, 201, 255, 0.6));
}

@keyframes logo-reveal {
  0% {
    opacity: 0;
    transform: scale(0.6);
    filter: blur(10px) drop-shadow(0 0 30px rgba(76, 201, 255, 0.6));
  }
  60% {
    opacity: 1;
    transform: scale(1.05);
    filter: blur(0) drop-shadow(0 0 30px rgba(76, 201, 255, 0.6));
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0) drop-shadow(0 0 30px rgba(76, 201, 255, 0.6));
  }
}

/* خط النبض تحت اللوجو */
.pulse-line {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--grad-primary);
  border-radius: 2px;
  animation: pulse-width 1.5s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(76, 201, 255, 0.6);
}

@keyframes pulse-width {
  0%, 100% { width: 30px; opacity: 0.4; }
  50%      { width: 80px; opacity: 1; }
}

/* نجيمات صغيرة */
.loader-container::before,
.loader-container::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 3px;
  background: #fff;
  border-radius: 50%;
  animation: twinkle 2s ease-in-out infinite;
}

.loader-container::before {
  top: 15%;
  right: 10%;
  animation-delay: 0s;
}

.loader-container::after {
  bottom: 20%;
  left: 8%;
  animation-delay: 1s;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.8); }
}

/*تنسيقات نموذج التواصل */
html[dir="rtl"] .iti {
    direction: ltr !important;
    width: 100%;
}

html[dir="rtl"] .iti input.iti__tel-input {
    direction: ltr !important;
    text-align: left !important;
}

html[dir="rtl"] .iti__country-container {
    left: 0 !important;
    right: auto !important;
}

html[dir="rtl"] .iti--separate-dial-code .iti__tel-input {
    padding-right: 12px !important;
}

html[dir="rtl"] .iti__selected-country-primary {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---------- Responsive ---------- */

/* Navbar - Tablet */
@media (max-width: 1024px) {
  .nav-inner {
    flex-wrap: nowrap;
    gap: 12px;
  }
  
  .nav-links {
    gap: 2px;
  }
  
  .nav-links a {
    padding: 8px 10px;
    font-size: 0.78rem;
  }
  
  .brand {
    font-size: 0.9rem;
    gap: 8px;
  }
  
  .brand img {
    width: 30px;
    height: 30px;
  }
  
  .brand-text small {
    font-size: 0.55rem;
  }
  
  .lang-toggle {
    padding: 7px 10px;
    font-size: 0.75rem;
  }
  
  .btn.hide-sm {
    display: none;
  }
  
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .split {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .split-visual {
    max-width: 200px;
    margin: 0 auto;
    order: -1;
  }
  
  .split-visual img {
    width: 50%;
  }
  
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Mobile - 768px */
@media (max-width: 768px) {
  .nav {
    padding: 10px 0;
  }
  
  .nav-inner {
    gap: 8px;
  }
  
  .nav-links {
    display: none;
    position: fixed;
    top: 56px;
    left: 12px;
    right: 12px;
    background: rgba(10, 15, 36, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    padding: 16px;
    flex-direction: column;
    gap: 2px;
    z-index: 99;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  }
  
  .nav-links.open {
    display: flex;
  }
  
  .nav-links a {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: 12px;
  }
  
  .nav-toggle {
    display: flex;
    width: 42px;
    height: 42px;
  }
  
  .brand-text small {
    display: block;
  }
  
  .hero {
    padding: 100px 0 40px;
    min-height: auto;
  }
  
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .hero-visual {
    max-width: 200px;
    margin: 0 auto;
    order: -1;
  }
  
  .hero-logo {
    width: 55%;
  }
  
  .hero-stats {
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    flex-wrap: wrap;
  }
  
  .hero-stats .stat strong {
    font-size: 1.4rem;
  }
  
  .section {
    padding: 50px 0;
  }
  
  .section-sub {
    margin-bottom: 28px;
  }
  
  .services-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }
  
  .page-head {
    padding: 120px 0 40px;
  }
  
  .cta-block {
    padding: 40px 20px;
  }
  
  .footer {
    padding: 40px 0 20px;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .modal {
    padding: 24px 18px;
  }
}

/* Small Mobile - 480px */
@media (max-width: 480px) {
  .hero-visual {
    max-width: 160px;
  }
  
  .hero-logo {
    width: 50%;
  }
  
  .hero h1 {
    font-size: 1.8rem;
  }
  
  .hero p.lead {
    font-size: 0.9rem;
  }
  
  .hero-ctas {
    flex-direction: column;
  }
  
  .hero-ctas .btn {
    width: 100%;
    justify-content: center;
  }
  
  .team-grid {
    grid-template-columns: 1fr;
  }
  
  .team-photo {
    width: 100px;
    height: 100px;
  }
  
  .contact-form {
    padding: 20px 14px;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
  
  .socials {
    justify-content: center;
  }
  
  .loader-container {
    width: 140px;
    height: 140px;
  }
  
  .loader-logo img {
    width: 55px;
    height: 55px;
  }
  
  .moon {
    width: 16px;
    height: 16px;
  }
}

/* Very Small Mobile - 380px */
@media (max-width: 380px) {
  .nav-links {
    top: 48px;
    left: 8px;
    right: 8px;
    padding: 12px;
  }
  
  .nav-links a {
    padding: 12px;
    font-size: 0.9rem;
  }
  
  .brand img {
    width: 26px;
    height: 26px;
  }
  
  .hero-visual {
    max-width: 140px;
  }
}

/* Large Screens */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
  
  .hero-grid {
    gap: 80px;
  }
  
  .services-grid {
    gap: 30px;
  }
}

/* Touch Devices */
@media (hover: none) and (pointer: coarse) {
  .service-card:hover,
  .team-card:hover,
  .feature:hover,
  .portfolio-item:hover {
    transform: none;
  }
  
  .btn:active {
    transform: scale(0.97);
  }
}

/* Responsive Images */
img {
  max-width: 100%;
  height: auto;
}

/* Responsive Placeholder */
#f-phone::placeholder {
  font-size: clamp(0.65rem, 2vw, 0.95rem);
  white-space: nowrap;
  overflow: visible;
}