/* ===== ریست و فونت ===== */
/* @import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;600;700&display=swap'); */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: #0a0e27;
    color: #e0e7ff;
    min-height: 100vh;
    overflow-x: hidden;
    cursor: none;
}

/* ===== کرسر ستاره‌ای ===== */
.custom-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    font-size: 24px;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 0 6px #38bdf8) drop-shadow(0 0 14px #0284c7);
    transition: font-size 0.15s;
}

/* ===== پس‌زمینه‌ی ذرات ===== */
#stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===== محتوای اصلی ===== */
main {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

/* ===== هیرو / تایپ‌رایتر ===== */
.hero {
    text-align: center;
    padding: 100px 20px 80px;
}

#typewriter {
    font-size: 2rem;
    font-weight: 600;
    color: #bae6fd;
    min-height: 80px;
    text-shadow: 0 0 30px rgba(56, 189, 248, 0.3);
}

#typewriter::after {
    content: '|';
    animation: blink 1s infinite;
    color: #38bdf8;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ===== گالری ===== */
.gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
    padding-bottom: 60px;
}

/* ===== کارت‌ها ===== */
.card {
    width: 100%;
    max-width: 500px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card-inner {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 24px;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color 0.4s, box-shadow 0.4s;
}

.card-inner:hover {
    border-color: rgba(56, 189, 248, 0.6);
    box-shadow: 
        0 0 20px rgba(56, 189, 248, 0.3),
        0 0 50px rgba(56, 189, 248, 0.2),
        0 0 80px rgba(56, 189, 248, 0.1),
        0 0 120px rgba(56, 189, 248, 0.05),
        0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-inner img {
    width: 100%;
    display: block;
    cursor: pointer;
    transition: transform 0.6s;
}

.card-inner:hover img {
    transform: scale(1.03);
}

/* --- کارت مربع --- */
.card.square .card-inner img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* --- کارت افقی (img4) --- */
.card.landscape .card-inner img {
    aspect-ratio: auto;
    object-fit: contain;
    max-height: 450px;
}

/* --- کارت سایز سفارشی (img5) --- */
.card.custom-size .card-inner img {
    aspect-ratio: auto;
    object-fit: contain;
    max-height: 500px;
}

/* ===== کپشن ===== */
.caption {
    padding: 20px 24px;
    font-size: 1rem;
    font-weight: 300;
    line-height: 2;
    color: #cbd5e1;
    text-align: center;
    border-top: 1px solid rgba(56, 189, 248, 0.1);
}

/* ===== بخش پاکت ===== */
.envelope-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 40px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.envelope-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.envelope {
    width: 160px;
    height: 120px;
    cursor: pointer;
    position: relative;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}
.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(135deg, #1e3a5f, #0f172a);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 16px 16px 0 0;
    transform-origin: top center;
    transition: transform 0.6s ease;
    z-index: 2;
}

.envelope-body {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-top: none;
    border-radius: 0 0 16px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    z-index: 1;
}

.envelope-icon {
    font-size: 1.8rem;
}

.envelope-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 300;
}

.envelope.open .envelope-flap {
    transform: rotateX(180deg);
}

/* ===== نامه ===== */
.letter {
    max-height: 0;
    overflow: hidden;
    width: 100%;
    max-width: 550px;
    transition: max-height 0.8s ease, margin-top 0.8s ease, opacity 0.6s ease;
    opacity: 0;
    margin-top: 0;
}

.letter.open {
    max-height: 800px;
    opacity: 1;
    margin-top: 30px;
}

.letter-content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 20px;
    padding: 32px 28px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    line-height: 2.4;
    font-size: 1rem;
    font-weight: 300;
    color: #cbd5e1;
    text-align: center;
    position: relative;
}

.letter-content p {
    margin-bottom: 8px;
}

.close-letter {
    margin-top: 20px;
    background: none;
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #bae6fd;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    transition: background 0.3s, border-color 0.3s;
}

