* {
  scroll-behavior: smooth;
}

body {
  background-color: #0B0405;
  font-family: 'Vazirmatn', sans-serif;
}

::selection {
  background: #9E83BE;
  color: #fff;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #0B0405;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(83, 12, 130, 1) 0%, rgba(194, 43, 148, 1) 100%);
  border-radius: 10px;
}

.glass {
  background: rgba(44, 19, 50, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(158, 131, 190, 0.15);
}

/* ===== گرادیانت دسکتاپ ===== */
.btn-primary {
  background: linear-gradient(90deg, rgba(83, 12, 130, 1) 0%, rgba(194, 43, 148, 1) 100%);
}

.btn-primary:hover {
  background-position: 100% 0;
  box-shadow: 0 0 45px rgba(158, 131, 190, .55), 0 0 80px rgba(162, 109, 184, .3);
  transform: translateY(-3px);
}

.btn-outline {
  border: 1px solid rgba(158, 131, 190, 0.2);
  background: rgba(158, 131, 190, .05);
  transition: all .35s ease;
}

.btn-outline:hover {
  border-color: #9E83BE;
  box-shadow: 0 0 25px rgba(158, 131, 190, .3);
  background: rgba(158, 131, 190, .1);
}

@keyframes floaty {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-18px);
  }
}

.animate-floaty {
  animation: floaty 6s ease-in-out infinite;
}

@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.animate-spin-slow {
  animation: spin-slow 18s linear infinite;
}

.animate-spin-slower {
  animation: spin-slow 30s linear infinite reverse;
}

@keyframes pulse-glow {

  0%,
  100% {
    opacity: .5;
  }

  50% {
    opacity: 1;
  }
}

.animate-pulse-glow {
  animation: pulse-glow 3.5s ease-in-out infinite;
}

@keyframes drift {
  0% {
    transform: translate(0, 0);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    transform: translate(var(--dx, 20px), -160px);
    opacity: 0;
  }
}

.particle {
  position: absolute;
  border-radius: 9999px;
  background: #9E83BE;
  animation: drift linear infinite;
}

.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s ease, transform .8s ease;
}

.fade-up.in-view {
  opacity: 1;
  transform: translateY(0);
}

.card-hover {
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}

.card-hover:hover {
  transform: translateY(-8px);
  border-color: rgba(158, 131, 190, .5);
  box-shadow: 0 0 40px rgba(158, 131, 190, .25);
}

.skill-ring {
  transition: transform .4s ease, box-shadow .4s ease;
}

.skill-ring:hover {
  transform: scale(1.08) rotate(8deg);
  box-shadow: 0 0 35px rgba(158, 131, 190, .5);
}

.nav-link {
  position: relative;
  transition: color .3s ease;
}

.nav-link.active {
  color: #fff;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  right: 0;
  left: 0;
  bottom: -10px;
  height: 2px;
  background: linear-gradient(90deg, #9E83BE, #A26DB8);
  box-shadow: 0 0 10px #9E83BE, 0 0 20px #A26DB8;
  border-radius: 4px;
}

.nav-link:hover {
  color: #fff;
}

.code-float {
  position: absolute;
  font-family: 'Courier New', monospace;
  color: rgba(158, 131, 190, .35);
  font-size: .78rem;
  user-select: none;
  pointer-events: none;
}

.noise-overlay {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.marquee-badge {
  animation: pulse-glow 2.5s ease-in-out infinite;
}

/* ===== لوگو ===== */
.logo-icon {
  width: 150px;
  height: auto;
  object-fit: contain;
  display: block;
  mix-blend-mode: screen;
}

/* حذف بک گراند اگر تصویر PNG دارد */
.logo-header {
  background: transparent;
}

/* موبایل */
@media (max-width: 768px) {
  .logo-icon {
    width: 80px;
  }
}

/* ===== اسکرول افقی هماهنگ با تم ===== */
.projects-scroll-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.5rem 0 1.5rem 0;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #9E83BE rgba(44, 19, 50, 0.3);
}

.projects-scroll-wrapper::-webkit-scrollbar {
  height: 6px;
}

.projects-scroll-wrapper::-webkit-scrollbar-track {
  background: rgba(44, 19, 50, 0.3);
  border-radius: 10px;
  border: 1px solid rgba(158, 131, 190, 0.1);
}

.projects-scroll-wrapper::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #9E83BE, #A26DB8);
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(158, 131, 190, 0.3);
}

