/* =======================
   تعریف فونت های سفارشی
======================= */

/* فونت Vazirmatn */
@font-face {
  font-family: 'Vazirmatn';
  src: url('./fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('./fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('./fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('./fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

/* فونت Iran Yekan */
@font-face {
  font-family: 'IranYekan';
  src: url('./fonts/iranyekan-regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'IranYekan';
  src: url('./fonts/iranyekan-bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

/* =======================
   Variables & Theme پیشرفته
======================= */
:root {
  --bg: #0a0a0a;
  --bg-secondary: #111111;
  --text: #f5f5f5;
  --muted: #a0a0a0;
  --gold: #ffc107;
  --gold-dark: #d4a200;
  --accent: linear-gradient(135deg, #ffc107, #ffd54f);
  --accent-gold: linear-gradient(135deg, #d4a200, #ffd877);
  --radius: 20px;
  --radius-lg: 30px;
  --container: 1200px;
  --shadow: rgba(0,0,0,0.4);
  --shadow-gold: rgba(212, 162, 0, 0.3);
  
  /* پشته فونت های فارسی */
  --font-primary: 'IranYekan', 'Vazirmatn', 'Tahoma', sans-serif;
  --font-heading: 'IranYekan', 'Vazirmatn', 'Segoe UI', sans-serif;
  
  /* انیمیشن ها */
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* =======================
   Reset & Base پیشرفته
======================= */
* { 
  box-sizing: border-box; 
  margin: 0;
  padding: 0;
}

html, body { 
  height: 100%; 
  font-family: var(--font-primary); 
  color: var(--text); 
  background: var(--bg); 
  line-height: 1.7; 
  scroll-behavior: smooth;
  font-weight: 400;
  font-size: 16px;
  text-align: right;
  direction: rtl;
  overflow-x: hidden;
}

/* اسکرول بار سفارشی */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dark);
}

/* =======================
   انیمیشن های سفارشی
======================= */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 193, 7, 0.3); }
  50% { box-shadow: 0 0 40px rgba(255, 193, 7, 0.6); }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}

/* =======================
   کامپوننت های پیشرفته
======================= */

/* هدر پیشرفته */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 193, 7, 0.1);
  transition: all 0.4s var(--ease-smooth);
}

.site-header.scrolled {
  background: rgba(10, 10, 10, 0.95);
  border-bottom-color: rgba(255, 193, 7, 0.2);
  padding: 5px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  transition: all 0.4s var(--ease-smooth);
}

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

.logo {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--accent);
  color: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.6rem;
  font-family: var(--font-heading);
  transition: all 0.4s var(--ease-bounce);
  animation: glow 3s ease-in-out infinite;
}

.logo:hover {
  transform: scale(1.1) rotate(10deg);
  animation: none;
}

.brand-text .name {
  font-weight: 900;
  font-size: 1.5rem;
  background: var(--accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: var(--font-heading);
  line-height: 1.3;
}

.brand-text .role {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 6px;
}

/* نویگیشن پیشرفته */
.top-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px;
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.nav-link {
  color: var(--muted);
  padding: 10px 20px;
  border-radius: 12px;
  transition: all 0.3s var(--ease-smooth);
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--font-heading);
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transition: right 0.3s var(--ease-smooth);
  z-index: -1;
}

.nav-link:hover,
.nav-link.active {
  color: #0a0a0a;
  transform: translateY(-2px);
}

.nav-link:hover::before,
.nav-link.active::before {
  right: 0;
}

/* هیرو سکشن پیشرفته */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
  background: radial-gradient(ellipse at center top, rgba(255, 193, 7, 0.1) 0%, transparent 50%);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(255, 193, 7, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 193, 7, 0.05) 0%, transparent 50%);
  animation: float 6s ease-in-out infinite;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 80px;
  align-items: center;
  position: relative;
  z-index: 2;
}

.hero-content {
  padding: 40px 0;
}

.hero-sub {
  font-size: 1.2rem;
  color: var(--muted);
  margin-bottom: 16px;
  font-weight: 600;
  font-family: var(--font-heading);
  animation: slideInUp 0.8s var(--ease-smooth);
}

.hero-title {
  font-size: 4rem;
  font-weight: 900;
  margin: 0 0 24px;
  line-height: 1.1;
  font-family: var(--font-heading);
  animation: slideInUp 0.8s var(--ease-smooth) 0.2s both;
}

.hero-title .accent {
  background: var(--accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  display: inline-block;
}

.hero-title .accent::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 0;
  width: 100%;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
}

.hero-lead {
  font-size: 1.3rem;
  color: #e8e5de;
  max-width: 55ch;
  margin-bottom: 40px;
  line-height: 1.8;
  font-weight: 500;
  animation: slideInUp 0.8s var(--ease-smooth) 0.4s both;
}

.hero-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  animation: slideInUp 0.8s var(--ease-smooth) 0.6s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  border-radius: 50px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.4s var(--ease-bounce);
  font-family: var(--font-heading);
  font-size: 1rem;
  border: none;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: right 0.6s;
}

.btn:hover::before {
  right: 100%;
}

.btn-gold {
  background: var(--accent);
  color: #0a0a0a;
  box-shadow: 0 8px 32px var(--shadow-gold);
}