.close-letter:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.6);
}

/* ===== فوتر ===== */
footer {
    text-align: center;
    padding: 40px 20px 20px;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 300;
}

/* ===== لایت‌باکس ===== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 0 60px rgba(56, 189, 248, 0.2);
    transform: scale(0.9);
    transition: transform 0.4s ease;
}

.lightbox.active img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 35px;
    font-size: 2.5rem;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 1000;
}

.lightbox-close:hover {
    color: #f87171;
}

/* ===== ریسپانسیو ===== */
@media (max-width: 600px) {
    main {
        padding: 30px 12px 50px;
    }

    .hero {
        padding: 70px 10px 50px;
    }

    #typewriter {
        font-size: 1.4rem;
    }

    .gallery {
        gap: 35px;
    }

    .card {
        max-width: 100%;
    }

    .caption {
        font-size: 0.9rem;
        padding: 16px 18px;
    }

    .envelope {
        width: 130px;
        height: 100px;
    }

    .envelope-icon {
        font-size: 1.5rem;
    }

    .letter-content {
        padding: 24px 16px;
        font-size: 0.9rem;
    }

    .lightbox img {
        max-width: 95vw;
    }

    .lightbox-close {
        top: 15px;
        right: 20px;
        font-size: 2rem;
    }
}
/* ===== انیمیشن sparkle ===== */
@keyframes sparkFade {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -200%) scale(0.3); }
}
/* ===== شمع ===== */
.candle {
    width: 18px;
    height: 38px;
    background: linear-gradient(#fbbf24, #d97706);
    border-radius: 4px 4px 0 0;
    margin: 0 auto 18px;
    position: relative;
    cursor: pointer;
}
.wick {
    width: 2px;
    height: 8px;
    background: #1e293b;
    margin: 0 auto;
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
}
.flame {
    display: none;
    width: 12px;
    height: 18px;
    background: radial-gradient(#fef3c7, #f59e0b);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    animation: flicker 0.3s infinite alternate;
}
.flame.lit {
    display: block;
    box-shadow: 0 0 15px #fbbf24, 0 0 30px #f59e0b, 0 0 45px #d97706;
}
@keyframes flicker {
    0% { transform: translateX(-50%) scale(1); }
    100% { transform: translateX(-50%) scale(1.08); }
}
/* ===== دود شمع ===== */
.smoke {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    opacity: 0.7;
    animation: smokeRise 1.2s ease-out forwards;
    pointer-events: none;
}

@keyframes smokeRise {
    0% {
        opacity: 0.6;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    50% {
        opacity: 0.3;
        transform: translateX(-30%) translateY(-20px) scale(2.5);
    }
    100% {
        opacity: 0;
        transform: translateX(-70%) translateY(-50px) scale(4);
    }
}
/* ===== شمع ===== */
.candle {
    width: 18px;
    height: 38px;
    background: linear-gradient(#fbbf24, #d97706);
    border-radius: 4px 4px 0 0;
    position: relative;
    cursor: pointer;
}
.wick {
    width: 2px;
    height: 8px;
    background: #1e293b;
    margin: 0 auto;
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
}
.flame {
    display: none;
    width: 12px;
    height: 18px;
    background: radial-gradient(#fef3c7, #f59e0b);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    animation: flicker 0.3s infinite alternate;
}
.flame.lit { display: block; }
@keyframes flicker {
    0% { transform: translateX(-50%) scale(1); }
    100% { transform: translateX(-50%) scale(1.2); }
}


@keyframes smokeRise {
    0% { opacity: 0.6; transform: translateX(-50%) translateY(0) scale(1); }
    50% { opacity: 0.3; transform: translateX(-30%) translateY(-20px) scale(2.5); }
    100% { opacity: 0; transform: translateX(-70%) translateY(-50px) scale(4); }
}

/* ===== راهنمای شمع ===== */
.candle-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}
.candle-hint {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 300;
}