:root {
  --navy: #14126B;
  --logo-filter: none;
  --cyan: #1EC3F0;
  --purple: #8B5CF6;

  --bg: #f0f4ff;
  --bg-card: #ffffff;
  --bg-nav: rgba(240, 244, 255, 0.88);
  --text: #0f0e2a;
  --text-muted: #5a6480;
  --border: #dde3f5;
  --shadow: 0 4px 24px rgba(20,18,107,0.08);
  --shadow-hover: 0 12px 48px rgba(20,18,107,0.18);
  --logo-bg: transparent;
}

[data-theme="dark"] {
  --bg: #06061a;
  --bg-card: #0d0d2b;
  --bg-nav: rgba(6, 6, 26, 0.88);
  --text: #e8eaf6;
  --text-muted: #8892b0;
  --border: #1a1a40;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-hover: 0 12px 48px rgba(30,195,240,0.2);
  --logo-bg: transparent;
  --logo-filter: brightness(0) invert(1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.4s, color 0.4s;
  line-height: 1.6;
  overflow-x: hidden;
}

html[lang="fa"] body,
html[lang="ar"] body {
  font-family: 'Vazirmatn', 'Tahoma', sans-serif;
}

/* ── SCROLL REVEAL ── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(.22,1,.36,1), transform 0.7s cubic-bezier(.22,1,.36,1);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 5%;
  height: 70px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.4s, box-shadow 0.3s;
  gap: 2rem;
}
nav.scrolled {
  box-shadow: 0 4px 30px rgba(20,18,107,0.12);
}
[data-theme="dark"] nav.scrolled {
  box-shadow: 0 4px 30px rgba(0,0,0,0.4);
}

/* pill nav — centered */
.nav-pill {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 5px 6px;
  gap: 2px;
  list-style: none;
  box-shadow: var(--shadow);
}

.nav-pill li a {
  display: block;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 22px;
  border-radius: 50px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.nav-pill li a:hover { color: var(--cyan); }
.nav-pill li a.nav-active {
  background: linear-gradient(135deg, var(--navy), #2a27a0);
  color: #fff;
  box-shadow: 0 2px 12px rgba(20,18,107,0.25);
}
[data-theme="dark"] .nav-pill li a.nav-active {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #fff;
  box-shadow: 0 2px 12px rgba(30,195,240,0.3);
}

.nav-controls {
  display: flex; align-items: center; gap: 6px;
  position: absolute; right: 5%;
}

.lang-group {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  background: none; border: none;
  border-radius: 50px;
  padding: 5px 12px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.05em;
  transition: all 0.2s;
  font-family: inherit;
}
.lang-btn:hover { color: var(--cyan); }
.lang-btn.active {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #fff;
}

.theme-btn {
  width: 38px; height: 38px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}
.theme-btn:hover { border-color: var(--cyan); transform: rotate(20deg); }

.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 6px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: all 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE MENU ── */
.mobile-menu {
  display: none;
  position: fixed; top: 70px; left: 0; right: 0; z-index: 99;
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 5%;
  flex-direction: column; gap: 4px;
  transform: translateY(-10px);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
}
.mobile-menu.open {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}
.mobile-menu a {
  text-decoration: none; color: var(--text);
  padding: 0.75rem 1rem; font-weight: 500;
  border-radius: 10px;
  transition: background 0.2s, color 0.2s;
}
.mobile-menu a:hover { background: rgba(30,195,240,0.08); color: var(--cyan); }

/* ── HERO ── */
#hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 100px 5% 60px;
  position: relative;
  overflow: hidden;
}

#particle-canvas {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0.9;
}

.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% -10%, rgba(30,195,240,0.18) 0%, transparent 65%),
    radial-gradient(ellipse 50% 45% at 85% 85%, rgba(139,92,246,0.14) 0%, transparent 55%),
    radial-gradient(ellipse 45% 40% at 10% 75%, rgba(20,18,107,0.12) 0%, transparent 55%);
}
[data-theme="dark"] .hero-bg {
  background:
    radial-gradient(ellipse 70% 55% at 50% -10%, rgba(30,195,240,0.22) 0%, transparent 65%),
    radial-gradient(ellipse 50% 45% at 85% 85%, rgba(139,92,246,0.2) 0%, transparent 55%),
    radial-gradient(ellipse 45% 40% at 10% 75%, rgba(20,18,107,0.35) 0%, transparent 55%);
}

