@font-face {
    font-family: 'IranNastaliq';
    src: url('../assets/fonts/IranNastaliq_1.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'DimaShekasteh';
    src: url('../assets/fonts/DimaShekasteh.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Miremad';
    src: url('../assets/fonts/Miremad.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'DibajFaNum';
    src: url('../assets/fonts/dibaj/DibajFaNum-Regular.woff2') format('woff2');
    font-weight: 400;
}
@font-face {
    font-family: 'DibajFaNum';
    src: url('../assets/fonts/dibaj/DibajFaNum-SemiBold.woff2') format('woff2');
    font-weight: 600;
}
@font-face {
    font-family: 'DibajFaNum';
    src: url('../assets/fonts/dibaj/DibajFaNum-Bold.woff2') format('woff2');
    font-weight: 700;
}

:root {
    --bg-paper: #dfd0be;
    --ink-black: #271e16;
    --ink-dark: #3a2e24;
    --ink-muted: #534335;
    --ink-accent: #782924;

    --font-nastaliq: 'Miremad', 'IranNastaliq', serif;
    --font-shekasteh: 'DimaShekasteh', 'Miremad', serif;
    --font-en: 'Great Vibes', cursive;
    --font-body: 'DibajFaNum', Tahoma, sans-serif;

    --ease-slow: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    width: 100%;
    height: 100%;
    background-color: #12100e;
    font-family: var(--font-body);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    overflow: hidden;
}

.hidden { display: none !important; }

#mobile-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 460px;
    background-color: var(--bg-paper);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    box-shadow: 0 0 45px rgba(0,0,0,0.85);
}
#mobile-container::-webkit-scrollbar { display: none; }

@media (min-width: 481px) {
    #mobile-container {
        height: 94vh;
        max-height: 900px;
        border-radius: 14px;
    }
}

/* ----------------------------------
   انیمیشن خودکار باز شدن لته‌های کارت
-------------------------------------*/
#split-screen {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: transparent;
    display: flex;
    z-index: 100;
    overflow: hidden;
    perspective: 1000px;
    pointer-events: none;
}

.split-half {
    width: 50%;
    height: 100%;
    background-color: #cbb8a3;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.15'/%3E%3C/svg%3E");
    box-shadow: inset 0 0 25px rgba(0,0,0,0.15);
    transition: transform 2.2s var(--ease-slow), opacity 1.8s ease;
}

.split-right {
    transform-origin: right center;
}

.split-left {
    transform-origin: left center;
}

.split-line {
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 1.5px; height: 100%;
    background: rgba(39, 30, 22, 0.25);
    z-index: 101;
    transition: opacity 0.8s ease;
}

/* حالت باز شدن کارت */
#split-screen.opening .split-line {
    opacity: 0;
}
#split-screen.opening .split-right {
    transform: rotateY(85deg) translateX(30%);
    opacity: 0;
}
#split-screen.opening .split-left {
    transform: rotateY(-85deg) translateX(-30%);
    opacity: 0;
}

/* ----------------------------------
   بافت زمینه و کادر اسلیمی
-------------------------------------*/
#main-screen {
    position: relative;
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-paper);
}

.vintage-bg-wrapper {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
    overflow: hidden;
}

.vintage-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    filter: sepia(60%) grayscale(20%) brightness(0.95);
    opacity: 0.35;
}

.paper-texture-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, transparent 40%, rgba(45, 34, 24, 0.28) 100%),
                url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.12'/%3E%3C/svg%3E");
    pointer-events: none;
}

.vintage-frame {
    position: absolute;
    top: 14px; bottom: 14px;
    left: 14px; right: 14px;
    border: 1.5px solid var(--ink-black);
    pointer-events: none;
    z-index: 2;
}

.ornament-corner {
    position: absolute;
    width: 48px;
    height: 48px;
    pointer-events: none;
}
.ornament-svg { width: 100%; height: 100%; }

.corner-tr { top: -2px; right: -2px; }
.corner-tl { top: -2px; left: -2px; transform: scaleX(-1); }
.corner-br { bottom: -2px; right: -2px; transform: scaleY(-1); }
.corner-bl { bottom: -2px; left: -2px; transform: scale(-1, -1); }

/* ----------------------------------
   محتوا و تنظیم نرم انیمیشن
-------------------------------------*/
#content-container {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    padding: 28px 20px 24px 20px;
    z-index: 10;
    width: 100%;
}

/* زمان فید شدن به ۳.۵ ثانیه افزایش یافت تا بسیار ملایم بالا بیاید */
.sequence-text {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 4s var(--ease-slow), transform 4s var(--ease-slow);
}
.sequence-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.header-text {
    font-family: var(--font-shekasteh);
    font-size: clamp(1.3rem, 5.2vw, 1.7rem);
    color: var(--ink-black);
    margin-top: 4px;
}

.names-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    direction: ltr;
    margin: 2px 0;
}

