:root {
  --ink: #223038;
  --muted: #6d7a80;
  --line: #d9e0e2;
  --line-strong: #c4cdd0;
  --paper: #ffffff;
  --wash: #f7f9f9;
  --accent: #2c6670;
  --accent-dark: #1f4f57;
  --gold: #aa844e;
  --max: 1080px;
}

* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.96rem;
  line-height: 1.38;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.13em;
  transition: color .15s ease;
}
a:hover { color: var(--accent-dark); }

#header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 30px 28px 14px;
}
#header:after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin-top: 12px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}
#header h1 {
  margin: 0;
  color: #17242b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 4.5vw, 3.65rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.035em;
}
#header h1 img {
  width: 37px;
  height: 40px;
  object-fit: contain;
  margin-left: .32rem;
  vertical-align: 8%;
}

#menu {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.98);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 3px 14px rgba(20,30,34,.035);
}
#menu ul {
  display: flex;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
  gap: 22px;
  list-style: none;
  overflow-x: auto;
}
#menu li { margin: 0; padding: 0; white-space: nowrap; }
#menu a {
  position: relative;
  display: block;
  padding: 9px 1px 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
#menu a:after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .18s ease;
}
#menu a:hover:after, #menu a.current:after { transform: scaleX(1); }
#menu a.current { color: var(--accent); }

#content {
  display: grid;
  grid-template-columns: 190px minmax(0,1fr);
  gap: 22px;
  align-items: start;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 28px 52px;
}
#columnA { grid-column: 2; grid-row: 1; min-width: 0; }
#columnB { grid-column: 1; grid-row: 1; min-width: 0; color: var(--muted); }

#columnB .page-photo {
  margin: 0;
  padding: 0 12px 0 0;
  border-right: 2px solid rgba(170,132,78,.45);
}
#columnB .page-photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  padding: 4px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(25,35,42,.065);
}
#columnB .page-photo figcaption {
  margin-top: 7px;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.28;
}

#columnA ul, #columnA ol {
  margin: 0;
  padding-left: 0;
}
#columnA li {
  position: relative;
  margin: .06rem 0;
  line-height: 1.34;
}
#columnA > ul { list-style: none; }
#columnA > ul > li { padding-left: .86rem; }
#columnA > ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .60em;
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 1px;
}
#columnA > ul + ul {
  margin-top: .78rem;
  padding-top: .62rem;
  border-top: 1px solid var(--line-strong);
}
#columnA > ul > li > ul,
#columnA > ul > li > ol {
  margin: .22rem 0 .34rem;
  padding-left: 1rem;
}
#columnA > ul > li > ul > li,
#columnA > ul > li > ol > li {
  padding-left: .7rem;
}
#columnA > ul > li > ul > li::before,
#columnA > ul > li > ol > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .61em;
  width: 3px;
  height: 3px;
  background: var(--line-strong);
}

p { margin: .25rem 0 .48rem; }
#columnA p { line-height: 1.36; }
strong, b { font-weight: 700; }
hr { margin: .9rem 0; border: 0; border-top: 1px solid var(--line); }

#footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #fafbfb, var(--wash));
  color: var(--muted);
}
#footer p {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 28px;
  font-size: .70rem;
  line-height: 1.35;
  letter-spacing: .01em;
}

#columnA h1, #columnA h2, #columnA h3 {
  color: #243239;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.2;
}
#columnA h2 { margin: 0 0 .55rem; font-size: 1.30rem; }
#columnA h3 { margin: .82rem 0 .28rem; font-size: 1.08rem; }

/* Home */
.home #content { grid-template-columns: 190px minmax(0,1fr); gap: 16px; padding-top: 23px; }
.home #columnB .page-photo { padding-right: 10px; }
.home #columnB .page-photo img { padding: 0; border: 0; box-shadow: 0 10px 24px rgba(25,35,42,.09); }
.home #columnA > ul:first-child > li:first-child { font-family: Georgia, "Times New Roman", serif; font-size: 1.06rem; color: #243239; }
.home .contact-divider { width: 100%; margin: .62rem 0 .78rem; border-top: 1px solid var(--gold); }

/* Research */
body.research #columnA .research-sections { padding-left: 0; margin-left: 0; }
body.research #columnA .research-sections > li.section-title {
  display: block;
  width: 100%;
  margin: 1rem 0 .38rem;
  padding: .68rem 0 0;
  border-top: 1px solid var(--line-strong);
  list-style: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
  font-weight: 500;
  line-height: 1.2;
  color: #243239;
}
body.research #columnA .research-sections > li.section-title:first-child { margin-top: .52rem; }
body.research #columnA .research-sections > li.section-title::before,
body.research #columnA .research-sections > li.section-title::marker { content: none !important; display: none !important; }
body.research #columnA .research-sections > li.section-title > strong { display: block; margin: 0; padding: 0; font: inherit; color: inherit; }
body.research #columnA .research-sections > li.section-content { list-style: none; margin: 0; padding: 0; }
body.research #columnA .research-sections > li.section-content::before,
body.research #columnA .research-sections > li.section-content::marker { content: none !important; display: none !important; }
body.research #columnA .research-sections > li.section-content > ul { margin: 0; padding-left: 0; list-style: none; }
body.research #columnA .research-sections > li.section-content > ul > li { padding-left: .86rem; }
body.research #columnA .research-sections > li.section-content > ul > li::before {
  content: ""; position: absolute; left: 0; top: .60em; width: 4px; height: 4px; background: var(--gold); border-radius: 1px;
}
body.research #columnA ul.subprojects { margin: .18rem 0 .42rem 1.35rem !important; padding: 0 !important; list-style: none !important; }
body.research #columnA ul.subprojects > li { margin: .08rem 0 !important; padding: 0 !important; list-style: none !important; }
body.research #columnA ul.subprojects > li::before,
body.research #columnA ul.subprojects > li::marker { content: none !important; display: none !important; }

