/* ===== Reset & Base ===== */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html, body {
  margin: 0;
  padding: 0;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

@media screen and (max-width: 768px) {
  html { font-size: 14px; }
}

body {
  color: #414141;
  background-color: #fff;
  -webkit-text-size-adjust: 100%;
}

img {
  display: block;
  max-width: 100%;
}

/* ===== Grid Layout ===== */
main, header, footer {
  display: grid;
  justify-items: stretch;
  grid-template-columns:
    [screen-start] 1fr
    [page-start] minmax(min-content, 3.5rem)
    [text-start] repeat(8, minmax(min-content, 3.5rem))
    [text-end] minmax(min-content, 3.5rem)
    [page-end] 1fr
    [screen-end];
  grid-column-gap: 1.5rem;
}

@media screen and (max-width: 768px) {
  main, header, footer {
    grid-template-columns:
      [screen-start] 12px
      [page-start text-start] repeat(8, 1fr)
      [text-end page-end] 12px
      [screen-end];
    grid-column-gap: 0.5rem;
  }
}

main > * { grid-column: text; }
.l-text  { grid-column: text; }
.l-page  { grid-column: page; }

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

h1 { font-size: 2.5rem; margin: 0 0 0.25rem; line-height: 1.2; font-weight: 700; color: #111; }
h2 { font-size: 1.75rem; margin: 0 0 0.5rem; font-weight: 700; }
h3 { font-size: 1.25rem; margin: 1rem 0 0.25rem; font-weight: 600; }
p  { margin: 0.75rem 0; }

a {
  color: #0d9488;
  text-decoration: none;
}
a:hover, a:focus {
  color: #0f766e;
  text-decoration: underline;
  text-decoration-color: #aaa;
}

hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid #e0e0e0;
}

/* ===== Header / Nav ===== */
#masthead {
  border-bottom: 2px solid #0d9488;
  padding: 0.5rem 0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 100;
}

#masthead > .site-title {
  grid-column: text-start / 6;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}

#masthead > .site-title a {
  color: #414141;
}

#masthead > nav {
  grid-column: 6 / text-end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  font-size: 0.9rem;
}

nav > a {
  background-color: rgba(0,0,0,0.03);
  border-radius: 5rem;
  padding: 0.4rem 0.8rem;
  color: #414141;
  font-weight: 500;
  transition: all .2s ease-in-out;
}

nav > a:hover {
  background: rgba(13,148,136,0.08);
  text-decoration: none;
  color: #0d9488;
}

@media screen and (max-width: 768px) {
  #masthead > .site-title { grid-column: page; margin-bottom: 0.25rem; }
  #masthead > nav { grid-column: page; justify-content: flex-start; flex-wrap: wrap; }
}

/* ===== Intro ===== */
#intro-wrapper {
  margin-top: 3rem;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

#intro-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1.5rem;
}

#portrait {
  border-radius: 50%;
  height: 9rem;
  width: 9rem;
  object-fit: cover;
  flex-shrink: 0;
  border: 4px solid #0d9488;
  box-shadow: 0 4px 20px rgba(13,148,136,0.2);
}

#intro-title-text h1 {
  font-size: 2.25rem;
}

#intro-subtitle {
  font-size: 1.35rem;
  color: #888;
  margin-top: 0.15rem;
}

#intro-socials {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0,0,0,0.035);
  border-radius: 50%;
  height: 2.4rem;
  width: 2.4rem;
  transition: all .2s ease-in-out;
  color: #414141;
}

.social-btn:hover {
  background: rgba(0,0,0,0.08);
  text-decoration: none;
  transform: scale(1.05);
}

.social-btn i {
  font-size: 1rem;
  line-height: 1;
}

/* ===== Quick Links ===== */
#quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

#quick-links a {
  background-color: transparent;
  border: 1.5px solid rgba(0,0,0,0.18);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  color: #414141;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all .2s ease-in-out;
}

#quick-links a:hover {
  border-color: #0d9488;
  color: #0d9488;
  background: rgba(13,148,136,0.05);
  text-decoration: none;
}

@media screen and (max-width: 600px) {
  #intro-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  #portrait { height: 6.5rem; width: 6.5rem; }
  #intro-title-text h1 { font-size: 1.85rem; }
}

