/* ---------- Design tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f6f7;         /* light grey, for neutral highlights */
  --bg-purple: #f4f0fb;      /* light purple, for accent highlights */
  --bg-card: #ffffff;
  --text: #16171a;
  --text-muted: #6b6f76;
  --accent: #6d28d9;      /* muted purple, editable */
  --accent-dark: #591db8;
  --border: #e4e5e8;
  --border-card: #e0d4f7;
  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --max-width: 900px;
  --radius: 10px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
}

a, button, summary, details, .news-item, .pub-item, .course-item, .research-item {
  -webkit-tap-highlight-color: transparent;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--accent);
}

.eyebrow {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

/* ---------- Header / nav ---------- */
header.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.site-title {
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}

nav.main-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

nav.main-nav a:hover,
nav.main-nav a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
}

/* ---------- Hero (home page) ---------- */
.hero {
  padding: 64px 0 48px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: center;
}

.hero img.portrait {
  width: 200px;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2.2rem;
  margin: 0 0 10px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero .role {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 400;
  margin: 0 0 16px;
}

.hero p {
  margin: 0 0 8px;
}

.links-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.links-row a {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--accent);
  padding: 8px 16px;
  border-radius: 8px;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.links-row a:hover {
  background: var(--bg-purple);
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(109, 40, 217, 0.15);
}

.links-row a:active {
  background: var(--bg-purple);
  transform: translateY(-1px);
}

/* ---------- Section styling ---------- */
main {
  padding: 20px 0 80px;
}

section + section {
  margin-top: 64px;
}

h2.section-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}

.section-intro {
  color: var(--text-muted);
  margin: 14px 0 24px;
  max-width: 640px;
}

.page-header {
  padding: 28px 0 16px;
}

.page-header h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.9rem;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.page-header p {
  color: var(--text-muted);
  max-width: 640px;
}

.tag-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--bg-purple);
  padding: 4px 12px;
  border-radius: 12px;
}


/* ---------- Publications ---------- */
.pub-year {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  margin: 32px 0 10px;
}

.pub-year:first-of-type { margin-top: 0; }

.pub-item {
  padding: 22px 26px;
  margin-bottom: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.pub-item:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 22px rgba(109, 40, 217, 0.14);
  transform: translateY(-4px);
}

.pub-item:last-child { margin-bottom: 0; }

.pub-item .pub-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 0.98rem;
  margin: 0 0 6px;
}

.pub-item .pub-meta {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0 0 6px;
}

.pub-item .pub-links {
  margin-top: 10px;
}

.pub-item .pub-links a {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 500;
  margin-right: 10px;
  color: var(--accent);
  background: var(--bg-purple);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.pub-item .pub-links a:hover { background: var(--accent); color: #ffffff; text-decoration: none; }

details.abstract summary {
  cursor: pointer;
  list-style: none;
}

details.abstract summary::-webkit-details-marker {
  display: none;
}

details.abstract summary::marker {
  display: none;
}

.pub-item details.abstract summary .pub-title {
  margin-bottom: 4px;
}

.course-item details.abstract summary h3 {
  margin-bottom: 4px;
}

details.abstract .dropdown-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 8px;
  vertical-align: middle;
  border-radius: 50%;
  background: rgba(109, 40, 217, 0.1);
  color: var(--accent);
  transition: transform 0.15s ease, background 0.15s ease;
}

details.abstract .dropdown-arrow svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

details.abstract summary:hover .dropdown-arrow {
  background: rgba(109, 40, 217, 0.18);
}

details.abstract[open] .dropdown-arrow {
  transform: rotate(180deg);
}

details.abstract .abstract-body {
  margin-top: 8px;
}

details.abstract .abstract-body p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.pub-status {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-alt);
  color: var(--text-muted);
  margin-left: 8px;
}

/* ---------- Teaching ---------- */
.course-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}

.course-item {
  padding: 18px 24px;
  margin-bottom: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.course-grid .course-item { margin-bottom: 0; }

.course-item:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 22px rgba(109, 40, 217, 0.14);
  transform: translateY(-4px);
}

.course-item:last-child { margin-bottom: 0; }

