/* Academic homepage — restrained, readable, bibliography-forward */

:root {
  --paper: #faf9f7;
  --surface: #ffffff;
  --soft: #f1efe9;
  --ink: #1c1917;
  --muted: #57534e;
  --accent: #1e3a5f;
  --accent-mid: #2a4f7a;
  --accent-soft: #e8eef5;
  --link: #1a4a7a;
  --line: #e4e0d8;
  --line-strong: #d0cbc0;
  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --serif-cjk: "Noto Serif SC", "Songti SC", "Noto Serif CJK SC", serif;
  --page: 960px;
  --header: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --measure: 65ch;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 20px);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.7;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.menu-open { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
ol, ul { margin: 0; padding: 0; }
a {
  color: var(--link);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 2px solid var(--accent-mid);
  outline-offset: 3px;
}

::selection {
  color: var(--paper);
  background: var(--accent);
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  color: white;
  background: var(--accent);
  font-family: var(--sans);
  font-size: 14px;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}
.skip-link:focus { transform: none; }

.page-shell,
.header-inner {
  width: min(calc(100% - 48px), var(--page));
  margin-inline: auto;
}

/* ——— Header ——— */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header);
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.site-header.is-scrolled {
  border-color: var(--line);
  background: color-mix(in srgb, var(--paper) 96%, transparent);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--paper);
  background: var(--accent);
  border-radius: 2px;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}

.site-nav {
  display: flex;
  gap: clamp(16px, 2vw, 28px);
  align-items: center;
}

.site-nav a {
  position: relative;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 150ms ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--ink);
}

.site-nav a.is-active::after {
  position: absolute;
  right: 0;
  bottom: -6px;
  left: 0;
  height: 1.5px;
  content: "";
  background: var(--accent);
}

.site-nav .nav-external {
  padding: 5px 12px;
  color: var(--accent);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-size: 13px;
  font-weight: 600;
}
.site-nav .nav-external:hover {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}
.site-nav .nav-external.is-active::after { display: none; }

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
}
.menu-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  margin: 5px auto;
  background: var(--ink);
  transition: transform 180ms ease;
}
.menu-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.25px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

/* ——— Hero ——— */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(220px, 0.72fr);
  gap: clamp(40px, 6vw, 72px);
  align-items: start;
  padding-top: calc(var(--header) + 56px);
  padding-bottom: 64px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: 18px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 14px;
  font-weight: 500;
}

.hero h1 {
  margin-bottom: 16px;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 4.8vw, 3.25rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero h1 span {
  margin-left: 10px;
  color: var(--muted);
  font-family: var(--serif-cjk);
  font-size: 0.48em;
  font-weight: 400;
  letter-spacing: 0.04em;
  vertical-align: 0.12em;
}

.hero-statement {
  max-width: 38em;
  margin-bottom: 20px;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.55;
  border-left: 2px solid var(--accent);
  padding-left: 16px;
}

.hero-bio {
  max-width: var(--measure);
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
}

.hero-bio a {
  color: var(--link);
  text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent);
  transition: color 150ms ease, text-decoration-color 150ms ease;
}
.hero-bio a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.button-primary {
  color: white;
  background: var(--accent);
  border: 1px solid var(--accent);
}
.button-primary:hover {
  background: var(--accent-mid);
  border-color: var(--accent-mid);
}

.text-link {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  color: var(--link);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; }
.text-link span { font-size: 0.9em; opacity: 0.7; }

/* ——— Portrait ——— */
.portrait-column {
  position: relative;
  justify-self: end;
  width: min(100%, 280px);
  margin-top: 8px;
}

.portrait-card {
  position: relative;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 4%, transparent);
}

.portrait-card img {
  width: 100%;
  aspect-ratio: 0.92;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.02);
}

.portrait-card figcaption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
}

.caption-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ——— Research ——— */
.research-band {
  background: var(--soft);
  border-block: 1px solid var(--line);
}

.research-inner {
  padding-block: 48px;
}

.research-intro {
  max-width: 40rem;
}

.research-intro h2 {
  margin-bottom: 14px;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 2.8vw, 1.9rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.research-intro > p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
  max-width: var(--measure);
}

.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin-top: 24px;
}

.topic-list li {
  padding: 5px 12px;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
}

/* ——— Sections ——— */
.section {
  padding-block: 72px;
}

.section-heading {
  max-width: 36rem;
  margin-bottom: 36px;
}

