:root {
    --bg-color: #0c0c0c;
    --text-color: #00ff41; /* Matrix/Terminal Green */
    --dim-color: #008f11;
    --highlight-color: #003b00;
    --font-family: 'Courier New', Courier, monospace;
}

/* Theme: Amber */
body.theme-amber {
    --text-color: #ffb000 !important;
    --dim-color: #a37200 !important;
    --highlight-color: #3b2a00 !important;
}

/* Theme: White */
body.theme-white {
    --text-color: #e0e0e0 !important;
    --dim-color: #888888 !important;
    --highlight-color: #333333 !important;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    margin: 0;
    padding: 20px;
    line-height: 1.2;
    text-transform: none;
    overflow-x: hidden; /* Prevent horizontal scroll on mobile */
}

/* Scanline effect */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 1000;
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
}

h1, h2, h3 {
    color: var(--text-color);
    font-weight: bold;
    text-transform: uppercase;
    border-bottom: 1px dashed var(--text-color);
    padding-bottom: 5px;
    margin-top: 20px;
    word-wrap: break-word;
}

a {
    color: var(--text-color);
    text-decoration: none;
}

a:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
}

.terminal-cursor {
    background-color: var(--text-color) !important;
    color: var(--bg-color) !important;
    outline: none;
}

.menu-item {
    margin: 5px 0;
    word-wrap: break-word;
}

.selector {
    color: var(--dim-color);
    margin-right: 10px;
}

pre {
    font-family: var(--font-family);
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 1em;
}

footer {
    margin-top: 50px;
    border-top: 1px solid var(--dim-color);
    color: var(--dim-color);
    font-size: 0.8em;
}

.header-art {
    color: var(--text-color);
    margin-bottom: 20px;
}

.header-art pre {
    white-space: pre;
    font-size: 0.8em;
}

/* Markdown-rendered HTML Styling */
.post-body, .reply-body, .about-content {
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.post-body h1, .post-body h2, .post-body h3 {
    border-bottom: 1px solid var(--dim-color);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.post-body blockquote {
    border-left: 3px solid var(--dim-color);
    margin-left: 0;
    padding-left: 15px;
    color: var(--dim-color);
    font-style: italic;
}

.post-body ul, .post-body ol {
    padding-left: 20px;
}

.post-body li {
    margin-bottom: 5px;
}

.post-body code {
    background-color: var(--highlight-color);
    padding: 2px 4px;
}

.post-body pre {
    background-color: var(--highlight-color);
    padding: 10px;
    border: 1px dashed var(--dim-color);
    margin: 15px 0;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .header-art pre {
        font-size: 0.4em; /* Scale down ASCII art on tiny screens */
    }

    pre {
        font-size: 0.9em;
    }

    nav div {
        float: none !important;
        margin-top: 10px;
    }
}
