/* ---------- Sections ---------- */

section { padding: 3.7rem 0 0; scroll-margin-top: 82px; }
.section-title {
  display: flex; align-items: baseline; gap: 0.8rem;
  margin: 0 0 1.6rem; font-family: var(--header-font); font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 700; line-height: 1.1; color: var(--ink); letter-spacing: -0.01em;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-note { margin: -1rem 0 1.4rem; color: var(--muted); font-size: 0.92rem; }

.eyebrow {
  margin: 0 0 0.8rem; color: var(--sage); font-size: 0.78rem; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase;
}

.card {
  padding: 1.5rem 1.6rem; border: 1px solid var(--line); border-radius: 20px;
  background: var(--surface); box-shadow: var(--shadow); min-width: 0;
}
.card h3 { margin: 0; font-size: 1.12rem; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.card-head .tag { flex-shrink: 0; }
.card-sub { margin: 0.35rem 0 0; font-weight: 500; }
.card-period { margin: 0.1rem 0 0.8rem; color: var(--muted); font-size: 0.88rem; }
.card-list { margin: 0; padding-left: 1.2rem; }
.card-list li + li { margin-top: 0.35rem; }
.card-links { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--line); font-weight: 600; }
.card-links a { color: var(--gold); }

.stack { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }

/* ---------- Profile ---------- */

.profile { padding-top: 3.2rem; }
.profile h1 {
  margin: 0; font-family: var(--header-font); font-size: clamp(3rem, 8vw, 4.6rem);
  line-height: 0.95; letter-spacing: -0.03em; color: var(--ink);
}
.alt-name { color: var(--muted); font-weight: 500; font-size: .53em; letter-spacing: -.01em; }
.affiliation { margin: 0.9rem 0 0; font-size: 1.12rem; font-weight: 600; color: var(--ink); }
.bio { max-width: 72ch; margin: 1rem 0 0; line-height: 1.85; }
.social-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }
.social-links a {
  display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.85rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface-strong);
  font-size: 0.9rem; font-weight: 600;
}
.social-links a:is(:hover,:focus-visible) { border-color: var(--gold-line); background: var(--gold-soft); }
.social-links svg { width: 17px; height: 17px; flex-shrink: 0; }

/* ---------- Supporting sections ---------- */

.about-sections > section { margin-top: 3.7rem; padding-top: 0; scroll-margin-top: 12px; }
.about-sections > section:not(#publications) .section-title { font-size: clamp(1.9rem, 3vw, 2.3rem); }
#experience .card { box-shadow: none; background: transparent; }
#news .news-item { padding-block: .65rem; }

/* ---------- News / honors (timeline rows) ---------- */

.timeline { margin: 0; padding: 0; list-style: none; }
.news-item, .honor-item {
  display: grid; grid-template-columns: 84px 1fr; gap: 1rem;
  padding: 0.7rem 0; border-bottom: 1px solid var(--line);
}
.news-item time, .honor-item time { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.honor-item { grid-template-columns: 84px 1fr auto; align-items: baseline; }
.honor-name { color: var(--ink); font-weight: 600; }
.honor-level { color: var(--muted); font-size: 0.9rem; text-align: right; }

/* ---------- Selected publications ---------- */

.pub-list { margin: 0; padding: 0; list-style: none; }
.pub-item {
  padding: 1.6rem 0; border-bottom: 1px solid var(--line);
}
.pub-item:first-child { padding-top: .5rem; }
.pub-content { min-width: 0; }
.pub-year { margin-bottom: .35rem; color: var(--gold); font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pub-title { margin: 0; font-size: 1.1rem; line-height: 1.55; color: var(--ink); text-wrap: pretty; overflow-wrap: anywhere; }
.pub-title a { text-decoration-color: transparent; text-underline-offset: 5px; }
.pub-title a:is(:hover,:focus-visible) { text-decoration: underline; text-decoration-thickness: 1px; }
.pub-summary { max-width: 70ch; margin: .75rem 0 .85rem; font-size: .94rem; line-height: 1.8; }
.pub-authors { margin-top: 0.35rem; font-size: 0.94rem; line-height: 1.7; }
.pub-venue { margin-top: 0.2rem; color: var(--muted); font-size: 0.9rem; font-style: italic; line-height: 1.65; }
.pub-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-top: 0.5rem; }
.pub-links { display: inline-flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pub-links a, .pub-links button {
  padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: none;
  font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--gold); cursor: pointer;
}
.pub-links a:is(:hover,:focus-visible), .pub-links button:is(:hover,:focus-visible) { border-color: var(--gold-line); background: var(--gold-soft); color: var(--ink); }
.more-link { display: inline-block; margin-top: 1rem; font-weight: 700; color: var(--gold); }

/* ---------- Projects / engagement ---------- */

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.project p { margin: 0.6rem 0 0.9rem; font-size: 0.95rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.plain-list { margin: 0.7rem 0 0; padding: 0; list-style: none; }
.plain-list li { display: grid; padding: 0.55rem 0; border-bottom: 1px solid var(--line); font-size: 0.93rem; }
.plain-list li:last-child { border-bottom: 0; }
.plain-list strong { font-weight: 600; }
.plain-list span { color: var(--muted); font-size: 0.86rem; }

/* ---------- Show more ---------- */

.is-collapsed > .extra { display: none; }
.toggle-btn {
  display: block; margin: 1.2rem auto 0; padding: 0.45rem 1.2rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface-strong);
  font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); cursor: pointer;
}
.toggle-btn:hover { border-color: var(--gold-line); color: var(--ink); }

/* ---------- Full publications page ---------- */

.page-head { padding: 4rem 0 0.5rem; }
.page-head h1 { margin: 0; font-family: var(--header-font); font-size: clamp(2.8rem, 7vw, 4rem); line-height: 1; color: var(--ink); }
.page-head p { margin: 0.8rem 0 0; color: var(--muted); }
.pub-cards { display: grid; gap: 1.2rem; padding: 2rem 0 0; }
.pub-card { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; scroll-margin-top: 12px; }
.pub-card:target { border-color: var(--gold-line); }
.pub-card h2 { margin: 0; font-size: 1.2rem; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere; }
.pub-thumb {
  align-self: start; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: #fff; cursor: zoom-in;
}
.pub-thumb img { display: block; width: 100%; height: auto; transition: transform 0.25s ease; }
.pub-thumb:hover img { transform: scale(1.03); }
.pub-abstract { margin: 0.8rem 0 0; font-size: 0.94rem; line-height: 1.8; overflow-wrap: anywhere; }
.pub-card .pub-links { margin-top: 0.9rem; }
.bibtex {
  margin: 0.9rem 0 0; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-strong); font-size: 0.8rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere;
}

