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

:root {
    --bg: #fff;
    --bg-secondary: #f5f5f5;
    --text: #333;
    --text-secondary: #555;
    --text-muted: #666;
    --text-faint: #888;
    --border: #eee;
    --link: #0066cc;
}

[data-theme="dark"] {
    --bg: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --text: #e5e5e5;
    --text-secondary: #b0b0b0;
    --text-muted: #909090;
    --text-faint: #707070;
    --border: #333;
    --link: #6cb6ff;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 4.5rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    transition: background 0.3s, color 0.3s;
}

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

a:hover {
    text-decoration: underline;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    z-index: 100;
    transition: background 0.3s, border-color 0.3s;
}

header nav {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

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

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

.theme-toggle:hover {
    color: var(--text);
    background: var(--bg-secondary);
}

.theme-toggle .sun-icon {
    display: block;
}

.theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

/* Main content */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 6rem 2rem 4rem;
}

section {
    margin-bottom: 3rem;
    padding-top: 1rem;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
}

/* Table of Contents */
.toc-section {
    margin-bottom: 2rem;
}

.toc-nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.toc-nav a {
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: color 0.2s;
}

.toc-nav a:hover {
    color: var(--link);
}

/* Hero / Intro */
.intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.5rem;
}

.intro img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
}

.intro h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.intro .hookline {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.intro .bio {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 500px;
}

/* Links */
.links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.links a:hover,
.links .email-link:hover {
    color: var(--link);
}

.links .email-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
}

.links svg {
    width: 18px;
    height: 18px;
}

/* Timeline */
.timeline-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    align-items: flex-start;
}

.timeline-item img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: contain;
    flex-shrink: 0;
    background: var(--bg-secondary);
    padding: 4px;
}

.timeline-logo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--text);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.demo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
}

.demo-link:hover {
    color: var(--text);
    border-color: var(--text-muted);
    text-decoration: none;
}

.timeline-content {
    flex: 1;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.timeline-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.timeline-role {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.timeline-date {
    color: var(--text-faint);
    font-size: 0.85rem;
}

.timeline-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
    padding-left: 1.25rem;
    list-style: disc;
}

.timeline-desc li {
    margin-bottom: 0.25rem;
}

.timeline-desc li:last-child {
    margin-bottom: 0;
}

/* Project Filters */
.project-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.filter-btn.active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

/* Projects */
.project {
    margin-bottom: 1.25rem;
}

.project-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.project-link {
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    transition: color 0.2s;
}

.project-link:hover {
    color: var(--link);
    text-decoration: none;
}

.project-link svg {
    width: 16px;
    height: 16px;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
    padding-left: 1.25rem;
    list-style: disc;
}

.project-desc li {
    margin-bottom: 0.25rem;
}

.project-desc li:last-child {
    margin-bottom: 0;
}

/* Notes Section */
.notes-intro {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.note-item {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: border-color 0.2s;
}

.note-item:hover {
    border-color: var(--text-muted);
}

.note-title {
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 0.25rem;
}

.note-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 600px) {
    header .nav-links {
        gap: 1rem;
        font-size: 0.85rem;
    }

    .timeline-header {
        flex-direction: column;
        gap: 0.1rem;
    }

    .project-filters {
        gap: 0.4rem;
    }

    .filter-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}