.section-heading h2,
.experience-panel > h2,
.contact-inner h2 {
  margin-bottom: 0;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 2.8vw, 1.9rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.section-heading > p:last-child:not(.section-kicker) {
  max-width: 40ch;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.section-heading-row {
  display: flex;
  max-width: none;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-link {
  margin-bottom: 4px;
  flex-shrink: 0;
}

/* ——— News ——— */
.news-list {
  list-style: none;
  border-top: 1px solid var(--line);
}

.news-list li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.news-list time {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.news-list p {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.55;
}

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

/* ——— Publications (bibliographic) ——— */
.section-tint {
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.publication-list {
  list-style: none;
  counter-reset: none;
}

.publication {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 8px 16px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.publication:first-child {
  border-top: 1px solid var(--line);
}

.publication-number {
  padding-top: 3px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.publication-content h3 {
  margin-bottom: 8px;
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.authors {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

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

.venue {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.5;
}

.pub-type {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 7px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 0.1em;
}

.pub-links {
  margin: 0;
}

.paper-link {
  display: inline-flex;
  align-items: center;
  color: var(--link);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--link) 30%, transparent);
}
.paper-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ——— Talks ——— */
.talk-list {
  border-top: 1px solid var(--line);
}

.talk-list article {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.talk-list time {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding-top: 3px;
}

.talk-list h3 {
  margin-bottom: 6px;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.talk-event {
  margin: 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.45;
}

/* ——— Education ——— */
.education-section {
  background: var(--soft);
  border-top: 1px solid var(--line);
}

.education-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.7fr);
  gap: clamp(40px, 6vw, 72px);
  align-items: start;
}

.timeline {
  list-style: none;
  border-top: 1px solid var(--line);
}

.timeline li {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-period,
.experience-date {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.timeline h3,
.experience-entry h3 {
  margin-bottom: 4px;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}

.timeline p,
.experience-entry p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.timeline .timeline-detail,
.experience-entry .timeline-detail {
  margin-top: 4px;
  font-size: 0.88rem;
  color: color-mix(in srgb, var(--muted) 85%, white);
}

.experience-panel {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
}

.experience-panel > h2 {
  margin-bottom: 20px;
  font-size: 1.25rem;
}

.experience-entry {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.experience-date {
  margin-bottom: 8px !important;
}

/* ——— Contact ——— */
.contact-section {
  color: var(--paper);
  background: var(--accent);
}

.contact-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 40px;
  align-items: end;
  padding-block: 64px;
}

.section-kicker-light {
  color: color-mix(in srgb, var(--paper) 70%, transparent);
}

.contact-inner h2 {
  margin-bottom: 10px;
  color: var(--paper);
}

.contact-note {
  margin: 0;
  max-width: 32ch;
  color: color-mix(in srgb, var(--paper) 72%, transparent);
  font-size: 1rem;
  line-height: 1.6;
}

.contact-details {
  justify-self: end;
  text-align: right;
}

.contact-details a {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--paper) 40%, transparent);
  text-underline-offset: 0.22em;
}
.contact-details a:hover {
  text-decoration-color: var(--paper);
}

.contact-details p {
  margin: 0;
  color: color-mix(in srgb, var(--paper) 68%, transparent);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
}

/* ——— Footer ——— */
.site-footer {
  color: var(--muted);
  background: var(--paper);
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.footer-inner p { margin: 0; }
.footer-inner div { display: flex; gap: 20px; }

.footer-inner a {
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms ease;
}
.footer-inner a:hover { color: var(--accent); }

/* ——— Reveal ——— */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ——— Responsive ——— */
@media (max-width: 900px) {
  .menu-toggle {
    position: relative;
    z-index: 2;
    display: block;
  }

  .site-nav {
    position: fixed;
    inset: var(--header) 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    max-height: 0;
    padding: 0 24px;
    overflow: hidden;
    visibility: hidden;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    transition: max-height 280ms var(--ease), opacity 180ms ease, visibility 280ms;
  }

  .site-nav.is-open {
    max-height: calc(100svh - var(--header));
    padding-block: 12px 20px;
    visibility: visible;
    opacity: 1;
  }

  .site-nav a {
    display: flex;
    align-items: center;
    min-height: 48px;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 500;
  }

  .site-nav a.is-active::after { display: none; }

  .site-nav .nav-external {
    justify-content: center;
    min-height: 42px;
    margin-top: 10px;
    font-family: var(--sans);
    font-size: 14px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(200px, 0.55fr);
    gap: 36px;
  }

  .education-grid {
    gap: 40px;
  }
}

@media (max-width: 720px) {
  :root { --header: 58px; }

  .page-shell,
  .header-inner {
    width: min(calc(100% - 36px), var(--page));
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-top: calc(var(--header) + 40px);
    padding-bottom: 48px;
  }

  .hero h1 {
    font-size: clamp(2.1rem, 8vw, 2.75rem);
  }

  .hero h1 span {
    display: block;
    margin: 8px 0 0;
    font-size: 0.52em;
    vertical-align: initial;
  }

  .portrait-column {
    justify-self: start;
    width: min(70vw, 240px);
  }

  .education-grid,
  .contact-inner {
    grid-template-columns: 1fr;
  }

  .section {
    padding-block: 56px;
  }

  .section-heading {
    margin-bottom: 28px;
  }

  .section-heading-row {
    display: block;
  }

  .section-heading-row .section-link {
    display: inline-flex;
    margin-top: 14px;
  }

  .news-list li {
    grid-template-columns: 100px 1fr;
    gap: 14px;
  }

  .talk-list article {
    grid-template-columns: 56px 1fr;
    gap: 12px;
  }

  .contact-details {
    justify-self: start;
    text-align: left;
  }

  .contact-inner {
    gap: 28px;
    padding-block: 52px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    justify-content: center;
    min-height: 100px;
  }
}

@media (max-width: 480px) {
  body { font-size: 16px; }

  .hero-links { gap: 12px; }
  .button-primary { width: 100%; }

  .news-list li,
  .timeline li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .publication {
    grid-template-columns: 2rem 1fr;
    gap: 4px 10px;
    padding: 22px 0;
  }

  .talk-list article {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .talk-list time { padding-top: 0; }

  .experience-panel { padding: 20px; }

  .contact-details a {
    font-size: 0.95rem;
    overflow-wrap: anywhere;
  }

  .footer-inner div {
    flex-wrap: wrap;
    gap: 10px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
