/* CSS Variables config for Dark (default) and Light mode */
:root {
  /* Dark mode as default */
  --bg-color: #06101d; /* Deep Navy */
  --bg-surface: #0a192f; /* Slightly lighter navy for cards/sidebar */
  --bg-surface-hover: #112240;
  
  --text-main: #ccd6f6; /* Off-white for main text */
  --text-muted: #8892b0; /* Grey for dates/meta */
  
  --accent-color: #00ff41; /* Matrix green */
  --accent-color-hover: #00cc33;
  --accent-transparent: rgba(0, 255, 65, 0.1);
  
  --border-color: #233554; /* Navy border */
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, Monaco, 'Andale Mono', monospace;
  
  --radius: 6px;
  --transition: all 0.2s ease-in-out;
}

[data-theme="light"] {
  --bg-color: #f8fafc; /* Very light grey/white */
  --bg-surface: #ffffff; /* pure white */
  --bg-surface-hover: #f1f5f9;
  
  --text-main: #0f172a; /* Dark slate */
  --text-muted: #64748b; /* Medium slate */
  
  --accent-color: #00992a; /* Darker Matrix green for light mode contrast */
  --accent-color-hover: #007722;
  --accent-transparent: rgba(0, 153, 42, 0.1);
  
  --border-color: #e2e8f0; /* Light border */
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 16px;
    transition: background-color var(--transition), color var(--transition);
}

a {
    color: var(--text-main);
    text-decoration: none;
    transition: color var(--transition);
}

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

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo a span {
    color: var(--accent-color);
}

.logo a:hover {
    color: var(--text-main);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.main-nav a {
    font-weight: 500;
    font-size: 0.95rem;
}

.main-nav a.active {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 2px;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.theme-toggle:hover {
    background-color: var(--bg-surface-hover);
    color: var(--accent-color);
}

[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
/* default */
.sun-icon { display: block; }
.moon-icon { display: none; }

/* Layout */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    padding-top: 40px;
    padding-bottom: 80px;
}

@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}

/* Feed items (Blog & Notes) */
.feed-header {
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--accent-color);
}

.feed-header h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.feed-subtitle {
    color: var(--text-muted);
    margin-top: 8px;
}

/* Blog Post */
.post {
    margin-bottom: 48px;
}

.post-header {
    margin-bottom: 12px;
}

.post-header time {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-family: var(--font-mono);
}

.post-title {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
}

.post-title a {
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: var(--transition);
}

.post-title a:hover {
    color: var(--accent-color);
    text-decoration-color: var(--accent-color);
}

.post-summary p {
    color: var(--text-main);
    opacity: 0.9;
    margin-bottom: 16px;
}

.post-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Notes specific */
.note {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    transition: var(--transition);
}

.note:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.note-meta time {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-bottom: 12px;
    display: inline-block;
}

.note-content p {
    margin-bottom: 16px;
}

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

.note-content pre {
    background-color: var(--bg-color);
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-color);
    margin: 16px 0;
}

.note-content code {
    font-family: var(--font-mono);
    color: var(--accent-color);
    background-color: var(--accent-transparent);
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.9em;
}

.note-content pre code {
    background-color: transparent;
    padding: 0;
}

.note-tags {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-color);
}

/* Shared Tags */
.tag {
    font-size: 0.8rem;
    background-color: var(--bg-surface-hover);
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    transition: var(--transition);
}

a.tag:hover, .tag:hover {
    background-color: var(--accent-transparent);
    color: var(--accent-color);
    cursor: pointer;
}

/* Sidebar Widgets */
.widget {
    background-color: var(--bg-surface);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.widget h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--text-main);
    border-left: 3px solid var(--accent-color);
    padding-left: 10px;
}

.about-widget p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.about-widget strong {
    color: var(--text-main);
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent-color);
}

.search-input {
    width: 100%;
    padding: 10px 12px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-main);
    font-family: var(--font-sans);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.simple-list {
    list-style: none;
}

.simple-list li {
    margin-bottom: 8px;
}

.simple-list a {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.simple-list a:hover {
    color: var(--accent-color);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