.course-item h3 {
  font-family: var(--serif);
  font-weight: 700;
  margin: 0 0 4px;
  font-size: 0.98rem;
}

.course-item .course-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- CV page ---------- */
.cv-block {
  margin-bottom: 28px;
  padding: 28px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
}

.cv-block h2.section-title { margin-bottom: 6px; }

.cv-entry {
  display: grid;
  grid-template-columns: 195px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 84px;
}

.cv-block .cv-entry:first-of-type { border-top: none; }

.cv-entry .cv-date {
  display: inline-block;
  align-self: start;
  width: fit-content;
  max-width: 100%;
  color: var(--accent-dark);
  background: var(--bg-purple);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.cv-entry .cv-detail {
  min-width: 0;
}

.cv-entry .cv-detail:has(.cv-logo) {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.cv-entry .cv-detail .cv-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 4px;
}

.cv-entry .cv-detail .cv-detail-text { flex: 1; min-width: 0; }

.cv-entry .cv-detail-text strong,
.cv-entry .cv-detail > strong {
  display: block;
  font-weight: 600;
  margin-bottom: 3px;
}

.cv-entry .cv-detail ul.cv-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cv-entry .cv-detail ul.cv-list li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.cv-entry .cv-detail ul.cv-list li:last-child { margin-bottom: 0; }

.cv-entry .cv-detail ul.cv-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.cv-entry .cv-detail-text span,
.cv-entry .cv-detail > span {
  display: block;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.download-btn {
  display: inline-block;
  margin-top: 6px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.92rem;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.download-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(109, 40, 217, 0.25);
}

.download-btn:active { transform: translateY(-1px); }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.contact-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-card {
  padding: 28px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.contact-card:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 22px rgba(109, 40, 217, 0.14);
  transform: translateY(-4px);
}

.contact-card h3 {
  display: inline-block;
  font-family: var(--sans);
  margin: 0 0 14px;
  color: var(--accent-dark);
  background: var(--bg-purple);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  font-size: 0.72rem;
  padding: 5px 12px;
  border-radius: 999px;
}

.contact-card p { margin: 0 0 4px; }
.contact-card p:last-child { margin-bottom: 0; }

/* ---------- News ---------- */
.news-item {
  display: flex;
  gap: 20px;
  padding: 22px 24px;
  margin-bottom: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.news-item:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 22px rgba(109, 40, 217, 0.14);
  transform: translateY(-4px);
}

.news-item:last-child { margin-bottom: 0; }

.news-item .news-thumb {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: cover;
  padding: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

.news-item .news-thumb.news-thumb-logo {
  object-fit: contain;
  padding: 16px;
  background: #ffffff;
}

.news-item .news-body { flex: 1; min-width: 0; }

.news-item .news-date {
  display: block;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.news-item h3 {
  font-family: var(--serif);
  font-weight: 700;
  margin: 0 0 6px;
  font-size: 1.02rem;
}

.news-item p {
  margin: 0 0 8px;
  color: var(--text-muted);
}

.news-item .news-link {
  font-size: 0.85rem;
  text-decoration: none;
}

.news-item .news-link:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 40px;
  }
  .hero img.portrait { margin: 0 auto; }
  .hero h1 { font-size: 1.7rem; }
  .page-header h1 { font-size: 1.55rem; }
  .links-row { justify-content: center; }

  .nav-toggle { display: block; }

  nav.main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid transparent;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease,
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s ease;
  }

  nav.main-nav.open {
    max-height: 320px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    border-bottom-color: var(--border);
  }

  nav.main-nav ul {
    flex-direction: column;
    padding: 12px 24px 20px;
    gap: 16px;
  }

  .cv-entry { grid-template-columns: 1fr; gap: 2px; }
  .cv-entry .cv-date { margin-bottom: 8px; }

  .course-grid { display: block; }
  .course-grid .course-item { margin-bottom: 12px; }
  .course-grid .course-item:last-child { margin-bottom: 0; }
  .contact-grid { grid-template-columns: 1fr; }

  .news-item { flex-direction: column; }
  .news-item .news-thumb { width: 100%; height: auto; aspect-ratio: 1 / 1; }
  .news-item .news-thumb.news-thumb-logo { width: 160px; height: 100px; aspect-ratio: auto; }
}
