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

:root {
  --primary: #0D2840;
  --accent: #00D9FF;
  --bg: #FAFBFC;
  --gray: #64748B;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Vazirmatn', system-ui, sans-serif;
  background: var(--bg);
  color: var(--primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: all 0.3s ease;
}

body.fa {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body.en {
  font-family: 'Vazirmatn', system-ui, sans-serif;
}

[dir="rtl"] { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; }
[dir="ltr"] { font-family: 'Vazirmatn', system-ui, sans-serif; }

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Loading */
#loading {
  position: fixed;
  inset: 0;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s;
}

#loading.hide { opacity: 0; pointer-events: none; }

.pulse {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.7; }
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  z-index: 1000;
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 2rem;
}

.logo { height: 80px; }

.nav-menu {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-menu a {
  text-decoration: none;
  color: var(--gray);
  font-weight: 500;
  font-size: 0.875rem;
  transition: color 0.3s;
}

.nav-menu a:hover { color: var(--primary); }

.nav-right {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.lang-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #E5E7EB;
  background: white;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s;
}

.lang-btn:hover { border-color: var(--primary); }

.menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-btn span {
  width: 20px;
  height: 2px;
  background: var(--primary);
  transition: all 0.3s;
}

.btn {
  padding: 0.625rem 1.5rem;
  background: var(--primary);
  color: white;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: transform 0.3s;
  display: inline-block;
}

.btn:hover { transform: translateY(-2px); }

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--primary);
  overflow: hidden;
  padding-top: 80px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  opacity: 0.3;
}

.hero-bg::before, .hero-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: var(--accent);
  filter: blur(150px);
}

.hero-bg::before {
  top: 0;
  left: 25%;
  width: 500px;
  height: 500px;
}

.hero-bg::after {
  bottom: 0;
  right: 25%;
  width: 400px;
  height: 400px;
}

.hero .container {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 900;
  line-height: 0.95;
  color: white;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  color: rgba(255,255,255,0.7);
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

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

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: white;
  color: var(--primary);
  border-radius: 9999px;
  font-weight: 600;
  font-size: 1.125rem;
  text-decoration: none;
  transition: transform 0.3s;
}

.btn-hero:hover { transform: translateY(-4px); }

.btn-hero-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 9999px;
  font-weight: 600;
  font-size: 1.125rem;
  text-decoration: none;
  transition: all 0.3s;
}

.btn-hero-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: white;
}

/* Sections */
.section {
  padding: 8rem 2rem;
  background: white;
}

.bg-gray { background: var(--bg); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.grid-3:has(.team-card:only-child) {
  grid-template-columns: 1fr;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.gradient {
  background: linear-gradient(120deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 2rem;
}

.section p {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--gray);
  margin-bottom: 1.5rem;
}

.subtitle {
  font-size: 1.125rem;
  color: var(--gray);
  max-width: 800px;
  margin-bottom: 5rem;
}

.visual {
  position: sticky;
  top: 8rem;
}

.visual-card {
  aspect-ratio: 1;
  border-radius: 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.card {
  padding: 4rem;
  border-radius: 1.5rem;
  margin-bottom: 3rem;
  transition: transform 0.4s;
}

.card:hover { transform: translateY(-4px); }

.card h3 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.glass {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.8);
}

.glass h3 { color: var(--primary); }

.dark {
  background: var(--primary);
  color: rgba(255,255,255,0.8);
}

.dark h3 { color: white; }

.project-card {
  display: flex;
  flex-direction: column;
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.project-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.project-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  padding: 0.375rem 0.75rem;
  background: rgba(0,217,255,0.1);
  color: var(--primary);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.dark .tag {
  background: rgba(255,255,255,0.1);
  color: white;
}

.icon {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.icon.light { background: rgba(255,255,255,0.1); }

.badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: rgba(13,40,64,0.05);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
}

.badge.light {
  background: rgba(255,255,255,0.1);
  color: white;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: gap 0.3s;
}

.link:hover { gap: 0.75rem; }

/* Team */
.team-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2rem;
  margin-top: 2rem;
}

.team-card {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.8);
  padding: 2.5rem;
  border-radius: 1.5rem;
  transition: all 0.4s;
  text-decoration: none;
  display: block;
  position: relative;
  text-align: center;
}

.team-card:hover { 
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.linkedin-icon {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0;
  transition: all 0.3s;
}

[dir="rtl"] .linkedin-icon {
  right: auto;
  left: 1.5rem;
}

.team-card:hover .linkedin-icon {
  opacity: 1;
  transform: scale(1.1);
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 auto 1.5rem;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transition: all 0.3s;
}

.avatar span {
  display: none;
}

.team-card:hover .avatar {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.team-card h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
  transition: color 0.3s;
}

.team-card:hover h4 {
  color: var(--accent);
}

.team-card p {
  font-size: 0.875rem;
  color: var(--gray);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

/* Contact */
.center { text-align: center; }

.contact-card {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 3rem;
  border-radius: 1.5rem;
  text-decoration: none;
  transition: transform 0.4s;
}

.contact-card:hover { transform: translateY(-4px); }

.contact-card span {
  color: var(--gray);
  font-weight: 500;
}

.contact-card strong {
  color: var(--primary);
  font-size: 1.25rem;
  transition: color 0.3s;
}

.contact-card:hover strong { color: var(--accent); }

/* Footer */
footer {
  background: var(--primary);
  color: white;
  padding: 4rem 2rem 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  margin-bottom: 3rem;
  align-items: start;
}

.logo-footer {
  height: 44px;
  filter: brightness(0) invert(1);
  margin-bottom: 1rem;
}

footer p {
  color: rgba(255,255,255,0.7);
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

footer a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: color 0.3s;
  font-size: 0.9375rem;
}

footer a:hover { color: var(--accent); }

.footer-links {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: flex-end;
}

[dir="rtl"] .footer-links {
  justify-content: flex-start;
}

.footer-links a { 
  color: rgba(255,255,255,0.8);
  font-weight: 500;
}

.footer-links .btn {
  padding: 0.5rem 1.25rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
}

.footer-links .btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: var(--accent);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  text-align: center;
}

.footer-bottom p {
  color: rgba(255,255,255,0.5);
  font-size: 0.875rem;
  margin: 0;
}

/* Responsive */
@media (max-width: 1024px) {
  .section { padding: 6rem 2rem; }
  .grid-2 { gap: 4rem; }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.05);
  }

  .nav-menu.active { display: flex; }
  .menu-btn { display: flex; }

  .grid-2, .grid-3, .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .visual { display: none; }
  .card { padding: 2rem; }
  .section { padding: 5rem 1.5rem; }
  
  .hero-cta {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-hero, .btn-hero-outline {
    width: 100%;
    justify-content: center;
  }
  
  .project-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .footer-links {
    align-items: flex-start;
  }
  
  .contact-card {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 1.25rem; }
  .card { padding: 1.5rem; }
  .section { padding: 4rem 1.25rem; }
}
