@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,600;1,400&family=Inter:wght@400;600&display=swap');

:root {
    --bg-email: #f0f2f5;
    --text-email: #1c1e21;
    --bg-paper: #fdfaf6;
    --text-paper: #2b2b2b;
    --accent: #d4af37; /* Citron yellow/gold */
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-email);
    color: var(--text-email);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#app {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Desktop layout */
@media (min-width: 768px) {
    #app {
        flex-direction: row;
    }
}

.cover-pane {
    flex: 1;
    height: 100%;
    position: relative;
    max-width: 100%;
    z-index: 5;
    background: #000;
}

@media (min-width: 768px) {
    .cover-pane {
        max-width: 450px;
        box-shadow: 2px 0 15px rgba(0,0,0,0.3);
    }
}

.cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.9;
}

.read-btn {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 30px;
    background: #fff;
    border: 2px solid var(--accent);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 1rem;
    color: #111;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    white-space: nowrap;
}

.read-btn:hover {
    background: #fffdf5;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.manuscript-container {
    flex: 2;
    height: 100%;
    background: #2a2a2a;
    display: flex;
    justify-content: center;
    padding: 0;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Mobile hide manuscript initially */
@media (max-width: 767px) {
    .manuscript-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 10;
        transform: translateY(100%);
    }
    .manuscript-container.open {
        transform: translateY(0);
    }
}

@media (min-width: 768px) {
    .manuscript-container {
        padding: 40px;
    }
}

.manuscript-page {
    background: var(--bg-paper);
    color: var(--text-paper);
    width: 100%;
    max-width: 750px;
    height: 100%;
    overflow-y: auto;
    padding: 60px 30px;
    font-family: 'Crimson Pro', serif;
    line-height: 1.8;
    font-size: 1.15rem;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    position: relative;
    scroll-behavior: smooth;
}

@media (min-width: 768px) {
    .manuscript-page {
        height: auto;
        max-height: 100%;
        border-radius: 4px;
        padding: 80px 100px;
    }
}

.manuscript-page h1 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 5px;
    font-weight: 600;
    letter-spacing: 1px;
}

.manuscript-page h2 {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 50px;
    font-weight: 400;
    color: #666;
    font-style: italic;
}

.manuscript-page p {
    margin-bottom: 24px;
    text-indent: 2em;
    text-align: justify;
}

.manuscript-page p:first-of-type, .manuscript-page p.section-break + p {
    text-indent: 0;
}

.section-break {
    text-align: center;
    margin: 40px 0;
    letter-spacing: 6px;
    text-indent: 0 !important;
    color: #888;
}

/* Citron Press magical mutable words */
.mutable {
    display: inline-block;
    position: relative;
    color: #2b2b2b;
    border-bottom: 1px dotted rgba(212, 175, 55, 0.8);
    cursor: pointer;
    transition: color 0.3s;
    font-weight: 600;
}

.mutable:hover {
    color: #b08d2b;
}

.mutable.glitching {
    animation: glitch 0.25s linear infinite;
    color: #000;
}

@keyframes glitch {
    0% { transform: translate(0) }
    20% { transform: translate(-1px, 2px); color: #000; background: rgba(212, 175, 55, 0.2); }
    40% { transform: translate(-2px, -1px); color: #b08d2b; }
    60% { transform: translate(2px, 1px); color: #fff; background: #b08d2b; }
    80% { transform: translate(1px, -2px); color: #b08d2b; background: transparent; }
    100% { transform: translate(0) }
}

.close-btn {
    display: none;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #111;
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    z-index: 20;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

@media (max-width: 767px) {
    .close-btn {
        display: block;
    }
    .manuscript-page {
        padding-bottom: 100px; /* Space for close button */
    }
}