@font-face {
    font-family: 'Fira Code';
    src: url('/templates/FiraCode-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

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

body {
    font-family: 'Space Grotesk', 'Courier New', monospace;
    line-height: 1.7;
    color: var(--foreground);
    background: var(--background);
    position: relative;
    overflow-x: hidden;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 1000;
    opacity: 0.3;
}

.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(var(--comment) 1px, transparent 1px),
        linear-gradient(90deg, var(--comment) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.05;
    pointer-events: none;
}

.navbar {
    border-bottom: 2px solid var(--main-highlight);
    padding: 1rem 0;
    background: var(--background);
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.navbar-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-family: 'Space Mono', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--main-highlight);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 0 10px var(--main-highlight);
}

.theme-selector {
    padding: 0.5rem 1rem;
    border: 2px solid var(--main-highlight);
    background: var(--background-elevated);
    color: var(--foreground);
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
}

.theme-selector:hover {
    box-shadow: 0 0 15px var(--main-highlight);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
    position: relative;
}

.post {
    background: var(--background);
    border: 1px solid var(--main-highlight);
    padding: 2.5rem;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

.post::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--main-highlight), var(--second-highlight), var(--third-highlight));
    z-index: -1;
    opacity: 0.1;
}

.post-header {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--comment);
    padding-bottom: 1.5rem;
}

.post-meta-top {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
}

.tag-badge {
    color: var(--third-highlight);
    text-transform: uppercase;
    font-weight: 700;
}

.timestamp {
    color: var(--comment);
}

.post-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--foreground);
    text-shadow: 2px 2px 0 var(--main-highlight);
}

.post-author {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    color: var(--comment);
    margin-bottom: 1rem;
}

.tag-list {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tag-chip {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--background-elevated);
    border: 1px solid var(--main-highlight);
    color: var(--main-highlight);
    text-decoration: none;
    font-size: 0.85rem;
    font-family: 'Space Mono', monospace;
    transition: all 0.2s;
}

.tag-chip:hover {
    background: var(--main-highlight);
    color: var(--background);
    box-shadow: 0 0 10px var(--main-highlight);
}

.post-content {
    font-size: 1.05rem;
}

.post-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    color: var(--foreground);
    border-left: 4px solid var(--main-highlight);
    padding-left: 1rem;
}

.post-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--second-highlight);
}

.post-content h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.post-content p {
    margin-bottom: 1.25rem;
}

.post-content a {
    color: var(--main-highlight);
    text-decoration: none;
    border-bottom: 1px solid var(--main-highlight);
    transition: all 0.2s;
}

.post-content a:hover {
    text-shadow: 0 0 5px var(--main-highlight);
}

.post-content ul, .post-content ol {
    margin-left: 2rem;
    margin-bottom: 1.25rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content li::marker {
    color: var(--main-highlight);
}

.post-content code {
    font-family: 'Fira Code', 'Space Mono', monospace;
    background: var(--background-elevated);
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--comment);
    font-size: 0.9em;
    color: var(--third-highlight);
}

.post-content pre {
    font-family: 'Fira Code', 'Space Mono', monospace;
    background: var(--background-elevated);
    padding: 1.5rem;
    border: 1px solid var(--main-highlight);
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.post-content pre code {
    background: none;
    padding: 0;
    border: none;
}

.post-content blockquote {
    border-left: 3px solid var(--second-highlight);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--comment);
    font-style: italic;
    background: var(--background-elevated);
    padding: 1rem 1.5rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto;
    border: 2px solid var(--comment);
}

.post-content .code-block-wrapper {
    position: relative;
    margin: 1.5rem 0;
}

.post-content .code-block-header {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    z-index: 10;
}

.post-content .code-block-lang {
    padding: 0.25rem 0.5rem;
    background: var(--purple);
    color: var(--background);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.post-content .code-block-lang:hover {
    opacity: 1;
}

.post-content .code-block-copy {
    padding: 0.25rem 0.5rem;
    background: var(--cyan);
    color: var(--background);
    border: none;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.post-content .code-block-copy:hover {
    opacity: 1;
}

.post-content .code-block-copy:active {
    transform: scale(0.95);
}

.post-content .code-block-copy.copied {
    background: var(--green);
}

.post-content .code-block-wrapper pre {
    margin: 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
}

.post-content th, .post-content td {
    padding: 0.75rem;
    border: 1px solid var(--comment);
    text-align: left;
}

.post-content th {
    background: var(--background-elevated);
    color: var(--main-highlight);
    font-weight: 700;
    text-transform: uppercase;
}

.post-content svg.math-inline {
    display: inline-block;
    vertical-align: middle;
    position: relative;
    height: 0.85em;
}

.post-content figure.math-display-wrapper {
    margin: 2rem auto;
    padding: 1.5rem;
    background: #ffffff;
    border: 2px solid var(--main-highlight);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.post-content svg.math-display {
    display: block;
}

.post-content figure.math-display-wrapper figcaption {
    margin-top: 1rem;
    font-size: 0.9rem;
    font-style: italic;
    color: #000000;
    text-align: center;
    font-family: 'Space Mono', monospace;
}

.footer {
    padding: 2rem 0;
    margin-top: 4rem;
    position: relative;
}

.footer-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--main-highlight), transparent);
    margin-bottom: 1rem;
}

.footer p {
    text-align: center;
    color: var(--comment);
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

@media (max-width: 768px) {
    .navbar-content, .container {
        padding: 0 1.5rem;
    }
    
    .post {
        padding: 1.5rem;
    }
    
    .post-title {
        font-size: 1.8rem;
    }
    
    .post-content h2 {
        font-size: 1.4rem;
    }
}
