/* کلاسی که با JS به المان‌ها موقع اسکرول داده میشه */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* افکت هاور دکمه‌ها (2026 Trend) */
.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    background: var(--brand-red);
    color: #fff;
    border-radius: 50px;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    z-index: 1;
    border: none;
    cursor: pointer;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 0; height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: var(--transition);
    z-index: -1;
}

.btn-modern:hover::before { width: 100%; }
.btn-modern:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(230, 0, 0, 0.3); }

/* کلاسی که با JS به المان‌ها موقع اسکرول داده میشه */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* افکت هاور دکمه‌ها (2026 Trend) */
.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    background: var(--brand-red);
    color: #fff;
    border-radius: 50px;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    z-index: 1;
    border: none;
    cursor: pointer;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 0; height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: var(--transition);
    z-index: -1;
}

.btn-modern:hover::before { width: 100%; }
.btn-modern:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(230, 0, 0, 0.3); }
/* ============================================ */
/* HYPER ARIAN - CINEMATIC PRELOADER v1.0.3     */
/* ============================================ */

/* === رنگ‌بندی بر اساس تم === */
#ha-preloader {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8f9fa; /* پیش‌فرض: لایت */
    transition: background 0.4s ease;
}

#ha-preloader[data-theme="dark"] {
    background: #0f1014;
}

#ha-preloader-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.ha-preloader-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 90%;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* === لوگو با درخشش === */
.ha-logo-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 30px;
    animation: haLogoEntry 1.2s cubic-bezier(0.25, 1, 0.5, 1) both;
}

.ha-preloader-logo {
    width: 130px;
    height: auto;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 30px rgba(230, 0, 0, 0.6));
    animation: haLogoPulse 2s ease-in-out infinite;
}

#ha-preloader[data-theme="dark"] .ha-preloader-logo {
    filter: drop-shadow(0 0 30px rgba(255, 51, 51, 0.8));
}

.ha-logo-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(230, 0, 0, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
    animation: haGlowPulse 2s ease-in-out infinite;
}

#ha-preloader[data-theme="dark"] .ha-logo-glow {
    background: radial-gradient(circle, rgba(255, 51, 51, 0.4) 0%, transparent 70%);
}

@keyframes haLogoEntry {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes haLogoPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes haGlowPulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

/* === متن برند (کلمه به کلمه نه حرف به حرف) === */
.ha-brand-text {
    font-family: 'YekanBakh', sans-serif;
    font-size: 2.8rem;
    font-weight: 900;
    margin-bottom: 35px;
    letter-spacing: 2px;
    direction: rtl;
    display: flex;
    justify-content: center;
    gap: 18px;
}

.ha-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(40px);
    animation: haWordUp 0.8s cubic-bezier(0.5, 0, 0, 1) forwards;
    background: linear-gradient(135deg, #E60000 0%, #ff6b6b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#ha-preloader[data-theme="dark"] .ha-word {
    background: linear-gradient(135deg, #fff 0%, #ff6b6b 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.ha-word-1 { animation-delay: 0.5s; }
.ha-word-2 { animation-delay: 0.8s; }

@keyframes haWordUp {
    to { opacity: 1; transform: translateY(0); }
}

/* === پروگرس بار === */
.ha-progress-wrap {
    width: 280px;
    margin: 0 auto;
    opacity: 0;
    animation: haFadeIn 0.6s ease 1.2s forwards;
}

.ha-progress-bar {
    width: 100%;
    height: 2px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

#ha-preloader[data-theme="dark"] .ha-progress-bar {
    background: rgba(255, 255, 255, 0.15);
}

.ha-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #E60000, #ff6b6b);
    box-shadow: 0 0 15px #E60000;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.ha-progress-text {
    font-family: 'YekanBakh', sans-serif;
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.6);
    font-weight: 700;
    letter-spacing: 1px;
}

#ha-preloader[data-theme="dark"] .ha-progress-text {
    color: rgba(255, 255, 255, 0.7);
}

/* === تگ‌لاین === */
.ha-tagline {
    margin-top: 20px;
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.5);
    letter-spacing: 3px;
    opacity: 0;
    animation: haFadeIn 0.6s ease 1.5s forwards;
    font-family: 'YekanBakh', sans-serif;
}

#ha-preloader[data-theme="dark"] .ha-tagline {
    color: rgba(255, 255, 255, 0.5);
}

@keyframes haFadeIn {
    to { opacity: 1; }
}

/* === پرده‌های قرمز با باز شدن نهایی === */
.ha-curtain {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(135deg, #E60000 0%, #c00 100%);
    z-index: 2;
    transform: scaleY(0);
    transition: transform 0.9s cubic-bezier(0.77, 0, 0.175, 1);
    box-shadow: 0 0 50px rgba(230, 0, 0, 0.5);
}

.ha-curtain-top {
    top: 0;
    transform-origin: top;
}

.ha-curtain-bottom {
    bottom: 0;
    transform-origin: bottom;
}

/* === مرحله 1: محتوا محو، پرده‌ها بسته میشن === */
#ha-preloader.ha-closing .ha-preloader-content {
    opacity: 0;
    transform: scale(0.95);
}

#ha-preloader.ha-closing .ha-curtain {
    transform: scaleY(1);
}

#ha-preloader.ha-closing .ha-curtain-top {
    transition-delay: 0.05s;
}

/* === مرحله 2: پرده‌ها از وسط باز میشن (مثل پرده‌ی سینما) === */
#ha-preloader.ha-opening .ha-curtain {
    transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

#ha-preloader.ha-opening .ha-curtain-top {
    transform: translateY(-100%);
}

