/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    color: #1a1a1a;
    background-color: #ffffff;
    line-height: 1.7;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #0a0a0a;
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1.5rem;
}

a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.main-content {
    min-height: calc(100vh - 200px);
}

/* Header */
.site-header {
    border-bottom: 1px solid #e5e7eb;
    background-color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

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

.nav-link {
    font-weight: 500;
    color: #374151;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    text-decoration: none;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    color: #6b7280;
    transition: color 0.2s ease;
}

.social-link:hover {
    color: #2563eb;
}

/* Footer */
.site-footer {
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
    margin-top: 4rem;
}

.site-footer .container {
    padding: 2rem;
}

.site-footer p {
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
}

/* Homepage - Post List */
.post-list {
    margin-top: 2rem;
}

.post-item {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
}

.post-item:last-child {
    border-bottom: none;
}

.post-header {
    margin-bottom: 1rem;
}

.post-title {
    margin-bottom: 0.5rem;
}

.post-title a {
    color: #0a0a0a;
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-title a:hover {
    color: #2563eb;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.meta-separator {
    color: #d1d5db;
}

.post-summary p {
    color: #4b5563;
    font-size: 1rem;
    margin: 0;
}

/* Individual Post */
.post {
    margin-top: 2rem;
}

.post-content {
    margin: 2rem 0;
    font-size: 1.125rem;
    line-height: 1.8;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

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

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

.post-content blockquote {
    border-left: 4px solid #2563eb;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #4b5563;
}

/* Tags and Categories */
.post-tags,
.post-categories,
.cve-tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    margin-top: 1rem;
}

.tag,
.category {
    background-color: #f3f4f6;
    color: #374151;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Talks & Publications */
.page-header {
    margin-bottom: 2rem;
    text-align: center;
}

.page-description {
    color: #6b7280;
    font-size: 1.125rem;
    margin: 0;
}

.talks-section,
.publications-section {
    margin-bottom: 3rem;
}

.talk-item,
.publication-item {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #f3f4f6;
}

.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    margin: 1.5rem 0;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0.5rem;
}

.publication-quote {
    background-color: #f8fafc;
    border-left: 4px solid #2563eb;
    padding: 1.5rem;
    margin: 1rem 0;
    font-size: 1.125rem;
    border-radius: 0.375rem;
}

.external-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #2563eb;
    padding: 0.75rem 1.5rem;
    border: 2px solid #2563eb;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.external-link:hover {
    background-color: #2563eb;
    color: white;
    text-decoration: none;
}

/* CVE Pages */
.cve-list {
    margin-top: 2rem;
}

.cve-item {
    margin-bottom: 2rem;
    border-bottom: 1px solid #f3f4f6;
}

.cve-title a {
    color: #0a0a0a;
    font-weight: 600;
}

.severity {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.severity-critical {
    background-color: #fecaca;
    color: #991b1b;
}

.severity-high {
    background-color: #fed7aa;
    color: #c2410c;
}

.severity-medium {
    background-color: #fef3c7;
    color: #d97706;
}

.severity-low {
    background-color: #d1fae5;
    color: #065f46;
}

.nvd-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.nvd-embed {
    margin-top: 1rem;
}

.nvd-embed iframe {
    width: 100%;
    height: 400px;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
}

.nvd-fallback {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.reference-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.reference-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #f3f4f6;
    color: #374151;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.reference-link:hover {
    background-color: #2563eb;
    color: white;
}

/* Code Blocks */
pre {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'Fira Code', Consolas, 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

code {
    font-family: 'Fira Code', Consolas, 'Courier New', monospace;
    font-size: 0.875rem;
}

p code,
li code {
    background-color: #f1f5f9;
    color: #be185d;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

/* Prism.js overrides */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #6b7280;
}

.token.punctuation {
    color: #374151;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: #dc2626;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #059669;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #2563eb;
}

.token.atrule,
.token.attr-value,
.token.keyword {
    color: #7c3aed;
}

.token.function,
.token.class-name {
    color: #dc2626;
}

.token.regex,
.token.important,
.token.variable {
    color: #ea580c;
}

/* 404 Error Page */
.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-title {
    font-size: 6rem;
    font-weight: 700;
    color: #e5e7eb;
    margin-bottom: 1rem;
}

.error-subtitle {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

.btn-primary {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: #2563eb;
    color: white;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    text-decoration: none;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 0;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .navigation {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .nav-links {
        gap: 1.5rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.375rem; }
    
    .post-content {
        font-size: 1rem;
    }
    
    .error-title {
        font-size: 4rem;
    }
    
    .reference-links {
        flex-direction: column;
    }
    
    .post-meta {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .social-links {
        margin-top: 1rem;
    }
    
    pre {
        padding: 1rem;
        font-size: 0.75rem;
    }
}

/* Content Sections */
.content-sections {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.content-section {
    margin-bottom: 1.5rem;
}

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

.post-item {
    display: flex;
    align-items: baseline;
    gap: 2rem;
    margin-bottom: 0rem;
    padding-bottom: 0.5rem;
}

.post-date {
    font-family: 'Fira Code', monospace;
    color: #6b7280;
    font-size: 0.9rem;
    white-space: nowrap;
}

.post-link {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s ease;
    flex: 1;
}

.post-link:hover {
    color: #2563eb;
    text-decoration: none;
}

.more-link {
    font-size: 0.9rem;
    text-decoration: underline;
}

.more-link a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.more-link a:hover {
    color: #2563eb;
    text-decoration: none;
}

.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.vim-hint {
    font-family: 'Fira Code', monospace;
    background-color: #e0e0e0;
    color: #333;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8em;
    border: 1px solid #ccc;
    margin-left: 10px;
}