:root {
  --text: #283747;
  --muted: #667585;
  --accent: #315f8d;
  --accent-soft: #e6eef6;
  --line: #dce4ec;
  --background: #f7f9fc;
  --white: #fff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--background); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 17px; line-height: 1.65; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--white); padding: .6rem; z-index: 10; }

header { background: rgba(247,249,252,.96); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.nav-wrap { max-width: 980px; margin: auto; height: 68px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; }
.name { font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; font-weight: 700; color: var(--text); }
nav { display: flex; gap: 25px; font-size: .88rem; }
nav a { color: #4c5e70; }
.menu { display: none; border: 0; background: none; font: inherit; color: var(--text); }

main { max-width: 980px; margin: auto; padding: 0 24px; }
.profile { padding: 70px 0 80px; display: grid; grid-template-columns: 290px 1fr; gap: 70px; border-bottom: 1px solid var(--line); }
aside { text-align: center; }
.portrait { width: 190px; height: 190px; border-radius: 50%; margin: 0 auto 23px; object-fit: cover; object-position: center 34%; display: block; border: 1px solid #c9d6e2; }
h1 { font: 400 2.1rem/1.2 Georgia, "Times New Roman", serif; margin: 0 0 5px; }
aside > p { color: var(--muted); margin: 0 0 1px; }
.email-address { display: block; margin-top: 7px; font-size: .9rem; }
.profile-links { display: flex; justify-content: center; margin-top: 22px; }
.button { padding: 9px 15px; background: var(--accent); border: 1px solid var(--accent); color: white; font-size: .82rem; }
.button:hover { color: white; text-decoration: none; }
.bio p:first-child { margin-top: 0; }
.bio h2 { font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 35px 0 10px; }
.interests { columns: 2; padding-left: 20px; margin: 0; color: var(--muted); }

section:not(.profile) { padding: 72px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 60px; }
section > h2, .gallery-heading h2 { font: 400 2rem Georgia, "Times New Roman", serif; margin: 0 0 35px; }
section > h3 { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 40px 0 20px; }
.publication { margin-bottom: 36px; max-width: 820px; }
.publication h4 { font: 600 1.08rem/1.45 Georgia, "Times New Roman", serif; margin: 0 0 6px; }
.publication p { margin: 6px 0; }
.publication .status { color: var(--muted); font-size: .92rem; }
.publication > a { font-size: .88rem; }
.simple-list { padding-left: 20px; }
.simple-list li { margin: 8px 0; }
.conference-list { list-style: none; margin: 0; padding: 0; max-width: 820px; }
.conference-list li { display: flex; justify-content: space-between; gap: 24px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.teaching-group { margin-bottom: 35px; }
.teaching-group h4 { font: 600 1rem Georgia, "Times New Roman", serif; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 0; }
.course-list { list-style: none; padding: 0; margin: 0; }
.course-list li { display: flex; justify-content: space-between; gap: 25px; padding: 11px 0; border-bottom: 1px solid var(--line); }
time { white-space: nowrap; color: var(--muted); font-size: .9rem; }

.gallery-heading { margin-bottom: 28px; }
.gallery-heading h2 { margin-bottom: 2px; }
.gallery-heading > div > p { color: var(--accent); font-size: .86rem; margin: 0; }
.gallery-heading > p { margin: 5px 0 0; color: var(--muted); }
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gallery-grid figure { margin: 0; aspect-ratio: 4/3; overflow: hidden; background: var(--accent-soft); position: relative; }
.gallery-open { width: 100%; height: 100%; display: block; padding: 0; border: 0; background: transparent; color: white; cursor: zoom-in; position: relative; }
.gallery-grid img { width: 104%; height: 104%; display: block; object-fit: cover; transform: translate(-2%, -2%); transition: transform .25s; }
.gallery-open > span { position: absolute; right: 0; bottom: 0; left: 0; padding: 5px 7px 4px; background: rgba(49,95,141,.94); color: white; font-size: .58rem; line-height: 1.2; text-align: right; letter-spacing: .01em; }
.gallery-grid figure:hover img { transform: translate(-2%, -2%) scale(1.025); }
.gallery-open:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

.lightbox { border: 0; padding: 48px 24px 24px; background: #111923; color: white; max-width: min(860px, 92vw); box-shadow: 0 20px 70px rgba(0,0,0,.35); }
.lightbox::backdrop { background: rgba(15,25,35,.82); }
.lightbox-close { position: absolute; top: 7px; right: 13px; border: 0; background: transparent; color: white; font: 300 2rem/1 sans-serif; cursor: pointer; }
.lightbox-frame { position: relative; overflow: hidden; }
.lightbox-frame img { display: block; max-width: 100%; max-height: 78vh; }
.lightbox-frame span { position: absolute; right: 0; bottom: 0; left: 0; padding: 7px 10px 6px; background: rgba(49,95,141,.96); color: white; font-size: .72rem; text-align: right; }

footer { max-width: 980px; margin: auto; padding: 30px 24px 55px; display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; }
footer p { margin: 0; }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-wrap { height: 60px; }
  .menu { display: block; }
  nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--background); border-bottom: 1px solid var(--line); padding: 20px 24px; flex-direction: column; gap: 14px; }
  nav.open { display: flex; }
  .profile { grid-template-columns: 1fr; gap: 45px; padding: 48px 0 60px; }
  .portrait { width: 150px; height: 150px; }
  .bio { max-width: 620px; }
  .interests { columns: 1; }
  .course-list li { align-items: flex-start; }
  .conference-list li { display: block; }
  .conference-list time { display: block; margin-top: 2px; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  footer { display: block; }
  footer p + p { margin-top: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .gallery-grid img { transition: none; }
}