.btn-gold:hover {
  transform: translateY(-6px) scale(1.05);
  box-shadow: 0 16px 48px var(--shadow-gold);
}

.btn-outline {
  border: 2px solid rgba(255, 193, 7, 0.3);
  color: var(--gold);
  background: transparent;
  backdrop-filter: blur(10px);
}

.btn-outline:hover {
  background: rgba(255, 193, 7, 0.1);
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(255, 193, 7, 0.2);
}

/* مدیا هیرو پیشرفته */
.hero-media {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero-media::before {
  content: '';
  position: absolute;
  width: 120%;
  height: 120%;
  background: var(--accent);
  border-radius: 40% 60% 60% 40% / 50% 40% 60% 50%;
  animation: float 8s ease-in-out infinite;
  opacity: 0.1;
  filter: blur(40px);
}

.hero-media img {
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius-lg);
  box-shadow: 
    0 32px 80px var(--shadow),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: all 0.4s var(--ease-smooth);
  position: relative;
  z-index: 2;
}

.hero-media img:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow: 
    0 48px 120px var(--shadow),
    0 0 0 1px rgba(255, 193, 7, 0.3);
}

/* سکشن‌های پیشرفته */
.section {
  padding: 120px 0;
  position: relative;
}

.section:nth-child(even) {
  background: var(--bg-secondary);
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 24px;
  color: #fff;
  position: relative;
  font-weight: 800;
  font-family: var(--font-heading);
  line-height: 1.3;
  text-align: center;
}

.section-title::after {
  content: '';
  display: block;
  width: 100px;
  height: 5px;
  background: var(--accent);
  border-radius: 3px;
  margin: 20px auto;
}

.section-desc {
  color: var(--muted);
  max-width: 70ch;
  line-height: 1.8;
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
  margin: 0 auto;
}

/* گرید پروژه‌های پیشرفته */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 32px;
  margin-top: 60px;
}

.project-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 
    0 16px 48px var(--shadow),
    inset 0 1px 0 rgba(255,255,255,0.1);
  transition: all 0.4s var(--ease-smooth);
  border: 1px solid rgba(255,255,255,0.1);
  position: relative;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.4s var(--ease-smooth);
  z-index: -1;
}

.project-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 
    0 32px 80px var(--shadow),
    0 0 0 1px rgba(255, 193, 7, 0.2);
  border-color: rgba(255, 193, 7, 0.3);
}

.project-card:hover::before {
  opacity: 0.05;
}

.project-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition: transform 0.4s var(--ease-smooth);
}

.project-card:hover img {
  transform: scale(1.1);
}

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

.card-title {
  font-size: 1.4rem;
  margin: 0;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-heading);
  line-height: 1.4;
  margin-bottom: 12px;
}

.card-desc {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 24px;
  flex-grow: 1;
  line-height: 1.7;
  font-weight: 500;
}

.card-link {
  font-weight: 700;
  color: var(--gold);
  transition: all 0.3s var(--ease-smooth);
  font-family: var(--font-heading);
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
}

.card-link:hover {
  color: #ffd877;
  gap: 12px;
  transform: translateX(-5px);
}

/* فلسفه پیشرفته */
.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  margin-top: 60px;
}

.philosophy-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  padding: 40px 32px;
  border-radius: var(--radius-lg);
  border-right: 4px solid var(--gold);
  transition: all 0.4s var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

.philosophy-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.4s var(--ease-smooth);
  z-index: -1;
}

.philosophy-card:hover {
  transform: translateY(-8px);
  border-right-color: transparent;
  box-shadow: 0 24px 64px var(--shadow);
}

.philosophy-card:hover::before {
  opacity: 0.05;
}

.philosophy-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  display: inline-block;
  animation: float 4s ease-in-out infinite;
}

.philosophy-card h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
  font-family: var(--font-heading);
}

.philosophy-card p {
  color: var(--muted);
  line-height: 1.8;
  font-weight: 500;
  font-size: 1.05rem;
}

/* استایل‌های جدید برای المان‌های تعاملی */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin: 60px 0;
}

.stat-card {
  background: rgba(255,255,255,0.03);
  padding: 32px;
  border-radius: var(--radius);
  text-align: center;
  transition: all 0.3s var(--ease-smooth);
  border: 1px solid rgba(255,255,255,0.1);
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 193, 7, 0.3);
  background: rgba(255,255,255,0.05);
}

.stat-number {
  font-size: 3rem;
  font-weight: 900;
  background: var(--accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-heading);
}

.stat-label {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}

/* =======================
   رسپانسیو پیشرفته
======================= */
@media (max-width: 1200px) {
  .hero-title {
    font-size: 3.5rem;
  }
}

@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr 350px;
    gap: 60px;
  }
  
  .hero-title {
    font-size: 3rem;
  }
}

@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  
  .hero-media {
    order: -1;
    margin-bottom: 40px;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .top-nav {
    display: none;
  }
  
  .hero-links {
    justify-content: center;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .philosophy-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    width: 95%;
    padding: 0 15px;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .section-title {
    font-size: 1.6rem;
  }
  
  .brand-text .name {
    font-size: 1.2rem;
  }
  
  .logo {
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
  }
}