/* Quiet academic style: system sans for text, Georgia for display headings. */

:root {
  --bg: #fff;
  --text: #202124;
  --muted: #62645f;
  --accent: #315c49;
  --line: #dedfd9;
  --thumb-bg: #f6f6f3;
  --serif: Georgia, 'Times New Roman', serif;
  font: 16px/1.65 system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent); text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
img { max-width: 100%; height: auto; }

.skip-link {
  position: absolute; z-index: 100; top: 8px; left: 16px;
  padding: 8px 16px; background: var(--bg); transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---------- Shell: header + footer ---------- */
.shell { width: min(100% - 64px, 1160px); margin: 0 auto; }

.header {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 16px 32px; padding: 30px 0 24px; border-bottom: 1px solid var(--line);
}
.site-name { color: var(--text); font-size: 15px; font-weight: 500; letter-spacing: -.03em; text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current] { color: var(--accent); text-decoration: underline; }

.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px;
  margin-top: 48px; padding: 24px 0 32px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px;
}

/* ---------- Shared bits ---------- */
.eyebrow { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.text-link { font-size: 13px; font-weight: 500; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* ---------- Home: intro ---------- */
.intro {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 34px; padding: 62px 0 64px; align-items: start;
}
.intro h1 { margin-bottom: 17px; font: 400 clamp(39px, 5vw, 52px)/1.09 var(--serif); letter-spacing: -.045em; }
.profile-photo {
  display: block; width: 152px; height: 190px; margin-bottom: 24px;
  object-fit: cover; object-position: 50% 15%; border-radius: 6px; border: 1px solid var(--line);
}
.tagline { font-size: 15px; color: var(--muted); }
.profile-links { display: grid; grid-template-columns: repeat(4, max-content); gap: 10px 22px; margin-top: 22px; font-size: 14px; }
.profile-links a { display: inline-flex; align-items: center; gap: 6px; }
.profile-links svg { flex-shrink: 0; }
.bio { font-size: 15px; line-height: 1.7; }
.bio p + p { margin-top: 12px; }
.intro .text-link { display: inline-block; margin-top: 20px; }

/* ---------- Home: sections ---------- */
.home-section { margin-top: 40px; }
.home-section h2, .section-head h2 { font-size: 18px; font-weight: 500; line-height: 1.4; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 18px; }

/* Focus | project | resources table (home "Selected research" and Projects page) */
.research-row {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) 105px;
  gap: 20px; border-top: 1px solid var(--line);
}
.research-row.head { padding: 14px 0; font-size: 12px; color: var(--muted); }
.research-row.head span:last-child { text-align: right; }
.project { padding: 26px 0 32px; }
.project .focus { font-size: 13px; line-height: 1.55; color: var(--muted); }
.project h3 { font-size: 20px; font-weight: 500; line-height: 1.45; letter-spacing: -.025em; }
.project .summary { margin-top: 10px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.project figure { margin: 20px 0 0; padding: 12px; background: #fff; border-radius: 5px; }
.project figure a, .project figure img { display: block; width: 100%; }
.project figure a { cursor: zoom-in; }
.resources { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; margin-top: 3px; font-size: 13px; }

.news { max-height: 300px; margin-top: 20px; overflow-y: auto; scrollbar-width: thin; }
.news li {
  display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 13px;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.6;
}
.news time { color: var(--muted); white-space: nowrap; }

.more {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  margin-top: 40px; padding-top: 25px; border-top: 1px solid var(--line);
}
.more h3 { font-size: 17px; font-weight: 500; }
.more p { margin: 6px 0 12px; font-size: 13px; color: var(--muted); }

/* ---------- Inner pages ---------- */
.page-heading { padding: 56px 0 40px; }
.page-heading h1 { font: 400 clamp(40px, 6vw, 54px)/1.15 var(--serif); letter-spacing: -.04em; }
.page-heading p { margin-top: 20px; color: var(--muted); font-size: 15px; line-height: 1.8; }

.section-title {
  margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
  font: 400 25px/1.3 var(--serif); letter-spacing: -.025em;
}
.section-title:not(:first-child) { margin-top: 44px; }

/* Research page: topic sidebar + papers */
.pub-layout { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 40px; align-items: start; }
.pub-nav { position: sticky; top: 24px; }
.pub-nav-title { margin-bottom: 14px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.pub-nav a {
  display: block; padding: 5px 0 5px 10px; border-left: 2px solid var(--line);
  color: var(--muted); font-size: 12px; line-height: 1.5; text-decoration: none;
}
.pub-nav a:hover { color: var(--accent); border-color: var(--accent); }
.pub-section { scroll-margin-top: 24px; }
.pub-section + .pub-section { margin-top: 44px; }

.pub { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.pub-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; border: 1px solid var(--line); border-radius: 3px; background: var(--thumb-bg); }
.pub-title { font: 400 18px/1.4 var(--serif); }
.pub-venue { margin-top: 6px; font-size: 12px; font-style: italic; color: var(--muted); }
.pub-authors { font-size: 12px; color: var(--muted); }
.pub-authors b { color: var(--text); font-weight: 600; }
.pub-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12px; }
.pub-links a { text-decoration: none; }
.pub-links a:hover { text-decoration: underline; }

/* Experience page */
.exp { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 28px; align-items: center; padding: 12px 0 24px; }
.exp + .exp { padding-top: 24px; border-top: 1px solid var(--line); }
.exp.no-logo { grid-template-columns: minmax(0, 1fr); }
.exp-logo { display: block; width: 100%; max-height: 64px; object-fit: contain; }
.exp-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 24px; }
.exp-title { font: 400 23px/1.4 var(--serif); letter-spacing: -.02em; }
a.exp-title { color: inherit; text-decoration-color: var(--line); }
a.exp-title:hover { color: var(--accent); }
.exp-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.exp-role { margin-top: 8px; font-size: 14px; line-height: 1.7; }
.exp ul { margin-top: 6px; padding-left: 18px; list-style: disc; font-size: 13px; color: var(--muted); }
/* Certifications list */
.certs li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px 24px;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.certs li > div { flex: 1; min-width: 0; }
.cert-logo { flex-shrink: 0; align-self: center; width: 40px; height: 40px; object-fit: contain; }
.cert-name { display: block; font: 400 17px/1.4 var(--serif); }
.cert-meta { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.certs a { flex-shrink: 0; font-size: 13px; }

.exp-side-link { float: right; margin-left: 24px; white-space: nowrap; }
.exp-side-link a + a { margin-left: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .pub-layout { display: block; }
  .pub-nav { display: none; }
}

@media (max-width: 760px) {
  .shell { width: calc(100% - 40px); }
  .intro { grid-template-columns: 1fr; gap: 28px; padding: 44px 0 48px; }
  .research-row.head { display: none; }
  .research-row { grid-template-columns: 1fr; gap: 10px; }
  .resources { flex-direction: row; flex-wrap: wrap; align-items: start; gap: 12px 18px; margin-top: 5px; }
}

@media (max-width: 560px) {
  .nav { gap: 0 12px; font-size: 13px; }
  .profile-links { grid-template-columns: repeat(2, max-content); }
  .page-heading { padding: 38px 0 30px; }
  .pub { grid-template-columns: 1fr; gap: 12px; }
  .exp { grid-template-columns: 60px minmax(0, 1fr); gap: 18px; align-items: start; }
  .exp-title { font-size: 20px; }
}

@media (max-width: 400px) {
  .section-head { flex-direction: column; gap: 8px; }
  .more { grid-template-columns: 1fr; gap: 24px; }
  .news li { grid-template-columns: 1fr; gap: 3px; }
  .project figure { padding: 6px; }
  .project h3 { font-size: 18px; }
}

@media (pointer: coarse) {
  .nav a, .resources a, .profile-links a { display: inline-flex; align-items: center; min-height: 44px; }
}

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