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

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* theme tokens — same palette as style.css, plus a few extras for cards */
:root {
    --bg: #fdfdfd;
    --bg-subtle: #f7f6f4;
    --bg-card: #ffffff;
    --bg-header: rgba(253, 253, 253, 0.92);
    --bg-button: #fdfdfd;
    --bg-tag: #f4f4f6;
    --bg-tag-hover: #e2e2e6;
    --text: #1e1e21;
    --text-muted: #444552;
    --text-soft: #28292d;
    --text-secondary: #6b6b6b;
    --heading: #464646;
    --border: #e8e8e8;
    --border-soft: #ececef;
    --border-strong: #cfcfd3;
    --accent: #2c4a8a;
    --accent-light: #eaf0fb;
    --accent-dark: #1f3666;
    --accent-contrast: #fdfdfd;
    --bg-venue: rgba(54, 84, 110, 0.08);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-header: 0 2px 6px rgba(0, 0, 0, 0.06);
    --radius: 12px;
    --transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

body.dark-mode {
    --bg: #17181c;
    --bg-subtle: #1d1e23;
    --bg-card: #1f2026;
    --bg-header: rgba(23, 24, 28, 0.92);
    --bg-button: #1f2026;
    --bg-tag: #24262c;
    --bg-tag-hover: #2f3137;
    --text: #e6e7ea;
    --text-muted: #b8bac1;
    --text-soft: #d0d2d7;
    --text-secondary: #9b9da5;
    --heading: #d6d7dc;
    --border: #2c2d33;
    --border-soft: #23242a;
    --border-strong: #3a3b42;
    --accent: #8fb4e6;
    --accent-light: rgba(143, 180, 230, 0.12);
    --accent-dark: #b6cdee;
    --accent-contrast: #17181c;
    --bg-venue: rgba(143, 180, 230, 0.18);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    --shadow-header: 0 2px 8px rgba(0, 0, 0, 0.45);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Noto Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    -webkit-text-size-adjust: 100%;
    transition: var(--transition);
}

p {
    display: block;
    margin-block-start: 1em;
    margin-block-end: 1em;
    color: var(--text);
    font-family: 'Noto Sans', sans-serif;
    font-weight: 400;
    line-height: 1.5;
    font-size: 14px;
}

a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    font-family: 'Noto Sans', sans-serif;
    font-size: 14px;
    transition: color 0.2s ease;
}
a:hover { color: var(--accent-dark); }

/* ── Navbar ── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-header);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--border);
    padding-left: max(48px, calc((100vw - 1100px) / 2 + 64px));
    padding-right: max(48px, calc((100vw - 1100px) / 2 + 48px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    transition: var(--transition), box-shadow 0.25s ease;
}

.navbar .site-name {
    font-family: 'Noto Sans', sans-serif;
    font-size: 19px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.2px;
    white-space: nowrap;
    flex-shrink: 0;
}

.navbar nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: flex-start;
    margin-left: -16px;
}

.navbar nav a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 6px 16px;
    border-radius: 6px;
    transition: color 0.2s;
    position: relative;
}
.navbar nav a:hover,
.navbar nav a.active { color: var(--text); }

.navbar nav a.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}

.nav-actions { display: flex; align-items: center; }

/* dark mode toggle */
.theme-toggle {
    appearance: none;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: var(--transition), transform 0.2s ease;
}
.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: rotate(20deg);
}
.theme-toggle svg { width: 16px; height: 16px; display: block; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
body.dark-mode .theme-toggle .icon-sun { display: block; }
body.dark-mode .theme-toggle .icon-moon { display: none; }

/* ── Page Container ── */
.page-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 40px 48px 60px 48px;
}

@media (min-width: 1140px) {
    .page-container { padding-left: 48px; padding-right: 48px; }
}

/* ── Two-Column Layout ── */
.two-col {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 60px;
    align-items: start;
}

/* ── Left: Profile (sticky) ── */
.profile {
    position: sticky;
    top: 84px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.avatar-frame {
    width: 100%;
    max-width: 205px;
    overflow: hidden;
    border-radius: 22px;
    margin-bottom: 18px;
}

.avatar-frame img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 22px;
}

