/* ==========================================================================
   پوریا احمدی - استایل اختصاصی سایت معرفی شخصی
   پالت رنگی: مدرن آبی و بنفش با پشتیبانی کامل از RTL و تم تیره
   ========================================================================== */

/* متغیرهای رنگی و تایپوگرافی */
:root {
  --font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  
  /* رنگ‌های اصلی و گرادیان */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.04);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #8b5cf6;
  --accent: #38bdf8;
  --accent-cyan: #06b6d4;
  
  /* گرادیان‌ها */
  --grad-primary: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
  --grad-text: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #38bdf8 100%);
  --grad-card: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
  
  /* رنگ متن */
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* بردر و سایه */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(99, 102, 241, 0.35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 35px -5px rgba(99, 102, 241, 0.3);
  
  /* انیمیشن */
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* بازنشانی و پایه */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.7;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* پس‌زمینه نوری تزیینی */
.glow-bg {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
  animation: pulseGlow 12s ease-in-out infinite alternate;
}

.glow-1 {
  width: 500px;
  height: 500px;
  top: -100px;
  right: -100px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.45), transparent 70%);
}

.glow-2 {
  width: 600px;
  height: 600px;
  bottom: 10%;
  left: -150px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.35), transparent 70%);
}

@keyframes pulseGlow {
  0% { transform: scale(0.9) translate(0, 0); opacity: 0.35; }
  100% { transform: scale(1.15) translate(20px, 30px); opacity: 0.55; }
}

/* ظروف محتوا (Containers) */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* هدر و ناوبری */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}

.brand-logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: inline-flex;
  align-items: center;
  transition: var(--transition);
}

.logo-accent {
  color: var(--primary-light);
}

.brand-logo .dot {
  color: var(--secondary);
}

.brand-logo:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.main-nav {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.98rem;
  padding: 0.5rem 0.25rem;
  position: relative;
  transition: var(--transition);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--grad-primary);
  border-radius: 2px;
  transition: width 0.25s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text-main);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  width: 100%;
}

/* دکمه‌ها */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.6rem;
  border-radius: 9999px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  outline: none;
}

.btn-primary {
  background: var(--grad-primary);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.btn-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary-light);
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.88rem;
}

/* بخش Hero */
.hero-section {
  padding: 5rem 0 4rem;
  position: relative;
}

.hero-container {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 3.5rem;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.45rem 1.1rem;
  border-radius: 9999px;
  color: var(--primary-light);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.8s ease backwards;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pingDot 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes pingDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 1.25rem;
  letter-spacing: -0.5px;
}

.gradient-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-description {
  font-size: 1.12rem;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 2rem;
  max-width: 620px;
}

.hero-cta-group {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.25rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  width: fit-content;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stat-divider {
  width: 1px;
  height: 36px;
  background-color: var(--border-color);
}

/* آواتار کارت در Hero */
.hero-visual {
  display: flex;
  justify-content: center;
  position: relative;
}

.avatar-card {
  position: relative;
  width: 100%;
  max-width: 360px;
}

.avatar-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-card);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.avatar-wrapper:hover {
  transform: translateY(-4px);
  border-color: var(--primary-light);
}

.floating-badge {
  position: absolute;
  bottom: -15px;
  right: -15px;
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.4);
  backdrop-filter: blur(12px);
  padding: 0.8rem 1.25rem;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-md);
  animation: floatCard 4s ease-in-out infinite;
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.floating-icon {
  font-size: 1.6rem;
}

.badge-text-primary {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.badge-text-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* بخش‌های اصلی (Sections) */
.section {
  padding: 6rem 0;
  position: relative;
}

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 3.5rem;
}

.section-subtitle {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary-light);
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* بخش درباره من */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.lead-text {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 1.25rem;
  line-height: 1.8;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.85;
}

.about-highlights {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.highlight-card {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
  transition: var(--transition);
}

.highlight-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateX(-4px);
}

.highlight-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  background: rgba(99, 102, 241, 0.1);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}

.highlight-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.highlight-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* بخش نمونه‌کارها (Projects) */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
  box-shadow: var(--shadow-md);
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow), var(--shadow-lg);
}

