/* =========================================================
   Xinyi Hong: personal academic site
   Layout skeleton adapted from the classic two-column
   academic homepage; palette is warm-paper + pine ink.
   ========================================================= */

/* --- 1. Design tokens --- */
:root {
    color-scheme: light;

    /* Palette lifted from stephen-smj.tech */
    --bg:            #ffffff;
    --bg-soft:       #f8f9fa;   /* code block */
    --ink:           #000000;   /* name, publication + org titles */
    --heading:       #000000;   /* section headings */
    --text:          #000000;   /* body copy */
    --text-mid:      #1a1a1a;   /* role, authors */
    --text-2:        #333333;   /* contact, descriptions */
    --text-soft:     #444444;   /* affiliation, venue */
    --text-list:     #000000;   /* list items, award names */
    --text-3:        #666666;   /* dates */
    --muted:         #555555;   /* anchor rail */
    --bracket:       #777777;   /* [ ] around link buttons, contact icons */
    --rule:          #eeeeee;
    --rule-soft:     #f0f0f0;   /* photo border, anchor rail */
    --rule-filter:   #edf0f4;
    --rule-strong:   #dddddd;
    --accent:        #0056b3;
    --accent-hover:  #0066cc;
    --accent-ring:   rgba(0, 86, 179, .25);
    --nav-bg:        rgba(255, 255, 255, .8);
    --nav-border:    rgba(0, 0, 0, .1);
    --shadow-sm:     0 1px 2px rgba(0, 0, 0, .04);
    --shadow-md:     0 6px 18px rgba(0, 0, 0, .07), 0 1px 3px rgba(0, 0, 0, .05);

    --sidebar-width: 260px;
    --nav-height:    54px;
    --content-max:   750px;

    /* One family across the whole site: Inter for Latin, Noto Sans SC for CJK. */
    --font-ui: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont,
               'Segoe UI', Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-height) + 24px); }

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg);
    font-feature-settings: 'cv05' 1, 'ss01' 1;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color .18s ease, opacity .18s ease;
}

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

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 3px;
}

img { max-width: 100%; }

.icon { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8;
        stroke-linecap: round; stroke-linejoin: round; vertical-align: -.13em; }
.icon--solid { fill: currentColor; stroke: none; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px;
    padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- 2. Top navigation --- */
.navbar {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--nav-height);
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .01em;
}

.nav-link { color: var(--text); opacity: .8; }
.nav-link:hover { color: var(--accent-hover); opacity: 1; text-decoration: none; }
.nav-link.active { color: var(--accent-hover); opacity: 1; font-weight: 600; }

.nav-sep { color: var(--rule-strong); user-select: none; }

/* Language switch: lives at the right edge of the Biography heading */
.lang-switch {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    flex-shrink: 0;
    font-size: 12.5px;
    font-weight: 500;
}
.lang-switch .cur { color: var(--text-3); }
.lang-switch .sep { color: var(--rule-strong); }
.lang-switch a { color: var(--accent); }

/* --- 3. Page shell --- */
.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: calc(var(--nav-height) + 60px) 24px 72px;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    gap: 48px;
}

/* --- 4. Sidebar --- */
.sidebar { min-width: 0; }

.sidebar-sticky { position: sticky; top: calc(var(--nav-height) + 32px); }

.profile-photo {
    width: 210px;
    height: 210px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin-bottom: 24px;
    border: 1px solid var(--rule-soft);
}

.name {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
    color: var(--ink);
    margin-bottom: 8px;
}

.name-alt {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-3);
    letter-spacing: .04em;
    margin-bottom: 10px;
}

.role {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-mid);
    margin-bottom: 4px;
}

.affiliation {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-soft);
    margin-bottom: 22px;
}

.contact-list { font-size: 13px; color: var(--text-2); margin-bottom: 20px; }

.contact-list p {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 7px 0;
    word-break: break-word;
}

