/* ایزوله‌سازی کامل با کلاس والد */
.portfolio-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
    color: #fff;
}

.portfolio-page .page-header { border-bottom: 1px solid #202020; padding-bottom: 30px; margin-bottom: 40px; }

.portfolio-page .filters { display:flex; gap:10px; margin-top: 20px; }
.portfolio-page .filter {
    background: transparent; border: 1px solid #333; color: #fff;
    padding: 8px 16px; border-radius: 99px; cursor: pointer;
}
.portfolio-page .filter.is-active { border-color: #D4A85F; color: #D4A85F; }

.portfolio-page .portfolio-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px;
}

.portfolio-page .p-card {
    background: #111; border: 1px solid #222; border-radius: 20px; overflow: hidden;
}

.portfolio-page .p-media img { width: 100%; display: block; }
.portfolio-page .p-body { padding: 20px; }
.portfolio-page .p-badge { color: #D4A85F; font-size: 0.8rem; }

.portfolio-page .p-btn-primary {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: #D4A85F;
    color: black;
    text-decoration: none;
    border-radius: 10px;
    font-weight: bold;
}
    /* این بخش برای ایزوله‌سازی است و با هیچ جای سایتت تداخل نداره */
    .portfolio-page-wrapper {
        --bg: #0a0a0a; 
        --panel: #0f0f0f; 
        --text: #f4f4f4; 
        --muted: #b7b7b7;
        --line: #202020; 
        --gold: #D4A85F; 
        --radius: 18px;
        background-color: var(--bg);
        color: var(--text);
        font-family: system-ui, -apple-system, sans-serif;
        padding-bottom: 60px;
    }
    /* اول: مطمئن شو کل پورتفولیو از زیر منو شروع میشه */
.portfolio-page-wrapper {
    position: relative !important;
    z-index: 1 !important;
}

/* دوم: استایل تایتل رو از حالت شناور دربیار */
.portfolio-page-wrapper .page-header {
    position: relative !important; /* خیلی مهم: از absolute یا fixed خارجش کن */
    top: auto !important;
    left: auto !important;
    margin-bottom: 40px !important;
    background: transparent !important; /* اگر پس‌زمینه اضافه داره حذفش کن */
    width: 100% !important;
    padding: 0 20px;
}

/* سوم: جلوگیری از تداخل با اسلایدر */
.portfolio-page-wrapper .portfolio-grid {
    position: relative !important;
    z-index: 2 !important;
}

    .portfolio-page-wrapper .container { width: min(1100px, 92vw); margin-inline: auto; }

    /* هدر */
    .portfolio-page-wrapper .page-header { padding: 70px 0 30px; border-bottom: 1px solid var(--line); }
    .portfolio-page-wrapper .page-title { margin: 0 0 10px; font-size: 2.6rem; }
    .portfolio-page-wrapper .page-subtitle { color: var(--muted); margin-bottom: 20px; }

    /* گرید پروژه ها */
    .portfolio-page-wrapper .portfolio-grid {
        display: grid; grid-template-columns: repeat(12, 1fr); gap: 22px; padding-top: 40px;
    }
    .portfolio-page-wrapper .project {
        grid-column: span 6; background: var(--panel); border: 1px solid var(--line);
        border-radius: var(--radius); overflow: hidden; transition: .3s;
    }
    .portfolio-page-wrapper .project:hover { border-color: var(--gold); transform: translateY(-5px); }
    
    .portfolio-page-wrapper .project-media { display: block; aspect-ratio: 16/9; overflow: hidden; }
    .portfolio-page-wrapper .project-media img { width: 100%; height: 100%; object-fit: cover; transition: .4s; }
    .portfolio-page-wrapper .project:hover .project-media img { transform: scale(1.08); }

    .portfolio-page-wrapper .project-body { padding: 20px; }
    .portfolio-page-wrapper .project-badge { color: var(--gold); font-size: 0.8rem; border: 1px solid var(--line); padding: 4px 8px; border-radius: 6px; }
    
    /* دکمه‌ها */
    .portfolio-page-wrapper .btn-group { display: flex; gap: 10px; margin-top: 20px; }
    .portfolio-page-wrapper .btn-p { 
        padding: 10px 18px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 0.9rem;
    }
    .portfolio-page-wrapper .btn-primary { background: var(--gold); color: #000; }
    .portfolio-page-wrapper .btn-ghost { border: 1px solid var(--line); color: var(--text); }

    @media (max-width: 900px) { .portfolio-page-wrapper .project { grid-column: span 12; } }
button{
    border-radius: 25px;
    width: 100%;
    padding: 15px;
    margin: 0px;
    font-size: larger;
    border: none;
    background-color: #D4A85F;
    font-weight: bolder;
    color:rgb(0, 0, 0);
}  
.reveal-text {
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    animation: reveal 10s ease forwards;
    animation-delay: 3s;
  }
  
  @keyframes reveal {
    from {
      width: 0;
    }
    to {
      width: 100%;
    }
  }
  
#typing-text{
    color: beige;
    text-align: center;
    margin: 20px;
    font-weight: 300;
}
body{
    background-color: black;
}
.head {
    align-items: center;
    display: flex;
    text-decoration: none;
    direction: rtl;
    margin-right: 10px;
    margin-left: 20px;
    margin-top: 0%;
    color: aliceblue;
    font-weight: bold;
    font-size: large;
}

/* ریسپانسیو برای موبایل */
@media (max-width: 900px) {
    .split-section {
        flex-direction: column; /* گروه‌ها زیر هم */
    }
    .group {
        width: 100%;
        text-align: center;
    }
}
/* CSS Navbar چسبان */
header {
    position: sticky;
    top: 0;              /* فاصله از بالای صفحه وقتی چسبید */
    z-index: 1000;       /* همیشه بالای بقیه عناصر */
}
.menu {
    display: grid;
    grid-template-columns: repeat(11, 1fr) ;
    grid-template-rows: 1fr 1fr;
    grid-gap: 0px;
    padding-bottom: 20px;
    margin: auto;
    align-items: center;
    background-color: #D4A85F;
    height: 30px;
    padding-top: 10px;
    border-radius: 15px;
    position: sticky;
    z-index: 10;  
}
.icon{
    display: none;
}

.head:hover{
    font-weight: bolder;
    color: rgb(0, 0, 0);
    transition: 1s;
    
}
@media (max-width: 1100px) {
    .menu{
        grid-template-columns: 1fr 1fr 1fr;
    }
    .item-menu{
        display: none;
    }
    .icon{
        display: block;
        grid-column: 3/4;
        max-width: 44px;
        text-align: right;
    }
    .i{
        grid-column: 3/4;
        margin-left: 200px;
    }
 }
@media(max-width:780px){
    .i{
        margin-left: 150px ;
    }
}
@media(max-width:640px){
    .i{
        margin-left: 100px;
    }
}
@media(max-width:540px){
    .menu{
        grid-template-columns: 1fr 1fr;

    }
    .i{
        grid-column: 2/3;
        margin-left: 160px;
    }
}
@media(max-width:430px){
    .menu{
        grid-template-columns: 1fr 1fr;

    }
    .i{
        grid-column: 2/3;
        margin-left: 120px;
    }
}
@media(max-width:400px){
    .menu{
        grid-template-columns: 1fr 1fr;

    }
    .i{
        grid-column: 2/3;
        margin-left: 90px;
    }
}
@media (max-width: 1100px) {
    /* منوی موبایل */
    .menu {
        display: flex;
        flex-direction: column; /* آیتم‌ها زیر هم */
        align-items: flex-start; 
        position: relative;    }

    .icon {
        align-items: flex-end;
        display: block;
        position: absolute;
        top: 6px;
        right: 10px;
        cursor: pointer;
        z-index: 1001;

    }

    .item-menu { /* همبرگر نو بار بالا */
        align-self: flex-end;
        display: none; /* ابتدا مخفی */
        text-align: center;
        padding-bottom: 15px;
        margin-top: 20px; /* فاصله بین آیتم‌ها */
        background-color: #2C2C2C;
        border-radius: 15px;
        padding-left: 20px;
        padding-right: 25px;
    }

    /* وقتی باز شد */
    .item-menu.open {
        display: block;

    }
}
.typewriter-container {
    font-size: x-small;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: px 0; /* فاصله بالا و پایین */
    /* height: calc(100vh - 100px); حذف شود */
}

#typewriter {
    color: rgb(255, 255, 255);
    font-size: 1.8em;
    text-align: center;
    direction: rtl;
    white-space: nowrap;
    overflow: hidden;

}

/* وقتی عرض صفحه کمتر از 840px شد */
@media (max-width: 840px) {
    #typewriter {
        white-space: normal; /* اجازه شکست خط */
        width: 80%; /* یا هر اندازه که دوست داری */
    }
}
/* ==== Preloader ==== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    z-index: 9999;
}

.preloader-logo {
    width: 250px;
    opacity: 0;
    transform: translateX(-150%);
    animation: slideIn 1.8s ease forwards;
}

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateX(-150%);
    }
    60% {
        opacity: 1;
        transform: translateX(10%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.preloader-hide {
    opacity: 0;
    transition: opacity 0.7s ease;
    pointer-events: none;
}
/* ===== SAFE SLIDER ===== */
.safe-slider {
    width: 100%;
    min-height: 90vh;
    position: relative;
    overflow: hidden;
    background: #000;
  }
  
  .safe-track {
    display: flex;
    transition: transform .7s ease;
    height: 100%;
  }
  
  .safe-slide {
    min-width: 100%;
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 40px;
    box-sizing: border-box;
  }
  hr{
    border: 1px solid #111;
}
  .safe-text {
    width: 40%;
    color: white;
    margin-left: 10px;
    text-align: center;
  }
  
  .safe-text h2 {
    font-size: 2.4rem;
    margin-bottom: 10px;
  }
  
  .safe-text p {
    opacity: 0.8;
    margin-bottom: 20px;
  }
  
  .safe-text button {
    padding: 10px 24px;
    border: none;
    background: #d4a85f;
    cursor: pointer;
    border-radius: 15px;
    margin: 5px;
    font-size: 20px;
    width: 45%;
  }
  button:hover{
    background-color: #9c7845;
    color: aliceblue;
    transition: 500ms;
  }
  
  .safe-frame {
    width: 65%;
    height: 65vh;
    border-radius: 16px;
    overflow: hidden;
  }
  
  .safe-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
  }
  
  /* arrows */
  .safe-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,.6);
    color: white;
    font-size: 32px;
    padding: 10px;
    cursor: pointer;
    z-index: 20;
  }
  
  .safe-prev { left: 20px; }
  .safe-next { right: 20px; }
  
  /* Mobile */
  @media (max-width: 1280px) {
    .safe-slide {
      flex-direction: column;
      padding: 20px;
    }
  
    .safe-text, .safe-frame {
      width: 100%;
      margin: none;
    }
  
    .safe-frame {
      height: 45vh;
    }
  }
  .ab{
    display: none;
}
@media (max-width: 900px){
    .ab{
        display: block;
    }
}
.bc{
    display: flexbox;
}
@media (max-width: 900px){
    .bc{
        display: none;
    }
}