/* ==========================================================================
   DARKNET OS // V3.4.0
   REVISIONS: ISOLATED PHOSPHOR GLOW TO TITLES ONLY
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@300;400;500;700&display=swap');

:root {
    --font-mono: 'Source Code Pro', "Courier New", monospace;

    /* Absolute Locked Typography Scale */
    --text-base: 14px;
    --text-post: 16px;
    --text-site: 24px;
    --text-small: 12px;
    --text-tiny: 10px;

    /* Strict Monochrome Palette */
    --sys-bg: #000000;
    --sys-surface: #111111;
    --sys-code: #111111;
    --sys-border: #333333;
    --sys-border-hover: #777777;

    --sys-text-main: #cccccc;
    --sys-text-muted: #666666;
    --sys-text-bright: #ffffff;

    /* CRT Settings */
    --phosphor-red: rgba(255, 0, 0, 0.3);
    --phosphor-cyan: rgba(0, 255, 255, 0.3);
}

/* ==========================================================================
   OS-LEVEL OVERRIDES
   ========================================================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

::selection {
    background: var(--sys-text-bright);
    color: var(--sys-bg);
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--sys-bg); border-left: 1px solid var(--sys-border); }
::-webkit-scrollbar-thumb { background: var(--sys-border); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--sys-border-hover); }

@keyframes system-boot {
    0% { opacity: 0; filter: blur(4px); }
    100% { opacity: 1; filter: blur(0); }
}

.boot-sequence {
    animation: system-boot 0.6s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
}

/* ==========================================================================
   CRT RENDER LAYER
   ========================================================================== */
html { background-color: var(--sys-bg); scrollbar-color: var(--sys-border) var(--sys-bg); }