.contact-list .icon { flex-shrink: 0; margin-top: .28em; color: var(--bracket); font-size: 14px; }
.contact-list a { color: var(--text-2); }
.contact-list a:hover { color: var(--accent); }

.social-icons { display: flex; flex-wrap: wrap; gap: 12px 14px; margin-bottom: 34px; }

.social-icons a {
    font-size: 19px;
    color: var(--text-2);
    line-height: 1;
    display: inline-flex;
}
.social-icons a:hover { color: var(--accent); }

/* In-page anchor rail */
.nav-menu {
    display: flex;
    flex-direction: column;
    border-left: 2px solid var(--rule-soft);
}

.nav-item {
    position: relative;
    padding: 5px 0 5px 18px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--muted);
    border-left: 2px solid transparent;
    margin-left: -1px;
    transition: color .18s ease, border-color .18s ease;
}
.nav-item:hover { color: var(--accent); text-decoration: none; }
.nav-item.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

/* Sidebar location card */
.side-map { margin-top: 30px; }

.side-map-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 9px;
}

.side-map iframe {
    display: block;
    width: 100%;
    height: 168px;
    border: 1px solid var(--rule-strong);
    border-radius: 8px;
    filter: saturate(.78) contrast(.97);
}

.side-map-cap {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-3);
}

.side-map-cap a { display: block; color: var(--accent); }

/* --- 5. Main column --- */
.main-content { min-width: 0; max-width: var(--content-max); }

section { margin-bottom: 56px; scroll-margin-top: calc(var(--nav-height) + 24px); }
section:last-child { margin-bottom: 0; }

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 10px;
    margin-bottom: 22px;
}

h2 {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -.015em;
    color: var(--heading);
    margin: 0;
}

.section-note { font-size: 12.5px; color: var(--text-3); flex-shrink: 0; }

p { margin: 10px 0; }
.main-content > section > p { text-align: justify; text-justify: inter-character; hyphens: auto; }

ul { padding-left: 20px; margin: 12px 0 16px; }
li { margin-bottom: 7px; color: var(--text-list); }

strong { color: var(--ink); font-weight: 600; }

.lede { color: var(--text); }

/* Research interests */

/* --- 6. News strip --- */
.news-strip {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 4px 4px 16px;
    margin: 0 -4px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--rule-strong) transparent;
}

.news-strip::-webkit-scrollbar { height: 6px; }
.news-strip::-webkit-scrollbar-track { background: transparent; }
.news-strip::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 3px; }

.news-card {
    position: relative;
    flex: 0 0 302px;
    min-height: 168px;
    padding: 18px 20px 20px;
    scroll-snap-align: start;
    background: var(--bg);
    border: 1px solid var(--rule);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--rule-strong);
}

.news-card.pinned { border-color: var(--accent); background: var(--bg); }

.news-date {
    display: block;
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-3);
    padding-bottom: 9px;
    margin-bottom: 11px;
    border-bottom: 1px solid var(--rule);
}

.news-card.pinned .news-date { color: var(--accent); border-bottom-color: var(--accent-ring); }

.news-card.pinned .news-date::before { content: '● '; font-size: 9px; vertical-align: .12em; }

.news-body { font-size: 13.5px; line-height: 1.6; color: var(--text); }

/* --- 7. Publications --- */
.pub-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin: -20px 0 22px;
    border-bottom: 1px solid var(--rule-filter);
}

.pub-filter {
    position: relative;
    appearance: none;
    border: 0;
    background: transparent;
    padding: 8px 1px 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: #737b87;
    cursor: pointer;
    transition: color .18s ease;
}

.pub-filter::after {
    content: '';
    position: absolute;
    left: 50%; right: 50%; bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
    transition: left .2s ease, right .2s ease;
}

.pub-filter:hover { color: var(--accent); }
.pub-filter.active { color: var(--accent); font-weight: 650; }
.pub-filter.active::after { left: 0; right: 0; }

