:root {
    --bg: #ffffff;
    --bg-alt: #f9f9f9;
    --card: #ffffff;
    --ink: #000000;
    --muted: #6b6b6b;
    --accent: #5c6672;
    --accent-2: #46586d;
    --border: #e0e0e0;
    --maxw: 900px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    font-weight: 400;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 400; letter-spacing: -0.01em; }
strong, b { font-weight: 500; }

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.muted { color: var(--muted); font-size: 0.9em; }
code { background: var(--bg-alt); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }


/* ---------- Nav ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
}

.nav {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.brand { display: inline-flex; align-items: center; color: var(--ink); }
.brand-mark { display: block; width: 100px; height: 32px; flex: 0 0 auto; color: var(--ink); transition: color 0.15s; }
.brand:hover .brand-mark { color: var(--accent-2); }

.nav-links {
    display: flex;
    gap: 22px;
    list-style: none;
    margin: 0;
    padding: 0;
}

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

.nav-toggle, .nav-toggle-label { display: none; }


/* ---------- Hero ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.hero {
    display: flex;
    gap: 32px;
    align-items: center;
    padding: 56px 0 40px;
    flex-wrap: wrap;
}

.avatar {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
    flex-shrink: 0;
}

.hero-text { flex: 1; min-width: 260px; }
.hero-text h1 { margin: 0 0 8px; font-size: clamp(1.9rem, 5vw, 2.7rem); font-weight: 300; }
.tagline { margin: 0 0 16px; color: #000; font-weight: 600; font-size: 1.05rem; }
.lede { margin: 0 0 18px; }

.hero-links { display: flex; gap: 28px; flex-wrap: wrap; }

.btn {
    display: inline-block;
    padding: 2px 1px 5px;
    border: 0;
    border-bottom: 1px solid var(--accent);
    border-radius: 0;
    background: none;
    color: var(--accent);
    font-size: 0.92rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    transition: color 0.15s, border-color 0.15s;
}
.btn:hover {
    color: var(--ink);
    border-bottom-color: var(--ink);
    text-decoration: none;
}
.btn-outline { /* same treatment as .btn */ }


/* ---------- Sections ---------- */
.section { padding: 44px 0; border-top: 1px solid var(--border); }
.section h2 { font-size: 1.5rem; margin: 0 0 18px; }

/* full-bleed alt background for zebra striping */
.section.alt {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    margin: 0 calc(50% - 50vw);
    padding-left: calc(50vw - 50%);
    padding-right: calc(50vw - 50%);
}

.chips {
    list-style: none;
    padding: 0;
    margin: 0 0 22px;
    display: grid;
    grid-template-columns: auto auto;
    justify-content: start;
    column-gap: 56px;
    row-gap: 13px;
}
.chips li {
    font-weight: 400;
    color: var(--ink);
}
.chips li a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1px;
    transition: border-color 0.15s, color 0.15s;
}
.chips li a:hover {
    color: var(--accent-2);
    border-bottom-color: var(--accent-2);
    text-decoration: none;
}


/* clear the sticky header on any anchor jump */
main section, .exp { scroll-margin-top: 80px; }


/* ---------- Experience ---------- */
.exp {
    margin-bottom: 28px;
    scroll-margin-top: 80px;
}
.exp h3 {
    margin: 0 0 2px;
    font-size: 1.08rem;
}
.exp-meta {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.9rem;
}
.exp ul {
    margin: 0;
    padding-left: 18px;
}
.exp li {
    margin-bottom: 6px;
}


/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 20px;
}
.card h3 { margin: 0 0 4px; font-size: 1.15rem; }
.card-tag { margin: 0 0 10px; color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }
.card p { margin: 0 0 10px; font-size: 0.95rem; }
.card-links { margin: 0; font-weight: 600; }


/* ---------- Publications ---------- */
.pub-list { padding-left: 20px; }
.pub-list li { margin-bottom: 12px; }
.pub-title { font-style: italic; }


/* ---------- CV ---------- */
.cv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; margin-top: 18px; }
.cv-grid h3 { margin: 0 0 8px; font-size: 1.05rem; }
.cv-grid ul { margin: 0; padding-left: 18px; }
.cv-grid li { margin-bottom: 6px; }


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


/* ---------- Mobile ---------- */
@media (max-width: 640px) {
    .nav-toggle-label {
        display: block;
        cursor: pointer;
        font-size: 1.4rem;
        color: var(--accent);
    }
    .nav-links {
        flex-basis: 100%;
        flex-direction: column;
        gap: 10px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease;
    }
    .nav-toggle:checked ~ .nav-links { max-height: 320px; margin-top: 12px; }

    .cards { grid-template-columns: 1fr; }
    .cv-grid { grid-template-columns: 1fr; }
    .chips { grid-template-columns: 1fr; }
    .hero { padding-top: 36px; }
}
