:root {
  color-scheme: light;
  --background: #fbfcfe;
  --surface: #ffffff;
  --text: #253142;
  --muted: #647184;
  --subtle: #8894a4;
  --line: #e1e7ef;
  --accent: #1674b8;
  --accent-hover: #0b5f99;
  --accent-soft: #edf6fc;
  --header: rgba(251, 252, 254, 0.93);
  --sans: "Inter", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --content-width: 850px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --background: #111820;
  --surface: #171f29;
  --text: #e8edf3;
  --muted: #abb5c2;
  --subtle: #7f8b99;
  --line: #2b3643;
  --accent: #65bff0;
  --accent-hover: #91d5f6;
  --accent-soft: #172b38;
  --header: rgba(17, 24, 32, 0.93);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--text); font: 400 16px/1.72 var(--sans); transition: background 180ms ease, color 180ms ease; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--accent); color: var(--surface); }

.skip-link { position: fixed; z-index: 100; top: -4rem; left: 1rem; padding: 0.65rem 0.85rem; background: var(--accent); color: var(--surface); }
.skip-link:focus { top: 1rem; }

.site-header { position: sticky; z-index: 20; top: 0; border-bottom: 1px solid var(--line); background: var(--header); backdrop-filter: blur(12px); }
.header-inner { width: min(calc(100% - 2.5rem), 1040px); min-height: 64px; display: flex; align-items: center; gap: 2rem; margin-inline: auto; }
.site-name { margin-right: auto; color: var(--text); font-weight: 700; text-decoration: none; }
.site-header nav { display: flex; align-items: center; gap: 1.35rem; }
.site-header nav a { color: var(--muted); font-size: 0.74rem; font-weight: 500; text-decoration: none; }
.site-header nav a:hover { color: var(--accent); }
.site-header nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.theme-toggle { position: relative; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: var(--surface); cursor: pointer; }
.theme-toggle span { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity 150ms ease, transform 150ms ease; }
.dark-icon { opacity: 0; transform: rotate(-25deg); }
[data-theme="dark"] .light-icon { opacity: 0; transform: rotate(25deg); }
[data-theme="dark"] .dark-icon { opacity: 1; transform: rotate(0); }

main, footer { width: min(calc(100% - 2.5rem), var(--content-width)); margin-inline: auto; }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: center; gap: clamp(2.5rem, 7vw, 5rem); padding: clamp(5rem, 11vw, 8rem) 0 clamp(4rem, 8vw, 6rem); }
.intro-copy { min-width: 0; }
.profile-photo-link { display: block; border-radius: 50%; }
.profile-photo { display: block; width: 100%; height: auto; aspect-ratio: 1; border: 4px solid var(--surface); border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line), 0 14px 36px rgba(30, 74, 110, 0.13); transition: box-shadow 180ms ease, transform 180ms ease; }
.profile-photo-link:hover .profile-photo { box-shadow: 0 0 0 1px var(--accent), 0 16px 40px rgba(30, 74, 110, 0.18); transform: translateY(-2px); }
.eyebrow { margin: 0 0 0.6rem; color: var(--accent); font-size: 0.8rem; font-weight: 600; }
h1 { margin: 0; font: 600 clamp(3rem, 8vw, 5.5rem)/1.03 var(--serif); letter-spacing: -0.04em; }
.role { margin: 1.25rem 0 0; color: var(--text); font: 400 clamp(1.15rem, 3vw, 1.5rem)/1.5 var(--serif); }
.affiliation { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.92rem; }
.social-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.3rem; margin: 1.75rem 0 0; padding: 0; list-style: none; }
.social-links a { display: inline-flex; align-items: center; gap: 0.42rem; font-size: 0.8rem; font-weight: 500; }
.social-links i { width: 1rem; text-align: center; }

main > section:not(.intro) { padding: 3.5rem 0; border-top: 1px solid var(--line); scroll-margin-top: 76px; }
h2 { display: flex; align-items: center; gap: 0.7rem; margin: 0 0 1.5rem; font: 600 1.65rem/1.3 var(--serif); }
.section-icon { width: 2rem; height: 2rem; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--accent); background: var(--accent-soft); font: 0.76rem var(--sans); }
h3 { font-family: var(--serif); }
section > p { max-width: 760px; }
section > p + p { margin-top: 1.1rem; }
.section-note { margin-top: -0.8rem; color: var(--muted); font: 0.95rem/1.65 var(--serif); }

