@import url('https://fonts.googleapis.com/css2?family=VT323&family=Courier+Prime:wght@400;700&display=swap');

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

body {
    font-family: 'Courier Prime', 'Courier New', monospace;
    background: #0a0014;
    color: #e8d9ff;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(157, 78, 221, 0.03) 0px,
            transparent 1px,
            transparent 2px,
            rgba(157, 78, 221, 0.03) 3px
        ),
        linear-gradient(135deg, #0a0014 0%, #1a0033 50%, #2d1b4e 100%);
    animation: scanlines 8s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(10px); }
}

/* CRT Flicker Effect */
@keyframes flicker {
    0% { opacity: 1; }
    2% { opacity: 0.95; }
    4% { opacity: 1; }
    8% { opacity: 0.97; }
    10% { opacity: 1; }
    12% { opacity: 0.92; }
    14% { opacity: 1; }
    70% { opacity: 1; }
    72% { opacity: 0.96; }
    74% { opacity: 1; }
    100% { opacity: 1; }
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 9999;
    pointer-events: none;
    animation: flicker 3s infinite;
}

/* Glitch Effect Keyframes */
@keyframes glitch {
    0% {
        transform: translate(0);
        text-shadow: 2px 2px #9d4edd, -2px -2px #e0aaff;
    }
    20% {
        transform: translate(-2px, 2px);
        text-shadow: 3px 3px #9d4edd, -3px -3px #e0aaff;
    }
    40% {
        transform: translate(-2px, -2px);
        text-shadow: 2px 2px #c77dff, -2px -2px #9d4edd;
    }
    60% {
        transform: translate(2px, 2px);
        text-shadow: 1px 1px #e0aaff, -1px -1px #9d4edd;
    }
    80% {
        transform: translate(2px, -2px);
        text-shadow: 3px 3px #9d4edd, -3px -3px #c77dff;
    }
    100% {
        transform: translate(0);
        text-shadow: 2px 2px #9d4edd, -2px -2px #e0aaff;
    }
}

@keyframes rgb-shift {
    0%, 100% {
        text-shadow: 
            2px 0 0 #ff00ff,
            -2px 0 0 #00ffff,
            0 0 10px rgba(157, 78, 221, 0.5);
    }
    50% {
        text-shadow: 
            -2px 0 0 #ff00ff,
            2px 0 0 #00ffff,
            0 0 20px rgba(157, 78, 221, 0.8);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 
            0 0 5px rgba(157, 78, 221, 0.5),
            0 0 10px rgba(157, 78, 221, 0.3),
            inset 0 0 10px rgba(157, 78, 221, 0.1);
    }
    50% {
        box-shadow: 
            0 0 10px rgba(157, 78, 221, 0.8),
            0 0 20px rgba(157, 78, 221, 0.5),
            inset 0 0 15px rgba(157, 78, 221, 0.2);
    }
}

/* Navigation */
nav {
    background: rgba(10, 0, 20, 0.95);
    backdrop-filter: blur(5px);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-top: 1px solid #9d4edd;
    border-bottom: 3px double #9d4edd;
    box-shadow: 
        0 0 20px rgba(157, 78, 221, 0.4),
        inset 0 1px 0 rgba(157, 78, 221, 0.2);
    animation: pulse-glow 4s infinite;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.logo {
    font-family: 'VT323', monospace;
    font-size: 1.8rem;
    font-weight: bold;
    color: #e0aaff;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: rgb-shift 3s infinite;
    position: relative;
}

.logo::before {
    content: '>>> ';
    color: #9d4edd;
}

.logo::after {
    content: ' <<<';
    color: #9d4edd;
}

.nav-links {
    display: flex;
    gap: 0;
    list-style: none;
    font-family: 'VT323', monospace;
    flex-direction: row;
}

.nav-links a {
    color: #e8d9ff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.5rem 1.5rem;
    border: 1px solid #9d4edd;
    border-right: none;
    background: rgba(26, 0, 51, 0.5);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links li:last-child a {
    border-right: 1px solid #9d4edd;
}

.nav-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 5px rgba(157, 78, 221, 0.5));
}

.nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(157, 78, 221, 0.4), transparent);
    transition: left 0.5s;
}

.nav-links a:hover::before {
    left: 100%;
}

.nav-links a:hover {
    background: rgba(157, 78, 221, 0.3);
    color: #ffffff;
    text-shadow: 0 0 10px #e0aaff;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

/* Main Content Area */
.main-content {
    background: rgba(10, 0, 20, 0.8);
    border: 2px solid #9d4edd;
    padding: 0;
    box-shadow: 
        0 0 30px rgba(157, 78, 221, 0.3),
        inset 0 0 20px rgba(157, 78, 221, 0.05);
    position: relative;
}

.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent, 
        #9d4edd 20%, 
        #e0aaff 50%, 
        #9d4edd 80%, 
        transparent);
    animation: loading-bar 2s linear infinite;
}

