/* --- THE DARK ACADEMIA CORE --- */
:root {
    --ink: #1c1917; 
    --paper: #f2e9d9; 
    --paper-dark: #e5dbc5;
    --gold: #926a2d; 
    --stamp-red: #8b0000; 
}

body {
    /* Reverted to Dark Wood Background */
    background-color: #1a1410;
    background-image: url('https://www.transparenttextures.com/patterns/dark-wood.png');
    color: var(--ink);
    /* Updated to Readable Serif */
    font-family: 'Crimson Text', serif;
    margin: 0;
    padding-top: 80px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- NAVIGATION --- */
.navbar {
    position: fixed; top: 0; width: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex; justify-content: center; align-items: center;
    padding: 10px 0; z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.navbar a { 
    color: white; 
    text-decoration: none; 
    /* Updated to Readable Script */
    font-family: 'La Belle Aurore', cursive; 
    font-size: 1.8rem; 
    margin: 0 20px; 
    transition: 0.3s; 
}
.navbar a:hover { color: var(--gold); text-shadow: 0 0 8px rgba(255,255,255,0.4); }

/* --- THE FLEXIBLE GRID (HOME PAGE) --- */
.container { 
    max-width: 1000px; 
    margin: auto; 
    padding: 20px;
    display: grid;
    grid-template-areas: 
        "profile profile" 
        "about projects";
    grid-template-columns: 1fr 1fr; 
    gap: 30px;
    min-height: 70vh; 
    width: 90%;
}

.profile { grid-area: profile; }
.about { grid-area: about; }
.projects { grid-area: projects; }

.grid-item {
    background: var(--paper);
    background-image: url('https://www.transparenttextures.com/patterns/paper-fibers.png');
    padding: 35px; 
    border: 1px solid rgba(0,0,0,0.1); /* Slightly lighter border for paper-on-wood */
    box-shadow: 10px 10px 30px rgba(0,0,0,0.5);
    display: flex; 
    flex-direction: column;
    justify-content: flex-start;
    transition: transform 0.3s ease;
}

.grid-item:hover {
    transform: translateY(-5px);
}

/* Updated Header Font Styles */
.grid-item h1 { 
    font-family: 'La Belle Aurore', cursive;
    font-size: 3rem; 
    margin-bottom: 10px; 
    color: var(--ink); 
}
.grid-item h3 { 
    font-family: 'Crimson Text', serif;
    font-weight: 700;
    border-bottom: 1px dashed rgba(0,0,0,0.2); 
    padding-bottom: 5px; 
    margin-bottom: 15px; 
    color: var(--ink); 
}
.grid-item p { margin: 5px 0; line-height: 1.5; font-size: 1.15rem; }

/* Library Stamp */
.library-stamp {
    border: 2px solid var(--stamp-red); color: var(--stamp-red);
    padding: 5px 10px; width: fit-content;
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase; transform: rotate(-2deg);
    opacity: 0.7; margin-top: 20px; font-weight: bold; font-size: 0.8rem;
}

/* Academic List */
.academic-list { list-style-type: none; padding: 0; margin: 0; }
.academic-list li { margin-bottom: 10px; font-size: 1.1rem; border-bottom: 1px solid rgba(0,0,0,0.05); padding-bottom: 5px; }

/* --- JOURNAL & CALENDAR --- */
.journal-container { max-width: 900px; margin: auto; padding: 20px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }

.day-card { 
    background: var(--paper); 
    background-image: url('https://www.transparenttextures.com/patterns/paper-fibers.png');
    min-height: 100px; padding: 10px; cursor: pointer; border: 1px solid rgba(0,0,0,0.1);
    transition: 0.3s; position: relative;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.3);
}
.day-card:hover { transform: translateY(-5px); background: var(--paper-dark); }
.has-entry::after { content: "✒️"; position: absolute; top: 5px; right: 5px; font-size: 0.8rem; }
.day-title { font-size: 0.8rem; font-style: italic; margin-top: 5px; color: var(--gold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- MODAL & ADMIN UI --- */
.admin-only { display: none; }
body[data-mode="admin"] .admin-only { display: inline-block; }
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 1500; }
.modal-content { 
    width: 90%; max-width: 500px; margin: 5% auto; background: var(--paper); 
    padding: 30px; box-shadow: 0 0 50px black; position: relative;
    background-image: url('https://www.transparenttextures.com/patterns/paper-fibers.png');
}

#entryText { width: 100%; height: 250px; background: transparent; border: none; font-size: 1.2rem; font-family: inherit; resize: none; outline: none; }
.title-input { background: transparent; border: none; border-bottom: 1px solid var(--ink); font-size: 1.5rem; width: 100%; margin-bottom: 10px; outline: none; }

/* --- WAX SEAL ANIMATION --- */
.wax-seal {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(5);
    width: 100px; height: 100px; background: #a81c1c; border-radius: 50%;
    display: none; z-index: 2000; opacity: 0; pointer-events: none;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
}
.stamping { display: block !important; animation: stampAnim 0.8s forwards; }
@keyframes stampAnim { 
    0% { transform: translate(-50%, -50%) scale(4); opacity: 0; } 
    50% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; } 
}

/* --- MOBILE RESPONSIVENESS FIXES --- */
@media (max-width: 768px) { 
    body { height: auto; overflow-y: auto; padding-top: 60px; }
    
    .container { 
        grid-template-areas: 
            "profile"
            "about"
            "projects";
        grid-template-columns: 1fr; 
        height: auto;
        min-height: auto;
        width: 95%;
        gap: 15px;
    }
    
    .grid-item { padding: 25px; margin-bottom: 5px; }
    .grid-item h1 { font-size: 2.2rem; }
    .calendar-grid { grid-template-columns: repeat(4, 1fr); } 
}
