@charset "utf-8";
/* ==========================================================================
   Theme for wcbai.com (on top of the academic-homepage template)
   Sidebar on the left, content on the right; a white sheet on a grey page, near-black text,
   Oxford-blue links; serif headings (Source Serif) over
   sans body (IBM Plex Sans). Light only.

   To re-tint or re-size the whole site, change the variables in :root.
   ========================================================================== */

/* ---------- Fonts (self-hosted) ---------- */
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap; src: url("../fonts/source-serif-4-latin-opsz-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 200 900; font-display: swap; src: url("../fonts/source-serif-4-latin-opsz-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 100 700; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-wght-italic.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); }

/* ---------- Variables ---------- */
:root {
    /* colors */
    --bg: #d9dde4;           /* page background (grey desk) */
    --surface: #ffffff;      /* the white sheet the content sits on */
    --ink: #1b1d22;          /* text and headings */
    --muted: #5d626c;        /* secondary text */
    --line: #e3e5ea;         /* hairlines */
    --accent: #1f4e8c;       /* links */
    --accent-soft: rgba(31, 78, 140, 0.09);
    --hover: #f3f5f9;        /* paper row under the mouse */
    --tint: #f2f4f8;         /* soft panel background */

    /* type scale: three text sizes + headings */
    --fs-body: 0.95rem;     /* 15px  bio, authors, rows */
    --fs-small: 0.84rem;        /* 13.5px  abstracts, dates, notes */
    --fs-item: 1.12rem;      /* item titles (paper, school, post) */
    --fs-section: 1.5rem;     /* About / Publications / ... */
    --fs-page: 1.9rem;       /* page titles */

    /* layout */
    --page: 786px;          /* max page width */
    --gutter: 28px;
    --sheet-pad: 20px;       /* extra white margin inside the sheet */          /* left/right page padding */
    --side: 130px;           /* sidebar width */
    --gap: 52px;             /* sidebar <-> content */
    --nav-h: 60px;
    --measure: 46em;         /* max width of running text */

    --serif: "Source Serif 4", "Source Han Serif SC", "Noto Serif SC", "Songti SC", Georgia, serif;   /* headings */
    --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    color-scheme: light;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body, body.bg-light {
    background-color: var(--bg) !important;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.42;
    padding-top: var(--nav-h);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
main { padding-top: 0; padding-bottom: 24px; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--ink); font-family: var(--serif); font-weight: 600; letter-spacing: -0.012em; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
::selection { background: rgba(31, 78, 140, 0.16); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
hr { border-color: var(--line); }
img { max-width: 100%; }
code, kbd, pre { font-family: var(--mono); }
code { color: var(--accent); font-size: 0.88em; }
mark { background: var(--accent-soft); color: inherit; border-radius: 4px; padding: 0.05em 0.35em; }

/* Bootstrap pieces still used by the blog post page */
.bg-white, .card { background-color: var(--surface) !important; }
.bg-light { background-color: var(--bg) !important; }
.text-dark, .text-body { color: var(--ink) !important; }
.text-muted { color: var(--muted) !important; }
.border, .border-top, .border-bottom, .border-gray { border-color: var(--line) !important; }
.shadow-sm { box-shadow: none !important; }
.badge {
    font-family: var(--mono); font-weight: 500; font-size: 0.7rem !important; letter-spacing: 0.05em; text-transform: uppercase;
    padding: 0.3em 0.7em; border-radius: 999px; vertical-align: 0.12em;
    background: var(--accent-soft) !important; color: var(--accent) !important;
}
.badge-light { background: transparent !important; color: var(--muted) !important; border: 1px solid var(--line); }

/* ---------- Page frame ---------- */
.site-nav > div, main.container-lg, .site-footer > div {
    max-width: calc(var(--page) + 2 * var(--sheet-pad));
    padding-left: calc(var(--gutter) + var(--sheet-pad)); padding-right: calc(var(--gutter) + var(--sheet-pad));
}
/* the sheet: a piece of paper lying on the desk */
main.container-lg {
    position: relative;
    margin-top: 20px; margin-bottom: 44px; padding-top: 26px; padding-bottom: 34px;
    background: var(--surface); border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(20, 24, 40, 0.04), 0 1px 1px rgba(20, 24, 40, 0.05), 0 3px 6px rgba(20, 24, 40, 0.06), 0 10px 22px rgba(20, 24, 40, 0.08), 0 28px 48px -12px rgba(20, 24, 40, 0.12);
}
/* a second sheet underneath, slightly askew (counter-clockwise). The four corners are
   drawn with fixed pixel offsets (--tilt-x / --tilt-y), so long and short pages show the same amount. */
main.container-lg { --tilt-x: 16px; --tilt-y: 9px; }
main.container-lg::before, main.container-lg::after {
    content: ""; position: absolute; z-index: -1;
    top: calc(var(--tilt-y) / -2); bottom: calc(var(--tilt-y) / -2); left: calc(var(--tilt-x) / -2); right: calc(var(--tilt-x) / -2);
    background: #fbfbfc;
    clip-path: polygon(0 var(--tilt-y), calc(100% - var(--tilt-x)) 0, 100% calc(100% - var(--tilt-y)), var(--tilt-x) 100%);
}
/* its edge line and a hint of shadow: the same shape, 1px larger and darker */
main.container-lg::after {
    z-index: -2; background: rgba(20, 24, 40, 0.16);
    top: calc(var(--tilt-y) / -2 - 1px); bottom: calc(var(--tilt-y) / -2 - 2px); left: calc(var(--tilt-x) / -2 - 1px); right: calc(var(--tilt-x) / -2 - 1px);
}

/* Pages without the sidebar (Publications / Blog / Showcase): same sheet width,
   text sits closer to the paper edge */
@media (min-width: 768px) {
    main.sheet-sub, .site-nav-sub > div, .site-footer-sub > div { padding-left: 34px; padding-right: 34px; }
    main.sheet-sub { padding-top: 20px; padding-bottom: 28px; }
}

/* ---------- Navbar ---------- */
/* not fixed: it scrolls away with the page */
.site-nav { position: absolute; padding: 0; background: none !important; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none !important; }
.site-nav > div { min-height: var(--nav-h); }
.site-nav .navbar-brand { color: var(--ink) !important; font-family: var(--serif); font-size: 1.1rem; font-weight: 600; letter-spacing: -0.012em; padding: 0; }
.site-nav .navbar-brand:hover { text-decoration: none; }
.site-nav .navbar-nav .nav-link { position: relative; margin-left: 1.9rem; padding: 0.15rem 0 !important; color: var(--ink) !important; font-size: 0.94rem; font-weight: 500; }
.site-nav .navbar-nav .nav-link:hover { color: var(--accent) !important; text-decoration: none; }
.site-nav .navbar-nav .active > .nav-link { color: var(--accent) !important; font-weight: 600; }
.site-nav .navbar-nav .active > .nav-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.site-nav .navbar-toggler { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line) !important; border-radius: 8px; color: var(--ink) !important; font-size: 0.85rem; }

/* ---------- Layout: sidebar + content ---------- */
.home-side { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); gap: 0 var(--gap); align-items: start; }
.profile.sticky-top { top: 18px; z-index: 1; padding-top: 2px; }
.profile-portrait { margin: 0 0 16px; aspect-ratio: 1 / 1; border-radius: 50%; overflow: hidden; background: var(--line); }
.profile-portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-size: 1.28rem; line-height: 1.15; margin: 0 0 10px; }
.profile-name small { display: block; margin-top: 6px; font-size: 0.55em; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.profile-positions { list-style: none; margin: 0 0 20px; padding: 0; font-size: 0.9rem; line-height: 1.32; }
.profile-positions li { margin-bottom: 4px; }
.profile-links { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.profile-links a { font-size: 0.9rem; font-weight: 600; }
.profile-links a:first-child, .profile-links a:hover { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }

/* ---------- Sections ---------- */
.section { padding-bottom: 40px; }
.section-pubs { padding-bottom: 30px; }
.section-title { font-size: var(--fs-section); line-height: 1.15; margin: 0 0 6px; }
.section-more { display: none; }

/* shared link look: bold orange with underline */
.bio a, .news-list a, .pub-links a, .year-links a, .show-link, .blog-content a {
    color: var(--accent); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px;
}
.bio a:hover, .news-list a:hover, .pub-links a:hover, .year-links a:hover, .show-link:hover, .blog-content a:hover { color: var(--ink); }

/* About */
.bio { font-size: var(--fs-body); line-height: 1.42; max-width: var(--measure); }
.bio p { margin-bottom: 0.55em; }
.bio p:last-child { margin-bottom: 0; }

/* Publications */
.pub { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 16px; align-items: start; margin: 0 -12px; padding: 9px 12px; border-radius: 10px; transition: background-color 0.2s; }
.pub:hover { background: var(--hover); }
.pub-list { padding-bottom: 0; margin-top: -4px; }
.pub-cover { order: 2; aspect-ratio: 365 / 190; border-radius: 8px; overflow: hidden; background: var(--line); }
.pub-cover img, .pub-cover svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.pub-title { font-size: var(--fs-item); font-weight: 600; line-height: 1.22; margin: 0 0 3px; }
.pub-highlight .pub-title { margin-bottom: 6px; }
.pub-highlight .pub-title span { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.pub-authors { font-size: var(--fs-body); line-height: 1.35; margin: 0 0 1px; }
.pub-authors .text-body { color: var(--ink) !important; }
.pub-authors a.text-body:hover { color: var(--accent) !important; }
.pub-authors strong { font-weight: 700; }
.pub-authors mark { display: none; }
.pub-venue { font-family: var(--mono); font-style: italic; font-size: var(--fs-small); margin: 0 0 2px; }
.pub-venue [data-semantic-scholar-id] { display: none; }
.pub-venue .badge { font: inherit !important; letter-spacing: 0; text-transform: none; padding: 0; border-radius: 0; vertical-align: baseline; background: none !important; color: inherit !important; }
.pub-venue .badge::before { content: "· "; }
.pub-note { font-size: var(--fs-small); font-style: italic; margin: 0 0 2px; }
.pub-abstract { font-size: var(--fs-small); line-height: 1.38; color: var(--muted); margin: 0 0 3px; }
.pub-links { display: flex; flex-wrap: wrap; margin: 0; }
.pub-links a { font-size: var(--fs-small); font-weight: 600; }
.pub-links a + a::before { content: "•"; display: inline-block; margin: 0 1em; font-size: 0.7em; font-weight: 400; color: var(--ink); vertical-align: 0.15em; }

/* Education / Experience */
.cv-list { list-style: none; margin: 0; padding: 0; }
.cv-list li { display: flex; align-items: flex-start; gap: 12px; padding: 3px 0 9px; }
.cv-list li:last-child { padding-bottom: 0; }
.cv-logo { flex: none; width: 34px; height: 34px; object-fit: contain; margin-top: 4px; }
.cv-main { flex: 1; min-width: 0; }
.cv-name { font-family: var(--serif); font-size: var(--fs-item); font-weight: 600; line-height: 1.25; letter-spacing: -0.012em; }
.cv-meta { font-size: var(--fs-body); line-height: 1.32; }
.cv-date { flex: none; padding-top: 0.25em; font-size: var(--fs-small); color: var(--muted); white-space: nowrap; }

/* Honors & Awards */
.award-rows { list-style: none; margin: 0; padding: 0; }
.award-rows li { display: grid; grid-template-columns: 64px 1fr; padding: 1px 0; font-size: var(--fs-body); line-height: 1.38; }
.award-year { font-weight: 600; }

/* News */
.news-year { display: grid; grid-template-columns: 64px 1fr; padding: 8px 0 7px; border-top: 1px solid var(--line); }
.news-year:first-child { border-top: 0; padding-top: 4px; }
.news-year-label { font-size: var(--fs-body); font-weight: 700; line-height: 1.38; padding-top: 1px; }
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { display: grid; grid-template-columns: 1fr auto; gap: 20px; padding: 1px 0; font-size: var(--fs-body); line-height: 1.38; }
.news-list time { order: 2; padding-top: 0.2em; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.news-list .badge { display: none; }

/* ---------- Publications / Blog / Showcase pages ---------- */
.page-title { font-size: var(--fs-page); line-height: 1.1; margin: 4px 0 8px; }
.page-lead { font-size: var(--fs-body); line-height: 1.42; max-width: var(--measure); margin: 0 0 16px; }
.year-links { font-size: var(--fs-body); font-weight: 600; margin: 0 0 14px; }
.year-links span { margin: 0 0.8em; font-weight: 400; }
.year-group { padding-bottom: 20px; }
.page-title + .year-group { padding-top: 6px; }
.year-heading { font-size: 1.3rem; line-height: 1.15; margin: 0 0 8px; }

/* Blog list */
.post { max-width: var(--measure); padding: 0 0 16px; }
.post-title { font-size: var(--fs-item); font-weight: 600; line-height: 1.22; margin: 0 0 4px; }
.post-title a { color: var(--ink); }
.post-title a:hover { color: var(--accent); text-decoration: none; }
.post-meta { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); margin: 0 0 4px; }
.post-meta span { margin-left: 1.2em; }
.post-meta span::before { content: "#"; }
.post-excerpt { font-size: var(--fs-body); line-height: 1.42; margin: 0; }

/* Blog post */
.blog-main article { padding: clamp(20px, 3vw, 40px) !important; border: 1px solid var(--line) !important; border-radius: 14px !important; }
.blog-main article h1.display-4 { font-size: clamp(2rem, 4.5vw, 2.8rem); font-weight: 600; line-height: 1.1; }
.blog-content { font-size: var(--fs-body); line-height: 1.55; }
.blog-content h1, .blog-content h2, .blog-content h3, .blog-content h4 { font-weight: 600; }
.blog-content h1, .blog-content h2 { border-bottom-color: var(--line) !important; }
.blog-content blockquote { border-left-color: var(--accent) !important; color: var(--muted) !important; }
.blog-content table th, .blog-content table td { border-color: var(--line) !important; }
.blog-content table th { background-color: var(--bg) !important; }
.blog-content pre { border: 1px solid var(--line); border-radius: 10px; }
.blog-toc-nav { border-left-color: var(--line) !important; }
.blog-toc-title { font-family: var(--mono); font-size: 0.72rem !important; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted) !important; }
.blog-toc-list a { color: var(--muted) !important; }
.blog-toc-list a:hover, .blog-toc-list a.active { color: var(--accent) !important; }

/* Showcase */
.gallery { margin: 0 0 26px; }
.gallery-stage { position: relative; aspect-ratio: 1060 / 382; border-radius: 12px; overflow: hidden; background: var(--line); }
.gallery-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.5s var(--ease); }
.gallery-stage img.active { opacity: 1; }
.gallery figcaption { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 8px 2px 0; }
.gallery-caption { font-size: var(--fs-body); font-style: italic; }
.gallery-nav { flex: none; white-space: nowrap; }
.gallery-nav button { margin-left: 8px; padding: 4px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font-size: 0.9rem; cursor: pointer; }
.gallery-nav button:hover { color: var(--accent); }
.show-item { display: grid; grid-template-columns: minmax(0, 1fr) 44%; gap: 28px; align-items: start; padding-bottom: 26px; }
.show-title { font-size: 1.3rem; line-height: 1.15; margin: 2px 0 6px; }
.show-text { font-size: var(--fs-body); line-height: 1.42; margin-bottom: 6px; }
.show-text p:last-child { margin-bottom: 0; }
.show-link { font-size: var(--fs-body); font-weight: 600; }
.show-image img { display: block; width: 100%; aspect-ratio: 490 / 176; object-fit: cover; border-radius: 12px; }
.show-image-plain img { aspect-ratio: auto; object-fit: contain; border-radius: 0; }

/* Tighter rows on the pages without the sidebar */
.is-sub .page-title { margin-bottom: 5px; }
.is-sub .page-lead { margin-bottom: 12px; }
.is-sub .year-links { margin-bottom: 10px; }
.is-sub .year-group { padding-bottom: 12px; }
.is-sub .year-heading { margin-bottom: 4px; }
.is-sub .pub { padding-top: 6px; padding-bottom: 6px; }
.is-sub .pub-authors { line-height: 1.3; }
.is-sub .pub-abstract { line-height: 1.32; margin-bottom: 2px; }
.is-sub .post { padding-bottom: 11px; }
.is-sub .post-excerpt { line-height: 1.36; }
.is-sub .gallery { margin-bottom: 18px; }
.is-sub .show-item { padding-bottom: 18px; }
.is-sub .show-text { line-height: 1.36; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 0; font-family: var(--mono); font-size: 0.74rem; color: var(--muted); }
.site-footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 0 0 22px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (min-width: 576px) {
    .site-nav .navbar-brand { display: none; }
}
@media (max-width: 991.98px) {
    :root { --gutter: 24px; }
    .show-item { grid-template-columns: minmax(0, 1fr) 40%; gap: 22px; }
}
@media (max-width: 767.98px) {
    :root { --gutter: 18px; --sheet-pad: 0px; --bg: #ffffff; }   /* phones: plain white page, no sheet */
    main.container-lg { margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 24px; border-radius: 0; box-shadow: none; }
    main.container-lg::before, main.container-lg::after { content: none; }
    .site-footer { border-top: 1px solid var(--line); }
    .site-footer-inner { padding: 14px 0 18px; }
    .home-side { grid-template-columns: 1fr; }
    .profile.sticky-top { position: static; display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; padding-top: 6px; margin-bottom: 26px; }
    .profile-portrait { margin: 0; aspect-ratio: 1 / 1; }
    .profile-name { font-size: 1.45rem; margin-bottom: 4px; }
    .profile-positions { margin-bottom: 10px; font-size: var(--fs-body); }
    .profile-positions li { margin-bottom: 2px; }
    .profile-links { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; }
    .profile-links a { font-size: 1rem; }
    .page-title { margin-top: 4px; }
    .gallery-stage { aspect-ratio: 16 / 9; }
    .show-item { grid-template-columns: 1fr; gap: 14px; padding-bottom: 32px; }
}
@media (max-width: 575.98px) {
    .site-nav { padding: 0 var(--gutter); background: var(--bg) !important; }       /* Bootstrap zeroes the container padding here */
    .site-nav .navbar-brand { line-height: var(--nav-h); }
    .site-nav .navbar-collapse { padding: 0 0 12px; }
    .site-nav .navbar-nav .nav-link { margin-left: 0; padding: 0.4rem 0 !important; }
    .site-nav .navbar-nav .active > .nav-link::after { display: none; }
    .pub { grid-template-columns: 1fr; gap: 10px; margin: 0 -10px; padding: 10px 10px 16px; }
    .pub-cover { order: 0; aspect-ratio: 16 / 9; }
    .cv-list li { flex-wrap: wrap; gap: 0 12px; }
    .cv-main { flex: 1 1 0; }
    .cv-date { flex-basis: 100%; padding: 1px 0 0 46px; }
    .news-year { grid-template-columns: 1fr; }
    .news-list li { gap: 12px; }
    .award-rows li { grid-template-columns: 60px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
