/* ============================================
   FONTS - LAHZEH
   ============================================ */

@font-face {
    font-family: 'Lahzeh-Regular';
    src: url('../fonts/Lahzeh-RegularSemiStretch.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Lahzeh-Medium';
    src: url('../fonts/Lahzeh-MediumSemiStretch.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Lahzeh-Bold';
    src: url('../fonts/Lahzeh-BoldSemiStretch.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ============================================
   PRELOADER - LOADING SCREEN
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lahzeh-Regular', 'DM Sans', sans-serif;
    overflow: hidden;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

:root {
    --gold-crayola: #e4c590;
    --gold-crayola-dark: #c4a87a;
    --eerie-black-1: #0d0c0a;
    --white: #ffffff;
}

/* ========================================== */
/* PRELOADER CONTAINER */
/* ========================================== */

.preload {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--eerie-black-1);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    overflow: hidden;
}

/* ========================================== */
/* BACKGROUND PARTICLES */
/* ========================================== */

.preload-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: var(--gold-crayola);
    opacity: 0;
    animation: particleFloat 6s ease-in-out infinite;
}

.particle-1 {
    width: 8px;
    height: 8px;
    top: 10%;
    left: 20%;
    animation-delay: 0s;
}

.particle-2 {
    width: 12px;
    height: 12px;
    top: 30%;
    right: 15%;
    animation-delay: 0.8s;
}

.particle-3 {
    width: 6px;
    height: 6px;
    top: 60%;
    left: 10%;
    animation-delay: 1.6s;
}

.particle-4 {
    width: 10px;
    height: 10px;
    top: 80%;
    right: 25%;
    animation-delay: 2.4s;
}

.particle-5 {
    width: 15px;
    height: 15px;
    top: 15%;
    left: 55%;
    animation-delay: 0.4s;
}

.particle-6 {
    width: 7px;
    height: 7px;
    top: 45%;
    right: 40%;
    animation-delay: 1.2s;
}

.particle-7 {
    width: 9px;
    height: 9px;
    top: 70%;
    left: 35%;
    animation-delay: 2s;
}

.particle-8 {
    width: 11px;
    height: 11px;
    top: 90%;
    right: 60%;
    animation-delay: 0.6s;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }
    30% {
        opacity: 0.6;
    }
    70% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translateY(-120px) scale(1.2);
    }
}

/* ========================================== */
/* GLOW EFFECT */
/* ========================================== */

.preload-glow {
    position: absolute;
    width: min(900px, 75vw);
    height: min(900px, 75vw);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(228, 197, 144, 0.07) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: glowPulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
}

/* ========================================== */
/* CONTENT */
/* ========================================== */

.preload-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    width: 100%;
    max-width: 700px;
    gap: 0;
}

/* ========================================== */
/* LOGO */
/* ========================================== */

.preload-logo {
    animation: logoFloat 2.5s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 0;
    line-height: 0;
}

.preload-logo img {
    width: min(480px, 60vw, 65vh);
    height: min(480px, 60vw, 65vh);
    display: block;
    object-fit: contain;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(clamp(-6px, -1.2vh, -14px));
    }
}

/* ========================================== */
/* LOADING WRAPPER */
/* ========================================== */

.preload-loading-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-top: 0;
}

/* ========================================== */
/* SPINNER */
/* ========================================== */

.preload-spinner-wrapper {
    position: relative;
}

.preload-spinner {
    width: clamp(40px, 5vh, 50px);
    height: clamp(40px, 5vh, 50px);
    border: clamp(3px, 0.4vh, 4px) solid rgba(228, 197, 144, 0.15);
    border-top: clamp(3px, 0.4vh, 4px) solid var(--gold-crayola);
    border-radius: 50%;
    animation: spin 0.9s cubic-bezier(0.6, 0, 0.4, 1) infinite;
    position: relative;
}