/* ===== Section Titles ===== */
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  border-left: 4px solid #0d9488;
  padding-left: 0.75rem;
}

.section-title a {
  color: #111;
  font-weight: 700;
}

.section-subtitle {
  font-size: 1.1rem;
  color: #666;
  margin: 0 0 1.25rem;
}

/* ===== Featured Publications List (homepage) ===== */
.featured-publications {
  margin-bottom: 1.5rem;
  font-size: 0.975rem;
}

.featured-publications .publication {
  display: block;
  color: #414141;
  margin-bottom: 0.85rem;
  line-height: 1.5;
  transition: opacity .15s;
}

.featured-publications .publication:hover {
  opacity: 0.7;
  text-decoration: none;
}

.featured-publications .publication strong {
  font-weight: 600;
  color: #1a1a1a;
}

.featured-publications .pub-authors {
  font-weight: 300;
  color: #555;
}

.featured-publications .pub-award,
.pub-award {
  display: inline;
  font-size: 0.82rem;
  font-weight: 600;
  color: #c8860a;
}

.featured-publications .pub-award .fa-trophy,
.pub-award .fa-trophy {
  color: #f0a500;
}

/* Show More button */
.show-more-btn {
  display: inline-block;
  color: #0d9488;
  border: 1px solid #0d9488;
  border-radius: 3px;
  padding: 6px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all .2s;
}

.show-more-btn:hover {
  background-color: rgba(13,148,136,0.08);
  text-decoration: none;
  opacity: 1;
}

/* ===== Publications List (full page) ===== */
.pub-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pub-list-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid #eee;
  display: block;
}

.pub-list-item:last-child { border-bottom: none; }

.pub-badge { display: none; }

/* Venue badge colors */
.venue-chi    { background: linear-gradient(135deg, #0070c9 0%, #5ac8fa 100%); }
.venue-assets { background: linear-gradient(135deg, #34c759 0%, #007aff 100%); }
.venue-ismar  { background: linear-gradient(135deg, #af52de 0%, #ff375f 100%); }
.venue-arxiv  { background: linear-gradient(135deg, #ff9f0a 0%, #ff6b35 100%); }
.venue-other  { background: linear-gradient(135deg, #636366 0%, #3a3a3c 100%); }

.pub-list-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 0.2rem;
  line-height: 1.35;
}

.pub-list-authors {
  font-size: 0.85rem;
  color: #666;
  margin: 0 0 0.35rem;
}

.pub-list-authors .me { font-weight: 700; color: #414141; }

.pub-list-venue {
  font-size: 0.8rem;
  font-weight: 600;
  color: #888;
  margin-bottom: 0.4rem;
}

@media screen and (max-width: 600px) {
}

/* Publication link tags (used on publications.html) */
.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.pub-link-tag {
  font-size: 0.72rem;
  background: #f4f4f4;
  border-radius: 1rem;
  padding: 0.2rem 0.55rem;
  color: #555;
  font-weight: 500;
  transition: all .15s;
}

.pub-link-tag i { margin-right: 0.2rem; }

.pub-link-tag:hover {
  background: #0d9488;
  color: #fff;
  text-decoration: none;
}

/* ===== Bio Section ===== */
.bio-text {
  font-size: 1.05rem;
  line-height: 1.7;
}

.bio-text + .bio-text {
  margin-top: 0.5rem;
}

/* ===== Footer ===== */
footer {
  background-color: #0c2a28;
  color: #d0d0d0;
  padding: 3rem 0;
  margin-top: 3rem;
}

#footer-content {
  grid-column: text;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-name {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.25rem;
}

.footer-note {
  font-size: 0.8rem;
  color: #888;
}

.footer-links {
  display: flex;
  gap: 0.75rem;
}

.footer-links a {
  color: #aaa;
  font-size: 0.85rem;
  transition: color .15s;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: none;
}

@media screen and (max-width: 768px) {
  #footer-content { grid-column: page; flex-direction: column; }
}

/* ===== Page-specific (publications.html) ===== */
.page-title {
  margin-top: 2.5rem;
  margin-bottom: 0;
  font-size: 2.25rem;
  font-weight: 700;
  color: #111;
}

.year-heading {
  font-size: 0.8rem;
  font-weight: 700;
  color: #0d9488;
  margin: 2rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid rgba(13,148,136,0.2);
  padding-bottom: 0.4rem;
}
