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

/* Light mode variables */
:root {
    --bg: #fff;
    --bg-alt: #f9f9f9;
    --text: #222;
    --text-muted: #555;
    --text-faint: #999;
    --border: #eee;
    --nav-bg: #fff;
    --toggle-bg: #ddd;
    --toggle-knob: #fff;
}

/* Dark mode variables */
body.dark {
    --bg: #121212;
    --bg-alt: #1e1e1e;
    --text: #e8e8e8;
    --text-muted: #aaa;
    --text-faint: #666;
    --border: #333;
    --nav-bg: #1a1a1a;
    --toggle-bg: #555;
    --toggle-knob: #fff;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    transition: background 0.3s, color 0.3s;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4rem;
    background: var(--nav-bg);
}

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

nav .nav-links a {
    text-decoration: none;
    color: var(--text);
    font-size: 0.95rem;
}

nav .nav-links a:hover { 
    color: var(--text-muted); 
}

.hero {
    padding: 8rem 4rem;
    background: var(--bg-alt);
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 1rem;
}

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

.section {
    padding: 5rem 4rem;
}

.section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.section p {
    color: var(--text-muted);
    max-width: 700px;
}

footer {
    padding: 2rem 4rem;
    border-top: 1px solid var(--border);
    color: var(--text-faint);
    font-size: 0.85rem;
}

/* Dark mode toggle */
.dark-toggle {
    background: var(--text);
    color: var(--bg);
    border: none;
    border-radius: 6px;
    padding: 0.4rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: system-ui, sans-serif;
    font-weight: 600;
    transition: background 0.3s, color 0.3s;
    flex-shrink: 0;
}

.dark-toggle:hover {
    opacity: 0.8;
}

/* Blog module */
.blog-post-card { 
    margin-bottom: 2.5rem; 
    padding-bottom: 2.5rem; 
    border-bottom: 
    1px solid var(--border); 
}

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

.blog-post-image { 
    width: 100%; 
    max-height: 300px; 
    object-fit: cover; 
    border-radius: 8px; 
    margin-bottom: 1rem; 
}

.blog-post-meta { 
    font-size: 0.85rem; 
    color: var(--text-muted); 
    margin-bottom: 0.5rem; 
}

.blog-post-title { 
    font-size: 1.5rem; 
    margin-bottom: 0.5rem; 
}

.blog-post-title a { 
    text-decoration: none; 
    color: var(--text); 
}

.blog-post-title a:hover { 
    text-decoration: underline; 
}

.blog-post-excerpt { 
    color: var(--text-muted); 
    margin-bottom: 0.75rem; 
}

.blog-read-more { 
    font-size: 0.9rem; 
    color: var(--text); 
    font-weight: 600; 
    text-decoration: none; 
}

.blog-read-more:hover { 
    text-decoration: underline; 
}

.blog-tag { 
    display: inline-block; 
    background: var(--bg-alt); 
    border-radius: 20px; 
    padding: 0.1rem 0.5rem; 
    font-size: 0.75rem; 
    margin-left: 0.25rem; 
}

/* CV site */
.cv-featured {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}
.cv-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    display: block;
    transition: transform 0.2s, box-shadow 0.2s;
}
.cv-card:hover { transform: translateY(-3px); box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.cv-card img { width: 100%; height: 180px; object-fit: cover; }
.cv-card-body { padding: 1rem; }
.cv-card-dates { font-size: 0.8rem; color: var(--text-faint); margin-bottom: 0.25rem; }
.cv-card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.25rem; }
.cv-card-company { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.cv-card-desc { font-size: 0.85rem; color: var(--text-muted); }

/* Timeline */
.cv-timeline { position: relative; padding-left: 2rem; }
.cv-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.cv-timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
}
.cv-timeline-item:last-child { border-bottom: none; }
.cv-timeline-item::before {
    content: '';
    position: absolute;
    left: -2.4rem;
    top: 0.4rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text);
    border: 2px solid var(--bg);
}
.cv-timeline-dates { font-size: 0.8rem; color: var(--text-faint); margin-bottom: 0.25rem; }
.cv-timeline-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.25rem; }
.cv-timeline-company a { color: var(--text-muted); font-size: 0.95rem; }
.cv-timeline-desc { margin-top: 0.5rem; color: var(--text-muted); font-size: 0.9rem; }
.cv-timeline-thumb { width: 80px; height: 60px; object-fit: cover; border-radius: 4px; float: right; margin-left: 1rem; }

/* Job detail page */
.cv-detail-header { margin-bottom: 2rem; }
.cv-detail-hero { width: 100%; max-height: 400px; object-fit: cover; border-radius: 8px; margin-bottom: 1.5rem; }
.cv-detail-meta { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.cv-detail-desc { color: var(--text-muted); max-width: 700px; margin-bottom: 2rem; }
.cv-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.cv-gallery img { width: 100%; height: 150px; object-fit: cover; border-radius: 6px; }
.cv-video-wrap { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 8px; margin-bottom: 1.5rem; }
.cv-video-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
@media (max-width: 768px) {
    .cv-featured { grid-template-columns: 1fr; }
    .cv-timeline { padding-left: 1.25rem; }
    .cv-timeline-thumb { width: 60px; height: 45px; }
}
