:root {
  --ink:    #1a1a1a;
  --muted:  #5a5a5a;
  --rule:   #c8b89a;
  --accent: #8b5e3c;
  --bg:     #faf8f4;
  --card:   #ffffff;
  --serif:  'Cormorant Garamond', Georgia, serif;
  --sans:   'Jost', system-ui, sans-serif;
}

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

html { font-size: 17px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.75;
  min-height: 100vh;
}

/* ── Layout ── */
.page {
  max-width: 780px;
  margin: 0 auto;
  padding: 2.5rem 2rem 6rem;
}

/* ── Avatar (portrait 5 : 7) ── */
.avatar-wrap {
  --avatar-w: 100px;
  flex-shrink: 0;
  width: var(--avatar-w);
  height: calc(var(--avatar-w) * 7 / 5);
  perspective: 600px;
  cursor: pointer;
}

.avatar-flipper {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

.avatar-wrap.flipped .avatar-flipper {
  transform: rotateY(180deg);
}

.avatar-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.avatar-back {
  transform: rotateY(180deg);
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--rule);
  display: block;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  border: 2px solid var(--rule);
  background: var(--bg);
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  display: none;
  align-items: center;
  justify-content: center;
}

/* ── Header ── */
.header {
  padding-bottom: 0.85rem;
  margin-bottom: 0.5rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.header-text {
  flex: 1;
}

.header h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 3rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0.3rem;
}

.header .subtitle {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.subtitle-row {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin-top: 0.3rem;
}

.header-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
  margin-top: 0.85rem;
  max-width: 36rem;
}

.header-contact-item {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
  font-size: 0.82rem;
}

.header-contact-label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.header-contact-item a {
  color: var(--ink);
  text-decoration: none;
  transition: color .2s;
}

.header-contact-item a:hover {
  color: var(--accent);
}

.header-contact-sep {
  width: 1px;
  height: 0.95em;
  background: var(--rule);
  align-self: center;
  opacity: 0.85;
}

/* ── Section headings ── */
.section {
  margin-bottom: 2rem;
}

.section-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* ── Section body text (e.g. under Research interests) ── */
.section-body {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.75;
}

.section-body strong {
  color: var(--ink);
  font-weight: 500;
}

.profile-links {
  display: flex;
  flex-direction: row;
  gap: 1.2rem;
  align-items: center;
}

.profile-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}

.profile-link:hover { color: var(--accent); }

.profile-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.profile-link:hover .profile-icon { opacity: 1; }

/* ── Education timeline ── */
.timeline { position: relative; padding-left: 1.4rem; }

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55rem;
  bottom: 0.55rem;
  width: 1px;
  background: var(--rule);
}

.timeline-entry {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-entry::before {
  content: '';
  position: absolute;
  left: -1.4rem;
  top: 0.55rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-3px);
}

.tl-period {
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.tl-degree {
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
}

.tl-institution {
  font-size: 0.9rem;
  color: var(--ink);
}

.tl-dept {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

/* ── Publications ── */
.pub-list { list-style: none; }

.pub-item {
  padding: 1.3rem 1.4rem;
  background: var(--card);
  border-left: 3px solid var(--rule);
  margin-bottom: 1rem;
  transition: border-color .2s, box-shadow .2s;
}

.pub-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 18px rgba(0, 0, 0, .06);
}

.pub-authors {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
  line-height: 1.55;
}

.pub-authors strong {
  color: var(--ink);
  font-weight: 500;
}

.pub-title {
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
  margin-bottom: 0.35rem;
}

.pub-venue {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 0.4rem;
}

.pub-venue strong {
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
}

.pub-doi a {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.pub-doi a:hover { border-color: var(--accent); }

/* ── Footnote ── */
.footnote {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.footnote span { display: inline-block; margin-right: 1.4rem; }

/* ── Footer ── */
.site-footer {
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rule);
  padding-top: 3rem;
  border-top: 1px solid var(--rule);
  margin-top: 1rem;
}

/* ── Responsive ── */
@media (max-width: 520px) {
  .header-inner { flex-direction: column-reverse; align-items: center; text-align: center; }
  .header h1 { font-size: 2.1rem; }
  .header-text { width: 100%; }
  .header-contact {
    justify-content: center;
    max-width: none;
    width: 100%;
  }
  .header-contact-item { justify-content: center; text-align: center; }
  .header-contact-sep { display: none; }
  .subtitle-row { flex-direction: column; align-items: center; gap: 0.65rem; }
  .profile-links { padding-left: 0; border-left: none; border-top: 1px solid var(--rule); padding-top: 0.75rem; flex-direction: row; flex-wrap: wrap; justify-content: center; }
}