.preload-spinner::after {
    content: '';
    position: absolute;
    top: clamp(-3px, -0.4vh, -4px);
    left: clamp(-3px, -0.4vh, -4px);
    right: clamp(-3px, -0.4vh, -4px);
    bottom: clamp(-3px, -0.4vh, -4px);
    border: clamp(3px, 0.4vh, 4px) solid transparent;
    border-top: clamp(3px, 0.4vh, 4px) solid rgba(228, 197, 144, 0.2);
    border-radius: 50%;
    animation: spin 1.8s linear infinite reverse;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================== */
/* LOADING TEXT */
/* ========================================== */

.preload-text {
    font-family: 'Lahzeh-Medium', 'DM Sans', sans-serif;
    font-size: clamp(1.1rem, 2.2vh, 1.5rem);
    letter-spacing: clamp(3px, 0.5vw, 6px);
    color: var(--gold-crayola);
    opacity: 0.5;
    animation: textPulse 2s ease-in-out infinite;
    margin: 0;
    margin-top: 2px;
    margin-bottom: 0;
}

@keyframes textPulse {
    0%, 100% {
        opacity: 0.35;
    }
    50% {
        opacity: 0.75;
    }
}

/* ========================================== */
/* DESCRIPTION */
/* ========================================== */

.preload-description {
    font-family: 'Lahzeh-Medium', 'DM Sans', sans-serif;
    font-size: clamp(1rem, 1.8vh, 1.3rem);
    letter-spacing: clamp(2px, 0.3vw, 4px);
    color: var(--gold-crayola);
    opacity: 0.5;
    text-align: center;
    margin: 0;
    padding: 0 clamp(15px, 4vw, 40px);
    margin-top: 3px;
    margin-bottom: 0;
}

/* ========================================== */
/* HIDDEN STATE */
/* ========================================== */

.preload.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preload.hidden .preload-content {
    animation: contentFadeOut 0.6s ease forwards;
}

@keyframes contentFadeOut {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.9);
        opacity: 0;
    }
}

/* ========================================== */
/* RESPONSIVE */
/* ========================================== */

/* دسکتاپ بزرگ */
@media screen and (min-width: 1200px) {
    .preload-logo img {
        width: min(520px, 55vw, 70vh);
        height: min(520px, 55vw, 70vh);
    }
    
    .preload-loading-wrapper {
        gap: 2px;
        margin-top: -80px;
    }
    
    .preload-spinner {
        width: 50px;
        height: 50px;
    }
    
    .preload-text {
        font-size: 1.5rem;
        letter-spacing: 5px;
        margin-top: 0px;
        margin-bottom: 0px;
    }
    
    .preload-description {
        font-size: 1.3rem;
        letter-spacing: 3px;
        margin-top: 0px;
        margin-bottom: 0px;
    }
}

/* دسکتاپ متوسط */
@media screen and (min-width: 992px) and (max-width: 1199px) {
    .preload-logo img {
        width: min(440px, 50vw, 60vh);
        height: min(440px, 50vw, 60vh);
    }
    
    .preload-loading-wrapper {
        gap: 2px;
        margin-top: -8px;
    }
    
    .preload-spinner {
        width: 46px;
        height: 46px;
    }
    
    .preload-text {
        font-size: 1.3rem;
        letter-spacing: 4px;
        margin-top: 0px;
        margin-bottom: 0px;
    }
    
    .preload-description {
        font-size: 1.1rem;
        letter-spacing: 3px;
        margin-top: 0px;
        margin-bottom: 0px;
    }
}

/* تبلت */
@media screen and (max-width: 991px) and (min-width: 769px) {
    .preload-logo img {
        width: min(350px, 55vw, 50vh);
        height: min(350px, 55vw, 50vh);
    }
    
    .preload-loading-wrapper {
        gap: 4px;
        margin-top: 2px;
    }
    
    .preload-spinner {
        width: 40px;
        height: 40px;
    }
    
    .preload-text {
        font-size: 1.1rem;
        letter-spacing: 4px;
        margin-top: 2px;
        margin-bottom: 0px;
    }
    
    .preload-description {
        font-size: 0.95rem;
        letter-spacing: 2.5px;
        margin-top: 2px;
        margin-bottom: 0px;
    }
}