.project-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #0f172a;
  overflow: hidden;
}

.project-thumbnail svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-thumbnail svg {
  transform: scale(1.04);
}

.project-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  color: var(--primary-light);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.3rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.project-body {
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.65rem;
}

.project-summary {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin-bottom: 1.5rem;
}

.tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  transition: var(--transition);
}

.project-card:hover .tag {
  color: var(--primary-light);
  border-color: rgba(99, 102, 241, 0.2);
}

.project-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 1rem;
  margin-top: auto;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: var(--transition);
}

.project-link:hover {
  color: #ffffff;
  gap: 0.7rem;
}

.project-link svg {
  transition: transform 0.2s ease;
}

.project-link:hover svg {
  transform: translateX(-4px);
}

/* بخش مهارت‌ها (Skills) */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.skill-category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  padding: 2rem;
  transition: var(--transition);
}

.skill-category-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
}

.skill-card-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.skill-icon-wrapper {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(99, 102, 241, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-category-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.skill-name {
  color: var(--text-main);
  font-weight: 500;
}

.skill-pct {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.skill-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 9999px;
  transition: width 1s ease-in-out;
}

/* بخش ارتباط و تماس */
.contact-section {
  padding-bottom: 7rem;
}

.contact-card {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.6) 0%, rgba(17, 24, 39, 0.8) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 28px;
  padding: 3.5rem 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.contact-header {
  max-width: 620px;
  margin: 0 auto 2.5rem;
}

.contact-details {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.9rem 1.8rem;
  border-radius: 9999px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: var(--transition);
}

.contact-pill:hover,
.contact-pill:focus-visible {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.contact-icon {
  color: var(--primary-light);
  transition: var(--transition);
}

.contact-pill:hover .contact-icon {
  color: #ffffff;
}

/* فوتر سایت */
.site-footer {
  background-color: #070a12;
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.footer-info {
  max-width: 380px;
}

.footer-logo {
  margin-bottom: 0.85rem;
  display: inline-block;
}

.footer-bio {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.8;
}

.footer-social-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-heading {
  font-size: 0.95rem;
  color: var(--text-main);
  font-weight: 700;
}

.social-links {
  display: flex;
  gap: 1rem;
  list-style: none;
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.1rem;
  border-radius: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--transition);
}

.social-link:hover,
.social-link:focus-visible {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary-light);
  color: var(--text-main);
  transform: translateY(-2px);
}

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

.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 1rem;
}

/* انیمیشن‌های ورود ملایم */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-content {
  animation: fadeIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-visual {
  animation: fadeIn 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* دسترس‌پذیری: فوکوس مشخص */
:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 3px;
  border-radius: 4px;
}

/* واکنش‌گرایی (Responsive Design) */

/* تبلت‌های بزرگ و لپ‌تاپ‌های کوچک */
@media (max-width: 1024px) {
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }
  
  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero-cta-group {
    justify-content: center;
  }
  
  .hero-stats {
    margin: 0 auto;
  }
  
  .hero-visual {
    order: -1;
  }
  
  .avatar-card {
    max-width: 280px;
  }
  
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* موبایل‌ها و تبلت‌های کوچک */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .site-header .container {
    height: 4rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .header-action {
    display: none;
  }
  
  .hero-title {
    font-size: 2.1rem;
  }
  
  .hero-stats {
    flex-direction: column;
    width: 100%;
    gap: 1rem;
  }
  
  .stat-divider {
    width: 100%;
    height: 1px;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .skills-grid {
    grid-template-columns: 1fr;
  }
  
  .floating-badge {
    bottom: -10px;
    right: 0;
  }
  
  .contact-card {
    padding: 2.5rem 1.5rem;
  }
  
  .contact-pill {
    width: 100%;
    justify-content: center;
  }
  
  .footer-container {
    flex-direction: column;
    gap: 2rem;
  }
  
  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-cta-group {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta-group .btn {
    width: 100%;
  }

  .nav-links {
    gap: 0.75rem;
    font-size: 0.85rem;
  }
}