.hero-content { position: relative; z-index: 1; max-width: 800px; }

.hero-logo-wrap {
  margin-bottom: 2.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-logo-wrap img {
  height: 160px; width: auto; display: block;
  filter: var(--logo-filter);
  transition: filter 0.4s;
}

.hero-tagline {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--cyan);
  background: rgba(30,195,240,0.1);
  border: 1px solid rgba(30,195,240,0.25);
  padding: 6px 18px; border-radius: 50px;
  margin-bottom: 1.5rem;
}
.hero-tagline::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); animation: pulse-dot 2s infinite; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.6); }
}

.hero-title {
  font-size: clamp(2.4rem, 6.5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--navy) 0%, #3b5bdb 40%, var(--cyan) 70%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradient-shift 6s ease infinite;
}
[data-theme="dark"] .hero-title {
  background: linear-gradient(135deg, #a5b4fc 0%, var(--cyan) 50%, var(--purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  background-size: 200% 200%;
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto 2.5rem;
  line-height: 1.8;
}

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn-primary {
  padding: 14px 34px;
  background: linear-gradient(135deg, var(--navy), var(--cyan));
  color: #fff;
  border: none; border-radius: 50px;
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: transform 0.25s, box-shadow 0.25s;
  box-shadow: 0 4px 24px rgba(30,195,240,0.35);
  position: relative; overflow: hidden;
  font-family: inherit;
}
.btn-primary::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0; transition: opacity 0.25s;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 36px rgba(30,195,240,0.45); }
.btn-primary:hover::after { opacity: 1; }

.btn-outline {
  padding: 14px 34px;
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 50px;
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: all 0.25s;
  font-family: inherit;
}
.btn-outline:hover { border-color: var(--purple); color: var(--purple); background: rgba(139,92,246,0.06); transform: translateY(-3px); }

/* ── SECTIONS ── */
section { padding: 100px 5%; }

.section-header { text-align: center; margin-bottom: 4rem; }

.section-tag {
  display: inline-block;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--cyan);
  background: rgba(30,195,240,0.1);
  border: 1px solid rgba(30,195,240,0.2);
  padding: 5px 16px; border-radius: 20px;
  margin-bottom: 0.85rem;
}

.section-title {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── SERVICES ── */
#services { background: var(--bg); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem 1.75rem;
  transition: transform 0.3s cubic-bezier(.22,1,.36,1), box-shadow 0.3s, border-color 0.3s;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  cursor: default;
}

.service-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--navy), var(--cyan), var(--purple));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(.22,1,.36,1);
}

.service-card::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(30,195,240,0.06) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

.service-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: var(--shadow-hover);
  border-color: rgba(30,195,240,0.25);
}
.service-card:hover::before { transform: scaleX(1); }
.service-card:hover::after { opacity: 1; }

[data-theme="dark"] .service-card {
  background: linear-gradient(145deg, #0d0d2b, #10103a);
}
[data-theme="dark"] .service-card:hover {
  border-color: rgba(30,195,240,0.35);
  box-shadow: 0 12px 48px rgba(30,195,240,0.15), 0 0 0 1px rgba(30,195,240,0.1);
}

.service-icon-wrap {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(30,195,240,0.12), rgba(139,92,246,0.12));
  border: 1px solid rgba(30,195,240,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  transition: transform 0.3s;
}
.service-card:hover .service-icon-wrap { transform: scale(1.1) rotate(-5deg); }

.service-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.service-desc { color: var(--text-muted); font-size: 0.875rem; line-height: 1.65; }

/* ── ABOUT ── */
#about {
  background: linear-gradient(160deg, rgba(20,18,107,0.03) 0%, rgba(139,92,246,0.04) 100%);
  position: relative; overflow: hidden;
}
[data-theme="dark"] #about {
  background: linear-gradient(160deg, rgba(20,18,107,0.4) 0%, rgba(139,92,246,0.12) 100%);
}
#about::before {
  content: '';
  position: absolute; top: -100px; right: -100px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30,195,240,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.about-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.about-text .section-tag { display: inline-block; }
.about-text .section-title { text-align: left; }

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.85;
}

.about-badges {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  margin-top: 1.75rem;
}

