:root {
    --primary-color: #1a1a1a;
    --secondary-color: #8b0000;
    --accent-color: #daa520;
    --background-color: #0a0a0a;
    --text-color: #e0e0e0;
    --border-color: #333;
    --link-color: #cd5c5c;
    --visited-color: #8b4513;
    --hover-color: #ff6347;
    --tag-bg: #2a0a0a;
    --tag-border: #5a1a1a;
}

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

body {
    font-family: 'Georgia', serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%231a1a1a' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: #111;
    border: 3px double var(--secondary-color);
    box-shadow: 0 0 15px rgba(139, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
}

.container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg, transparent 50%, rgba(139, 0, 0, 0.05) 50%),
        linear-gradient(transparent 50%, rgba(139, 0, 0, 0.05) 50%);
    background-size: 10px 10px;
    pointer-events: none;
    z-index: -1;
}

header {
    background: linear-gradient(135deg, var(--primary-color), #000);
    color: var(--accent-color);
    padding: 30px;
    text-align: center;
    border-bottom: 2px groove var(--secondary-color);
    position: relative;
}

header::after {
    content: "❦";
    display: block;
    font-size: 2rem;
    margin-top: 25px;
    color: var(--secondary-color);
}

h1 {
    font-family: 'Georgia', serif;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.subtitle {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 20px;
    font-style: italic;
    color: #aaa;
}

.cover-image {
    display: block;
    max-width: 300px;
    margin: 20px auto;
    border: 2px ridge var(--secondary-color);
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.5);
}

.content {
    padding: 30px;
    position: relative;
}

/* Credits section - now at the top */
.credits {
    margin: 0 0 30px 0;
    padding: 35px 25px 25px 25px;
    background: rgba(26, 26, 26, 0.7);
    border: 2px ridge var(--secondary-color);
    font-family: 'Georgia', serif;
    line-height: 1.7;
    position: relative;
}

.credits::before {
    content: "❧";
    position: absolute;
    top: 5px;
    left: 20px;
    color: var(--accent-color);
    font-size: 1.5rem;
}

.credits p {
    margin-bottom: 15px;
    text-align: justify;
    word-wrap: break-word;
    hyphens: auto;
}

.credits p:last-child {
    margin-bottom: 0;
}

/* Index page specific styles */
.section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px dotted var(--border-color);
    padding-bottom: 10px;
}

.section-title {
    font-family: 'Georgia', serif;
    color: var(--accent-color);
    margin: 0;
    font-size: 1.8rem;
}

.count {
    background: var(--tag-bg);
    color: var(--accent-color);
    border: 1px solid var(--tag-border);
    border-radius: 20px;
    padding: 2px 12px;
    font-size: 1rem;
    margin-left: 15px;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
}

.items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 15px;
}

