/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f7f6f3;
    --surface: #ffffff;
    --text: #1c1c1a;
    --text-secondary: #5c5c58;
    --text-muted: #8a8a85;
    --border: #e4e3de;
    --accent: #2b4a3e;
    --accent-soft: #e8f0ec;
    --link: #3a6b58;
    --link-hover: #2b4a3e;
    --accent-web: #3d5a80;
    --accent-bi: #6b5b95;
    --accent-ml: #4a7c59;
    --accent-comp: #b8860b;
    --accent-teach: #8b6914;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(28, 28, 26, 0.05), 0 4px 16px rgba(28, 28, 26, 0.04);
    --max-width: 960px;
}

[data-theme="comfort"] {
    --bg: #2a2926;
    --surface: #353431;
    --text: #e4e2dc;
    --text-secondary: #b8b5ad;
    --text-muted: #8a877f;
    --border: #454340;
    --accent: #8fbaa8;
    --accent-soft: #3a4540;
    --link: #9ecfb8;
    --link-hover: #c5e4d4;
    --accent-web: #8fa8c4;
    --accent-bi: #b0a0c8;
    --accent-ml: #8fb89a;
    --accent-comp: #d4b86a;
    --accent-teach: #c4a870;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.15);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

.page {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
}

/* Top toggles */
.site-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.site-bar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 10px 40px;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 32px;
    padding: 0 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.toggle-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.toggle-btn[aria-pressed="true"] {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.toggle-icon {
    width: 15px;
    height: 15px;
}

/* Hero */
.hero {
    padding: 64px 0 52px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 52px;
}

.hero-inner {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.profile-image img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    display: block;
    flex-shrink: 0;
}

.eyebrow {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

h1 {
    font-family: 'DM Sans', 'Inter', sans-serif;
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.1;
    color: var(--text);
    margin-bottom: 6px;
}

.tagline {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 16px;
}

.intro {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 62ch;
    margin-bottom: 14px;
}

.availability {
    font-size: 0.88rem;
    color: var(--accent);
    background: var(--accent-soft);
    display: inline-block;
    padding: 8px 16px;
    border-radius: 100px;
    margin-bottom: 22px;
    line-height: 1.5;
}

/* Contact pills */
.contact-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 7px 14px;
    border-radius: 100px;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    line-height: 1.3;
}

.pill-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.65;
    transition: opacity 0.15s ease;
}

.pill:hover .pill-icon {
    opacity: 1;
}

.pill:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

[data-theme="comfort"] .pill-accent {
    border-color: var(--accent);
}

[data-theme="comfort"] .pill-accent:hover {
    background: #4a5550;
}

.pill-accent {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: var(--accent);
    font-weight: 500;
    opacity: 0.95;
}

.pill-accent:hover {
    background: var(--accent-soft);
    border-color: var(--link-hover);
    color: var(--link-hover);
}

/* Inline text links */
.text-link,
.timeline-body a,
.project-card a {
    color: var(--link);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease;
}

.text-link:hover,
.timeline-body a:hover,
.project-card a:hover {
    color: var(--link-hover);
}

/* Sections */
.section {
    margin-bottom: 56px;
}

h2 {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 12px;
}

h2::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    max-width: 120px;
}

h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.35;
}

/* Focus cards — 2-column grid */
.focus-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.focus-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 26px;
    box-shadow: var(--shadow);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.focus-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.focus-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border-radius: 10px;
    margin-bottom: 14px;
    color: var(--accent);
}

.focus-icon svg {
    width: 18px;
    height: 18px;
}

.focus-label {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
}

.focus-card p {
    font-size: 0.93rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Timeline */
.timeline {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 28px;
    bottom: 28px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-soft), var(--border), var(--accent-soft));
    border-radius: 1px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 28px;
    align-items: start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    position: relative;
    transition: border-color 0.15s ease;
}

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 32px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--accent);
    transform: translateX(-50%);
    margin-left: 5px;
}

.timeline-item:hover {
    border-color: var(--accent);
}

.timeline-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-meta time {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
}

.timeline-place {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.timeline-body p {
    font-size: 0.93rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.timeline-body ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-body li {
    font-size: 0.86rem;
    color: var(--text-muted);
    padding-left: 14px;
    position: relative;
}

.timeline-body li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.5;
}

/* Projects — 2-column grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    border-left: 3px solid var(--border);
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.project-card--web { border-left-color: var(--accent-web); }
.project-card--bi { border-left-color: var(--accent-bi); }
.project-card--ml { border-left-color: var(--accent-ml); }
.project-card--comp { border-left-color: var(--accent-comp); }
.project-card--teach { border-left-color: var(--accent-teach); }

.project-type {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    padding: 2px 8px;
    background: var(--bg);
    border-radius: 4px;
}

.project-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.55;
}

.project-card a {
    color: var(--link);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
}

.project-card a:hover {
    color: var(--link-hover);
}

/* Skills — 2-column grid */
.skills-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 32px;
}

.skill-group h3 {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tag {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 100px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.tag:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

/* Education */
.education-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    box-shadow: var(--shadow);
}

.education-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.education-card p {
    font-size: 0.92rem;
    color: var(--text-secondary);
}

/* Footer */
footer {
    padding: 36px 0 48px;
    border-top: 1px solid var(--border);
    text-align: center;
}

footer p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .page {
        padding: 0 24px;
    }

    .site-bar-inner {
        padding: 10px 24px;
    }

    .focus-grid,
    .project-grid,
    .skills-layout {
        grid-template-columns: 1fr;
    }

    .timeline-item {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 20px 22px;
        margin-left: 0;
    }

    .timeline {
        padding-left: 16px;
    }

    .timeline::before {
        left: 4px;
    }

    .timeline-item::before {
        left: -16px;
        margin-left: 4px;
    }
}

@media (max-width: 600px) {
    .hero {
        padding: 44px 0 36px;
        margin-bottom: 36px;
    }

    .hero-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    .intro,
    .availability {
        max-width: none;
    }

    .contact-pills {
        justify-content: center;
    }

    h1 {
        font-size: 2rem;
    }

    .section {
        margin-bottom: 44px;
    }
}

@media (max-width: 400px) {
    .page {
        padding: 0 16px;
    }

    .site-bar-inner {
        padding: 10px 16px;
    }

    .profile-image img {
        width: 80px;
        height: 80px;
    }

    .pill {
        font-size: 0.78rem;
        padding: 6px 12px;
    }
}