body {
    background: linear-gradient(to top, #000000 50%, #101010 50%);
    background-size: 100% 4px;

    color: var(--sys-text-main);
    font-family: var(--font-mono);

    /* Body text glow removed for maximum legibility */
    filter: blur(0.4px);

    animation: scanlines infinite 55s linear;

    font-size: var(--text-base);
    font-weight: 300;
    line-height: 1.6;
    padding: 3rem 4rem;
    min-height: 100vh;

    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
}

@keyframes scanlines {
    from { background-position: 0 0; }
    to { background-position: 0 -10px; }
}

/* THE FIX: Reimplemented heavy glow for CRT titles */
.crt-slice {
    display: inline-block;
    font-weight: 500;
    color: var(--sys-text-bright);
    text-transform: uppercase;
    text-shadow:
        0.5px 0 0 var(--phosphor-red),
        -0.5px 0 0 var(--phosphor-cyan),
        0 0 8px rgba(255, 255, 255, 0.4),   /* Inner Bloom */
        0 0 12px rgba(255, 255, 255, 0.15); /* Outer Halo */
    -webkit-mask-image: repeating-linear-gradient(to bottom, #000 0px, #000 2px, transparent 2px, transparent 3px);
    mask-image: repeating-linear-gradient(to bottom, #000 0px, #000 2px, transparent 2px, transparent 3px);
}

a { color: var(--sys-text-main); text-decoration: none; padding: 0 2px; margin: 0 -2px; }
a:hover, a:focus-visible { background-color: var(--sys-text-bright); color: var(--sys-bg); outline: none; }

/* ==========================================================================
   LAYOUT GRID & NAVIGATION
   ========================================================================== */
.top-header { max-width: 1000px; margin: 0 auto 1.5rem auto; display: flex; justify-content: space-between; align-items: center; }

.site-branding { display: flex; flex-direction: column; }
.site-title { font-size: var(--text-site); line-height: 1; margin: 0; padding: 0; }
.site-subtitle {
    font-size: 11px;
    color: var(--sys-text-muted);
    margin-top: 0.2rem;
    letter-spacing: 0.5px;
    text-transform: none;
}

.search-input {
    background: transparent; border: 1px solid var(--sys-border); color: var(--sys-text-main);
    font-family: var(--font-mono); font-size: var(--text-small); padding: 0.3rem 0.8rem;
    width: 250px; border-radius: 0; outline: none;
}
.search-input:focus { border-color: var(--sys-text-bright); }

.top-nav {
    max-width: 1000px; margin: 0 auto 3rem auto;
    border-top: 1px solid var(--sys-border); border-bottom: 1px solid var(--sys-border);
    padding: 0.6rem 0 0.6rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 3rem;
    font-size: var(--text-small); text-transform: uppercase;
}

.container {
    max-width: 1000px; margin: 0 auto;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 3rem;
}

/* ==========================================================================
   MODULE: SIDEBAR
   ========================================================================== */
.sidebar-module { margin-bottom: 2.5rem; }
.sidebar-title {
    font-size: var(--text-post); font-weight: 500; border-bottom: 1px solid var(--sys-border);
    padding-bottom: 0.2rem; margin-bottom: 0.8rem; display: inline-block; text-transform: uppercase;
}
.sidebar-list { list-style: none; font-size: var(--text-small); }
.sidebar-list li { margin-bottom: 0.3rem; display: flex; }
.sidebar-list li::before { content: "- "; color: var(--sys-text-muted); margin-right: 0.3rem; }
.sidebar-list a { text-transform: uppercase; }

/* ==========================================================================
   MODULE: ARTICLE ENGINE
   ========================================================================== */
.main-content {
    width: 100%;
    min-width: 0;
}

.post-header { margin-bottom: 2rem; border-bottom: 1px solid var(--sys-border); padding-bottom: 1rem; }
.post-title { font-size: var(--text-post); font-weight: 500; text-transform: uppercase; margin-bottom: 0.4rem; line-height: 1.2; color: var(--sys-text-bright); }

.post-meta-data {
    font-size: var(--text-small); color: var(--sys-text-muted); display: flex; flex-wrap: wrap; gap: 1rem;
    word-wrap: break-word; overflow: visible;
}
.post-meta-data span { word-wrap: break-word; }

.tag-container { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.tag-pill {
    font-size: var(--text-tiny); text-transform: uppercase; color: var(--sys-text-muted);
    border: 1px solid var(--sys-border); padding: 0.1rem 0.4rem;
}
.tag-pill:hover { border-color: var(--sys-text-bright); color: var(--sys-bg); background: var(--sys-text-bright); }

.content-body { max-width: 750px; }
.content-body p { margin-bottom: 1.5rem; text-align: justify; word-wrap: break-word; }
/* THE FIX: Reimplemented heavy glow and STRICT SIZING for Markdown-generated headers */
.content-body h1, .content-body h2, .content-body h3, .content-body h4, .content-body h5, .content-body h6 {
    color: var(--sys-text-bright);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
    line-height: 1.3; /* Tightens the gap on multi-line headers */
    text-shadow:
        0 0 8px rgba(255, 255, 255, 0.4),   /* Inner Bloom */
        0 0 12px rgba(255, 255, 255, 0.15); /* Outer Halo */
}

/* Force markdown headers to obey the absolute terminal scale */

.content-body h1 { font-size: var(--text-site); } /* Locks to 20px */
.content-body h2 { font-size: var(--text-post); } /* Locks to 16px */
.content-body h3, .content-body h4, .content-body h5, .content-body h6 { font-size: var(--text-base); } /* Locks to 14px */

.content-body h1:first-child, .content-body h2:first-child, .content-body h3:first-child { margin-top: 0; }

/* THE FIX: Proper hanging indents and spacing for lists */
.content-body ul, .content-body ol {
    margin-left: 0;
    padding-left: 2.5rem; /* Creates the structural channel for the numbers */
    margin-bottom: 1.5rem;
}

.content-body ul { list-style-type: square; }
.content-body ol { list-style-type: decimal; }

.content-body li {
    margin-bottom: 0.5rem;
    list-style-position: outside; /* Forces the text to wrap in a block, leaving the number outside */
    padding-left: 0.5rem; /* Adds a rigid buffer between the number and the text */
}

.post-nav {
    display: flex; justify-content: space-between; margin-top: 4rem; padding-top: 1rem;
    border-top: 1px dashed var(--sys-border); font-size: var(--text-small);
}

/* ==========================================================================
   MEDIA & STRICT MONOCHROME CODE BLOCKS
   ========================================================================== */
pre {
    background-color: rgba(17, 17, 17, 0.8) !important;
    border: 1px solid var(--sys-border) !important;
    padding: 1.5rem !important; margin: 2rem 0 !important;
    display: block !important;
    overflow-x: auto !important;
    max-width: 100%;
    font-size: var(--text-small);
}

pre span { background-color: transparent !important; }

.z-keyword { color: var(--sys-text-bright) !important; font-weight: 700 !important; }
.z-entity { color: var(--sys-text-bright) !important; font-weight: 500 !important; }
.z-string { color: #999999 !important; }
.z-constant { color: var(--sys-text-bright) !important; }
.z-variable { color: var(--sys-text-main) !important; }
.z-comment { color: var(--sys-text-muted) !important; font-style: normal !important; }
.z-punctuation { color: var(--sys-text-muted) !important; }
.z-support { color: var(--sys-text-main) !important; }
.z-source { color: var(--sys-text-main) !important; }

.content-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2.5rem auto;
    border: 1px solid var(--sys-border);
    background-color: var(--sys-surface);
    padding: 0.5rem;
    filter: grayscale(80%) contrast(1.1);
    transition: filter 0.3s ease;
}

.content-body img:hover { filter: grayscale(0%) contrast(1); }

.content-body .image-caption {
    font-size: var(--text-tiny);
    color: var(--sys-text-muted);
    text-align: center;
    margin-top: -1.5rem;
    margin-bottom: 2.5rem;
    text-transform: uppercase;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS
   ========================================================================= */
@media (max-width: 800px) {
    body { padding: 1.5rem; }
    .top-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .search-input { width: 100%; }
    .container { grid-template-columns: 1fr; gap: 2rem; }
    .sidebar { display: flex; flex-wrap: wrap; gap: 2rem; border-bottom: 1px solid var(--sys-border); padding-bottom: 1.5rem; margin-bottom: 1rem; }
    .sidebar-module { margin-bottom: 0; min-width: 140px; }
}