.pub-item {
    display: flex;
    gap: 22px;
    margin-bottom: 30px;
    align-items: flex-start;
}
.pub-item[hidden] { display: none; }

.pub-thumb {
    flex: 0 0 190px;
    width: 190px;
    border: 1px solid var(--rule);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-soft);
    transition: transform .25s ease, box-shadow .25s ease;
}
.pub-thumb:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pub-thumb img { display: block; width: 100%; height: auto; }

.pub-details { flex: 1; min-width: 0; }

.pub-empty { margin: 0; padding: 20px 0; font-size: 14px; color: var(--text-3); }

/* --- Sub-page shell (repositories, footprint) --- */
.container--wide { grid-template-columns: minmax(0, 1fr); }
.main-content--wide { max-width: 100%; }
.page-lede { font-size: 15px; color: var(--text-2); margin: 0 0 26px; }

/* --- Repository grid --- */
.repo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 18px;
}

.repo-card {
    display: flex;
    flex-direction: column;
    padding: 15px 18px 14px;
    background: var(--bg);
    border: 1px solid var(--rule);
    border-top: 3px solid var(--repo-accent, var(--rule-strong));
    border-radius: 8px;
    color: inherit;
    transition: transform .18s ease, box-shadow .18s ease;
}
.repo-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.repo-name {
    font-size: 15px;
    font-weight: 650;
    color: var(--accent);
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}

.repo-desc {
    flex: 1;
    margin: 0 0 16px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-2);
}

.repo-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 13px;
    font-size: 12px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}
.repo-lang { display: inline-flex; align-items: center; gap: 6px; }
.repo-stat { display: inline-flex; align-items: center; gap: 5px; }
.repo-stat svg { width: 12px; height: 12px; fill: currentColor; }
.repo-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.repo-date { margin-left: auto; }

.repo-status { margin: 20px 0 0; font-size: 13px; color: var(--text-3); }

/* --- Footprint --- */
#footprint {
    /* Google Maps-ish palette: warm off-white land, soft blue water. */
    --fp-water:      #c9e0f1;
    --fp-land:       #f2efe9;
    --fp-border:     #d9d3c6;
    --fp-land-seen:  #cadfb0;
    --fp-border-seen:#aecb8e;
    --fp-pin:        #ea4335;   /* map-marker red */
    --fp-pin-ring:   rgba(234, 67, 53, .24);
    --fp-tile-bg:    #f2f4f7;
}

/* map card */
.fp-map-card {
    border: 1px solid var(--rule);
    border-radius: 14px;
    padding: 20px 22px 0;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}
.fp-map { position: relative; }
.fp-map-svg { display: block; width: 100%; height: auto; }

.fp-sea { fill: var(--fp-water); }
.fp-land {
    fill: var(--fp-land);
    stroke: var(--fp-border);
    stroke-width: 0.6;
    stroke-linejoin: round;
    transition: fill .25s ease;
}
.fp-land.is-visited { fill: var(--fp-land-seen); stroke: var(--fp-border-seen); }

/* pins */
.fp-pins { position: absolute; inset: 0; }
/* The marker is 18x23 with its tip at the bottom centre; the negative
   margins put that tip exactly on the projected coordinate. */
