
:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --ink: #11141a;
  --muted: #626977;
  --line: #dce1e9;
  --accent: #2f5bd3;
  --accent-soft: #e9efff;
  --header-bg: rgba(247, 248, 251, 0.88);
  --shadow: 0 18px 60px rgba(30, 42, 70, 0.1);
  font-family: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #101217;
  --surface: #171a21;
  --ink: #f1f3f8;
  --muted: #a4abb9;
  --line: #2b303b;
  --accent: #88a8ff;
  --accent-soft: #1d2a4e;
  --header-bg: rgba(16, 18, 23, 0.88);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  min-width: 320px;
  min-height: 100vh;
  flex-direction: column;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--accent), transparent 55%);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent);
}

.shell {
  width: min(100% - 2.5rem, 62rem);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  translate: 0 -200%;
  border-radius: 0.35rem;
  padding: 0.65rem 0.85rem;
  background: var(--ink);
  color: var(--bg);
}

.skip-link:focus {
  translate: 0;
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 4.5rem;
  gap: 2rem;
}

.wordmark {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 750;
  letter-spacing: 0.055em;
  text-decoration: none;
  text-transform: uppercase;
}

.site-header nav {
  display: flex;
  justify-content: flex-end;
  gap: clamp(0.9rem, 2.5vw, 1.8rem);
}

.site-header nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 580;
  text-decoration: none;
}

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

.theme-toggle {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
}

.theme-toggle:hover {
  color: var(--ink);
}

.home-main {
  display: grid;
  align-items: center;
  padding-block: clamp(4rem, 10vw, 7rem) clamp(5rem, 10vw, 8rem);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14.5rem;
  align-items: start;
  gap: clamp(3rem, 8vw, 6rem);
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1 {
  margin: 0 0 1.15rem;
  font-size: clamp(2.1rem, 4.5vw, 2.4rem);
  font-weight: 690;
  letter-spacing: -0.05em;
  line-height: 1.05;
}

.position-line {
  max-width: 42rem;
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.006em;
  line-height: 1.72;
}

.research-kicker {
  margin: 2.35rem 0 0.55rem;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.research-summary {
  max-width: 42rem;
  margin-top: 2.5rem;
}

.research-summary > h2 {
  margin: 0 0 0.8rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.012em;
  line-height: 1.35;
}

.research-statement,
.keywords-sentence {
  font-family: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
}

.research-statement {
  max-width: 39rem;
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.08rem, 0.98rem + 0.35vw, 1.2rem);
  letter-spacing: -0.009em;
  line-height: 1.63;
}

.keywords-sentence {
  max-width: 39rem;
  margin: 1.1rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.keywords-sentence strong {
  color: var(--ink);
  font-weight: 650;
}

.portrait-frame {
  width: 100%;
  margin: 0.25rem 0 0;
}

.portrait-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.2rem;
  filter: saturate(0.9) contrast(1.02);
}

.contact-block address {
  color: var(--muted);
  font-size: 0.94rem;
  font-style: normal;
  line-height: 1.65;
}

.contact-block address a {
  color: var(--accent);
  text-decoration: none;
}

.page-main {
  width: min(100% - 2.5rem, 54rem);
  margin-inline: auto;
  padding-block: clamp(4rem, 9vw, 6.5rem) 7rem;
}

.page-header {
  max-width: 42rem;
  margin-bottom: 4rem;
}

.page-header h1 {
  margin-bottom: 0.8rem;
  font-size: clamp(2.25rem, 5vw, 3.2rem);
}

.page-intro {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.teaching-main .page-header {
  margin-bottom: 1.35rem;
}

.section-tabs {
  display: flex;
  gap: 1.75rem;
  margin: 0 0 2.3rem;
  border-bottom: 1px solid var(--line);
}

.section-tabs a {
  position: relative;
  padding: 0.7rem 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 620;
  text-decoration: none;
}

.section-tabs a:hover,
.section-tabs a.is-current {
  color: var(--ink);
}

.section-tabs a.is-current::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
}

.section-tabs a:focus-visible {
  border-radius: 0.18rem;
  outline: 2px solid var(--accent);
  outline-offset: 0.25rem;
}

.content-section + .content-section {
  margin-top: 4.75rem;
}

.content-section > h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 0.9rem;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.65rem;
  font-size: 1.25rem;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.research-list,
.course-list,
.advising-list,
.event-list,
.cv-list,
.post-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.research-list > li,
.course-list > li,
.advising-list > li,
.event-list > li,
.cv-list > li,
.post-list > li {
  border-bottom: 1px solid var(--line);
}

.paper {
  padding: 1.25rem 0 1.35rem;
}

.paper h3 {
  margin: 0;
  font-size: 1.03rem;
  font-weight: 650;
  line-height: 1.48;
}

.paper h3 a {
  text-decoration: none;
}

.paper .authors,
.paper .status,
.paper .note {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.91rem;
}

.paper .status {
  color: var(--ink);
}

.paper-links,
.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.55rem;
}

.paper-links a,
.resource-links a {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
}

.paper-links a:hover,
.resource-links a:hover {
  text-decoration: underline;
}

.course,
.advising-entry,
.event,
.cv-entry {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1.75rem;
  padding: 1.4rem 0 1.55rem;
}

.term,
.event-date,
.cv-date {
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
}

.course h3,
.event h3,
.cv-entry h3 {
  margin: 0;
  font-size: 1.03rem;
  font-weight: 650;
  line-height: 1.45;
}

