/* Quiet academic typography, one accent, and a consistent section grid. */
:root {
  color-scheme: light;
  --background: #fafbfc;
  --text: #202a35;
  --muted: #515a67;
  --line: #dfe4e9;
  --accent: #245574;
  --accent-dark: #133952;
  --max-width: 960px;
  --link-line: #9aafbd;
  --selection: #dce8f0;
}

/* Honour the existing saved light/dark preference. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #04060d;
  --text: #ebeff7;
  --muted: #c0cada;
  --line: #303c50;
  --accent: #afcef5;
  --accent-dark: #dceaff;
  --link-line: #607995;
  --selection: #334965;
}

* { box-sizing: border-box; }
html { font-size: 106.25%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--link-line);
}
a:hover { color: var(--accent-dark); text-decoration-color: currentColor; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 1px; }
::selection { background: var(--selection); color: var(--text); }
.container { width: min(var(--max-width), calc(100% - 4rem)); margin-inline: auto; }
.skip-link { position: absolute; top: -100px; left: 1rem; padding: 0.5rem 1rem; background: var(--background); z-index: 2; }
.skip-link:focus { top: 0.5rem; }
.site-header { border-bottom: 1px solid var(--line); }
.nav-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; min-height: 5rem; }
.nav-controls { display: flex; align-items: center; gap: 1.5rem; }
.site-name { font-size: 0.9375rem; font-weight: 600; color: var(--text); text-decoration: none; }
.section-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; font-size: 0.9375rem; }
.section-tabs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; }
.section-tabs a:hover { color: var(--accent); text-decoration: underline; }
.theme-toggle { display: none; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.js .theme-toggle { display: inline-grid; }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.theme-icon { display: block; width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon-sun, :root[data-theme="dark"] .theme-icon-moon { display: none; }
:root[data-theme="dark"] .theme-icon-sun { display: block; }
section { scroll-margin-top: 2rem; }
.intro { padding: 4.75rem 0 2.75rem; }
.identity { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2rem; margin-bottom: 1.8rem; }
.eyebrow { margin: 0 0 0.9rem; color: var(--accent); font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.5rem, 2.5vw, 1.75rem); font-style: italic; font-weight: 400; line-height: 1.3; letter-spacing: 0; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.65rem, 5.7vw, 4.25rem); font-weight: 400; letter-spacing: -0.046em; line-height: 1.08; }
.affiliation { margin: 0; padding-left: 1.5rem; border-left: 1px solid var(--line); color: var(--muted); font-size: 0.9375rem; line-height: 1.65; }
.affiliation > span { display: block; }
.affiliation > span:first-child { margin-bottom: 0.25rem; font-weight: 500; color: var(--text); }
p { margin: 0; }
.bio { max-width: 720px; font-size: 1.0625rem; }
.academic-links, .item-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.4rem; font-size: 0.9375rem; }
.academic-links { margin-top: 1.2rem; }
.academic-links a, .item-links a { display: inline-flex; align-items: center; min-height: 44px; }
.section { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 2rem; padding: 2.5rem 0; border-top: 1px solid var(--line); }
h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.375rem; font-weight: 400; line-height: 1.5; }
.research-section { padding-block: 1.8rem; }
.interest-list { display: grid; grid-template-columns: 1fr 1.2fr; gap: 0.25rem 1.25rem; list-style: none; margin: 0; padding: 0; font-size: 0.9375rem; }
.news-list, .publication-list { list-style: none; margin: 0; padding: 0; min-width: 0; }
.news-list li { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 1.5rem; }
.news-list li + li { margin-top: 1.5rem; }
.news-list time { padding-top: 0.15rem; color: var(--muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.news-list p { line-height: 1.75; }
.news-list a { text-decoration: none; }
.news-list a:hover { text-decoration: underline; }
strong { font-weight: 600; }
/* Equal date gutters and centred markers keep every entry on one axis. */
.publication-list { --date-width: 6.5rem; --marker-width: 1rem; --timeline-gap: 1.25rem; }
.publication-list > li {
  position: relative;
  display: grid;
  grid-template-columns: var(--date-width) var(--marker-width) minmax(0, 1fr);
  column-gap: var(--timeline-gap);
  padding-bottom: 2.5rem;
}
.publication-list > li:last-child { padding-bottom: 0; }
.publication-list > li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: calc(var(--date-width) + var(--timeline-gap) + var(--marker-width) / 2);
  top: 0.8rem;
  bottom: -0.8rem;
  width: 1px;
  background: var(--link-line);
  transform: translateX(-50%);
}
.publication-date { font-size: 0.9375rem; line-height: 1.6; text-align: right; font-variant-numeric: tabular-nums; }
.publication-date time { display: block; color: var(--text); font-weight: 500; }
.publication-date time span { display: block; color: var(--muted); font-weight: 400; }
.timeline-marker { position: relative; z-index: 1; justify-self: center; margin-top: 0.4875rem; width: 0.625rem; height: 0.625rem; border: 2px solid var(--accent); border-radius: 50%; background: var(--background); }
.publication-list article { min-width: 0; }
.publication-venue { margin-bottom: 0.55rem; font-size: 0.9375rem; color: var(--accent); font-weight: 500; line-height: 1.6; }
.publication-type { margin-top: 0.4rem; font-size: 0.9375rem; color: var(--muted); }
.publication-type span { margin-inline: 0.3rem; }
h3 { margin: 0; max-width: 650px; font-size: 1.125rem; font-weight: 600; line-height: 1.5; letter-spacing: -0.012em; }
.authors { margin-top: 0.5rem; color: var(--muted); font-size: 0.9375rem; }
.item-links { margin-top: 0.3rem; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; margin-top: 1rem; padding-block: 1.5rem 2.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8125rem; }
.site-footer span { margin-inline: 0.35rem; }

