@import url('https://fonts.googleapis.com/css2?family=VT323&family=IBM+Plex+Mono:wght@400;500;600;700&family=Inter:wght@400;600;800&display=swap');

:root {
    --bg-color: #fcfaf7;
    --text-primary: #2d2a26;
    --text-secondary: #7a7469;
    --primary-color: #af4b2e; /* Muted Terracotta */
    --secondary-color: #743a29; /* Deep Earth */
    --accent-color: #d9a08b; /* Soft Clay */
    --border-color: #edeae4;
    --side-bg: #f5f2ed;
    --terminal-black: #1a1816;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'VT323', monospace;
    line-height: 1.5;
    font-size: 1.2rem;
    -webkit-font-smoothing: initial;
    image-rendering: pixelated;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 30px;
}

.mt-gap { margin-top: 60px; }

/* HEADER */
.main-header {
    border-bottom: 6px solid var(--primary-color);
    padding: 20px 0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-box {
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    box-shadow: 4px 4px 0 var(--secondary-color);
}

h1 {
    font-family: 'VT323', monospace;
    font-size: 2.8rem;
    font-weight: 400;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-secondary);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
}

.nav-menu a:hover, .nav-menu a.active {
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent-color);
}

/* CONTENT GRID */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 60px;
}

/* ARTICLE FEED */
.post-item {
    margin-bottom: 70px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
}

.item-header {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
}

.post-date, .post-tag {
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    color: var(--secondary-color);
    text-transform: uppercase;
}

.post-tag { color: var(--accent-color); background: #f0f0f0; padding: 0 8px; border: 1px solid var(--border-color); }

.post-title {
    font-size: 2.2rem;
    font-weight: 400;
    line-height: 1;
    margin-bottom: 15px;
}

.post-title a { text-decoration: none; color: var(--terminal-black); border-bottom: 4px solid var(--primary-color); }
.post-title a:hover { background: var(--primary-color); color: #fff; }

.post-excerpt {
    font-size: 1.05rem;
    color: #444;
    margin-bottom: 20px;
}

.read-more {
    font-family: 'VT323', monospace;
    font-size: 1.3rem;
    color: var(--primary-color);
    text-decoration: none;
    border: 2px solid var(--primary-color);
    padding: 2px 10px;
}

.read-more:hover {
    background: var(--primary-color);
    color: #fff;
}

/* SIDEBAR */
.sidebar-section {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-family: 'VT323', monospace;
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    border-left: 8px solid var(--primary-color);
    padding-left: 10px;
}

.search-wrap {
    display: flex;
    align-items: center;
    border: 3px solid var(--text-primary);
    padding: 5px;
    background: #fff;
}

.search-wrap input {
    border: none;
    background: none;
    color: var(--text-primary);
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    width: 100%;
    outline: none;
}

.cursor {
    animation: blink 1s infinite;
    color: var(--primary-orange);
    font-weight: bold;
}

@keyframes blink { 50% { opacity: 0; } }

.cat-list { list-style: none; }
.cat-list li { margin-bottom: 8px; }
.cat-list a {
    text-decoration: none;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-main);
    font-weight: 500;
}
.cat-list a:hover { opacity: 0.6; }

.scan-item {
    margin-bottom: 15px;
    cursor: pointer;
}

.scan-date {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.scan-item h4 {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
}

.system-status p {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    top:0; left:0; width:100%; height:100%;
    background: rgba(255,255,255,0.95);
    z-index: 2000;
    overflow-y: auto;
}

.modal-content {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    background: #fff;
    border: 6px solid var(--terminal-black);
    color: var(--text-primary);
}

.close-modal {
    position: fixed;
    top: 30px; right: 40px;
    background: var(--text-primary);
    color: white;
    border: none;
    padding: 6px 12px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    cursor: pointer;
}

.modal-post-header { margin-bottom: 30px; border-bottom: 4px double var(--primary-color); padding-bottom: 20px; }
.modal-post-header h1 { font-family: 'VT323', monospace; font-weight: 400; font-size: 3.5rem; color: var(--primary-color); line-height: 1; }
.modal-post-header .date { font-family: 'VT323', monospace; font-size: 1.2rem; color: var(--secondary-color); }

.modal-article-content { font-size: 1.4rem; line-height: 1.4; color: var(--text-primary); }
.modal-article-content img { max-width: 100%; border: 4px solid var(--primary-color); margin: 30px 0; }

/* FOOTER */
.main-footer { padding: 40px 0; border-top: 6px solid var(--primary-color); background: #fff; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; }
.footer-inner p { font-family: 'VT323', monospace; font-size: 1.2rem; color: var(--text-secondary); }
.footer-links { display: flex; gap: 15px; }
.footer-links a { font-family: 'VT323', monospace; font-size: 1.2rem; color: var(--primary-color); text-decoration: none; }

/* LOADING */
.pixel-loader { width: 32px; height: 32px; border: 4px solid var(--primary-color); border-right-color: transparent; animation: rotate 0.5s infinite steps(4); }
@keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.modal::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.05) 50%);
    z-index: 2001;
    background-size: 100% 3px;
    pointer-events: none;
}

@keyframes flicker {
    0% { opacity: 0.273; }
    5% { opacity: 0.100; }
    10% { opacity: 0.233; }
    15% { opacity: 0.150; }
    20% { opacity: 0.279; }
    25% { opacity: 0.120; }
    30% { opacity: 0.239; }
    35% { opacity: 0.156; }
    40% { opacity: 0.222; }
    45% { opacity: 0.144; }
    50% { opacity: 0.278; }
    55% { opacity: 0.123; }
    60% { opacity: 0.222; }
    65% { opacity: 0.155; }
    70% { opacity: 0.278; }
    75% { opacity: 0.123; }
    80% { opacity: 0.222; }
    85% { opacity: 0.155; }
    90% { opacity: 0.278; }
    95% { opacity: 0.123; }
    100% { opacity: 0.222; }
}

@media (max-width: 900px) {
    .content-grid { grid-template-columns: 1fr; }
    .sidebar { display: none; }
}
