body {
    margin: 0;
    padding: 0;
    font-family: Georgia, serif;
    background-color: #f4e8d1;
    scroll-behavior: smooth;
}

.letter-container {
    width: 90vw;
    max-width: 800px;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.cover {
    background-color: #fff1d6;
    border: 2px solid #5a371f;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    padding: 2rem;
    text-align: center;
    border-radius: 8px;
}

.cover-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.cover-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    color: #5a371f;
    margin: 1rem 0;
}

.cover-sub, .cover-foot {
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    color: #5a371f;
}

.ornament {
    margin: 1rem 0;
}

.ornament svg {
    width: clamp(100px, 30vw, 160px);
    height: auto;
}

.emblem svg {
    width: clamp(60px, 15vw, 96px);
    height: auto;
}

.letter {
    background-color: #fff;
    border: 1px solid #d6b25a;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.letter h1, .letter h2 {
    color: #5a371f;
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 1rem;
}

.letter p {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    line-height: 1.6;
    color: #333;
}

.flourish {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: #d6b25a;
    margin: 1rem 0;
}

.credit {
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: #5a371f;
    margin-top: 1rem;
    text-align: center;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    position: sticky;
    bottom: 1rem;
    z-index: 10;
}

.nav-btn {
    background-color: #5a371f;
    color: #fff1d6;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    cursor: pointer;
    border-radius: 5px;
    touch-action: manipulation;
}

.nav-btn:hover {
    background-color: #d6b25a;
    color: #5a371f;
}

.nav-btn.hidden {
    display: none;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .letter-container {
        width: 95vw;
        margin: 1rem auto;
        gap: 1.5rem;
    }

    .cover, .letter {
        padding: 1rem;
    }

    .cover-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    .nav-btn {
        padding: 0.7rem 1.2rem;
        font-size: clamp(0.8rem, 3vw, 1rem);
    }

    .controls {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .letter-container {
        width: 90vw;
    }

    .cover-title {
        font-size: clamp(1.7rem, 4vw, 2.2rem);
    }
}