/* Typewriter Noir Theme */
:root {
    --bg-color: #050505;
    --paper-color: #121212;
    --text-color: #c0c0c0;
    --accent-color: #8b0000; /* Darker Blood Red */
    --dim-text: #444;
    --font-mono: 'Courier New', Courier, monospace;
    --scanline-color: rgba(18, 16, 16, 0.1);
}

@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

@keyframes flicker {
    0% { opacity: 0.97; }
    5% { opacity: 0.95; }
    10% { opacity: 0.9; }
    15% { opacity: 0.95; }
    20% { opacity: 0.98; }
    25% { opacity: 0.95; }
    30% { opacity: 0.9; }
    35% { opacity: 0.95; }
    40% { opacity: 0.98; }
    45% { opacity: 1; }
    50% { opacity: 0.98; }
    55% { opacity: 0.95; }
    60% { opacity: 0.9; }
    65% { opacity: 0.95; }
    70% { opacity: 0.98; }
    75% { opacity: 0.95; }
    80% { opacity: 0.9; }
    85% { opacity: 0.95; }
    90% { opacity: 0.98; }
    95% { opacity: 0.95; }
    100% { opacity: 0.98; }
}

@keyframes type {
    from { width: 0; }
    to { width: 100%; }
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-mono);
    line-height: 1.7;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* CRT Scanline Overlay */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(var(--scanline-color) 50%, rgba(0, 0, 0, 0) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    z-index: 9999;
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
    opacity: 0.3;
}

/* Vignette */
body::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: radial-gradient(circle, rgba(0,0,0,0) 40%, rgba(0,0,0,0.8) 100%);
    z-index: 9998;
    pointer-events: none;
}

body.index-page {
    overflow: hidden;
}

#container {
    max-width: 750px;
    width: 100%;
    padding: 6rem 3rem;
    background-color: var(--paper-color);
    box-shadow: 0 0 100px rgba(0,0,0,0.8);
    min-height: 100vh;
    border-left: 1px solid #1a1a1a;
    border-right: 1px solid #1a1a1a;
    position: relative;
    z-index: 10;
    animation: flicker 0.15s infinite;
}

header {
    margin-bottom: 5rem;
    border-bottom: 1px solid #222;
    padding-bottom: 1.5rem;
}

h1, h2, h3 {
    color: #eee;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 4px;
}

h1 {
    font-size: 1.2rem;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    border-right: .15em solid var(--accent-color);
    width: 100%;
    animation: type 2s steps(40, end), blink-caret .75s step-end infinite;
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--accent-color); }
}

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

h1 a:hover {
    color: var(--accent-color);
}

.category {
    font-size: 0.75rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 5px;
    text-align: center;
    margin-bottom: 3rem;
    font-weight: bold;
}

.title {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 4rem;
    color: #eee;
    border-bottom: 1px dashed #333;
    display: inline-block;
    width: 100%;
    padding-bottom: 1rem;
}

p {
    margin-bottom: 2rem;
    text-align: justify;
    hyphens: auto;
}

.verse {
    white-space: pre-wrap;
    font-style: italic;
    margin-left: 1rem;
    border-left: 1px solid var(--accent-color);
    padding-left: 2rem;
    color: #999;
    margin-bottom: 3rem;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

a:hover {
    color: #fff;
    background-color: var(--accent-color);
    border-bottom: 1px solid var(--accent-color);
}

#ui-layer {
    position: fixed;
    bottom: 2rem;
    left: 0;
    width: 100%;
    text-align: center;
    pointer-events: none;
    z-index: 1000;
}

#ui-layer * {
    pointer-events: auto;
}

.status-monitor {
    font-size: 0.65rem;
    color: var(--dim-text);
    letter-spacing: 3px;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.blink {
    animation: blink-animation 1s steps(5, start) infinite;
    color: var(--accent-color);
}

@keyframes blink-animation {
    to { visibility: hidden; }
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.nav-links a {
    font-size: 0.75rem;
    letter-spacing: 5px;
    opacity: 0.4;
    color: var(--text-color);
    border: none;
}

.nav-links a:hover {
    opacity: 1;
    background: transparent;
    color: var(--accent-color);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    #container {
        padding: 2rem 1rem;
        border: none;
    }
    .verse {
        margin-left: 1rem;
        padding-left: 1rem;
    }
    .grid {
        grid-template-columns: repeat(20, 10px); /* Wrap heatmap dots on small screens */
    }
}
