/* ==========================================================================
   GitHub Primer–style homepage refinements
   ========================================================================== */

#news,
#education,
#experience,
#publications,
#research {
  scroll-margin-top: 80px;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

.main-heading {
  margin: 0 0 1rem;
  color: #1f2328;
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-align: left;
}

.page__content p {
  color: #3d444d;
  line-height: 1.7;
}

/* Section headings: h2 with GitHub-docs style bottom border */
.page__content h2 {
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #d1d9e0;
  color: #1f2328;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   Intro links — styled as GitHub buttons
   -------------------------------------------------------------------------- */

.intro-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.25rem 0 2.25rem;
}

.intro-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.3rem 0.9rem;
  border: 1px solid #d1d9e0;
  border-radius: 6px;
  background: #f6f8fa;
  box-shadow: 0 1px 0 rgba(31, 35, 40, 0.04);
  color: #24292f;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.intro-links a:hover {
  border-color: #afb8c1;
  background: #eff2f5;
  color: #1f2328;
}

/* --------------------------------------------------------------------------
   News
   -------------------------------------------------------------------------- */

.news-box {
  margin-bottom: 2.25rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid #d1d9e0;
  border-radius: 6px;
  background: #f6f8fa;
}

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

.news-list li {
  display: grid;
  grid-template-columns: 5.2rem minmax(0, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  color: #3d444d;
  font-size: 0.92rem;
  line-height: 1.6;
}

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

.news-date {
  color: #59636e;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Timeline / Experience / Publications — shared card base
   -------------------------------------------------------------------------- */

.timeline-list,
.experience-container,
.publication-list {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 2.25rem;
}

.timeline-item,
.experience-card,
.publication-card,
.research-project {
  box-sizing: border-box;
  padding: 1rem 1.2rem;
  border: 1px solid #d1d9e0;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.timeline-item:hover,
.experience-card:hover,
.publication-card:hover {
  border-color: #afb8c1;
  box-shadow: 0 1px 3px rgba(31, 35, 40, 0.08);
}

.timeline-item,
.experience-card,
.research-project {
  border-left: 3px solid #818b98;
}

.item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.item-header strong {
  display: block;
  color: #1f2328;
  font-size: 1rem;
  font-weight: 600;
}

.item-subtitle {
  display: block;
  margin-top: 0.15rem;
  color: #59636e;
  font-size: 0.875rem;
}

.item-header time {
  flex: 0 0 auto;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: #eff2f5;
  color: #4b5563;
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.timeline-item p,
.experience-card p,
.research-project p {
  margin: 0.7rem 0 0;
  color: #3d444d;
  line-height: 1.65;
}

/* --------------------------------------------------------------------------
   Experience — company logos
   -------------------------------------------------------------------------- */

.experience-title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.company-logo {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
  border: 1px solid #e4e8ec;
}

/* --------------------------------------------------------------------------
   Publications
   -------------------------------------------------------------------------- */

.publication-card h3 {
  margin: 0.65rem 0 0.45rem;
  color: #1f2328;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.publication-card p {
  margin: 0 0 0.5rem;
  color: #59636e;
  line-height: 1.6;
  font-size: 0.92rem;
}

.publication-teaser {
  display: block;
  margin: 0.8rem 0 0.6rem;
  border: 1px solid #d1d9e0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.publication-teaser img {
  display: block;
  width: 100%;
  height: auto;
}

.publication-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  color: #59636e;
  font-size: 0.78rem;
}

/* Badges — GitHub label style */
.venue-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border: 1px solid #d1d9e0;
  border-radius: 999px;
  background: #fff;
  color: #4b5563;
  font-weight: 600;
}

.venue-badge--green {
  border-color: #b5dfc7;
  background: #dafbe1;
  color: #116329;
}

.venue-badge--gold {
  border-color: #e8d0a3;
  background: #fff8c5;
  color: #7d4e00;
}

.venue-badge--neutral {
  border-color: #d1d9e0;
  background: #eff2f5;
  color: #4b5563;
}

.publication-card a,
.page__content a {
  color: #0969da;
  font-weight: 500;
  text-decoration: none;
}

.publication-card a:hover,
.page__content a:hover {
  color: #0550ae;
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Research
   -------------------------------------------------------------------------- */

.research-project ul {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
  color: #3d444d;
}

.research-project li {
  margin-bottom: 0.45rem;
  line-height: 1.65;
}

.research-project li:last-child {
  margin-bottom: 0;
}

.research-project li::marker {
  color: #818b98;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */

.sidebar .author__urls a {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 720px) {
  #main {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  .sidebar {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
  }

  .author__avatar,
  .author__content {
    display: block;
    min-width: 0;
  }

  .author__avatar {
    flex: 0 0 44px;
    width: 44px;
  }

  .author__content {
    flex: 1 1 auto;
    width: auto;
    padding: 0 0 0 0.75rem;
  }

  .author__urls-wrapper {
    display: none;
  }

  .author__bio {
    overflow-wrap: anywhere;
  }

  .page,
  .page__inner-wrap,
  .page__content {
    float: none;
    width: 100% !important;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .page__content {
    overflow-wrap: anywhere;
  }

  .main-heading {
    font-size: 1.65rem;
  }

  .news-list li {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .item-header {
    flex-direction: column;
    gap: 0.45rem;
  }

  .item-header time {
    align-self: flex-start;
    white-space: normal;
  }

  .experience-title {
    align-items: flex-start;
  }

  .timeline-item,
  .experience-card,
  .publication-card,
  .research-project,
  .news-box {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
}