.profile .intro-name {
    font-weight: 600;
    font-size: 27px;
    margin-top: 0;
    margin-bottom: 0.08em;
    color: var(--text);
    line-height: 1.0;
    text-align: center;
}

.profile .role {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    margin: 14px 0 2px 0;
    line-height: 1.4;
    text-align: center;
}

.profile .org {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
    margin: 0 0 18px 0;
    line-height: 1.4;
    text-align: center;
}

/* CV / Scholar / Contact buttons (rendered by site.js) */
.profile-button-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 18px;
}
.profile-button-wrapper a { display: inline-block; }

a .profile-button,
a .project-button {
    font-family: 'Noto Sans', sans-serif;
    font-size: 13.5px;
    border: 1px solid var(--border-strong);
    padding: 5px 10px;
    border-radius: 3px;
    color: var(--text);
    background-color: var(--bg-button);
    cursor: pointer;
    transition: var(--transition);
}

a .profile-button:hover,
a .project-button:hover {
    color: var(--text);
    background-color: var(--bg-tag);
    border-color: var(--border-strong);
}

/* Contact block (border above, CONTACT heading, email list) */
.contact-block {
    width: 100%;
    border-top: 1px solid var(--border);
    padding-top: 18px;
    margin-top: 6px;
    margin-bottom: 24px;
    text-align: center;
}
.contact-heading {
    font-weight: 600;
    color: var(--text);
    font-size: 16px;
    letter-spacing: 0.04em;
    margin: 0 0 12px 0;
    font-family: 'Roboto', sans-serif;
}
.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.contact-list li { margin: 0 0 0px 0; }
.u-email {
    font-weight: 700;
    font-size: 14.5px;
    color: var(--accent);
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
}
.u-email:hover { color: var(--accent-dark); }

.social-icons {
    margin-top: 14px;
    display: flex;
    justify-content: center;
    gap: 18px;
}
.social-icons a { color: var(--accent); }
.social-icons .icon {
    font-size: 22px;
    margin-right: 0;
    color: var(--accent);
    transition: var(--transition);
}
.social-icons a:hover .icon { opacity: 0.7; }

/* research interests box */
.research-interests {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    width: 100%;
    text-align: left;
}

.research-interests h3 {
    font-family: 'Noto Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--heading);
}

.interest-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.interest-tag {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* ── Right: Content ── */
.content { min-width: 0; }

section { margin-bottom: 48px; scroll-margin-top: 76px; }
section:first-child { margin-top: 0; }
#about { margin-bottom: 36px; }
#updates { margin-bottom: 36px; }
#research-interest { margin-bottom: 38px; }

section h2 {
    font-family: 'Noto Sans', sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: var(--heading);
    text-transform: capitalize;
    letter-spacing: 0.5px;
}

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

/* About / Research */
.about-text p,
.research-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    margin: 0;
}

.about-text p + p { margin-top: 12px; }

.research-content,
.research-text { color: var(--text); }
.research-text ul { padding-left: 2em; margin-top: 12px; }
.research-text li { margin-bottom: 8px; }

/* News */
.update-container {
    display: flex;
    flex-direction: column;
}

.update-item-hidden { display: none; }

.update-item .update-item-wrapper {
    display: grid;
    align-items: top;
    grid-template-columns: 80px auto;
    column-gap: 13px;
    grid-template-rows: 1fr;
    margin-bottom: 13px;
}

.update-item-wrapper .update-date {
    font-weight: 500;
    color: var(--text);
    width: fit-content;
    padding-top: 4px;
    font-family: 'Noto Sans', sans-serif;
    font-size: 14px;
    margin-top: -2px;
}

.update-item-wrapper .update-title {
    font-weight: 500;
    color: var(--text);
    width: fit-content;
    text-align: left;
    font-family: 'Noto Sans', sans-serif;
    line-height: 1.6;
    font-size: 14px;
}

.update-item-wrapper .update-content {
    color: var(--text);
    width: fit-content;
}

.news-see-more-wrapper { margin-top: 10px; }

.news-see-more-btn {
    font-family: 'Noto Sans', sans-serif;
    font-size: 13px;
    border: 1px solid var(--border-strong);
    padding: 5px 12px;
    border-radius: 3px;
    color: var(--text);
    background-color: var(--bg-button);
    cursor: pointer;
    transition: var(--transition);
}
.news-see-more-btn:hover {
    color: var(--text);
    background-color: var(--bg-tag);
    border-color: var(--border-strong);
}