.projects-scroll-wrapper::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #A26DB8, #9E83BE);
  box-shadow: 0 0 25px rgba(158, 131, 190, 0.5);
}

.project-scroll-item {
  flex: 0 0 280px;
  scroll-snap-align: start;
}

/* نشانگر اسکرول (برای نمایش تعداد پروژه‌ها) */
.scroll-indicator {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.scroll-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(158, 131, 190, 0.2);
  transition: all 0.3s ease;
  border: 1px solid rgba(158, 131, 190, 0.1);
  cursor: pointer;
}

.scroll-dot.active {
  background: #9E83BE;
  width: 24px;
  border-radius: 4px;
  box-shadow: 0 0 15px rgba(158, 131, 190, 0.4);
  border-color: #9E83BE;
}

.scroll-dot:hover {
  background: rgba(158, 131, 190, 0.5);
  transform: scale(1.2);
}

@media (min-width: 640px) {
  .project-scroll-item {
    flex: 0 0 320px;
  }
}

@media (min-width: 1024px) {
  .project-scroll-item {
    flex: 0 0 360px;
  }
}

/* ===== ریسپانسیو ===== */
@media (max-width: 480px) {
  .hero-section {
    padding-top: 5.5rem !important;
    padding-bottom: 2.5rem !important;
    min-height: auto !important;
  }

  .hero-title {
    font-size: 1.5rem !important;
    line-height: 1.3 !important;
    color: #fff !important;
  }

  .hero-subtitle {
    font-size: 1rem !important;
    background: linear-gradient(90deg, rgba(219, 112, 192, 1) 9%, rgba(205, 104, 242, 1) 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
  }

  .btn-primary {
    background: linear-gradient(90deg, rgba(176, 67, 152, 1) 3%, rgba(137, 51, 145, 1) 25%, rgba(184, 66, 227, 1) 99%) !important;
  }

  .hero-description {
    font-size: 0.85rem !important;
    line-height: 1.7 !important;
    color: #D1C4E9 !important;
  }

  .avatar-wrapper {
    width: 200px !important;
    height: 200px !important;
  }

  .code-float {
    display: none !important;
  }

  .badge-text {
    font-size: 0.6rem !important;
    padding: 0.15rem 0.6rem !important;
    color: #C4B5D4 !important;
  }

  .btn-primary,
  .btn-outline {
    padding: 0.5rem 1rem !important;
    font-size: 0.75rem !important;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.4rem !important;
  }

  .stats-card {
    padding: 0.6rem !important;
    background: rgba(44, 19, 50, 0.7) !important;
  }

  .stats-number {
    font-size: 1.2rem !important;
    color: #fff !important;
  }

  .stats-label {
    font-size: 0.6rem !important;
    color: #C4B5D4 !important;
  }

  .skills-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.8rem !important;
  }

  .skill-icon {
    width: 3.2rem !important;
    height: 3.2rem !important;
  }

  .skill-icon svg {
    width: 1.8rem !important;
    height: 1.8rem !important;
  }

  .skill-name {
    font-size: 0.6rem !important;
    color: #C4B5D4 !important;
  }

  .project-scroll-item {
    flex: 0 0 220px !important;
  }

  .project-image {
    height: 130px !important;
  }

  .contact-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.4rem !important;
  }

  .contact-card {
    padding: 0.8rem !important;
    background: rgba(44, 19, 50, 0.7) !important;
  }

  .contact-icon {
    width: 2.2rem !important;
    height: 2.2rem !important;
  }

  .contact-icon svg {
    width: 1rem !important;
    height: 1rem !important;
  }

  .contact-label {
    font-size: 0.65rem !important;
    color: #fff !important;
  }

  .contact-value {
    font-size: 0.55rem !important;
    color: #C4B5D4 !important;
  }

  .section-title {
    font-size: 1.4rem !important;
    color: #fff !important;
  }

  .section-padding {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  .navbar-glass {
    padding: 0.05rem 0.3rem !important;
    min-height: 38px !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
  }

  .mobile-menu {
    padding: 0.8rem !important;
    gap: 0.5rem !important;
  }

  .mobile-menu a {
    font-size: 0.8rem !important;
    color: #C4B5D4 !important;
  }

  .hero-order {
    order: 1 !important;
  }

  .hero-content {
    order: 2 !important;
  }

  .particle {
    display: none !important;
  }

  .download-btn-mobile {
    display: none !important;
  }

  .logo-header {
    display: flex !important;
  }

  .logo-text {
    display: none !important;
  }

  .scroll-dot {
    width: 6px;
    height: 6px;
  }

  .scroll-dot.active {
    width: 18px;
  }
}

