:root {
  --bg: #f7f5ef;
  --ink: #20262b;
  --ink-soft: #4a5158;
  --forest: #2b4c3f;
  --ochre: #c97a3d;
  --line: #dad4c4;
  --card-bg: #ffffff;

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--forest);
  text-decoration: none;
  border-bottom: 1px solid rgba(43, 76, 63, 0.35);
  transition: border-color 0.15s ease, color 0.15s ease;
}
a:hover, a:focus-visible {
  border-color: var(--forest);
  color: var(--ochre);
}
a:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===================== LAYOUT ===================== */

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 32px 96px;
  display: grid;
  grid-template-columns: 280px minmax(0, 700px);
  gap: 80px;
  align-items: start;
}
.content { min-width: 0; }

/* ===================== SIDEBAR ===================== */

.sidebar { position: sticky; top: 56px; }

.portrait {
  width: 300px;
  height: 300px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  margin-bottom: 22px;
  box-shadow: 0 1px 0 rgba(32,38,43,0.06);
}

.name {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1.2;
  margin: 0 0 10px;
}

.role { font-size: 0.92rem; color: var(--ink-soft); margin: 0 0 14px; }
.location { font-size: 0.88rem; color: var(--ink-soft); margin: 0 0 20px; }

/* ---- social icon row ---- */

.social-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--ink-soft);
}
.icon-btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.icon-btn:hover, .icon-btn:focus-visible {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}

.icon-btn-label {
  width: auto;
  border-radius: 18px;
  padding: 0 14px 0 10px;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 500;
}
.icon-btn-label span { line-height: 1; }

.section-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.section-nav a {
  font-size: 0.88rem;
  color: var(--ink-soft);
  border-bottom: none;
  width: fit-content;
  padding-left: 10px;
  border-left: 2px solid transparent;
}
.section-nav a:hover { color: var(--forest); }
.section-nav a.active {
  color: var(--ink);
  font-weight: 600;
  border-left-color: var(--ochre);
}

/* ===================== CONTENT SECTIONS ===================== */

.section {
  padding-top: 46px;
  margin-top: 46px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 32px;
}
.section.first { padding-top: 0; margin-top: 0; border-top: none; }

h2 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0 0 18px;
  color: var(--ink);
}

.section p { margin: 0 0 14px; max-width: 62ch; }

.tag-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tag-list li {
  font-size: 0.9rem;
  border: 1px solid var(--line);
  background: var(--card-bg);
  padding: 7px 14px;
  border-radius: 3px;
  color: var(--ink-soft);
}

/* ===================== PUBLICATIONS ===================== */

.pub { padding: 18px 0; border-bottom: 1px solid var(--line); }
.pub:first-of-type { padding-top: 4px; }

.pub-title { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; margin: 0 0 6px; }
.pub-title a { color: var(--ink); border-bottom: 1px solid var(--line); }
.pub-title a:hover { color: var(--forest); border-color: var(--forest); }

.pub-authors { margin: 0 0 3px; font-size: 0.92rem; color: var(--ink-soft); }
.pub-venue { margin: 0 0 6px; font-size: 0.88rem; color: var(--ink-soft); font-style: italic; }
.pub-links { margin: 0; font-size: 0.86rem; }
.pub-links a { border-bottom: none; }

.hint { font-size: 0.84rem; color: var(--ink-soft); margin-top: 14px !important; }

/* ===================== TIMELINE (Teaching / Education / Achievements) ===================== */

.timeline-item {
  position: relative;
  padding: 4px 0 4px 24px;
  margin-bottom: 26px;
  border-left: 2px solid var(--line);
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -6px; top: 9px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ochre);
}
.timeline-item:last-child { margin-bottom: 0; }

.timeline-meta { margin: 0 0 4px; font-size: 0.82rem; color: var(--ochre); font-weight: 500; }
.timeline-title { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; margin: 0 0 4px; }
.timeline-org { margin: 0 0 8px; font-size: 0.9rem; color: var(--ink-soft); }

/* ===================== ACTIVITIES GALLERY (no captions) ===================== */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}
.gallery-item {
  margin: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--line);
}
.gallery-item.span-2 { grid-column: span 2; }
.gallery-item img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}
.gallery-item.span-2 img { height: 300px; }

/* ===================== FOOTER ===================== */

.footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 860px) {
  .page { grid-template-columns: 1fr; gap: 40px; padding: 40px 20px 64px; }
  .sidebar { position: static; display: flex; flex-direction: column; }
  .portrait { width: 96px; height: 96px; }
  .social-icons { border-bottom: none; padding-bottom: 0; margin-bottom: 8px; }
  .section-nav { flex-direction: row; flex-wrap: wrap; gap: 14px; }
  .section-nav a { padding-left: 0; border-left: none; border-bottom: 2px solid transparent; }
  .section-nav a.active { border-left: none; border-bottom-color: var(--ochre); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery-item.span-2 { grid-column: span 2; }
}

@media (max-width: 480px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery-item.span-2 { grid-column: span 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a { transition: none; }
}