.dated-list { margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.dated-list li { display: grid; grid-template-columns: 115px 1fr; gap: 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.dated-list time { padding-top: 0.12rem; color: var(--subtle); font-size: 0.72rem; font-weight: 500; }
.dated-list span { font: 0.98rem/1.55 var(--serif); }

.publication-group { display: grid; grid-template-columns: 72px 1fr; gap: 1.5rem; margin-top: 2.4rem; }
.publication-group > h3 { margin: 0.15rem 0 0; color: var(--accent); font-size: 1.05rem; }
.publication-list { margin: 0; padding: 0; list-style: none; counter-reset: publications; }
.publication-list li { counter-increment: publications; position: relative; display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: 0 0 1.25rem 2rem; }
.publication-list li::before { content: counter(publications) "."; position: absolute; left: 0; top: 0.15rem; color: var(--subtle); font-size: 0.68rem; }
.publication-list p { margin: 0; color: var(--muted); font: 0.93rem/1.58 var(--serif); }
.publication-list strong { color: var(--text); font-weight: 600; }
.publication-list li > a, .status { align-self: start; padding: 0.08rem 0.32rem; border: 1px solid var(--line); border-radius: 3px; font-size: 0.58rem; font-weight: 600; line-height: 1.6; letter-spacing: 0.04em; text-decoration: none; text-transform: uppercase; }
.status { color: var(--subtle); }
.award { color: var(--accent); }
.publication-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.3rem; margin-top: 1.4rem; }
.publication-actions a { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.72rem; font-weight: 500; }
.publication-actions .primary-link { padding: 0.55rem 0.8rem; border-radius: 4px; background: var(--accent); color: var(--surface); text-decoration: none; }
.publication-actions .primary-link:hover { background: var(--accent-hover); }
.generated-placeholder { padding: 1rem 1.2rem; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--muted); font: 0.9rem var(--serif); }

.project-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 1rem; }
.project-list article { display: flex; flex-direction: column; padding: 1.25rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease; }
.project-list article:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(30, 74, 110, 0.08); }
.project-list h3 { margin: 0 0 0.55rem; font-size: 1.28rem; }
.project-list h3 a { text-decoration: none; }
.project-list h3 span { font: 0.7rem var(--sans); }
.project-list p { margin: 0; color: var(--muted); font: 0.96rem/1.55 var(--serif); }
.project-list small { display: block; margin-top: 0.75rem; color: var(--subtle); font-size: 0.63rem; line-height: 1.5; }
.more-link { margin-top: 1.25rem; font-size: 0.78rem; }
/*.thesis-list { margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }*/
/*.thesis-list li { display: grid; grid-template-columns: 145px 1fr; gap: 1.5rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }*/
.thesis-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.thesis-list li {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 1.5rem;
  padding: 0.5rem 0;
}

.thesis-list li + li {
  margin-top: 0.25rem;
}

#theses > .publication-group + .publication-group {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}
.thesis-meta { display: flex; flex-direction: column; gap: 0.15rem; }
.thesis-meta time { color: var(--accent); font-size: 0.72rem; font-weight: 600; }
.thesis-meta span { color: var(--subtle); font-size: 0.63rem; }
.thesis-list p { margin: 0; font: 1rem/1.55 var(--serif); }
.thesis-list p a { color: var(--text); text-decoration: none; }
.thesis-list p a:hover { color: var(--accent); }
.thesis-list p a span { color: var(--accent); font: 0.7rem var(--sans); }
.address { color: var(--muted); font-size: 0.82rem; }

footer { min-height: 100px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--subtle); font-size: 0.68rem; }

.publications-page { padding-top: 0.1px; }
.page-heading { padding: clamp(4rem, 9vw, 6.5rem) 0 3.5rem; }
.page-heading h1 { margin-top: 0.5rem; font-size: clamp(3rem, 8vw, 5rem); }
.page-heading > p:last-of-type { max-width: 650px; margin: 1rem 0 0; color: var(--muted); font: 1.08rem/1.6 var(--serif); }
.page-heading .eyebrow a { text-decoration: none; }
.publication-archive { padding: 2.5rem 0 !important; }
.publication-archive .publication-group { display: block; margin-top: 0; }
.publication-archive .publication-group > h2 { margin: 0 0 1.4rem; padding-bottom: 0.65rem; border-bottom: 1px solid var(--line); color: var(--accent); font: 600 1.1rem/1.4 var(--serif); }

@media (max-width: 800px) {
  .header-inner { flex-wrap: wrap; gap: 0.75rem; padding: 0.75rem 0; }
  .site-name { width: calc(100% - 50px); }
  .theme-toggle { order: 2; }
  .site-header nav { order: 3; width: 100%; gap: 0.9rem; overflow-x: auto; padding-bottom: 0.15rem; scrollbar-width: none; }
  .site-header nav::-webkit-scrollbar { display: none; }
  .site-header nav a { white-space: nowrap; }
  main > section:not(.intro) { scroll-margin-top: 110px; }
  .intro { grid-template-columns: minmax(0, 1fr) 180px; gap: 2rem; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .intro { grid-template-columns: 1fr; gap: 2rem; padding-top: 3.5rem; }
  .intro-copy { grid-row: 2; }
  .profile-photo-link { grid-row: 1; width: 140px; }
  .publication-group { grid-template-columns: 1fr; gap: 0.7rem; }
  .publication-list li { grid-template-columns: 1fr; gap: 0.5rem; }
  .publication-list li > a, .status { width: max-content; }
  .dated-list li { grid-template-columns: 90px 1fr; }
  .thesis-list li { grid-template-columns: 1fr; gap: 0.55rem; }
  .thesis-meta { flex-direction: row; gap: 0.6rem; align-items: center; }
  .project-list { grid-template-columns: 1fr; }
  footer { min-height: 120px; flex-direction: column; justify-content: center; gap: 0.6rem; }
}

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