.fp-pin {
    position: absolute;
    width: 10px;
    height: 13px;
    margin: -12.1px 0 0 -5px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    transform-origin: 50% 100%;
    animation: fp-drop .45s cubic-bezier(.2, .8, .3, 1) backwards;
}
.fp-pin-mark {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    transform-origin: 50% 100%;
    filter: drop-shadow(0 1px 1.2px rgba(0, 0, 0, .3));
    transition: transform .18s cubic-bezier(.2, .8, .3, 1);
}
.fp-pin-body {
    fill: var(--fp-pin);
    stroke: #ffffff;
    stroke-width: 2.3;
    paint-order: stroke;
}
.fp-pin-eye { fill: #ffffff; }
.fp-pin-halo { left: -4.5px; top: -4.5px; width: 26px; height: 26px; }
/* the one place you are based in: a bigger pin with a star and a standing
   halo, so it reads as home at a glance without leaving the red family */
.fp-pin.is-base {
    width: 15px;
    height: 19px;
    margin: -17.7px 0 0 -7.5px;
    z-index: 1;
}
.fp-pin.is-base .fp-pin-body { stroke-width: 1.8; }
.fp-pin.is-base .fp-pin-halo {
    left: -6.5px;
    top: -6.5px;
    width: 28px;
    height: 28px;
    opacity: .8;
    transform: scale(.9);
}
.fp-pin.is-base:hover .fp-pin-halo,
.fp-pin.is-base:focus-visible .fp-pin-halo,
.fp-pin.is-base.is-active .fp-pin-halo { opacity: 1; transform: scale(1); }

.fp-pin-halo {
    position: absolute;
    left: -5px;
    top: -4.9px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--fp-pin-ring);
    transform: scale(.35);
    opacity: 0;
    transition: transform .22s ease, opacity .22s ease;
}
.fp-pin:hover .fp-pin-mark,
.fp-pin:focus-visible .fp-pin-mark { transform: translateY(-2px) scale(1.12); }
.fp-pin.is-active .fp-pin-mark { transform: translateY(-2px) scale(1.18); }
.fp-pin:hover .fp-pin-halo,
.fp-pin:focus-visible .fp-pin-halo,
.fp-pin.is-active .fp-pin-halo { transform: scale(1); opacity: 1; }
/* overlapping markers: whichever one you are pointing at comes forward */
.fp-pin:hover,
.fp-pin:focus-visible,
.fp-pin.is-active { z-index: 2; }
.fp-pin:focus { outline: none; }
.fp-pin:focus-visible { outline: 2px solid var(--fp-pin); outline-offset: 3px; border-radius: 4px; }

.fp-map.has-filter .fp-pin:not(.is-active) { opacity: .3; }
.fp-pin { transition: opacity .2s ease; }

@keyframes fp-drop {
    from { opacity: 0; transform: translateY(-9px) scale(.55); }
    to   { opacity: 1; transform: none; }
}

/* pin tooltip */
.fp-tip {
    position: absolute;
    z-index: 3;
    transform: translate(-50%, calc(-100% - 19px));
    padding: 7px 11px;
    border: 1px solid var(--rule-strong);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .16s ease;
}
.fp-tip.is-on { opacity: 1; }
/* flags sit on the text baseline at every size they are used */
.fp-flag {
    display: inline-block;
    width: 18px;
    height: 13px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .1);
    flex: none;
}
.fp-tip-head { display: flex; align-items: center; gap: 7px; }
.fp-tip-city { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.fp-tip-base {
    padding: 1px 6px;
    border: 1px solid var(--rule-strong);
    border-radius: 999px;
    color: var(--text-3);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.fp-tip-note { display: block; margin-top: 3px; font-size: 11px; color: var(--text-3); }

/* stats bar under the map */
.fp-map-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 0 14px;
    border-top: 1px solid var(--rule);
}
.fp-stats { display: flex; flex-wrap: wrap; gap: 22px; }
.fp-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-3);
}
.fp-stat strong {
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.fp-hint { margin: 0; font-size: 12px; color: var(--text-3); }

.fp-demo {
    margin: 0 0 22px;
    padding: 10px 14px;
    border: 1px dashed var(--rule-strong);
    border-radius: 8px;
    font-size: 12.5px;
    color: var(--text-2);
    background: var(--bg-soft);
}
.fp-demo code { font-size: 12px; }

/* active filter chip */
.fp-chipbar:empty { display: none; }
.fp-chipbar { margin-bottom: 20px; }
.fp-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border: 1px solid var(--rule-strong);
    border-radius: 999px;
    background: #ffffff;
    font: inherit;
    font-size: 12.5px;
    color: var(--text-2);
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.fp-chip:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.fp-chip-city { font-weight: 600; color: var(--ink); }
.fp-chip-note { color: var(--text-3); }
.fp-chip-x { font-size: 15px; line-height: 1; color: var(--bracket); }
.fp-intro {
    margin: 14px 0 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-2);
}

