/* ===== Base ===== */
:root {
    --bg: #f2f4f8;
    --panel: #ffffff;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: rgba(17, 24, 39, .10);
    --accent: #2563eb;
    /* academic blue */
    --shadow: 0 12px 28px rgba(17, 24, 39, .10);
    --radius: 16px;
}


* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(1100px 650px at 10% -10%, rgba(37, 99, 235, .10), transparent 60%),
        radial-gradient(900px 600px at 95% 10%, rgba(16, 185, 129, .08), transparent 55%),
        var(--bg);
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    line-height: 1.55;
}


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

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

.container {
    width: min(1050px, calc(100% - 40px));
    margin: 0 auto;
}

/* accessibility */
.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link:focus {
    left: 16px;
    top: 16px;
    width: auto;
    height: auto;
    padding: 10px 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    z-index: 999;
}

/* ===== Header ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(247, 248, 251, .85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}


.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    gap: 18px;
}

.brand-name {
    font-weight: 700;
    letter-spacing: .2px;
    font-size: 18px;
}

.brand-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}

.nav {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav a {
    font-size: 14px;
    color: var(--muted);
    padding: 8px 10px;
    border-radius: 10px;
    transition: background .15s ease, color .15s ease;
}

.nav a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .06);
}

/* ===== Sections ===== */
.section {
    padding: 44px 0;
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.section-head h2 {
    margin: 0;
    font-size: 22px;
    letter-spacing: .2px;
}

.section-head p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

/* ===== Hero ===== */
.hero {
    padding: 46px 0 10px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.4fr .8fr;
    gap: 18px;
    align-items: start;
}

h1 {
    margin: 0 0 10px;
    font-size: clamp(28px, 4vw, 40px);
    letter-spacing: -.4px;
}

.accent {
    color: var(--accent);
}

.lead {
    margin: 0 0 16px;
    color: rgba(17, 24, 39, .90);
    font-size: 16px;
}

.meta {
    margin-top: 14px;
    color: var(--muted);
    font-size: 13px;
}

/* ===== Cards ===== */
.card {
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, .14);
    border-radius: var(--radius);
    box-shadow:
        0 1px 0 rgba(17, 24, 39, .04),
        0 10px 25px rgba(17, 24, 39, .10);
    padding: 20px;
}



.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.card h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.card p {
    margin: 0 0 12px;
    color: rgba(17, 24, 39, .82);
    font-size: 14px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.tag {
    font-size: 12px;
    color: rgba(17, 24, 39, .85);
    background: rgba(37, 99, 235, .08);
    border: 1px solid rgba(37, 99, 235, .18);
    padding: 5px 8px;
    border-radius: 999px;
}


.card-links {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--muted);
}

.card-links a {
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

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

/* ===== Buttons ===== */
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 4px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    font-size: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
}

.button:hover {
    border-color: rgba(96, 165, 250, .35);
    background: rgba(96, 165, 250, .08);
}

.button.primary {
    background: rgba(96, 165, 250, .18);
    border-color: rgba(96, 165, 250, .35);
}

/* Teaching card: increase contrast without affecting other cards */
.teaching-card {
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, .16);
    box-shadow:
        0 1px 0 rgba(17, 24, 39, .05),
        0 12px 28px rgba(17, 24, 39, .12);
}

.teaching-card .clean-list>li {
    color: #111827;
    font-weight: 500;
}

.teaching-card .clean-list ul li {
    color: rgba(17, 24, 39, .85);
    font-weight: 400;
}


/* ===== Photo placeholder ===== */
.photo-card {
    padding: 16px;
}

.photo-placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    border: 1px dashed rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .03);
}

.photo-caption {
    margin-top: 12px;
}

.photo-name {
    font-weight: 600;
}

.photo-note {
    font-size: 13px;
    color: var(--muted);
}

.photo-image {
    width: 100%;
    height: auto;
    border-radius: 14px;
    border: 1px solid var(--border);
    object-fit: cover;
}


/* ===== Publications ===== */
.pub-list {
    display: grid;
    gap: 12px;
}

.pub {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .03);
}

.pub-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.pub-authors,
.pub-venue {
    color: var(--muted);
    font-size: 13px;
}

.pub-links {
    margin-top: 8px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pub-links a {
    font-size: 13px;
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

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

/* ===== Lists / Contact ===== */
.clean-list {
    margin: 0;
    padding-left: 18px;
}

.clean-list li {
    margin: 6px 0;
    color: rgba(229, 231, 235, .9);
}

.contact-card .label {
    display: inline-block;
    width: 70px;
    color: var(--muted);
    font-size: 13px;
}

.contact-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 18px;
    padding: 8px 0;
}

.contact-row a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ===== Footer ===== */
.site-footer {
    padding: 26px 0 60px;
    color: var(--muted);
    font-size: 13px;
}

.footer-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.footer-dot {
    opacity: .6;
}

/* Publications: match Teaching (one card, clean entries) */
.publications-card .pub {
    background: transparent;
    /* remove individual box fill */
    border: none;
    /* remove individual box border */
    padding: 12px 0;
    /* vertical spacing */
    border-radius: 0;
}

.publications-card .pub+.pub {
    border-top: 1px solid rgba(17, 24, 39, .10);
    /* subtle divider */
}

.publications-card .pub-title {
    font-weight: 650;
}

.publications-card .pub-authors,
.publications-card .pub-venue {
    color: rgba(17, 24, 39, .75);
}

.publications-card .pub-links a {
    color: rgba(17, 24, 39, .70);
}

.publications-card .pub-links a:hover {
    color: var(--accent);
}

/* Talks: two-column inside one card (matches Teaching/Publications style) */
.talks-card {
    padding: 18px 20px;
}

.talks-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.talks-subhead {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 650;
}

.talks-list {
    margin: 0;
    padding-left: 18px;
}

.talks-list li {
    margin: 10px 0;
    color: rgba(17, 24, 39, .88);
}

.talk-meta {
    color: rgba(17, 24, 39, .65);
    font-size: 13px;
}

@media (max-width: 900px) {
    .talks-grid {
        grid-template-columns: 1fr;
    }
}

/* Service card: improve contrast and readability */
.service-card {
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, .16);
    box-shadow:
        0 1px 0 rgba(17, 24, 39, .05),
        0 12px 28px rgba(17, 24, 39, .12);
}

/* Ensure readable text hierarchy inside Service */
.service-card .clean-list>li {
    color: #111827;
    font-weight: 500;
}

.service-card em {
    color: rgba(17, 24, 39, .85);
}

.service-card .service-meta {
    display: block;
    margin-top: 6px;
    color: rgba(17, 24, 39, .70);
    font-size: 13px;
}

.service-card .clean-list li {
    margin: 6px 0;
}

.upcoming {
    margin-left: 6px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 500;
    color: #2563eb;
    background: rgba(37, 99, 235, .10);
    border: 1px solid rgba(37, 99, 235, .25);
    border-radius: 6px;
}


/* ===== Responsive ===== */
@media (max-width: 900px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .contact-row {
        grid-template-columns: 1fr;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }
}