  @font-face {
    font-family: 'IranSans';
    src: url('../fonts/iransans/IRANSansLight.woff') format('woff');
  }
  html, body {
    overflow-x: hidden;
    font-family: 'IranSans', 'Tahoma', 'Arial', sans-serif;
  }
  
  /**
   * Enable smooth scrolling on the whole document
   */
  html {
    scroll-behavior: smooth;
  }
  
  /**
   * Disable smooth scrolling when users have prefers-reduced-motion enabled
   */
  @media screen and (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }
  }
  
  /**
   * Add .section to every anchored element for scroll margin
   */
  .section {
    scroll-margin-top: 2rem;
  }
  
  /* Header */
  .site-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 3rem;
    text-decoration: none;
  }
  
  @media (min-width: 48em) {
    .site-title {
      float: left;
    }
  }
  
  .nav-link {
    font-weight: 700;
    color: rgba(0, 0, 0, 0.8) !important;
  }
  
  .social-nav .nav-link {
    padding: 0 0.5rem;
    font-size: 1.1rem;
    line-height: 2.5rem;
  }
  
  .nav-link:hover,
  .nav-link:focus,
  .active .nav-link {
    color: rgba(0, 0, 0, 0.6) !important;
  }
  
  /* Hero (intro) section */
  .intro-title {
    font-weight: 800;
  }
  
  @-webkit-keyframes animateWave {
    0% {
      transform: scale(1, 0);
    }
    100% {
      transform: scale(1, 1);
    }
  }
  
  @keyframes animateWave {
    0% {
      transform: scale(1, 0);
    }
    100% {
      transform: scale(1, 1);
    }
  }
  
  .wave-bg {
    width: 100%;
    overflow: hidden;
  }
  .progress-bar {
    background-color: var(--primary-color) !important;
  }
  .progress {
    height: 0.3rem !important;
  }
  img.avatar {
    border-radius: 30px;
  }
  /* Masonary grid for /* Portfolio Section Container */
  #portfolio { position: relative; z-index: 1; }

  .background-effects { position: absolute; inset: 0; overflow: hidden; z-index: -1; }
  .blob {
    position: absolute; width: 400px; height: 400px;
    background: radial-gradient(circle, #9A4DFF 0%, transparent 70%);
    filter: blur(80px); opacity: 0.2;
  }
  .blob-1 { top: -100px; right: -120px; }
  .blob-2 { bottom: -120px; left: -120px; }

  /* Grid System */
  .custom-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.6rem;
    direction: rtl;
  }

  /* Portfolio Card */
  .portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    margin: 0;
    height: 100%;
    text-align: center;
    box-shadow: 2px 2px 4px var(--primary-color);
  }

  .portfolio-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 60px rgba(0,0,0,0.15);
  }

  .portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.2, 0.65, 0.3, 1);
  }

  .portfolio-item:hover img {
    transform: scale(1.08);
  }

  /* Caption */
  .portfolio-item figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    color: #fff;
    text-align: right;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.8s ease;
  }

  .portfolio-item:hover figcaption {
    transform: translateY(0);
    opacity: 1;
  }

  /* Badge */
  .tech-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: #512BD4;
    color: #fff;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
  }

  /* Tall Item */
  .grid-item.tall { grid-row: span 2; min-height: 450px; }

  /* Responsiveness */
  @media (max-width: 991px) {
    .custom-portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  }

  @media (max-width: 640px) {
    .custom-portfolio-grid { grid-template-columns: 1fr; }
    .grid-item.tall { grid-row: span 1; min-height: 300px; }
  }

  /* Additional utility styles */
  .container-narrow {
    max-width: 1024px;
    margin: 0 auto;
  }
  
  .text-small {
    font-size: 0.875rem;
  }
  
  .text-uppercase {
    letter-spacing: 0.05em;
  }
  
  .hover-effect {
    transition: transform .18s ease-in-out;
  }
  
  .hover-effect:hover {
    transform: translateY(-2px);
  }
  
  .marker {
    font-family: 'IranSans';
    position: relative;
    display: inline;
    width: auto;
  }
  .btn-Contact{
      display: inline-block;
      font-weight: 700;
      line-height: 1.6;
      text-align: center;
      text-decoration: none;
      vertical-align: middle;
      cursor: pointer;
      user-select: none;
      padding: 0.6rem 2.25rem;
      font-size: 1rem;
      border-radius: 6px;
      transition: all 0.18s ease-in-out;
  }
  .marker-center {
    padding-right: 0;
  }
  
  .marker:after {
    content: "";
    width: 125px; 
    height: 30px; 
    position: absolute;
    bottom: -25px; 
    left: 0; 
    background: var(--marker-url);
    background-repeat: no-repeat;
    color: black;
  }
  
  
  .marker-center:after {
    bottom: -30px;
    left: 50%;
    margin-left: -60px;
  }
  
  @media (max-width: 575.98px) {
    .marker {
      padding-right: 0;
    }
    .marker:after {
      bottom: -30px;
      left: 50%;
      margin-left: -60px;
    }
  }
  
  .entry-title a {
    text-decoration: none;
  }
  .fixed-header {
    position: fixed;
    padding-top: .36em;
    padding-bottom: .36em;
    top: 0;
    right: 0;
    left: 0;
    z-index: 10;
  }
  /* گرید سه ستونه با راست‌چینی و پشتیبانی از آیتم tall */
  .custom-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    direction: rtl;          /* راست‌چین: اولین آیتم در سمت راست نمایش داده می‌شود */
    grid-auto-rows: auto;    /* ارتفاع ردیف‌ها بر اساس محتوا */
  }

  /* آیتم‌های معمولی گرید */
  .custom-portfolio-grid .grid-item {
    width: 100%;            /* لغو float و عرض ثابت از استایل قبلی */
    float: none;
    padding: 0;
    margin: 0;
    transition: transform 0.3s ease;
  }

  /* آیتم کشیده (دو برابر ارتفاع) */
  .custom-portfolio-grid .grid-item.tall {
    grid-row: span 2;
  }

  /* تصاویر داخل portfolio-item کاملاً responsive */
  .custom-portfolio-grid .portfolio-item {
    height: 100%;
    margin: 0;
  }

  .custom-portfolio-grid .portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;      /* برش هوشمند برای حفظ نسبت و پر کردن قاب */
  }

  /* ریسپانسیو: تبلت (دو ستون) */
  @media (max-width: 991px) {
    .custom-portfolio-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 1rem;
    }
    /* آیتم tall همچنان دو ردیف می‌گیرد */
  }

  /* موبایل (یک ستون) */
  @media (max-width: 640px) {
    .custom-portfolio-grid {
      grid-template-columns: 1fr;
      gap: 1.2rem;
    }
    .custom-portfolio-grid .grid-item.tall {
      grid-row: span 1;   /* در موبایل ارتفاع عادی باشد */
    }
  }

  /* در صورت وجود کلاس قبلی grid-sizer آن را مخفی کنید */
  .grid-sizer {
    display: none;
  }

  /* اطمینان از حذف floatهای مزاحم از استایل قدیمی */
  .grid:after,
  .grid-item {
    display: block;
    clear: none;
  }
  

