:root {
  --bg: #fdfcfa;
  --ink: #1d2430;
  --muted: #5d6675;
  --rule: #e2ddd3;
  --accent: #13294b;
  --link: #0a58ca;
  --warm: #c8501a;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: "Source Sans 3", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161d;
    --ink: #e4e6ea;
    --muted: #9aa3b2;
    --rule: #2a313d;
    --accent: #e9ecf2;
    --link: #7fb2ff;
    --warm: #f08a55;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 76rem; margin: 0 auto; padding: 0 2rem; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
main a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
main a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--warm); outline-offset: 3px; border-radius: 2px; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: 0.25rem 1.5rem;
  padding-top: 0.9rem; padding-bottom: 0.9rem;
}
.site-name { font: 600 1.15rem/1.2 var(--serif); color: var(--accent); }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-header nav a { color: var(--muted); font-size: 0.95rem; letter-spacing: 0.02em; }
.site-header nav a:hover { color: var(--accent); }

/* intro */
.intro {
  display: grid; grid-template-columns: 17rem 1fr; gap: 3rem;
  align-items: start; padding: 3.5rem 0 1rem;
}
.portrait { width: 100%; height: auto; border-radius: 4px; display: block; }
h1 { font: 600 2.6rem/1.1 var(--serif); color: var(--accent); margin: 0 0 1.1rem; letter-spacing: -0.01em; }
.intro p { margin: 0 0 1rem; text-align: justify; }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.4rem; margin-top: 1.6rem !important; font-size: 0.98rem; }

/* sections */
section[id] { padding-top: 3.25rem; }
h2 {
  font: 600 1.7rem/1.2 var(--serif); color: var(--accent);
  margin: 0 0 0.4rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--rule);
}
.papers + h2 { margin-top: 3.25rem; }

/* papers */
.papers { list-style: none; margin: 0; padding: 0; }
.papers li { padding: 0.95rem 0; border-bottom: 1px solid var(--rule); }
.papers li:first-child { padding-top: 0.5rem; }
.papers li:last-child { border-bottom: 0; }
.papers span, .papers a.title { display: block; }
.title { font: 600 1.14rem/1.35 var(--serif); color: var(--ink); }
a.title { color: var(--link); }
.authors, .venue { color: var(--muted); font-size: 0.98rem; }
.authors { margin-top: 0.2rem; }
.venue em { color: var(--ink); font-weight: 600; }
.note { color: var(--warm); font-size: 0.92rem; margin-top: 0.15rem; }

address { font-style: normal; font-size: 0.92rem; line-height: 1.3; margin-top: 0.9rem; }

.site-footer { margin-top: 4rem; padding-top: 1.25rem; padding-bottom: 2.5rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.9rem; }
.site-footer p { margin: 0; }

@media (max-width: 42rem) {
  .intro { grid-template-columns: 1fr; gap: 1.75rem; padding-top: 2.25rem; }
  .portrait { max-width: 12rem; }
  h1 { font-size: 2.1rem; }
}

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

/* cv page */
.cv { max-width: 62rem; padding-top: 2.5rem; }
.cv-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem; margin-bottom: 1.25rem; }
.cv-head h1 { font-size: 2rem; margin: 0; }
.cv-pages canvas {
  display: block; width: 100%; height: auto; margin: 0 0 1.25rem;
  background: #fff; border: 1px solid var(--rule); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}
.cv-pages p { color: var(--muted); }
.site-header nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
