:root {
  --bg: #ffffff;
  --paper: #ffffff;
  --ink: #172033;
  --muted: #697386;
  --line: #e8edf5;
  --accent: #4f7cff;
  --accent-soft: #edf3ff;
  --accent-ink: #315fc7;
  --mint: #eaf8f4;
  --shadow: 0 18px 50px rgba(31, 48, 82, .08);
  --radius: 22px;
  --shell: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple SD Gothic Neo", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { background: #dce7ff; }

.shell { width: min(var(--shell), calc(100% - 48px)); margin: 0 auto; }
.skip-link { position: fixed; top: 10px; left: 10px; padding: 8px 12px; transform: translateY(-140%); background: var(--ink); color: white; border-radius: 8px; z-index: 99; }
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.88); border-bottom: 1px solid rgba(232,237,245,.9); backdrop-filter: blur(14px); }
.nav-wrap { height: 68px; display: flex; align-items: center; gap: 28px; }
.brand { width: 36px; height: 36px; display: grid; place-items: center; text-decoration: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; letter-spacing: -.02em; }
.nav { display: flex; gap: 24px; margin-left: auto; }
.nav a { text-decoration: none; font-size: 14px; font-weight: 650; color: #5c6678; }
.nav a:hover { color: var(--ink); }
.cv-button { text-decoration: none; border: 1px solid #dce3ef; padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 750; background: white; transition: .18s ease; }
.cv-button:hover { border-color: #bfcdf0; box-shadow: 0 5px 20px rgba(79,124,255,.12); transform: translateY(-1px); }

.hero { padding: 90px 0 78px; display: grid; grid-template-columns: minmax(0, 1.45fr) 340px; align-items: center; gap: 90px; }
.eyebrow, .section-kicker { margin: 0 0 12px; font-size: 12px; line-height: 1; letter-spacing: .15em; text-transform: uppercase; font-weight: 800; color: var(--accent-ink); }
h1 { margin: 0; font-size: clamp(52px, 7vw, 78px); line-height: .98; letter-spacing: -.055em; font-weight: 800; }
.role { margin: 20px 0 0; font-size: 21px; font-weight: 650; letter-spacing: -.02em; color: #3d4759; }
.intro { max-width: 720px; margin: 18px 0 0; color: var(--muted); font-size: 17px; }
.social-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 26px; }
.social-links a { position: relative; text-decoration: none; font-size: 14px; font-weight: 750; color: #34405a; }
.social-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; border-radius: 4px; background: #cddcff; transform: scaleX(0); transform-origin: left; transition: .18s ease; }
.social-links a:hover::after { transform: scaleX(1); }
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 30px; }
.chips span { padding: 7px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 750; }
.chips span:nth-child(2n) { background: #f2f0ff; color: #6651ae; }
.chips span:nth-child(3n) { background: var(--mint); color: #347966; }

.hero-card { border: 1px solid var(--line); border-radius: 26px; padding: 14px; box-shadow: var(--shadow); background: linear-gradient(180deg, #fff 0%, #fbfcff 100%); }
.portrait { width: 100%; aspect-ratio: 1.06 / 1; object-fit: cover; object-position: center; display: block; border-radius: 17px; background: #f4f5f7; }
.profile-meta { display: grid; gap: 0; padding: 11px 4px 0; }
.profile-meta div { display: flex; justify-content: space-between; gap: 18px; padding: 9px 3px; border-bottom: 1px solid var(--line); font-size: 12px; }
.profile-meta div:last-child { border-bottom: 0; }
.profile-meta span { color: #8a93a2; }
.profile-meta strong { text-align: right; font-weight: 700; color: #354055; }

.main-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 72px; padding-bottom: 90px; }
.section { padding: 62px 0; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.section-heading.simple { align-items: flex-start; }
h2 { margin: 0; font-size: 30px; line-height: 1.15; letter-spacing: -.035em; }
.pub-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.filter { border: 0; padding: 7px 11px; border-radius: 999px; background: transparent; color: #7b8492; font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.filter:hover, .filter.active { background: var(--accent-soft); color: var(--accent-ink); }

.publication-list { border-top: 1px solid var(--line); }
.publication { display: grid; grid-template-columns: 64px 1fr; gap: 20px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.publication[hidden] { display: none; }
.pub-year { padding-top: 3px; font-size: 12px; font-weight: 800; color: #9aa2af; }
.venue { margin: 0 0 6px; font-size: 12px; font-weight: 800; color: var(--accent-ink); letter-spacing: .01em; }
.pub-body h3 { margin: 0; font-size: 18px; line-height: 1.38; letter-spacing: -.02em; }
.authors { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.authors strong { color: #2f3a51; text-decoration: underline; text-decoration-color: #cbd8fb; text-decoration-thickness: 3px; text-underline-offset: 2px; }
.pub-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.pub-links a { text-decoration: none; font-size: 12px; font-weight: 800; color: var(--accent-ink); }
.pub-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.publication.featured { position: relative; }
.publication.featured::before { content: ""; position: absolute; left: -14px; top: 27px; width: 4px; height: 22px; border-radius: 4px; background: #a9bfff; }

.timeline { display: grid; gap: 0; }
.timeline-item { display: grid; grid-template-columns: 150px 1fr; gap: 28px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.timeline-item:first-child { border-top: 1px solid var(--line); }
.timeline-date { font-size: 12px; color: #8a93a2; font-weight: 750; padding-top: 4px; }
.timeline-item h3 { margin: 0; font-size: 16px; letter-spacing: -.015em; }
.timeline-item h3 span { color: #7d8797; font-weight: 600; }
.timeline-item p { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.timeline-item .place { font-size: 12px; color: #969dab; }

.education-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.edu-card { border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: #fcfdff; }
.edu-card:last-child { grid-column: 1 / -1; }
.edu-date { margin: 0 0 12px; color: var(--accent-ink); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.edu-card h3 { margin: 0; font-size: 17px; }
.edu-card p:not(.edu-date) { margin: 6px 0 0; font-size: 13px; }
.muted { color: var(--muted); }

.side-column { padding-top: 62px; }
.side-section { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; background: #fff; }
.side-section:nth-child(2) { background: #fcfdff; }
.side-section h2 { font-size: 20px; margin-bottom: 20px; }
.mini-list { display: grid; gap: 18px; }
.mini-list article + article { padding-top: 18px; border-top: 1px solid var(--line); }
.mini-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.mini-top h3 { margin: 0; font-size: 14px; line-height: 1.35; }
.mini-top span { white-space: nowrap; font-size: 10px; color: #969dab; font-weight: 750; }
.mini-list p { margin: 7px 0 0; font-size: 12px; color: var(--muted); }
.mini-list a { display: inline-block; margin-top: 8px; font-size: 11px; font-weight: 800; text-decoration: none; color: var(--accent-ink); }
.award-list, .service-list { display: grid; gap: 15px; }
.award-list div { display: grid; gap: 3px; }
.award-list strong, .service-list strong { font-size: 12px; line-height: 1.4; }
.award-list span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.service-list p { margin: 0; color: var(--muted); font-size: 12px; }
.skill-list { margin: 0; display: grid; gap: 12px; }
.skill-list div { display: grid; grid-template-columns: 86px 1fr; gap: 12px; }
.skill-list dt { color: #8a93a2; font-size: 11px; font-weight: 750; }
.skill-list dd { margin: 0; font-size: 12px; font-weight: 650; }

footer { border-top: 1px solid var(--line); background: #fbfcfe; }
.footer-inner { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #8992a0; font-size: 11px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr 280px; gap: 48px; }
  .main-grid { grid-template-columns: 1fr; gap: 0; }
  .side-column { padding-top: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .side-section { margin-bottom: 0; }
}

@media (max-width: 700px) {
  .shell { width: min(100% - 32px, var(--shell)); }
  .nav { display: none; }
  .cv-button { margin-left: auto; }
  .hero { padding: 56px 0 54px; grid-template-columns: 1fr; gap: 34px; }
  h1 { font-size: clamp(46px, 15vw, 64px); }
  .hero-card { max-width: 360px; }
  .main-grid { padding-bottom: 60px; }
  .section { padding: 48px 0; }
  .section-heading { display: grid; align-items: start; }
  .publication { grid-template-columns: 44px 1fr; gap: 12px; }
  .publication.featured::before { display: none; }
  .timeline-item { grid-template-columns: 1fr; gap: 6px; }
  .education-grid, .side-column { grid-template-columns: 1fr; }
  .edu-card:last-child { grid-column: auto; }
  .footer-inner { padding: 22px 0; display: grid; gap: 4px; }
}

@media print {
  .site-header, .pub-filter, .cv-button { display: none !important; }
  .hero { padding-top: 20px; }
  .hero-card { box-shadow: none; }
  .section, .side-section { break-inside: avoid; }
  body { color: black; }
}

/* Refined navigation, hero profile, and full CV detail sections */
.brand {
  width: auto;
  height: auto;
  display: inline-block;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #111318;
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -.035em;
  line-height: 1;
}

.nav-dropdown { position: relative; display: flex; align-items: center; }
.more-button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px 0;
  color: #5c6678;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}
.more-button:hover,
.nav-dropdown.open .more-button { color: var(--ink); }
.more-button .more-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  margin: 0;
  line-height: 1;
  transform-origin: 50% 50%;
  transition: transform .18s ease;
  position: relative;
  top: -1px;
}
.nav-dropdown.open .more-button .more-chevron { transform: rotate(180deg); }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: -14px;
  width: 222px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 18px 44px rgba(31, 48, 82, .12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: .16s ease;
}
.nav-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-menu a {
  display: block;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
  color: #485366;
}
.dropdown-menu a:hover { background: var(--accent-soft); color: var(--accent-ink); }

.hero {
  grid-template-columns: 318px minmax(0, 1fr);
  gap: 76px;
  align-items: center;
}
.hero-copy { min-width: 0; }
.role { max-width: 760px; }
.hero-card { padding: 13px; }
.profile-meta { padding-top: 13px; }
.profile-meta div {
  align-items: flex-start;
  padding: 11px 4px;
  font-size: 13px;
}
.profile-meta span {
  flex: 0 0 72px;
  padding-top: 1px;
  font-size: 12px;
}
.profile-meta strong {
  font-size: 13px;
  line-height: 1.45;
}

.side-section { position: relative; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.side-section:hover { border-color: #d9e2f3; box-shadow: 0 10px 28px rgba(31,48,82,.06); transform: translateY(-1px); }
.side-jump { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.side-section a:not(.side-jump) { position: relative; z-index: 2; }
.side-section h2, .side-section .section-kicker, .side-section .mini-list, .side-section .award-list, .side-section .service-list, .side-section .skill-list { position: relative; z-index: 0; }
.jump-arrow { float: right; color: #a0abc0; font-size: 15px; font-weight: 600; }

.detail-sections { padding-bottom: 90px; }
.detail-section { scroll-margin-top: 84px; }
.detail-section .section-heading { margin-bottom: 28px; }
.detail-section .timeline { max-width: 940px; }
.detail-section .timeline-item { grid-template-columns: 170px minmax(0, 1fr); }
.detail-section .timeline-item p a { color: var(--accent-ink); font-weight: 750; text-decoration: none; }
.detail-section .timeline-item p a:hover { text-decoration: underline; text-underline-offset: 3px; }
.service-detail-grid,
.skills-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 940px;
}
.detail-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  background: #fcfdff;
}
.detail-card h3 { margin: 0; font-size: 16px; line-height: 1.4; letter-spacing: -.015em; }
.detail-card p:not(.edu-date) { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.muted-weight { color: var(--muted); font-weight: 600; }

#publications, #experience, #education { scroll-margin-top: 84px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 270px minmax(0, 1fr); gap: 48px; }
}

@media (max-width: 700px) {
  .brand { font-size: 15px; }
  .hero { grid-template-columns: 1fr; gap: 32px; }
  .hero-card { max-width: 330px; order: 0; }
  .hero-copy { order: 1; }
  .profile-meta div { font-size: 13px; }
  .detail-section .timeline-item { grid-template-columns: 1fr; }
  .service-detail-grid, .skills-detail { grid-template-columns: 1fr; }
}

/* Feedback refinement: alignment, venue hierarchy, typography */
.nav { align-items: center; }
.nav > a,
.more-button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  line-height: 1;
}
.more-button { padding: 0; }

/* Keep the primary affiliation compact and intentionally two lines. */
.profile-meta strong {
  letter-spacing: -.012em;
}
.profile-meta div:first-child strong {
  font-size: 12.5px;
  line-height: 1.38;
  white-space: nowrap;
}

/* Keep the hero role on a single line at desktop widths. */
.role {
  font-size: 18px;
  white-space: nowrap;
  max-width: none;
}

/* Slightly stronger blue hierarchy for section metadata. */
.section-kicker {
  font-size: 13.5px;
  letter-spacing: .13em;
}
.edu-date {
  font-size: 12px;
}

/* Publication venue: abbreviation + full venue / notes on one line when space allows. */
.venue {
  margin: 0 0 8px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.venue-short {
  color: var(--accent-ink);
  font-size: 14px;
  line-height: 1.25;
  font-weight: 850;
  letter-spacing: .005em;
}
.venue-detail {
  color: #7d8797;
  font-size: 12.5px;
  line-height: 1.4;
  font-weight: 650;
  letter-spacing: 0;
}

/* Consistent author emphasis without first-author-specific decoration. */
.authors strong {
  color: #2f3a51;
  text-decoration: none;
  border-bottom: 2px solid #cbd8fb;
  padding-bottom: 1px;
}
.publication.featured::before { display: none; }

/* Equal visual weight for both languages. */
.language-items {
  display: grid;
  gap: 6px;
}
.detail-card .language-items p {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
}
.language-items strong { font-weight: 700; }

@media (max-width: 1040px) {
  .role { font-size: 17px; }
}

@media (max-width: 900px) {
  .role {
    white-space: normal;
    max-width: 680px;
  }
  .profile-meta div:first-child strong {
    white-space: normal;
  }
}

/* Publication reading order: title first, venue second, authors third. */
.pub-body h3 { margin-bottom: 7px; }
.venue {
  display: block;
  white-space: nowrap;
  margin: 0 0 7px;
}
.venue-short { margin-right: 6px; }

/* Slightly larger date labels, especially in Academic Service cards. */
#service .edu-date {
  font-size: 13.5px;
  line-height: 1.25;
  margin-bottom: 10px;
}

@media (max-width: 700px) {
  .venue { white-space: normal; }
}


/* Final polish: preserve title-case date labels and align the More chevron. */
.edu-date,
#service .edu-date {
  text-transform: none;
}

.more-button .more-chevron {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 3px;
  border-right: 1.7px solid currentColor;
  border-bottom: 1.7px solid currentColor;
  position: relative;
  top: -2px;
  transform: rotate(45deg);
  transform-origin: 50% 50%;
  transition: transform .18s ease, top .18s ease;
  flex: 0 0 auto;
}
.nav-dropdown.open .more-button .more-chevron {
  top: 1px;
  transform: rotate(225deg);
}
