/* ============================================
   LETTER.CSS - Beautiful Letter Display
   ============================================ */
.letter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    /* Higher than Reveal (2000) */
    background: rgba(0, 0, 0, 0.6);
    /* Dim background */
    backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.letter-overlay.active {
    display: flex;
    opacity: 1;
}

.letter-card {
    background: #fff;
    width: 90%;
    max-width: 500px;
    padding: 3rem 2.5rem;
    border-radius: 4px;
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.1),
        0 10px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(50px) rotateX(10deg);
    opacity: 0;
    transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1), opacity 1s ease;

    /* Paper Texture effect (optional subtle grain) */
    background-image: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)), url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");

    position: relative;
    overflow: hidden;
}

.letter-overlay.active .letter-card {
    transform: translateY(0) rotateX(0);
    opacity: 1;
}

/* Decoration: Fold or Line */
.letter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: repeating-linear-gradient(45deg,
            #ff6b6b,
            #ff6b6b 10px,
            #feca57 10px,
            #feca57 20px,
            #48dbfb 20px,
            #48dbfb 30px);
    opacity: 0.8;
}

.letter-highlight {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 2rem;
    font-weight: 700;
}

.letter-body {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
    white-space: pre-wrap;
    /* Preserve line breaks */
    margin-bottom: 2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.letter-footer {
    text-align: right;
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: #888;
    margin-top: 1rem;
    font-style: italic;
}

/* Scrollbar for letter body */
.letter-body::-webkit-scrollbar {
    width: 4px;
}

.letter-body::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}