.badge {
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.78rem; font-weight: 600;
  border: 1px solid;
  transition: transform 0.2s;
}
.badge:hover { transform: translateY(-2px); }
.badge-navy { color: #3b5bdb; border-color: rgba(59,91,219,0.4); background: rgba(59,91,219,0.08); }
.badge-cyan { color: var(--cyan); border-color: rgba(30,195,240,0.35); background: rgba(30,195,240,0.08); }
.badge-purple { color: var(--purple); border-color: rgba(139,92,246,0.35); background: rgba(139,92,246,0.08); }

.about-visual {
  display: flex; align-items: center; justify-content: center;
}

.logo-orbit {
  position: relative;
  width: 260px; height: 260px;
}

.logo-orbit-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(30,195,240,0.2);
  animation: orbit-spin 12s linear infinite;
}
.logo-orbit-ring::before {
  content: '';
  position: absolute; top: -5px; left: 50%;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  transform: translateX(-50%);
}
.logo-orbit-ring-2 {
  position: absolute; inset: 20px;
  border-radius: 50%;
  border: 1px solid rgba(139,92,246,0.2);
  animation: orbit-spin 8s linear infinite reverse;
}
.logo-orbit-ring-2::before {
  content: '';
  position: absolute; bottom: -5px; left: 50%;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 10px var(--purple);
  transform: translateX(-50%);
}

@keyframes orbit-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.logo-orbit-center {
  position: absolute; inset: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 40px rgba(30,195,240,0.12), var(--shadow);
  overflow: hidden;
}
[data-theme="dark"] .logo-orbit-center {
  background: rgba(255,255,255,0.92);
}

.logo-orbit-center img { width: 90px; height: auto; }

/* ── CONTACT ── */
#contact { background: var(--bg); }

.contact-inner { max-width: 760px; margin: 0 auto; }

.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  position: relative; overflow: hidden;
}
.contact-card::before {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  transform: scaleX(0);
  transition: transform 0.3s;
}
.contact-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); border-color: rgba(30,195,240,0.25); }
.contact-card:hover::before { transform: scaleX(1); }

[data-theme="dark"] .contact-card {
  background: linear-gradient(145deg, #0d0d2b, #10103a);
}

.contact-card-icon {
  font-size: 1.4rem; margin-bottom: 0.75rem;
  width: 42px; height: 42px;
  background: linear-gradient(135deg, rgba(30,195,240,0.1), rgba(139,92,246,0.1));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}

.contact-card-label {
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--cyan);
  margin-bottom: 0.5rem;
}

.contact-card-value {
  font-size: 0.875rem;
  color: var(--text);
  word-break: break-word;
  line-height: 1.6;
}
.contact-card-value a {
  color: var(--text); text-decoration: none;
  transition: color 0.2s;
}
.contact-card-value a:hover { color: var(--cyan); }

.email-reveal {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex; align-items: center; gap: 7px;
  background: none; border: none;
  font-family: inherit;
  transition: color 0.2s;
  padding: 0;
}
.email-reveal:hover { color: var(--cyan); }
.eye-icon { font-size: 1rem; }

/* ── FOOTER ── */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 2.5rem 5%;
  font-size: 0.85rem;
  position: relative; overflow: hidden;
}
footer::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--purple), transparent);
}
footer strong { color: #fff; }
footer a { color: var(--cyan); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .nav-pill { display: none; }
  .hamburger { display: flex; }
  nav { justify-content: flex-end; }
  .nav-controls { position: static; }
}

@media (max-width: 768px) {
  .about-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  .about-text .section-title { text-align: center; }
  .about-badges { justify-content: center; }
  .about-visual { order: -1; }
  .logo-orbit { width: 200px; height: 200px; }
  .logo-orbit-center img { width: 70px; }

  .hero-actions { flex-direction: column; align-items: center; }
  .btn-primary, .btn-outline { width: 100%; max-width: 280px; text-align: center; }
}

@media (max-width: 480px) {
  nav { padding: 0 4%; }
  section { padding: 80px 4%; }
  .services-grid { grid-template-columns: 1fr; }
  .contact-cards { grid-template-columns: 1fr; }
  .lang-group { gap: 0; }
  .lang-btn { padding: 5px 9px; }
}

/* ── RTL ── */
[dir="rtl"] .about-text .section-title { text-align: right; }
[dir="rtl"] .about-badges { flex-direction: row-reverse; }
[dir="rtl"] .hero-actions { flex-direction: row-reverse; }
[dir="rtl"] .email-reveal { flex-direction: row-reverse; }
[dir="rtl"] .service-card::before { transform-origin: right; }