/* year heading */
.fp-year {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 34px 0 14px;
}
.fp-year:first-child { margin-top: 0; }
.fp-year-num {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.fp-year-rule { flex: 1; height: 1px; background: var(--rule); }
.fp-year-count { font-size: 11.5px; color: var(--text-3); }

/* justified photo rows */
.fp-grid { display: block; }
.fp-row { display: flex; gap: 10px; margin-bottom: 10px; }
.fp-tile {
    position: relative;
    margin: 0;
    overflow: hidden;
    border-radius: 7px;
    background: var(--fp-tile-bg);
    flex: none;
}
.fp-tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s cubic-bezier(.2, .7, .3, 1);
}
.fp-tile[role="button"] { cursor: pointer; }
.fp-tile:hover img { transform: scale(1.045); }
.fp-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.fp-tile.is-empty {
    display: grid;
    place-items: center;
    border: 1px dashed var(--rule-strong);
    background: repeating-linear-gradient(
        135deg, #f7f8fa 0 9px, #f2f4f7 9px 18px);
}
.fp-tile-ph { font-size: 11.5px; color: var(--text-3); }
.fp-tile.is-empty .fp-tile-cap { display: none; }

.fp-tile-cap {
    display: flex;
    align-items: center;
    gap: 7px;
    position: absolute;
    inset: auto 0 0 0;
    padding: 22px 11px 9px;
    background: linear-gradient(to top, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0));
    color: #ffffff;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .22s ease, transform .22s ease;
}
.fp-tile:hover .fp-tile-cap,
.fp-tile:focus-visible .fp-tile-cap { opacity: 1; transform: none; }
.fp-tile-city { font-size: 12.5px; font-weight: 600; }
.fp-tile-cap .fp-flag { width: 16px; height: 12px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); }

.fp-empty { font-size: 13px; color: var(--text-3); }

/* lightbox */
body.fp-locked { overflow: hidden; }
.fp-box[hidden] { display: none; }
.fp-box {
    position: fixed;
    inset: 0;
    z-index: 2000;          /* the navbar is fixed at 1000, so sit above it */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5vh 24px 4vh;  /* keep the photo clear of every edge */
    background: rgba(14, 16, 19, .95);
    animation: fp-fade .2s ease;
}
@keyframes fp-fade { from { opacity: 0; } to { opacity: 1; } }
.fp-box-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: min(92vw, 1400px);
    max-height: 100%;
}
.fp-box-img {
    max-width: min(92vw, 1400px);
    max-height: 68vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}