.item {
    margin-bottom: 10px;
    padding: 12px 15px;
    background: rgba(26, 26, 26, 0.7);
    border-left: 3px solid var(--secondary-color);
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.item:hover {
    background: rgba(139, 0, 0, 0.2);
    border-left: 3px solid var(--accent-color);
    transform: translateX(5px);
}

.item a {
    color: var(--link-color);
    text-decoration: none;
    font-family: 'Georgia', serif;
    font-size: 1.1rem;
    line-height: 1.4;
    display: block;
}

.item a:hover {
    color: var(--hover-color);
    text-decoration: underline;
}

.item a::before {
    content: "☛";
    color: var(--accent-color);
    margin-right: 8px;
}

/* End index page specific styles */

.metadata {
    background: rgba(26, 26, 26, 0.7);
    border-left: 4px solid var(--secondary-color);
    padding: 35px 20px 20px 20px;
    margin: 20px 0;
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.metadata::before {
    content: "❧";
    position: absolute;
    top: 5px;
    left: 10px;
    color: var(--accent-color);
    font-size: 1.2rem;
}

.metadata h2 {
    color: var(--accent-color);
    margin-top: -15px;
    margin-bottom: 15px;
    font-family: 'Georgia', serif;
    border-bottom: 1px dotted var(--border-color);
    padding-bottom: 5px;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.metadata-item {
    margin-bottom: 10px;
}

.metadata-label {
    font-weight: bold;
    color: var(--accent-color);
    font-family: 'Courier New', Courier, monospace;
}

.abstract {
    margin: 25px 0;
    padding: 35px 20px 20px 20px;
    background: rgba(26, 26, 26, 0.7);
    border-left: 4px solid var(--accent-color);
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.abstract::before {
    content: "❦";
    position: absolute;
    top: 5px;
    left: 10px;
    color: var(--secondary-color);
    font-size: 1.2rem;
}

.abstract h2 {
    color: var(--accent-color);
    margin-top: -15px;
    margin-bottom: 15px;
    font-family: 'Georgia', serif;
    border-bottom: 1px dotted var(--border-color);
    padding-bottom: 5px;
}

.abstract p {
    text-align: justify;
    word-wrap: break-word;
    hyphens: auto;
    margin-bottom: 1.5em;
    line-height: 1.6;
}

.themes {
    margin: 25px 0;
}

.themes h2 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-family: 'Georgia', serif;
    border-bottom: 1px dotted var(--border-color);
    padding-bottom: 5px;
}

.theme-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.theme-tag {
    background: rgba(139, 0, 0, 0.2);
    color: var(--accent-color);
    padding: 5px 12px;
    border: 1px outset var(--secondary-color);
    font-size: 0.9rem;
    font-family: 'Courier New', Courier, monospace;
}

.download-section {
    text-align: center;
    margin: 30px 0;
    padding: 35px 20px 20px 20px;
    background: rgba(26, 26, 26, 0.7);
    border: 2px ridge var(--secondary-color);
    position: relative;
}

.download-section::before {
    content: "❧";
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--accent-color);
    font-size: 1.2rem;
}

.download-btn {
    display: inline-block;
    background: var(--secondary-color);
    color: #fff;
    padding: 12px 25px;
    border: 2px outset var(--accent-color);
    text-decoration: none;
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.download-btn:hover {
    background: var(--accent-color);
    border-style: inset;
    color: #000;
    text-decoration: none;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dotted var(--border-color);
}

.nav-link {
    color: var(--link-color);
    text-decoration: none;
    padding: 10px 15px;
    border: 1px outset var(--secondary-color);
    transition: all 0.3s;
    font-family: 'Courier New', Courier, monospace;
}

.nav-link:hover {
    background: var(--secondary-color);
    border-style: inset;
    color: #fff;
    text-decoration: none;
}

footer {
    text-align: center;
    padding: 20px;
    color: #777;
    font-size: 0.9rem;
    border-top: 1px dotted var(--border-color);
    font-family: 'Courier New', Courier, monospace;
}

/* Glossary page specific styles */
.intro {
    margin: 25px 0;
    padding: 35px 20px 20px 20px;
    background: rgba(26, 26, 26, 0.7);
    border-left: 4px solid var(--accent-color);
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.intro::before {
    content: "❦";
    position: absolute;
    top: 5px;
    left: 10px;
    color: var(--secondary-color);
    font-size: 1.2rem;
}

.intro h2 {
    color: var(--accent-color);
    margin-top: -15px;
    margin-bottom: 15px;
    font-family: 'Georgia', serif;
    border-bottom: 1px dotted var(--border-color);
    padding-bottom: 5px;
}

.intro p {
    text-align: justify;
    word-wrap: break-word;
    hyphens: auto;
    margin-bottom: 1.5em;
    line-height: 1.6;
}

.chapbooks {
    margin: 25px 0;
    padding: 35px 20px 20px 20px;
    background: rgba(26, 26, 26, 0.7);
    border-left: 4px solid var(--secondary-color);
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.chapbooks::before {
    content: "❧";
    position: absolute;
    top: 5px;
    left: 10px;
    color: var(--accent-color);
    font-size: 1.2rem;
}

.chapbooks h2 {
    color: var(--accent-color);
    margin-top: -15px;
    margin-bottom: 15px;
    font-family: 'Georgia', serif;
    border-bottom: 1px dotted var(--border-color);
    padding-bottom: 5px;
}

.chapbook-list {
    list-style-type: none;
    padding: 0;
}

.chapbook-item {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.chapbook-item::before {
    content: "☛";
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

.chapbook-item a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--link-color);
}

.chapbook-item a:hover {
    color: var(--hover-color);
    border-bottom: 1px solid var(--hover-color);
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--link-color);
    font-family: 'Courier New', Courier, monospace;
}

.back-link:hover {
    color: var(--hover-color);
    border-bottom: 1px solid var(--hover-color);
}

/* Animated elements for that classic web feel */
@keyframes flicker {
    0% { opacity: 0.9; }
    50% { opacity: 1; }
    100% { opacity: 0.9; }
}

header {
    animation: flicker 3s infinite;
}

/* Retro cursor effect */
a {
    cursor: pointer;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #111;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border: 1px outset var(--accent-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
    }
    
    header {
        padding: 20px 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .content {
        padding: 20px 15px;
    }
    
    .metadata-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-link {
        text-align: center;
    }
    
    .items {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .count {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .credits {
        padding: 30px 15px 15px 15px;
    }
    
    header::after {
        margin-top: 20px;
    }
    
    .metadata,
    .abstract,
    .intro,
    .chapbooks,
    .download-section {
        padding-top: 30px;
    }
    
    .metadata::before,
    .abstract::before,
    .intro::before,
    .chapbooks::before,
    .download-section::before {
        top: 10px;
    }
    
    .metadata h2,
    .abstract h2,
    .intro h2,
    .chapbooks h2 {
        margin-top: -10px;
    }
    
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 2rem;
    }
}