@media (max-width: 760px) {
  .container { width: calc(100% - 3rem); }
  .intro { padding-top: 3rem; }
  .identity { grid-template-columns: 1fr; gap: 1.4rem; }
  .affiliation { border: 0; padding: 0; }
  .desktop-break { display: none; }
  .section { grid-template-columns: 1fr; gap: 1.25rem; padding-block: 2rem; }
  .research-section { gap: 0.8rem; }
  .nav-bar { flex-wrap: wrap; padding-block: 0.8rem; gap: 0 1rem; }
  .section-tabs { gap: 0 1.1rem; }
}
@media (max-width: 480px) {
  .container { width: calc(100% - 2.5rem); }
  .nav-bar { align-items: flex-start; flex-direction: column; }
  .site-name { padding-top: 0.25rem; }
  .nav-controls { width: 100%; gap: 0.6rem; }
  .section-tabs { flex: 1; width: 100%; justify-content: space-between; gap: 0 0.5rem; }
  .intro { padding-block: 2.5rem 2rem; }
  .interest-list { grid-template-columns: 1fr; gap: 0.35rem; }
  .news-list li { grid-template-columns: 1fr; gap: 0.4rem; }
  .site-footer { flex-direction: column; }
  .publication-list > li { grid-template-columns: 0.75rem minmax(0, 1fr); gap: 0.8rem 1rem; padding-bottom: 2.25rem; }
  .publication-list > li:not(:last-child)::before { left: 0.375rem; }
  .publication-date { grid-column: 2; grid-row: 1; text-align: left; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.75rem; }
  .publication-date time span { display: inline; }
  .timeline-marker { grid-column: 1; grid-row: 1; }
  .publication-list article { grid-column: 2; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  :root[data-theme] { --text: #202a35; --muted: #5c6672; --accent: #245574; --line: #dfe4e9; }
  body { background: white; color: black; font-size: 10pt; }
  .container { width: 100%; }
  .site-header, .skip-link { display: none; }
  .intro { padding-top: 0; }
  .section { padding-block: 1.25rem; }
  .publication-list li, .news-list li { break-inside: avoid; }
  a { color: inherit; }
}

/* Fade only colours after a theme interaction; initial page paint stays instant. */
@media (prefers-reduced-motion: no-preference) {
  :root.theme-transitions,
  :root.theme-transitions *,
  :root.theme-transitions *::before,
  :root.theme-transitions *::after {
    transition-property: background-color, color, border-color, text-decoration-color, fill, stroke;
    transition-duration: 320ms;
    transition-timing-function: cubic-bezier(0.2, 0, 0.2, 1);
  }
}