/* Presentations */
.presentations #columnA h2 {
  margin: 0 0 .68rem;
  padding: 0 0 .52rem;
  border-bottom: 1px solid var(--line-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.30rem;
  font-weight: 500;
  line-height: 1.2;
  color: #243239;
}
.presentations #columnA > ul { margin: 0; padding: 0; list-style: none; }
.presentations #columnA > ul > li { margin: .16rem 0; padding-left: .86rem; line-height: 1.34; }
.presentations #columnA > ul > li::before { content: ""; position: absolute; left: 0; top: .61em; width: 4px; height: 4px; background: var(--gold); border-radius: 1px; }

/* Publications */
.publications #columnA { font-size: .94rem; }
.publications #columnA br + br { line-height: .35; }
.publications #columnB .page-photo img { max-height: 590px; object-fit: cover; object-position: center; }

/* Teaching */
.teaching #columnB .page-photo img { max-height: 560px; object-fit: cover; object-position: center; }

/* Links */
.links #content { grid-template-columns: 158px minmax(0,1fr); gap: 24px; padding-top: 25px; }
.links #columnB { grid-column: 1; grid-row: 1; align-self: start; }
.links #columnA { grid-column: 2; grid-row: 1; align-self: start; }
.links #columnB .page-photo { margin: 0; padding: 0; border-right: 0; }
.links #columnB .page-photo img { display: block; width: 158px; height: 381px; max-width: none; max-height: none; padding: 0; border: 0; box-shadow: none; object-fit: cover; }
.links #columnA .links-list { margin: 0; padding: 0; list-style: none; }
.links #columnA .links-list li { margin: 0; padding: .30rem 0 .30rem 1rem; line-height: 1.38; list-style: none; }
.links #columnA .links-list li::before { content: ""; position: absolute; left: 0; top: .88rem; width: .28rem; height: .28rem; background: var(--gold); }
.links #columnA .links-list li::marker { content: none; }

@media (max-width: 820px) {
  #header { padding: 27px 20px 13px; }
  #header h1 img { width: 34px; height: 37px; }
  #menu ul { padding: 0 20px; gap: 18px; }
  #content, .home #content, .links #content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 24px 20px 42px;
  }
  #columnB, #columnA, .links #columnB, .links #columnA { grid-column: 1; }
  #columnB { grid-row: 1; }
  #columnA { grid-row: 2; }
  #columnB .page-photo { max-width: 250px; padding-right: 10px; }
  .home #content { gap: 12px; }
  .home #columnB { margin-bottom: 0; }
  .links #columnB .page-photo img { width: 158px; height: 381px; }
}

@media print {
  #menu { position: static; box-shadow: none; }
  #content, .home #content { display: block; max-width: none; padding: 20px; }
  body { font-size: 11pt; }
  a { color: inherit; }
}

/* Home QR code */
.home .home-qr { margin-top: 12px; width: 82px; }
.home .home-qr img { display: block; width: 82px; height: 82px; object-fit: contain; border: 1px solid var(--line-strong); background: #fff; padding: 3px; box-sizing: border-box; }

/* Home QR refinement: smaller and aligned with the bottom of the main text column. */
.home #columnB {
  display: flex;
  flex-direction: column;
  align-self: stretch;
}
.home .home-qr {
  margin-top: auto;
  width: 66px;
}
.home .home-qr img {
  width: 66px;
  height: 66px;
  padding: 2px;
}
@media (max-width: 720px) {
  .home #columnB { display: block; }
  .home .home-qr { margin-top: 10px; }
}

/* Home QR alignment: flush right within the image column. */
.home .home-qr { margin-left: auto; }
@media (max-width: 720px) {
  .home .home-qr { margin-left: auto; }
}

/* Home portrait caption: align with the right edge of the portrait. */
.home #columnB .page-photo figcaption { text-align: right; }

/* Home QR vertical fine-tuning: raise slightly to align with final text line. */
@media (min-width: 721px) {
  .home .home-qr { transform: translateY(-5px); }
}

/* Home QR vertical fine-tuning v2: raise an additional 5px (10px total). */
@media (min-width: 761px) {
  .home .home-qr { transform: translateY(-10px); }
}