@media (min-width: 481px) and (max-width: 640px) {
  .hero-section {
    padding-top: 6.5rem !important;
    padding-bottom: 3rem !important;
    min-height: auto !important;
  }

  .hero-title {
    font-size: 1.8rem !important;
    color: #fff !important;
  }

  .hero-subtitle {
    font-size: 1.05rem !important;
    background: linear-gradient(90deg, rgba(158, 131, 190, 1) 0%, rgba(214, 83, 173, 1) 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
  }

  .btn-primary {
    background: linear-gradient(90deg, rgba(158, 131, 190, 1) 0%, rgba(194, 43, 148, 1) 100%) !important;
  }

  .hero-description {
    font-size: 0.9rem !important;
    color: #D1C4E9 !important;
  }

  .avatar-wrapper {
    width: 300px !important;
    height: 300px !important;
  }

  .code-float {
    display: none !important;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem !important;
  }

  .stats-card {
    background: rgba(44, 19, 50, 0.7) !important;
  }

  .stats-number {
    color: #fff !important;
  }

  .stats-label {
    color: #C4B5D4 !important;
  }

  .skills-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1rem !important;
  }

  .skill-name {
    color: #C4B5D4 !important;
  }

  .project-scroll-item {
    flex: 0 0 250px !important;
  }

  .contact-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.6rem !important;
  }

  .contact-card {
    background: rgba(44, 19, 50, 0.7) !important;
  }

  .contact-label {
    color: #fff !important;
  }

  .contact-value {
    color: #C4B5D4 !important;
  }

  .hero-order {
    order: 1 !important;
  }

  .hero-content {
    order: 2 !important;
  }

  .download-btn-mobile {
    display: none !important;
  }

  .logo-header {
    display: flex !important;
  }

  .logo-text {
    display: none !important;
  }

  .navbar-glass {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .hero-section {
    min-height: auto !important;
    padding-top: 7.5rem !important;
  }

  .hero-title {
    font-size: 2.4rem !important;
  }

  .avatar-wrapper {
    width: 260px !important;
    height: 260px !important;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  .skills-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  .contact-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .download-btn-mobile {
    display: inline-flex !important;
  }

  .logo-header {
    display: none !important;
  }

  .logo-text {
    display: inline !important;
  }

  .navbar-glass {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
  }
}

@media (min-width: 1025px) {
  .hero-section {
    min-height: 100vh !important;
  }

  .avatar-wrapper {
    width: 380px !important;
    height: 380px !important;
  }

  .download-btn-mobile {
    display: inline-flex !important;
  }

  .logo-header {
    display: none !important;
  }

  .logo-text {
    display: inline !important;
  }
}

/* پروژه جدید */
.project-tag {
  background: rgba(158, 131, 190, 0.15);
  border: 1px solid rgba(158, 131, 190, 0.2);
  color: #C4B5D4;
  font-size: 0.6rem;
  padding: 0.15rem 0.75rem;
  border-radius: 9999px;
  display: inline-block;
}

.project-tag:hover {
  border-color: #9E83BE;
  color: #fff;
}