/* موبایل - بزرگتر شده */
@media screen and (max-width: 768px) {
    .preload-logo img {
        width: min(320px, 60vw, 50vh);
        height: min(320px, 60vw, 50vh);
    }
    
    .preload-loading-wrapper {
        gap: 6px;
        margin-top: 4px;
    }
    
    .preload-spinner {
        width: clamp(38px, 5vh, 45px);
        height: clamp(38px, 5vh, 45px);
    }
    
    .preload-text {
        font-size: clamp(1.1rem, 2vh, 1.3rem);
        letter-spacing: clamp(3px, 0.5vw, 5px);
        margin-top: 3px;
        margin-bottom: 0px;
    }
    
    .preload-description {
        font-size: clamp(0.95rem, 1.6vh, 1.1rem);
        letter-spacing: clamp(2px, 0.3vw, 4px);
        margin-top: 4px;
        margin-bottom: 0px;
    }
}

/* موبایل کوچک - بزرگتر شده */
@media screen and (max-width: 480px) {
    .preload-logo img {
        width: min(250px, 55vw, 45vh);
        height: min(250px, 55vw, 45vh);
    }
    
    .preload-loading-wrapper {
        gap: 5px;
        margin-top: 3px;
    }
    
    .preload-spinner {
        width: clamp(32px, 4.5vh, 38px);
        height: clamp(32px, 4.5vh, 38px);
        border-width: clamp(2.5px, 0.4vh, 3px);
    }
    
    .preload-spinner::after {
        border-width: clamp(2.5px, 0.4vh, 3px);
    }
    
    .preload-text {
        font-size: clamp(0.95rem, 1.8vh, 1.1rem);
        letter-spacing: clamp(2.5px, 0.4vw, 4px);
        margin-top: 2px;
        margin-bottom: 0px;
    }
    
    .preload-description {
        font-size: clamp(0.85rem, 1.4vh, 1rem);
        letter-spacing: clamp(2px, 0.3vw, 3px);
        margin-top: 3px;
        margin-bottom: 0px;
    }
}

/* موبایل خیلی کوچک */
@media screen and (max-width: 360px) {
    .preload-logo img {
        width: min(180px, 50vw, 38vh);
        height: min(180px, 50vw, 38vh);
    }
    
    .preload-loading-wrapper {
        gap: 4px;
        margin-top: 2px;
    }
    
    .preload-spinner {
        width: clamp(26px, 3.5vh, 32px);
        height: clamp(26px, 3.5vh, 32px);
        border-width: 2px;
    }
    
    .preload-spinner::after {
        border-width: 2px;
    }
    
    .preload-text {
        font-size: clamp(0.8rem, 1.4vh, 0.95rem);
        letter-spacing: clamp(2px, 0.3vw, 3px);
        margin-top: 2px;
        margin-bottom: 0px;
    }
    
    .preload-description {
        font-size: clamp(0.7rem, 1.1vh, 0.85rem);
        letter-spacing: 1.5px;
        margin-top: 2px;
        margin-bottom: 0px;
    }
    
    .particle {
        display: none;
    }
}

/* ارتفاع کم (موبایل افقی) */
@media screen and (max-height: 600px) {
    .preload-logo img {
        width: min(180px, 40vh);
        height: min(180px, 40vh);
    }
    
    .preload-loading-wrapper {
        gap: 3px;
        margin-top: 1px;
    }
    
    .preload-spinner {
        width: 28px;
        height: 28px;
    }
    
    .preload-text {
        font-size: 0.85rem;
        letter-spacing: 2px;
        margin-top: 1px;
        margin-bottom: 0px;
    }
    
    .preload-description {
        font-size: 0.75rem;
        margin-top: 2px;
        margin-bottom: 0px;
    }
}