/* ============================================================
   home.css — Homepage layout (loaded after site.css)
   Project pages use site.css only; nothing here leaks into them.
   ============================================================ */

.home {
  --ink:        #e8ecf1;
  --ink-soft:   #a3adba;
  --ink-faint:  #6e7886;
  --rule:       #222a35;
  --surface:    #121821;
  --link:       #b9a6ff;   /* AA on #0d1117 (the old #7c3aed was ~3:1) */
  --link-hover: #ded4ff;

  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
}

.home a {
  color: var(--link);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

.home a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.home a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Masthead --- */
.masthead {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 2rem;
  align-items: center;
  padding: 5.5rem 0 3rem;
}

.masthead img {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--rule);
}

.masthead h1 {
  font-size: clamp(2.25rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 0.75rem;
}

.roles {
  list-style: none;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.roles a { color: var(--ink); }
.roles a:hover { color: var(--link-hover); }

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  font-size: 0.92rem;
}

.home .contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-soft);
}

.home .contact a:hover { color: var(--ink); text-decoration: none; }

.contact svg { width: 15px; height: 15px; flex-shrink: 0; }

/* --- Sections --- */
.block {
  padding: 2.25rem 0;
  border-top: 1px solid var(--rule);
}

.block > h2 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

.about p {
  max-width: 680px;
  color: var(--ink);
  margin-bottom: 0.9rem;
}

.about p:last-child { margin-bottom: 0; }

/* --- Publications --- */
.pubs {
  list-style: none;
  display: grid;
  gap: 1.75rem;
}

.pub {
  display: grid;
  grid-template-columns: 208px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.pub-media {
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--rule);
}

.pub-media video,
.pub-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pub-media.contain img { object-fit: contain; background: #fff; }

.pub h3 {
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.005em;
  margin: 0 0 0.3rem;
}

.home .pub h3 a { color: var(--ink); }
.home .pub h3 a:hover { color: var(--link-hover); }

.authors {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 0.4rem;
}

.authors strong { color: var(--ink); font-weight: 600; }

.pub-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
  font-size: 0.86rem;
}

.venue {
  color: var(--ink);
  font-weight: 600;
  margin-right: 0.25rem;
}

/* --- News --- */
.news {
  list-style: none;
  display: grid;
  gap: 0.7rem;
}

.news li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  font-size: 0.94rem;
}

.news time {
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.news span { max-width: 64ch; }

/* --- Education --- */
.edu {
  list-style: none;
  display: grid;
  gap: 0.45rem;
  font-size: 0.94rem;
}

.edu li span { color: var(--ink-soft); margin-left: 0.5rem; }

/* --- Footer --- */
.home-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0 3rem;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* --- Single load moment --- */
@media (prefers-reduced-motion: no-preference) {
  .masthead { animation: rise 0.6s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
  }
}

/* --- Small screens --- */
@media (max-width: 640px) {
  .masthead {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding-top: 3.5rem;
  }
  .masthead img { width: 104px; height: 104px; }
  .pub { grid-template-columns: 1fr; gap: 0.75rem; }
  .pub-media { max-width: 420px; }
  .news li { grid-template-columns: 1fr; gap: 0; }
}