.name-en {
    font-family: var(--font-en);
    font-size: clamp(2rem, 9.5vw, 3rem);
    color: var(--ink-black);
    line-height: 1;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.4);
}

.name-fa {
    font-family: var(--font-nastaliq);
    font-size: clamp(2rem, 9.5vw, 3rem);
    color: var(--ink-black);
    line-height: 1;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.4);
}

.and-symbol {
    font-family: var(--font-nastaliq);
    font-size: clamp(1.4rem, 6vw, 2rem);
    color: var(--ink-accent);
    margin: 0 4px;
}

.love-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 2px 0;
}

.love-typography-img-large {
    width: 85%;
    max-width: 420px;
    height: auto;
    margin-top: -40px;
    max-height: 20vh;
    object-fit: contain;
    filter: invert(10%) sepia(25%) saturate(400%) hue-rotate(345deg);
}

.poem-text {
    font-family: var(--font-shekasteh);
    font-size: clamp(0.95rem, 3.8vw, 1.2rem);
    color: var(--ink-dark);
    line-height: 1.8;
    max-width: 92%;
    margin-top: 4px;
}

.vintage-date-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 86%;
    margin: 2px 0;
    padding: 6px 14px;
    border-top: 1px dashed rgba(39, 30, 22, 0.35);
    border-bottom: 1px dashed rgba(39, 30, 22, 0.35);
}

.date-month-text {
    font-size: clamp(0.85rem, 3.4vw, 1rem);
    font-weight: 700;
    color: var(--ink-muted);
    letter-spacing: 1px;
}

.date-center-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin: 2px 0;
}

.date-pill {
    font-size: clamp(0.75rem, 3vw, 0.9rem);
    font-weight: 600;
    color: var(--ink-dark);
    border-bottom: 1px solid var(--ink-black);
    padding: 2px 4px;
    min-width: 70px;
    text-align: center;
}

.date-number {
    font-size: clamp(2.2rem, 9.5vw, 3rem);
    font-weight: 700;
    color: var(--ink-accent);
    line-height: 1;
}

.date-year-text {
    font-size: clamp(0.85rem, 3.4vw, 1rem);
    font-weight: 700;
    color: var(--ink-muted);
    letter-spacing: 2px;
}

.event-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    margin: 2px 0;
}

.reception-text {
    font-size: clamp(0.86rem, 3.5vw, 1rem);
    font-weight: 700;
    color: var(--ink-black);
}

.patakhti-text {
    font-size: clamp(0.72rem, 2.9vw, 0.84rem);
    color: var(--ink-accent);
    font-weight: 600;
}

.address-text {
    font-size: clamp(0.78rem, 3.1vw, 0.9rem);
    color: var(--ink-muted);
    margin-top: 15px;
}

.notice-text {
    font-size: clamp(0.6rem, 2.4vw, 0.72rem);
    color: #8c2a2a;
    line-height: 1.5;
    max-width: 86%;
}

.bottom-families {
    font-size: clamp(0.74rem, 2.9vw, 0.86rem);
    color: var(--ink-muted);
    font-weight: 600;
    border-top: 1px solid rgba(39, 30, 22, 0.15);
    padding-top: 4px;
    width: 80%;
    margin-bottom: 2px;
}

/* دکمه‌ها */
.vintage-music-btn,
.vintage-route-btn {
    position: absolute;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(223, 208, 190, 0.8);
    border: 1px solid var(--ink-black);
    color: var(--ink-black);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 90;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}
.vintage-music-btn { top: 22px; right: 22px; }
.vintage-route-btn { bottom: 20px; left: 20px; }

.vintage-music-btn:hover,
.vintage-route-btn:hover {
    background: var(--ink-black);
    color: #dfd0be;
}

/* باتم شیت */
.sheet-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(20, 15, 10, 0.55);
    backdrop-filter: blur(3px);
    z-index: 100; opacity: 0; visibility: hidden; transition: all 0.4s ease;
}
.sheet-overlay.active { opacity: 1; visibility: visible; }

.bottom-sheet {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: #e5d7c7;
    border-top: 2px solid var(--ink-black);
    border-radius: 18px 18px 0 0;
    padding: 20px 20px 28px;
    z-index: 101;
    transform: translateY(100%);
    transition: transform 0.4s var(--ease-slow);
    text-align: center;
}
.bottom-sheet.active { transform: translateY(0); }

.sheet-handle { width: 36px; height: 3px; background: var(--ink-muted); border-radius: 2px; margin: 0 auto 12px; }
.close-btn { position: absolute; top: 12px; right: 15px; background: none; border: none; color: var(--ink-black); font-size: 1.4rem; cursor: pointer; }

.sheet-title { font-family: var(--font-shekasteh); font-size: 1.5rem; color: var(--ink-black); margin-bottom: 6px; }
.sheet-desc { font-size: 0.85rem; color: var(--ink-muted); margin-bottom: 16px; }

.routing-btn {
    display: inline-block;
    text-decoration: none;
    background: var(--ink-black);
    color: #dfd0be;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    width: 85%;
}