.fp-box-cap {
    display: grid;
    justify-items: center;
    gap: 2px;
    text-align: center;
    color: rgba(255, 255, 255, .85);
}
.fp-box-cap .fp-flag { box-shadow: 0 0 0 1px rgba(255, 255, 255, .3); }
.fp-box-city { font-size: 14px; font-weight: 600; color: #ffffff; }
.fp-box-when {
    font-size: 12px;
    color: rgba(255, 255, 255, .55);
    font-variant-numeric: tabular-nums;
}
.fp-box-note { display: block; margin-top: 5px; font-size: 12.5px; }
.fp-box-count {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    color: rgba(255, 255, 255, .45);
    font-variant-numeric: tabular-nums;
}
.fp-box-btn {
    position: absolute;
    border: 0;
    background: none;
    color: rgba(255, 255, 255, .55);
    cursor: pointer;
    line-height: 1;
    transition: color .18s ease;
    font-family: var(--font-ui);
}
.fp-box-btn:hover { color: #ffffff; }
.fp-box-close { top: 14px; right: 20px; font-size: 30px; }
.fp-box-prev, .fp-box-next { top: 50%; transform: translateY(-50%); font-size: 46px; padding: 10px 18px; }
.fp-box-prev { left: 8px; }
.fp-box-next { right: 8px; }

@media (max-width: 700px) {
    .fp-map-card { padding: 14px 14px 0; border-radius: 11px; }
    .fp-pin { width: 9px; height: 12px; margin: -11.1px 0 0 -4.5px; }
    .fp-pin.is-base { width: 13px; height: 17px; margin: -15.8px 0 0 -6.5px; }
    .fp-pin.is-base .fp-pin-halo { left: -6px; top: -5.8px; width: 25px; height: 25px; }
    .fp-pin-halo { left: -4.5px; top: -4.3px; width: 18px; height: 18px; }
    .fp-map-foot { flex-direction: column; align-items: flex-start; gap: 8px; }
    .fp-stats { gap: 16px; }
    .fp-tile-cap { opacity: 1; transform: none; }
    .fp-box-prev, .fp-box-next { font-size: 34px; padding: 8px 10px; }
}

/* --- GitHub contribution graph --- */
.gh-graph { margin-top: 26px; }

.gh-label {
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 10px;
}

.gh-graph img { display: block; width: 100%; height: auto; }
.gh-graph a:hover { opacity: .85; }

.pub-title {
    font-size: 16px;
    font-weight: 650;
    line-height: 1.42;
    color: var(--ink);
    margin-bottom: 6px;
}

.pub-authors { font-size: 14px; color: var(--text-mid); margin-bottom: 5px; }
.pub-authors .me { color: var(--ink); font-weight: 650; }
.pub-authors sup { font-size: .78em; }

.pub-venue { font-size: 13.5px; font-style: italic; color: var(--text-soft); margin-bottom: 10px; }
.pub-venue em { color: var(--text-soft); }

.pub-badge {
    display: inline-block;
    font-family: var(--font-ui);
    font-style: normal;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: .01em;
    color: var(--accent);
    background: var(--bg);
    border: 1px solid var(--accent-ring);
    font-variant-numeric: tabular-nums;
    border-radius: 3px;
    padding: 1px 7px;
    margin-left: 6px;
    vertical-align: 1px;
}

.pub-badge:hover { text-decoration: none; border-color: var(--accent); }

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

.pub-btn {
    appearance: none;
    border: 0;
    background: none;
    padding: 0;
    font-family: var(--font-ui);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--accent);
    cursor: pointer;
}
.pub-btn:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }
.pub-btn::before { content: '['; color: var(--bracket); margin-right: 3px; }
.pub-btn::after  { content: ']'; color: var(--bracket); margin-left: 3px; }

/* --- 8. Experience / education --- */
.exp-item { display: flex; gap: 16px; margin-bottom: 24px; }

.exp-logo {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    overflow: hidden;
}
.exp-logo img { width: 100%; height: 100%; object-fit: contain; }

.exp-content { flex: 1; min-width: 0; }

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 3px;
}

.exp-org { font-size: 15px; font-weight: 650; color: var(--ink); }
.exp-org a { color: inherit; }
.exp-org a:hover { color: var(--accent); }

.exp-time {
    flex-shrink: 0;
    font-family: var(--font-ui);
    font-size: 12.5px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.exp-role { font-size: 14px; font-weight: 500; color: var(--accent); margin-bottom: 5px; }
.exp-desc { font-size: 13.5px; color: var(--text-2); line-height: 1.55; }

/* --- 9. Awards / two-column rows --- */
.row-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
    margin-bottom: 18px;
}
.row-item:last-child { margin-bottom: 0; }

