/* ===========================
   Base
   =========================== */

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

:root {
  --text: #111111;
  --secondary: #5a5a5a;
  --link: #1a56b0;
  --accent: #d95f3b;
  --border: #e4e4e4;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --max-width: 720px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background: #fff;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===========================
   Header / Nav
   =========================== */

header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-title:hover {
  text-decoration: none;
  color: var(--text);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 24px;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--secondary);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

/* ===========================
   Main & sections
   =========================== */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 52px 24px 64px;
  flex: 1;
}

section {
  scroll-margin-top: 68px; /* offset for sticky nav */
}

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

/* Section headings (Research, Teaching) */
section > h2 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--accent);
  margin-bottom: 28px;
}

/* ===========================
   About / Profile
   =========================== */

.about {
  display: flex;
  gap: 44px;
  align-items: flex-start;
}

.profile-photo {
  width: 225px;
  height: 225px;
  object-fit: cover;
  object-position: 65% 50%;
  border-radius: 4px;
  flex-shrink: 0;
}

.profile-content {
  flex: 1;
}

.profile-content p {
  font-size: 0.95rem;
  margin-bottom: 20px;
}

/* Contact links row */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.contact-links a {
  font-size: 0.85rem;
  color: var(--secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
}

.contact-links a:hover {
  color: var(--text);
  border-bottom-color: var(--text);
  text-decoration: none;
}


/* ===========================
   Research
   =========================== */

/* Subsection headings (Working Papers, WIP, Policy) */
.subsection {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
  margin-top: 32px;
  margin-bottom: 20px;
}

.paper {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.paper:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.paper-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 5px;
}

.paper-title {
  font-size: 0.975rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.45;
}

.paper-title a {
  color: var(--text);
}

.paper-title a:hover {
  text-decoration: underline;
}

.paper-authors {
  font-size: 0.875rem;
  color: var(--secondary);
  margin-bottom: 2px;
}

.paper-venue {
  font-size: 0.8rem;
  color: var(--secondary);
  margin-bottom: 0;
}

.paper-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

/* PDF / link buttons */
.paper-actions > a {
  font-size: 0.78rem;
  color: var(--secondary);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 9px;
  transition: border-color 0.12s, color 0.12s;
}

.paper-actions > a:hover {
  color: var(--link);
  border-color: var(--link);
  text-decoration: none;
}

/* Abstract toggle */
details.abstract {
  display: inline-block;
}

details.abstract summary {
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--secondary);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  user-select: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 9px;
  transition: border-color 0.12s, color 0.12s;
}

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

details.abstract summary::after {
  content: '▸';
  font-size: 0.6rem;
  display: inline-block;
  transition: transform 0.12s;
  margin-left: 2px;
}

details.abstract[open] summary::after {
  transform: rotate(90deg);
}

details.abstract summary:hover {
  color: var(--link);
  border-color: var(--link);
  text-decoration: none;
}

details.abstract .abstract-text {
  margin-top: 16px;
  font-size: 0.875rem;
  color: var(--secondary);
  line-height: 1.7;
}

/* ===========================
   Teaching
   =========================== */

.teaching-table {
  width: 100%;
  border-collapse: collapse;
}

.teaching-table tr + tr td {
  padding-top: 18px;
}

.teaching-year {
  font-size: 0.82rem;
  color: var(--secondary);
  white-space: nowrap;
  padding-right: 28px;
  vertical-align: top;
  padding-top: 2px;
}

.teaching-course {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.teaching-role {
  font-size: 0.875rem;
  color: var(--secondary);
}

.teaching-place {
  font-size: 0.82rem;
  color: var(--secondary);
}

/* ===========================
   Footer
   =========================== */

footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
}

footer p {
  font-size: 0.78rem;
  color: var(--secondary);
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 560px) {
  main {
    padding: 36px 20px 52px;
  }

  .about {
    flex-direction: column;
    gap: 24px;
  }

  .profile-photo {
    width: 110px;
    height: 110px;
  }
}
