:root {
  --paper: #f6f3ec;
  --ink: #1c1b19;
  --body: #44413d;
  --muted: #77716a;
  --faint: #9c958c;
  --brown: #684938;
  --brown-hover: #87624e;
  --gold: #ad8a4f;
  --line: #dfd8ce;
  --line-soft: #e9e4dc;
  --serif: "Libre Baskerville", Georgia, serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --content-width: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brown); text-decoration: none; transition: color 180ms ease; }
a:hover { color: var(--brown-hover); }

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 1rem;
  padding: 0.65rem 1rem;
  color: white;
  background: var(--brown);
  transform: translateY(-120%);
}
.skip-link:focus { transform: translateY(0); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header,
.header-rule,
main,
footer {
  width: min(var(--content-width), calc(100% - 5rem));
  margin-inline: auto;
}

.site-header {
  min-height: 114px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.identity { display: flex; flex-direction: column; color: var(--ink); }
.identity:hover { color: var(--ink); }
.identity-name {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.identity-role {
  margin-top: 0.18rem;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

nav { display: flex; align-items: center; gap: 0.1rem; }
nav a {
  padding: 0.52rem 0.95rem;
  border-radius: 3px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
nav a:hover { color: var(--ink); background: rgba(104, 73, 56, 0.045); }
nav a[aria-current="page"] { color: var(--brown); background: rgba(104, 73, 56, 0.07); }

.menu-toggle { display: none; }

.header-rule span {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, var(--line), var(--gold), var(--line));
  opacity: 0.58;
}

main { flex: 1; }

.page { animation: page-in 320ms ease both; }
.page[hidden] { display: none; }

@keyframes page-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-page {
  min-height: 660px;
  padding: 3.7rem 0 4.5rem;
  display: grid;
  grid-template-columns: minmax(180px, 230px) 1fr;
  gap: clamp(3rem, 7vw, 5.2rem);
  align-items: start;
}

.portrait-wrap { position: relative; }
.portrait-wrap img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 7px 35px rgba(46, 35, 27, 0.1);
}

.home-content { padding-top: 0.2rem; }
.kicker {
  margin: 0 0 0.5rem;
  color: var(--gold);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

h1, h2, h3, h4 { font-family: var(--serif); }

h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(2.3rem, 5vw, 3.15rem);
  line-height: 1.16;
  letter-spacing: -0.035em;
}

.bio { max-width: 645px; color: var(--body); font-size: 0.94rem; line-height: 1.95; }
.bio p { margin: 0; }
.bio p + p { margin-top: 1rem; }
.bio strong { color: var(--ink); font-weight: 600; }
.bio .personal-note {
  color: var(--brown);
  font-family: var(--serif);
  font-size: 1rem;
  font-style: italic;
}

.contact-summary {
  margin-top: 2rem;
  padding-top: 1.65rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  font-size: 0.84rem;
}
.contact-summary div { display: grid; grid-template-columns: 90px 1fr; gap: 0.6rem; }
.contact-summary span {
  color: var(--faint);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.contact-summary p { margin: 0; color: var(--body); }

.actions { margin-top: 1.8rem; display: flex; flex-wrap: wrap; gap: 0.65rem; }
.button {
  padding: 0.52rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--body);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}
.button:hover { border-color: var(--brown); color: var(--brown); }
.button.filled { border-color: var(--brown); color: #fff; background: var(--brown); }
.button.filled:hover { border-color: var(--brown-hover); color: #fff; background: var(--brown-hover); }

.inner-page { max-width: 760px; padding: 4rem 0 5.5rem; }
.page-heading { margin-bottom: 3.2rem; }
.page-heading h1,
.page-heading h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(2rem, 4vw, 2.65rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
}
.page-heading > p:last-child { max-width: 650px; margin: 0; color: var(--muted); font-size: 0.91rem; }

#research .page-heading { margin-bottom: 2rem; }
.research-group + .research-group { margin-top: 2.25rem; }
.research-group > h3,
.cv-section > h3,
.subsection > h3 {
  margin: 0 0 1.6rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  color: var(--brown);
  font-size: 0.75rem;
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.research-group > h3 {
  margin-bottom: 1.15rem;
  padding-bottom: 0.55rem;
  font-size: 1.25rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
  text-transform: none;
}
.paper { margin-bottom: 2rem; }
.paper:last-child { margin-bottom: 0; }
.paper h4 {
  margin: 0 0 0.35rem;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.01em;
}
.paper p { margin: 0.18rem 0; color: var(--muted); font-size: 0.86rem; }
.paper .authors strong { color: var(--body); }
.paper .paper-meta { margin-top: 0.3rem; color: var(--body); font-size: 0.82rem; }
.paper-status { font-style: italic; }
.paper-link { white-space: nowrap; }
.paper-link > span { margin: 0 0.35rem; color: var(--muted); }
.paper a { font-weight: 600; text-decoration: underline; text-underline-offset: 0.18em; }

.cv-section + .cv-section { margin-top: 4rem; }
.cv-row {
  padding: 1.55rem 0;
  display: grid;
  grid-template-columns: 135px 1fr;
  gap: 2rem;
  border-bottom: 1px solid var(--line-soft);
}
.cv-year { padding-top: 0.15rem; color: var(--faint); font-size: 0.76rem; font-weight: 500; }
.cv-year span { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; }
.cv-row h4 { margin: 0; font-size: 1rem; }
.cv-row p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.84rem; }
.cv-row .degree { color: var(--body); font-weight: 600; }
.cv-row .location { color: var(--faint); font-size: 0.75rem; }

.achievements article {
  padding: 1.1rem 0;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.86rem;
}
.achievements article span { color: var(--ink); font-weight: 600; }
.achievements article p { margin: 0; color: var(--muted); }

.contact-page { max-width: 680px; }
.contact-list { border-top: 1px solid var(--line); }
.contact-list > div {
  padding: 1rem 0;
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1.5rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.88rem;
}
.contact-list span { color: var(--faint); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.contact-list p { margin: 0; color: var(--body); }
.large-mail-link {
  margin-top: 3rem;
  display: inline-block;
  color: var(--brown);
  font-family: var(--serif);
  font-size: 1.3rem;
  border-bottom: 1px solid var(--brown);
}
.large-mail-link span { font-family: var(--sans); font-size: 0.9rem; }

footer {
  padding: 2.2rem 0;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  border-top: 1px solid var(--line-soft);
  color: var(--faint);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}
footer p { margin: 0; }

@media (max-width: 800px) {
  .site-header, .header-rule, main, footer { width: min(100% - 3rem, var(--content-width)); }
  .site-header { min-height: 96px; flex-wrap: wrap; padding: 1.35rem 0 1rem; }
  .identity-role { max-width: 250px; }
  .menu-toggle {
    width: 42px;
    height: 42px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    border: 0;
    background: transparent;
    cursor: pointer;
  }
  .menu-toggle span:not(.sr-only) { width: 100%; height: 1px; display: block; background: var(--ink); }
  nav { width: 100%; display: flex; flex-wrap: wrap; padding-top: 0.5rem; }
  .has-js nav:not(.open) { display: none; }
  nav.open { display: flex; }
  nav a { padding: 0.45rem 0.65rem; }
  .home-page { padding: 2.6rem 0 4rem; grid-template-columns: 1fr; gap: 2.8rem; }
  .portrait-wrap { width: min(62%, 230px); }
  .home-content { padding-top: 0; }
  .inner-page { padding: 3rem 0 4.5rem; }
  footer { flex-direction: column; gap: 0.3rem; }
}

@media (max-width: 520px) {
  .site-header, .header-rule, main, footer { width: min(100% - 2rem, var(--content-width)); }
  .identity-name { font-size: 1.35rem; }
  .identity-role { font-size: 0.6rem; }
  .portrait-wrap { width: min(68%, 230px); }
  .contact-summary div,
  .cv-row,
  .achievements article,
  .contact-list > div { grid-template-columns: 1fr; gap: 0.28rem; }
  .actions { flex-direction: column; }
  .button { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