.row-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.row-name .sub {
    display: block;
    margin-top: 2px;
    font-size: 13.5px;
    font-weight: 400;
    color: var(--text-3);
}

.row-time {
    flex-shrink: 0;
    font-family: var(--font-ui);
    font-size: 12.5px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* --- 10. Skills --- */
.skill-grid { display: grid; gap: 12px; margin-top: 4px; }

.skill-row {
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    gap: 16px;
    align-items: baseline;
}

.skill-label {
    font-family: var(--font-ui);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-3);
    padding-top: 2px;
}

.skill-list { font-size: 14px; line-height: 1.6; color: var(--text); }

/* --- 11. Contact --- */
#contact p { margin: 8px 0; }

/* --- 12. Citation modal --- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(22, 26, 24, .45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.modal.show { display: flex; }

.modal-card {
    position: relative;
    width: 100%;
    max-width: 620px;
    max-height: 80vh;
    overflow: auto;
    background: var(--bg);
    border: 1px solid var(--rule);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 24px 26px 22px;
}

.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 650; color: var(--ink); }

.modal-close {
    appearance: none; border: 0; background: none; cursor: pointer;
    font-size: 24px; line-height: 1; color: var(--text-3); padding: 0 2px;
}
.modal-close:hover { color: var(--ink); }

.citation-text {
    font-family: var(--font-ui);
    font-size: 12px;
    line-height: 1.6;
    white-space: pre;
    overflow-x: auto;
    color: var(--text);
    background: var(--bg-soft);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 14px 16px;
    margin: 0 0 14px;
}

.copy-btn {
    appearance: none;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 550;
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
    transition: background .18s ease;
}
.copy-btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* --- 13. Responsive --- */
@media (max-width: 900px) {
    .container {
        display: block;
        padding: calc(var(--nav-height) + 28px) 20px 48px;
    }

    .sidebar { margin-bottom: 36px; }

    .sidebar-sticky {
        position: static;
        display: grid;
        grid-template-columns: 124px minmax(0, 1fr);
        column-gap: 20px;
        align-items: start;
    }

    .profile-photo { width: 124px; height: 124px; margin-bottom: 0; grid-column: 1; grid-row: 1; }
    .sidebar-id   { grid-column: 2; grid-row: 1; }
    .sidebar-meta { grid-column: 1 / -1; grid-row: 2; margin-top: 18px; }

    .name { font-size: 23px; }
    .affiliation { margin-bottom: 0; }
    .contact-list { margin-bottom: 14px; }
    .social-icons { margin-bottom: 0; }
    .nav-menu { display: none; }
    .side-map { grid-column: 1 / -1; grid-row: 3; margin-top: 24px; }

    .main-content { max-width: 100%; }

    section { margin-bottom: 42px; }

    .skill-row { grid-template-columns: 1fr; gap: 6px; }
}

@media (max-width: 560px) {
    .container { padding: calc(var(--nav-height) + 22px) 16px 36px; }

    .sidebar-sticky { grid-template-columns: 100px minmax(0, 1fr); column-gap: 16px; }
    .profile-photo { width: 100px; height: 100px; }
    .name { font-size: 21px; }
    .affiliation { margin-bottom: 14px; }

    h2 { font-size: 18.5px; }
    body { font-size: 14.5px; }

    .news-card { flex-basis: 260px; }

    .exp-header { flex-direction: column; gap: 2px; }
    .row-item { flex-direction: column; gap: 2px; }
    .nav-inner { gap: 12px; font-size: 12.5px; }

    .pub-item { flex-direction: column; gap: 14px; }
    .pub-thumb { flex: none; width: 100%; max-width: 260px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
    .navbar, .nav-menu, .pub-filters, .modal { display: none !important; }
    .container { display: block; padding: 0; max-width: none; }
    body { font-size: 11pt; background: #fff; color: #000; }
    .pub-item[hidden] { display: flex !important; }
}
