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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: #1a1a1a;
  background: #fff;
  max-width: 775px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* Header */
header {
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(to right, #4a90d9, #7c5cbf, #d95a8a) 1;
}

.site-title {
  font-size: 2.50rem;
  font-weight: 600;
}

.site-title a {
  font-size: 2.50rem;
  color: inherit;
  text-decoration: none;
}

.site-desc {
  font-size: 1.5rem;
  color: #666;
  margin-top: 0.15rem;
}

nav {
  margin-top: 1rem;
}

nav a {
  font-size: 0.95rem;
  color: #444;
  text-decoration: none;
  margin-right: 1.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

nav a:hover {
  color: #4a90d9;
  border-bottom-color: #4a90d9;
}

nav a.active {
  color: #1a1a1a;
  font-weight: 600;
  border-bottom-color: #4a90d9;
}

/* Main content */
main p {
  margin-bottom: 1rem;
}

main a {
  color: #1a1a1a;
  text-decoration: underline;
  text-decoration-color: #bbb;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

main a:hover {
  text-decoration-color: #1a1a1a;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  margin-top: 2.5rem;
  margin-bottom: 0.85rem;
}

ul {
  padding-left: 1.1rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.3rem;
}

/* Publication entries */
.pub {
  margin-bottom: 1.25rem;
}

.pub-title {
  font-weight: 500;
}

.pub-meta {
  font-size: 0.875rem;
  color: #555;
}

.pub-links {
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.pub-links a {
  margin-right: 0.75rem;
}

/* Footer */
footer {
  margin-top: 4rem;
  font-size: 0.8rem;
  color: #999;
}

footer a {
  color: #999;
  text-decoration: none;
  transition: color 0.2s ease;
}

footer a:hover {
  color: #4a90d9;
}

/* Bibliography (jekyll-scholar) */
ol.bibliography {
  list-style: none;
  padding: 0;
  margin-bottom: 1rem;
}

ol.bibliography li {
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  line-height: 1.5;
  background: #f8f9fa;
  border-radius: 6px;
  padding: 0.85rem 1rem;
  border: 1px solid #eee;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

ol.bibliography li:hover {
  border-color: #ccc;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

/* Clickable publication card */
.pub-card-link {
  display: block;
  color: #1a1a1a;
  text-decoration: none;
}

.pub-card-link:hover {
  text-decoration: none;
  color: #1a1a1a;
}

/* Expandable publication with abstract */
.pub-details {
  cursor: pointer;
  position: relative;
}

.pub-details summary {
  list-style: none;
  color: #1a1a1a;
}

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

.pub-details summary::after {
  content: "▸";
  position: absolute;
  bottom: -1rem;
  right: 0.1rem;
  font-size: 2rem;
  color: #aaa;
  transition: color 0.2s ease, transform 0.2s ease;
}

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

.pub-details:hover summary::after {
  color: #4a90d9;
}

.pub-abstract {
  margin-top: 0.6rem;
  padding: 0.75rem 0.85rem;
  background: #fff;
  border-left: 2px solid #4a90d9;
  border-radius: 0 4px 4px 0;
  font-size: 0.85rem;
  color: #444;
  line-height: 1.55;
}

.pub-abstract p {
  margin-bottom: 0.5rem;
}

.pub-paper-link {
  display: inline-block;
  font-size: 0.8rem;
  color: #4a90d9;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.pub-paper-link:hover {
  color: #3a70b0;
}

/* Tags */
.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.tag-invited {
  color: #4a90d9;
  background: rgba(74, 144, 217, 0.1);
  border: 1px solid rgba(74, 144, 217, 0.25);
}

.tag-lecture {
  color: #7c5cbf;
  background: rgba(124, 92, 191, 0.1);
  border: 1px solid rgba(124, 92, 191, 0.25);
}

.tag-workshop {
  color: #d95a8a;
  background: rgba(217, 90, 138, 0.1);
  border: 1px solid rgba(217, 90, 138, 0.25);
}

.tag-undergrad {
  color: #2a9d8f;
  background: rgba(42, 157, 143, 0.1);
  border: 1px solid rgba(42, 157, 143, 0.25);
}

.tag-grad {
  color: #e76f51;
  background: rgba(231, 111, 81, 0.1);
  border: 1px solid rgba(231, 111, 81, 0.25);
}

/* Dissertation section */
.dissertation {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.dissertation-text {
  flex: 1;
}

.dissertation-cover {
  flex-shrink: 0;
  width: 35%;
}

.dissertation-cover img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Thesis cards */
.thesis-list + ul {
  list-style: none;
  padding: 0;
}

.thesis-list + ul > li {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 0.85rem 1rem;
  border: 1px solid #eee;
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.thesis-list + ul > li:hover {
  border-color: #ccc;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.thesis-list + ul > li a {
  text-decoration: none;
  color: #1a1a1a;
}

.thesis-meta {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.2rem;
}

/* Responsive */
@media (max-width: 480px) {
  body {
    padding: 2rem 1rem 3rem;
  }

  .dissertation {
    flex-direction: column-reverse;
  }

  .dissertation-cover {
    width: 60%;
    margin: 0 auto;
  }
}