.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 3vw; background: rgba(8, 12, 18, 0.88); border: 0; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: 10px; background: #fff; }
.lightbox-close {
  position: absolute; top: 14px; right: 18px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 28px; line-height: 1; cursor: pointer;
}

/* ---------- Mobile ---------- */

@media (max-width: 720px) {
  body { font-size: 15px; }
  .wrap { width: calc(100% - 28px); }
  .brand-name { display: none; }
  section { padding-top: 3.2rem; }
  .card { padding: 1.2rem; }
  .card-head { flex-direction: column; gap: 0.4rem; }
  .news-item, .honor-item { grid-template-columns: 1fr; gap: 0.1rem; }
  .honor-level { text-align: left; }
  .about-sections > section { margin-top: 3.2rem; }
  .pub-item { padding: 1.5rem 0; }
  .pub-item .pub-authors { margin-top: .5rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .pub-card { grid-template-columns: 1fr; }
  .pub-thumb { max-width: 420px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

@media print {
  .site-nav, .toggle-btn, .theme-toggle, .skip-link { display: none !important; }
  .is-collapsed > .extra { display: revert; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* "More" on /about/ publications: same look as the show-more buttons, links to the full list. */
.more-btn { width: fit-content; text-align: center; }

.section-menu { margin-top: 2rem; border-block: 1px solid var(--line); padding: 12px 0; }
.about-sections { display: flow-root; min-width: 0; }
.section-menu summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.section-links { display: flex; flex-wrap: wrap; gap: 6px 20px; padding-top: 12px; font-size: .85rem; }
.section-links a[aria-current] { color: var(--gold); text-decoration: underline; text-underline-offset: 5px; }
.pub-meta:empty { display: none; }
.pub-meta .tag { background: transparent; font-size: .7rem; color: var(--muted); }
.pub-card.no-figure { grid-template-columns: minmax(0,1fr); }
.pub-body { min-width: 0; }
.bib-details { margin-top: 16px; }
.bib-details summary { color: var(--gold); font-size: .85rem; cursor: pointer; }
.copy-bib { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; color: var(--ink); background: var(--surface); cursor: pointer; }
.copy-status { display: block; font-size: .8rem; color: var(--muted); }
.social-links a, .pub-links a, .pub-links button, .toggle-btn, .copy-bib {
  display: inline-flex; align-items: center; justify-content: center; min-height: 36px;
  border-radius: var(--control-radius); font-size: .82rem; line-height: 1.5;
}
.toggle-btn { display: flex; width: fit-content; }
.pub-links a, .pub-links button { padding: 5px 12px; }
.social-links a { padding: 7px 12px; }
.copy-bib { font-weight: 600; }
.copy-bib:is(:hover,:focus-visible) { border-color: var(--gold-line); color: var(--gold); }
.card-list, .bio, .pub-summary { overflow-wrap: anywhere; }
.research-bio { color: var(--ink-soft); }
.section-title { letter-spacing: -.025em; }
.card { border-radius: 16px; transition: border-color 200ms ease, box-shadow 200ms ease; }
.card:focus-within { border-color: var(--gold-line); }
#service .grid-2 { align-items: start; }
.service-card { background: var(--surface); box-shadow: none; padding: 1.4rem 1.5rem; }
.service-card h3 { font-size: 1rem; letter-spacing: -.015em; padding-bottom: .4rem; }
.service-card .plain-list li { padding-block: .8rem; gap: .2rem; }
.service-card .plain-list strong { font-size: .9rem; line-height: 1.6; }
.service-card .plain-list span { font-size: .8rem; }
.service-more { margin-top: 8px; border-top: 1px solid var(--line); }
.service-more summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding-top: 8px; color: var(--gold); cursor: pointer; font-size: .82rem; font-weight: 600; list-style: none; }
.service-more summary::-webkit-details-marker { display: none; }
.service-more .label-less { display: none; }
.service-more[open] .label-more { display: none; }
.service-more[open] .label-less { display: inline; }
.service-more .more-count { margin-left: 6px; color: var(--muted); font-weight: 400; }
.more-chevron { transition: transform 180ms ease; }
.service-more[open] .more-chevron { transform: rotate(180deg); }
.service-more .plain-list { margin-top: .3rem; }
.motion-details { display: flow-root; }
.service-more.motion-details[data-expanded="false"] .label-more { display: inline; }
.service-more.motion-details[data-expanded="false"] .label-less { display: none; }
.service-more.motion-details[data-expanded="false"] .more-chevron { transform: none; }
.service-more.motion-details[data-expanded="true"] .label-more { display: none; }
.service-more.motion-details[data-expanded="true"] .label-less { display: inline; }
.service-more.motion-details[data-expanded="true"] .more-chevron { transform: rotate(180deg); }
.service-more summary:is(:hover,:focus-visible) { color: var(--ink); }
@media (min-width: 1280px) {
  .profile-page .wrap { width: min(1120px, calc(100% - 64px)); }
  .profile-page .profile { margin-left: 200px; }
  .about-layout:has(.section-menu) { display: grid; grid-template-columns: 152px minmax(0, 1fr); gap: 48px; align-items: start; }
  .about-layout .section-menu { position: sticky; top: 88px; margin-top: 3.7rem; padding: 0; border: 0; max-height: calc(100vh - 112px); overflow-y: auto; }
  .about-layout .section-menu summary { padding: 8px 0; font-size: .74rem; letter-spacing: .06em; }
  .about-layout .section-links { display: grid; gap: 4px; padding-top: 10px; }
  .about-layout .section-links a { border-left: 1px solid var(--line); padding: 7px 0 7px 14px; color: var(--muted); font-size: .8rem; line-height: 1.5; }
  .about-layout .section-links a:is(:hover,:focus-visible), .about-layout .section-links a[aria-current] { border-color: var(--gold-line); color: var(--gold); text-decoration: none; }
}
@media (hover: hover) and (pointer: fine) {
  .card:hover { border-color: var(--gold-line); box-shadow: 0 8px 24px rgba(0,0,0,.055); }
}
@media (max-width:720px) {
  .profile { padding-top: 2rem; }
  .profile h1 { line-height: 1.15; }
  .affiliation { font-size: 1rem; }
  .bio { line-height: 1.8; }
  /* The native disclosure stays reachable on long mobile pages. */
  .section-menu {
    position: sticky; top: 68px; z-index: 10; margin-top: 1.8rem;
    padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--nav-bg); backdrop-filter: blur(14px);
    max-height: calc(100svh - 92px); overflow-y: auto;
  }
  .section-menu summary { min-height: 28px; line-height: 28px; color: var(--ink-soft); }
  .about-sections > section { scroll-margin-top: 64px; }
  .section-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-bottom: 4px; }
  .section-links a { display: flex; align-items: center; min-height: 40px; }
  .social-links a, .pub-links a, .pub-links button, .toggle-btn, .copy-bib { min-height: 44px; }
}
@media print {
  html { color-scheme: light; }
  .section-menu, .copy-bib { display: none; }
  body { color: #222; }
  .service-more > .plain-list { display: block !important; }
  .service-more summary { display: none; }
  .about-layout { display: block !important; }
  .profile-page .profile { margin-left: 0; }
}
