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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #1a1a1a;
  background: #fff;
  margin: 0;
}

a { color: inherit; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main { padding: 2.5rem 0 4rem; }

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 1.75rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.01em;
}

p { margin: 0 0 0.75rem; }

/* ── Header ──────────────────────────────────────────────────────────────── */
header {
  border-bottom: 2px solid #e87722;
  padding: 1rem 0;
}

.header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-name {
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

nav { display: flex; gap: 1.75rem; }

nav a {
  font-size: 0.9rem;
  text-decoration: none;
  color: #555;
}

nav a:hover, nav a.active { color: #e87722; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid #ebebeb;
  padding: 1.5rem 0;
  font-size: 0.85rem;
  color: #999;
}

/* ── Homepage ────────────────────────────────────────────────────────────── */
.home-content { max-width: 640px; }

.home-content p { line-height: 1.75; }

.home-content img { float: right; width: 180px; margin: 0 0 1.5rem 2rem; border-radius: 4px; }

/* ── Publications list ───────────────────────────────────────────────────── */
.controls {
  margin-bottom: 1.75rem;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #1a1a1a;
  outline: none;
}

.search-input:focus {
  border-color: #e87722;
  box-shadow: 0 0 0 2px #e8772220;
}

.result-count {
  font-size: 0.875rem;
  color: #999;
  min-height: 1.4em;
  margin-bottom: 0.5rem;
}

.year-heading {
  font-size: 0.95rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 2rem 0 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #ebebeb;
}

.year-group:first-child .year-heading { margin-top: 0; }

.pub-list { list-style: none; margin: 0; padding: 0; }

.pub-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid #f2f2f2;
}

.pub-item:last-child { border-bottom: none; }

.pub-title {
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 0.2rem;
  line-height: 1.4;
}

.pub-title-link {
  text-decoration: none;
  color: inherit;
}

.pub-title-link:hover { text-decoration: underline; }

/* on single-paper page the title is larger */
.paper-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}

.preprint-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7a6000;
  background: #fffbea;
  border: 1px solid #e8d44d55;
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  vertical-align: middle;
  margin-left: 0.4rem;
  position: relative;
  top: -1px;
}

.pub-authors, .paper-authors {
  font-size: 0.875rem;
  color: #555;
  margin: 0 0 0.15rem;
}

.pub-authors strong, .paper-authors strong { color: #1a1a1a; font-weight: 600; }

.pub-venue p, .paper-venue-block p {
  font-size: 0.875rem;
  color: #555;
  margin: 0;
}

.pub-venue em, .paper-venue-block em { font-style: italic; }

/* ── Expandable abstract ─────────────────────────────────────────────────── */
details { margin-top: 0.5rem; }

details summary {
  font-size: 0.8rem;
  color: #999;
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  user-select: none;
}

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

details summary::before {
  content: '▶';
  font-size: 0.55rem;
  display: inline-block;
  transition: transform 0.15s;
}

details[open] summary::before { transform: rotate(90deg); }
details summary:hover { color: #e87722; }

.abstract-text {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  line-height: 1.75;
  color: #444;
  padding-left: 0.85rem;
  border-left: 2px solid #ebebeb;
}

.abstract-text p { margin: 0 0 0.5rem; }
.abstract-text p:last-child { margin: 0; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.pub-badges, .paper-badges {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 3px;
  text-decoration: none;
  border: 1px solid;
  line-height: 1.6;
  white-space: nowrap;
}

.badge-pdf   { border-color: #e87722; color: #e87722; }
.badge-pdf:hover { background: #e87722; color: #fff; }

.badge-doi   { border-color: #bbb; color: #666; }
.badge-doi:hover { border-color: #555; color: #333; }

.badge-arxiv { border-color: #b31b1b88; color: #b31b1b; }
.badge-arxiv:hover { background: #b31b1b; color: #fff; }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination {
  margin-top: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.show-more-btn {
  padding: 0.6rem 1.75rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  background: none;
  font-family: inherit;
  font-size: 0.9rem;
  color: #555;
  cursor: pointer;
}

.show-more-btn:hover { border-color: #e87722; color: #e87722; }

.pagination-count { font-size: 0.85rem; color: #aaa; }

.no-results { color: #999; font-style: italic; padding: 2rem 0; }

/* ── Single paper page ───────────────────────────────────────────────────── */
.back-link {
  display: inline-block;
  font-size: 0.875rem;
  color: #888;
  text-decoration: none;
  margin-bottom: 1.75rem;
}

.back-link:hover { color: #e87722; }
.back-link::before { content: '← '; }

.divider {
  border: none;
  border-top: 1px solid #ebebeb;
  margin: 1.75rem 0;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
  margin: 0 0 0.6rem;
}

.abstract {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #333;
}

/* ── People page ─────────────────────────────────────────────────────────── */

/* Shared photo styles */
.person-photo {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #e8e8e8;
}

.person-initial {
  background: #e8e8e8;
  color: #666;
  font-size: 1.75rem;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* PI card */
.pi-card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

.pi-card .person-photo {
  width: 120px;
  height: 120px;
  border-radius: 8px;
}

.pi-card .person-initial {
  font-size: 2.5rem;
}

.pi-info { display: flex; flex-direction: column; gap: 0.2rem; }

.pi-name {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
}

/* Current members list */
.person-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.person-subheading {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  margin: 1.5rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #ebebeb;
}

.person-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f5f5f5;
}

.person-item:last-of-type { border-bottom: none; }

.person-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.person-name { font-weight: 500; }
.person-name a { color: inherit; text-decoration: none; }
.person-name a:hover { text-decoration: underline; }

.person-role {
  font-size: 0.875rem;
  color: #555;
}

.person-meta {
  font-size: 0.85rem;
  color: #777;
}

.person-meta a { color: #e87722; text-decoration: none; }
.person-meta a:hover { text-decoration: underline; }

/* Alumni list */
.alumni-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.alumni-list li {
  padding: 0.35rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid #f5f5f5;
}

.alumni-list li:last-child { border-bottom: none; }

@media (max-width: 480px) {
  .pi-card { flex-direction: column; gap: 1rem; }
  .pi-card .person-photo { width: 90px; height: 90px; }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
  h1 { font-size: 1.4rem; }
  .paper-title { font-size: 1.25rem; }
}