#ha-preloader.ha-opening .ha-curtain-bottom {
    transform: translateY(100%);
}

#ha-preloader.ha-opening {
    background: transparent !important;
    pointer-events: none;
}

#ha-preloader.ha-opening #ha-preloader-canvas {
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* === رسپانسیو موبایل === */
@media (max-width: 768px) {
    .ha-preloader-logo {
        width: 100px;
    }
    .ha-logo-glow {
        width: 140px;
        height: 140px;
    }
    .ha-brand-text {
        font-size: 2rem;
        gap: 12px;
    }
    .ha-progress-wrap {
        width: 220px;
    }
    .ha-tagline {
        font-size: 0.8rem;
        letter-spacing: 2px;
    }
}
/* ============================================ */
/* QUICK TRANSITION MODE - بارهای بعدی          */
/* ============================================ */

#ha-quick-preloader {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    pointer-events: none;
    overflow: hidden;
}

.ha-quick-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #E60000 0%, #c00 50%, #E60000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* انیمیشن ورود: از پایین به بالا */
    transform: translateY(100%);
    animation: haQuickEnter 0.7s cubic-bezier(0.77, 0, 0.175, 1) forwards;
    
    box-shadow: 0 0 60px rgba(230, 0, 0, 0.5);
}

#ha-quick-preloader[data-theme="dark"] .ha-quick-panel {
    background: linear-gradient(135deg, #ff3333 0%, #c00 50%, #ff3333 100%);
}

/* انیمیشن ورود پرده از پایین */
@keyframes haQuickEnter {
    0% { 
        transform: translateY(100%); 
    }
    100% { 
        transform: translateY(0); 
    }
}

/* === لوگوی وسط با fade-in بعد از پر شدن پرده === */
/* === لوگوی وسط با glow سینمایی === */
.ha-quick-logo {
    position: relative;
    opacity: 0;
    transform: scale(0.7);
    animation: haQuickLogoIn 0.5s ease 0.5s forwards;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ✨ Halo نوری ملایم پشت لوگو */
.ha-quick-logo::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(
        circle, 
        rgba(255, 255, 255, 0.3) 0%, 
        rgba(255, 255, 255, 0.1) 35%,
        transparent 70%
    );
    transform: translate(-50%, -50%);
    z-index: 0;
    animation: haHaloPulse 2s ease-in-out infinite;
    pointer-events: none;
}

/* 🌟 حلقه نوری متحرک */
.ha-quick-logo::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    z-index: 0;
    animation: haRingExpand 2.2s ease-out infinite;
    pointer-events: none;
}

.ha-quick-logo img {
    width: 130px;
    height: auto;
    position: relative;
    z-index: 2;
    
    /* پس‌زمینه سفید + گردی + سایه */
    background: #ffffff;
    padding: 18px;
    border-radius: 50%;
    
    box-shadow: 
        0 0 0 6px rgba(255, 255, 255, 0.15),
        0 0 0 12px rgba(255, 255, 255, 0.08),
        0 10px 40px rgba(0, 0, 0, 0.25),
        0 0 60px rgba(255, 255, 255, 0.5);
    
    animation: haLogoBreath 1.8s ease-in-out infinite;
}

/* انیمیشن نفس کشیدن لوگو */
@keyframes haLogoBreath {
    0%, 100% { 
        transform: scale(1);
    }
    50% { 
        transform: scale(1.06);
    }
}

/* Halo نبض‌دار */
@keyframes haHaloPulse {
    0%, 100% { 
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.15);
    }
}

/* حلقه expand شونده */
@keyframes haRingExpand {
    0% { 
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(0.85);
        border-width: 2px;
    }
    100% { 
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.6);
        border-width: 1px;
    }
}

@keyframes haQuickLogoIn {
    0% { 
        opacity: 0; 
        transform: scale(0.7); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1); 
    }
}

/* === خروج: پنل به سمت بالا میره === */
#ha-quick-preloader.ha-quick-exit .ha-quick-panel {
    animation: haQuickExit 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

#ha-quick-preloader.ha-quick-exit .ha-quick-logo {
    animation: haQuickLogoOut 0.4s ease forwards;
}
#ha-quick-preloader,
#ha-page-exit {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    pointer-events: none;
    overflow: hidden;
}

@keyframes haQuickExit {
    0% { 
        transform: translateY(0); 
    }
    100% { 
        transform: translateY(-100%); 
    }
}

@keyframes haQuickLogoOut {
    0% { 
        opacity: 1; 
        transform: scale(1); 
    }
    100% { 
        opacity: 0; 
        transform: scale(0.8); 
    }
}

/* === رسپانسیو === */
@media (max-width: 768px) {
    .ha-quick-logo img {
        width: 85px;
    }
    
    .ha-quick-logo::before {
        width: 140px;
        height: 140px;
    }
    
    .ha-quick-logo::after {
        width: 110px;
        height: 110px;
    }
}

/* وقتی از صفحه‌ی قبل میایم: انیمیشن ورود رو رد کن، ولی خروج رو نگه دار */
#ha-quick-preloader.ha-no-enter .ha-quick-panel {
    animation: none;
    transform: translateY(0);
}

#ha-quick-preloader.ha-no-enter .ha-quick-logo {
    animation: none;
    opacity: 1;
    transform: scale(1);
}

/* مهم: وقتی exit رو می‌گیره، انیمیشن خروج باید کار کنه */
#ha-quick-preloader.ha-no-enter.ha-quick-exit .ha-quick-panel {
    animation: haQuickExit 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

#ha-quick-preloader.ha-no-enter.ha-quick-exit .ha-quick-logo {
    animation: haQuickLogoOut 0.4s ease forwards;
}