.advising-entry h4 {
  margin: 0;
  font-size: 1.03rem;
  font-weight: 650;
  line-height: 1.45;
}

.course h3 a,
.event h3 a {
  text-decoration: none;
}

.course p,
.advising-entry p,
.event p,
.cv-entry p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.advising-entry .advising-place {
  color: var(--ink);
}

.advising-entry .advising-topic {
  font-style: italic;
}

.course .reference-intro {
  margin-top: 1rem;
  color: var(--ink);
  font-weight: 600;
}

.reference-list {
  margin: 0.55rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.reference-list li + li {
  margin-top: 0.45rem;
}

.reference-list a {
  color: var(--accent);
}

.course .course-place,
.event .event-place,
.cv-entry .institution {
  color: var(--ink);
}

.contact-note {
  border-left: 2px solid var(--accent);
  margin: 1rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty-state {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  padding-block: 1.5rem;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.blog-main .page-header {
  margin-bottom: 2.25rem;
}

.blog-introduction {
  max-width: 44rem;
  margin-bottom: 3rem;
}

.blog-introduction p {
  margin: 0;
}

.blog-introduction p + p {
  margin-top: 1.25rem;
}

.tag-main .page-header {
  margin-top: 1.25rem;
}

.post-list {
  border-top: 1px solid var(--ink);
}

.post-card {
  padding: 1.5rem 0 1.8rem;
}

.post-card h2 {
  margin: 0;
  font-size: clamp(1.3rem, 2vw, 1.5rem);
  font-weight: 680;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.post-card h2 a {
  text-decoration: none;
}

.post-date {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
}

.post-summary {
  max-width: 40rem;
  margin: 0.6rem 0 0;
  color: var(--muted);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.85rem;
  margin: 0.65rem 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  list-style: none;
}

.post-tags li::before {
  margin-right: 0.08em;
  color: var(--accent);
  content: "#";
}

.post-tags a {
  text-decoration: none;
}

.back-link {
  margin: 0 0 1.35rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.back-link a {
  text-decoration: none;
}

.blog-article-header {
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.4rem;
}

.blog-article-header h1 {
  margin: 0;
}

.post-body {
  max-width: 48rem;
}

.post-body > p {
  max-width: 44rem;
  margin: 0 0 1rem;
}

.table-region {
  max-width: 100%;
  margin-top: 1.8rem;
  overflow-x: auto;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.table-region:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0.25rem;
}

.talk-count-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.94rem;
  line-height: 1.45;
}

.country-name-column {
  width: 24%;
}

.places-column {
  width: 62%;
}

.count-column {
  width: 14%;
}

.talk-count-table caption {
  padding: 0.8rem 0 0.65rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 650;
  text-align: left;
}

.talk-count-table th,
.talk-count-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0.6rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}

.talk-count-table thead th {
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.talk-count-table tbody th {
  color: var(--ink);
  font-weight: 600;
}

.talk-count-table th:first-child,
.talk-count-table td:first-child {
  padding-left: 0;
  padding-right: 2rem;
}

.talk-count-table th:last-child,
.talk-count-table td:last-child {
  padding-right: 0;
  text-align: right;
}

.talk-count-table tbody td:last-child {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.talk-count-table tbody tr:last-child th,
.talk-count-table tbody tr:last-child td {
  border-bottom: 0;
}

.not-found {
  display: grid;
  min-height: 65vh;
  place-content: center;
  text-align: center;
}

.not-found p {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: flex-end;
  gap: 2rem;
  padding-block: 1.5rem;
}

.footer-inner p {
  margin: 0;
  font-size: 0.82rem;
}

@media (max-width: 700px) {
  .shell,
  .page-main {
    width: min(100% - 1.5rem, 62rem);
  }

  .header-inner {
    grid-template-columns: auto 1fr;
    gap: 1rem;
  }

  .site-header nav {
    order: 3;
    grid-column: 1 / -1;
    justify-content: flex-start;
    gap: 0.85rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-header nav a {
    font-size: 0.875rem;
    padding-block: 0.25rem 0.75rem;
    white-space: nowrap;
  }

  .theme-toggle {
    justify-self: end;
  }

  .home-main {
    padding-top: 3.5rem;
  }

  .intro {
    grid-template-columns: minmax(0, 1fr) 9rem;
    gap: 2rem;
  }

  .portrait-frame {
    margin-top: 0;
  }

  .course,
  .advising-entry,
  .event,
  .cv-entry {
    grid-template-columns: 7rem 1fr;
    gap: 1.1rem;
  }

  .footer-inner {
    display: grid;
    gap: 0.35rem;
  }
}

@media (max-width: 540px) {
  .intro {
    grid-template-columns: 1fr;
  }

  .portrait-frame {
    order: -1;
    width: 8rem;
  }

  .page-header {
    margin-bottom: 3rem;
  }

  .course,
  .advising-entry,
  .event,
  .cv-entry {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .blog-main .page-header {
    margin-bottom: 2rem;
  }

  .post-card {
    padding-block: 1.25rem 1.5rem;
  }

  .talk-count-table th,
  .talk-count-table td {
    padding: 0.6rem 0.4rem;
  }

  .talk-count-table th:first-child,
  .talk-count-table td:first-child {
    padding-right: 1rem;
  }

  .talk-count-table thead th {
    font-size: 0.75rem;
  }

  .talk-count-table td,
  .talk-count-table tbody th {
    font-size: 0.9rem;
  }

  .country-name-column {
    width: 28%;
  }

  .places-column {
    width: 56%;
  }

  .count-column {
    width: 16%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