@keyframes loading-bar {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.post-header {
    padding: 2rem;
    border-bottom: 3px double #9d4edd;
    background: rgba(26, 0, 51, 0.5);
}

.post-title {
    font-family: 'VT323', monospace;
    font-size: 2.5rem;
    color: #e0aaff;
    margin: 0 0 1rem 0;
    text-shadow: 
        2px 2px 0 #9d4edd,
        4px 4px 0 rgba(157, 78, 221, 0.5);
    text-transform: lowercase;
    letter-spacing: 3px;
}

.post-title:hover {
    animation: glitch 0.3s infinite;
}

.post-meta {
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    color: #c77dff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.post-meta::before {
    content: '[ ';
    color: #9d4edd;
}

.post-meta::after {
    content: ' ]';
    color: #9d4edd;
}

.post-content {
    padding: 2rem;
    line-height: 1.8;
    font-size: 1.1rem;
}

.post-content p {
    margin-bottom: 1.5rem;
    color: #e8d9ff;
}

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

.back-link {
    display: inline-block;
    margin: 2rem;
    padding: 0.75rem 1.5rem;
    background: rgba(26, 0, 51, 0.5);
    border: 2px solid #9d4edd;
    color: #e0aaff;
    text-decoration: none;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.back-link::before {
    content: '< ';
    color: #9d4edd;
}

.back-link:hover {
    background: rgba(157, 78, 221, 0.3);
    box-shadow: 
        0 0 20px rgba(157, 78, 221, 0.4),
        inset 0 0 10px rgba(157, 78, 221, 0.2);
    color: #ffffff;
    text-shadow: 0 0 10px #e0aaff;
}

/* Comments Section */
.comments-section {
    margin-top: 0;
    border-top: 3px double #9d4edd;
    background: rgba(10, 0, 20, 0.5);
}

.comments-header {
    padding: 1.5rem 2rem;
    background: rgba(26, 0, 51, 0.7);
    border-bottom: 2px solid #9d4edd;
}

.comments-header .widget-title {
    padding: 0;
    border: none;
    background: transparent;
    margin: 0;
}

.giscus-wrapper {
    padding: 2rem;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-widget {
    background: rgba(10, 0, 20, 0.9);
    padding: 0;
    border: 2px solid #9d4edd;
    box-shadow: 
        0 0 20px rgba(157, 78, 221, 0.2),
        inset 0 0 15px rgba(157, 78, 221, 0.05);
    position: relative;
    overflow: hidden;
}

.sidebar-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #9d4edd, transparent);
    animation: scan 3s linear infinite;
}

@keyframes scan {
    0% { transform: translateY(0); }
    100% { transform: translateY(300px); }
}

.widget-title {
    font-family: 'VT323', monospace;
    font-size: 1.4rem;
    color: #e0aaff;
    margin: 0;
    padding: 1rem;
    border-bottom: 2px solid #9d4edd;
    text-shadow: 0 0 10px rgba(224, 170, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 3px;
    background: rgba(26, 0, 51, 0.7);
}

.widget-title::before {
    content: '// ';
    color: #9d4edd;
}

.community-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem;
}

.community-item {
    padding: 0.75rem 1rem;
    background: rgba(26, 0, 51, 0.3);
    border: 1px solid rgba(157, 78, 221, 0.3);
    border-bottom: none;
    transition: all 0.2s ease;
    position: relative;
}

.community-item:last-child {
    border-bottom: 1px solid rgba(157, 78, 221, 0.3);
}

.community-item::before {
    content: '>> ';
    color: #9d4edd;
    opacity: 0;
    transition: opacity 0.2s;
}

.community-item:hover::before {
    opacity: 1;
}

.community-item:hover {
    background: rgba(157, 78, 221, 0.2);
    border-color: #9d4edd;
    box-shadow: inset 3px 0 0 #9d4edd;
}

.community-item a {
    color: #e8d9ff;
    text-decoration: none;
    display: block;
    font-family: 'Courier Prime', monospace;
    font-size: 0.95rem;
}

.community-item:hover a {
    color: #ffffff;
    text-shadow: 0 0 5px #e0aaff;
}

.community-count {
    font-size: 0.85rem;
    color: #c77dff;
    margin-left: 0.5rem;
    font-family: 'VT323', monospace;
}

.community-count::before {
    content: '[';
    color: #9d4edd;
}

.community-count::after {
    content: ']';
    color: #9d4edd;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: #c77dff;
    margin-top: 3rem;
    border-top: 3px double #9d4edd;
    background: rgba(10, 0, 20, 0.8);
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
}

footer::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        #9d4edd 20%, 
        #e0aaff 50%, 
        #9d4edd 80%, 
        transparent);
}

footer a {
    color: #e0aaff;
    text-decoration: none;
    transition: all 0.2s;
}

footer a:hover {
    text-shadow: 0 0 10px #e0aaff;
    color: #ffffff;
}

footer p {
    margin: 0.5rem 0;
}

/* Responsive */
@media (max-width: 968px) {
    .container {
        grid-template-columns: 1fr;
    }

    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
    }

    .nav-links a {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
        letter-spacing: 1px;
    }
}

@media (max-width: 640px) {
    .nav-links a {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }

    .nav-icon {
        font-size: 1rem;
    }

    .post-title {
        font-size: 2rem;
        letter-spacing: 2px;
    }

    .logo {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }
}

/* Static Noise Overlay */
.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.02;
    z-index: 9998;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" /></filter><rect width="100%" height="100%" filter="url(%23noise)" /></svg>');
    animation: noise-animation 0.2s infinite;
}

@keyframes noise-animation {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -5%); }
    20% { transform: translate(-10%, 5%); }
    30% { transform: translate(5%, -10%); }
    40% { transform: translate(-5%, 15%); }
    50% { transform: translate(-10%, 5%); }
    60% { transform: translate(15%, 0%); }
    70% { transform: translate(0%, 15%); }
    80% { transform: translate(-15%, 10%); }
    90% { transform: translate(10%, 5%); }
}