/* Global Design System */

:root {
  /* Colors - Deep & Professional */
  --bg: #010816;
  --bg-darker: #00040a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --surface-accent: rgba(0, 229, 255, 0.05);
  --text: rgba(255, 255, 255, 0.95);
  --text-muted: rgba(255, 255, 255, 0.65);
  --text-dim: rgba(255, 255, 255, 0.45);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.15);

  /* Primary Action Colors */
  --primary: #00e5ff;
  --primary-glow: rgba(0, 229, 255, 0.3);
  --primary-dark: #00b8cc;

  /* Spacing & Sizing */
  --container-width: 1200px;
  --header-height: 80px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  /* Effects */
  --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.4);
  --glass-bg: rgba(1, 8, 22, 0.75);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 80% 0%, rgba(0, 229, 255, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 20% 50%, rgba(0, 100, 255, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Layout Components */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.brand {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

.site-main {
  padding-top: var(--header-height);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  gap: 8px;
}

.btn-primary {
  background: var(--primary);
  color: var(--bg);
  box-shadow: 0 0 20px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--text);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-outline {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface);
}

.btn-outline:hover {
  background: var(--surface-strong);
  border-color: var(--text-muted);
}

/* Cards & Sections */
.section {
  padding: 100px 0;
}

.section-header {
  max-width: 600px;
  margin-bottom: 60px;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin: 0 0 16px;
  line-height: 1.2;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--primary);
  background: var(--surface-strong);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* Blog Specific Cards */
.blog-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  height: 100%;
}

.card-img-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  /* 16:9 Aspect Ratio */
  overflow: hidden;
  background: var(--bg-darker);
}

.card-img-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog-card:hover .card-img-wrapper img {
  transform: scale(1.05);
}

.svg-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.muted-text {
  color: var(--text-muted);
}

/* Blog List Layout */
.blog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.blog-title {
  margin: 0;
}

.blog-lead {
  margin: 0;
}

.blog-post-title {
  margin-top: 0;
  font-size: 1.5rem;
}

.blog-post-excerpt {
  margin-top: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  /* Standard property for compatibility */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-post-meta {
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.blog-post-btn {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* Hero Section */
.hero {
  padding: 120px 0 80px;
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: 700px;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero-title span {
  color: var(--primary);
}

.hero-lead {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  gap: 16px;
}

/* Grids */
.grid {
  display: grid;
  gap: 32px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Forms */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface-strong);
  box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.1);
}

/* Stats / Partners Section */
.stats-section {
  padding: 60px 0;
  background: var(--bg-darker);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  opacity: 0.6;
  filter: grayscale(1);
}

.stat-item:hover {
  opacity: 1;
  filter: grayscale(0);
  transform: translateY(-5px);
}

.stat-icon {
  width: 60px;
  height: 60px;
}

.stat-label {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-item:hover .stat-label {
  color: var(--primary);
}

/* Footer */
.site-footer {
  background: var(--bg-darker);
  border-top: 1px solid var(--border);
  padding: 80px 0 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 64px;
  margin-bottom: 60px;
}

.footer-brand .brand-title {
  margin-bottom: 12px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-nav h4 {
  margin: 0 0 24px;
  font-size: 1rem;
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav li {
  margin-bottom: 12px;
}

.footer-nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-nav a:hover {
  color: var(--text);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* Responsive & Mobile Nav */

.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1100;
}

.hamburger {
  width: 24px;
  height: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

.mobile-nav-toggle.active .hamburger span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-nav-toggle.active .hamburger span:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle.active .hamburger span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 40px;
}

.mobile-nav-content .nav-link {
  font-size: 1.5rem;
  font-weight: 700;
}

.no-scroll {
  overflow: hidden;
}

/* Updated Responsive Queries */
@media (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 70px;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-nav-toggle {
    display: block;
  }

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

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .section {
    padding: 60px 0;
  }

  .section-title {
    font-size: 2rem;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-content,
.card,
.section-header {
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.card:nth-child(2) {
  animation-delay: 0.1s;
}

.card:nth-child(3) {
  animation-delay: 0.2s;
}

/* Utility Classes */
.mt-4 {
  margin-top: 1rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.text-center {
  text-align: center;
}

/* RTL Tweaks */
[dir="rtl"] .brand-title {
  letter-spacing: 0;
}