:root {
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.3s ease;
    --max-width: 800px;
}

/* Dark theme (default) */
[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --text-primary: #e0e0e0;
    --text-secondary: #888888;
    --text-muted: #555555;
    --accent: #00ff88;
    --accent-dim: #00cc6a;
    --border: #222222;
    --code-bg: #0d0d0d;
    --link: #00ff88;
    --link-hover: #00cc6a;
}

/* Light theme */
[data-theme="light"] {
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f0f0;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;
    --accent: #0066cc;
    --accent-dim: #004499;
    --border: #e0e0e0;
    --code-bg: #f5f5f5;
    --link: #0066cc;
    --link-hover: #004499;
}

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

html {
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    transition: background var(--transition), color var(--transition);
    min-height: 100vh;
}

/* Header */
header {
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem;
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo::before {
    content: '> ';
    opacity: 0.5;
}

nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition);
}

nav a:hover {
    color: var(--accent);
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

/* Main content */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Hero section */
.hero {
    margin-bottom: 4rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--border);
}

.hero h1 {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.hero p {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 600px;
}

/* Post list */
.posts {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-item {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: border-color var(--transition), transform var(--transition);
}

.post-item:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.post-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.post-date::before {
    content: '$ ';
    opacity: 0.5;
}

.post-tag {
    color: var(--accent);
}

.post-tag::before {
    content: '#';
}

.post-item h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.post-item h2 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition);
}

.post-item h2 a:hover {
    color: var(--accent);
}

.post-excerpt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Single post */
.post-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.post-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-content {
    font-size: 1rem;
    line-height: 1.8;
}

.post-content h2 {
    font-size: 1.3rem;
    margin: 2.5rem 0 1rem;
    font-weight: 600;
}

.post-content h3 {
    font-size: 1.1rem;
    margin: 2rem 0 0.75rem;
    font-weight: 600;
}

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

.post-content a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-color: var(--accent-dim);
    text-underline-offset: 2px;
}

.post-content a:hover {
    color: var(--link-hover);
}

.post-content ul,
.post-content ol {
    margin: 1rem 0 1.5rem 1.5rem;
}

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

.post-content code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    border: 1px solid var(--border);
}

.post-content pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* CVE/vulnerability specific */
.cve-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: var(--accent);
    color: var(--bg-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-weight: 600;
}

.severity-critical { background: #ff4444; }
.severity-high { background: #ff8800; }
.severity-medium { background: #ffcc00; color: #000; }
.severity-low { background: #44cc44; }

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4rem;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

footer a:hover {
    color: var(--accent);
}

/* Responsive */
@media (max-width: 600px) {
    header {
        padding: 1rem;
    }

    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }

    main {
        padding: 2rem 1rem;
    }

    .hero h1 {
        font-size: 1.25rem;
    }

    .post-header h1 {
        font-size: 1.4rem;
    }
}