/* ── Publications (line-divider, original style.css) ── */
.pub-container {
    display: flex;
    flex-direction: column;
}

.pub-item-wrapper {
    display: grid;
    grid-template-columns: 220px auto;
    grid-template-rows: 1fr;
    column-gap: 20px;
    padding-bottom: 22px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border);
}

.pub-container .pub-item-wrapper:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.pub-fig-wrapper {
    display: block;
    min-width: 0;
}

.pubfigure {
    border-radius: 6px;
    overflow: hidden;
    max-width: 215px;
    width: 100%;
    margin-top: 5px;
}

.pub-content-wrapper { min-width: 0; }
.pub-content-wrapper p { font-size: 13.5px; }

.pub-venue {
    display: inline-block;
    font-family: 'Noto Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--accent);
    background: var(--bg-venue);
    padding: 5px 14px;
    border-radius: 100px;
    margin-bottom: 10px;
}

.pub-title p {
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.4;
    font-size: 14px;
}

.pub-author p {
    margin-top: 6px;
    margin-bottom: 0;
    line-height: 1.4;
    color: var(--text-muted);
    font-size: 13.5px;
}

.pub-abstract p {
    font-size: 13.5px;
    color: var(--text-soft);
    margin-top: 10.5px;
    margin-bottom: 0;
    line-height: 1.4;
}

.pub-link a,
.pub-cite-and-links a {
    font-size: 13.5px;
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.5;
}

.pub-links-row {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pub-links-row a {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-tag);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: var(--transition);
}

.pub-links-row a:hover {
    color: var(--text);
    background: var(--bg-tag-hover);
    border-color: var(--border-strong);
}

/* ── Academic services ── */
.aca-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.aca-columns { padding-left: 0; }
.aca-column { width: 100%; }

.aca-heading {
    font-weight: 700;
    color: var(--heading);
    font-size: 14.5px;
    margin: 0 0 6px 0;
}

.aca-list {
    list-style-type: disc;
    padding-left: 22px;
    margin: 0;
}

.aca-list li::marker { font-size: 11px; color: var(--accent); }

.aca-list li {
    font-size: 13.5px;
    color: var(--text);
    line-height: 1.6;
}
.aca-list a {
    font-size: 13.5px;
    color: var(--accent);
    line-height: 1.6;
}
.aca-list a:hover { color: var(--accent-dark); }

/* ── Footer ── */
.footer {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 48px 32px;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    padding-top: 24px;
}

.footer-meta { margin: 0; font-size: 12.5px; color: var(--text-secondary); }
.footer-meta-copy { margin: 4px 0 0 0; font-size: 12.5px; color: var(--text-secondary); }

/* ── Responsive ── */
@media (min-width: 961px) {
    .profile { margin-top: 3px; }
}

@media (max-width: 960px) {
    .navbar { padding: 0 20px; }
    .navbar .site-name { font-size: 17px; }
    .navbar nav { gap: 0; justify-content: flex-end; }
    .navbar nav a { padding: 6px 10px; font-size: 13px; }

    .page-container { padding: 32px 24px 64px; }

    .two-col {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .profile {
        position: relative;
        top: 0;
    }

    .contact-block { text-align: center; }
    .social-icons { justify-content: center; }

    .footer { padding: 24px 20px 32px; }
}

@media (max-width: 560px) {
    .navbar { padding: 0 14px; }
    .navbar .site-name { font-size: 16px; }
    .navbar nav a { padding: 6px 8px; font-size: 12px; }
    .page-container { padding: 24px 20px 56px; }

    .pub-item-wrapper {
        grid-template-columns: 1fr;
        row-gap: 12px;
    }
    .pubfigure { max-width: 320px; margin: 0 auto; }
}

/* tablet range: scale avatar proportionally when profile is full-width.
   36.6vw at 560px ≈ 205px, matches base size for smooth transition */
@media (min-width: 561px) and (max-width: 960px) {
    .avatar-frame { max-width: min(36.6vw, 300px); }
}

/* mobile: use real weight 600 for <b>/<strong> to avoid broken faux bold (matches style.css) */
@media screen and (max-width: 650px) {
    b, strong { font-weight: 600; }
}
