/* ---------------------------------------------------------------
   Frank Liu — research site
   Layout follows the al-folio idiom; background uses the warm bone
   tone from claude.ai (#F0EEE6) with a deep-teal accent.
   --------------------------------------------------------------- */

:root {
  --bg:            #f0eee6;
  --bg-raised:     #faf9f5;
  --ink:           #1f1e1c;
  --ink-soft:      #6b6861;
  --rule:          #ddd9cd;
  --accent:        #14646f;
  --accent-hover:  #0d8b9c;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "Roboto Slab", Georgia, "Times New Roman", serif;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 .6rem;
}

h1 { font-size: 2.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.5rem; margin-top: 2.6rem; }
h3 { font-size: 1.15rem; margin-top: 1.8rem; }

p { margin: 0 0 1.1rem; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}

a:hover { color: var(--accent-hover); border-bottom-color: currentColor; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ------------------------------ navigation ------------------------------ */

.nav {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav-inner {
  max-width: 60rem;
  margin: 0 auto;
  padding: .85rem 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav-brand {
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 1.15rem;
  color: var(--ink);
  border: 0;
}

.nav-brand:hover { color: var(--accent); }

.nav-links {
  margin-left: auto;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--ink-soft);
  font-size: .95rem;
}

.nav-links a:hover { color: var(--accent); }

.nav-links a[aria-current="page"] {
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
}

/* -------------------------------- layout -------------------------------- */

main {
  max-width: 60rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.page-title { margin-bottom: .25rem; }

.page-intro {
  color: var(--ink-soft);
  max-width: 44rem;
  margin-bottom: 2.5rem;
}

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

/* --------------------------------- about -------------------------------- */

.about {
  display: grid;
  grid-template-columns: 1fr 15rem;
  gap: 3rem;
  align-items: start;
}

.about-body { max-width: 40rem; }

.about-body p { line-height: 1.75; }

.card-highlight {
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  padding: 1.1rem 1.3rem;
  margin: 1.8rem 0 0;
}

.card-highlight p { margin: 0; }

.portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 2px;
  display: block;
  background: #e5e1d6;
}

.portrait-fallback {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #e5e1d6;
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: .85rem;
  text-align: center;
  padding: 1rem;
}

.contact {
  margin-top: 1.1rem;
  font-size: .9rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

.contact div + div { margin-top: .55rem; }

/* --------------------------------- news --------------------------------- */

.news { width: 100%; border-collapse: collapse; }

.news td {
  border-bottom: 1px solid var(--rule);
  padding: .8rem .5rem .8rem 0;
  vertical-align: top;
  font-size: .95rem;
}

.news td:first-child {
  white-space: nowrap;
  color: var(--ink-soft);
  width: 8.5rem;
  font-variant-numeric: tabular-nums;
}

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

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

.pub-list li {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
}

.pub-title {
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 1.05rem;
  display: block;
  margin-bottom: .2rem;
}

.pub-authors { font-size: .95rem; }

.pub-venue { font-size: .9rem; color: var(--ink-soft); font-style: italic; }

.pub-links { margin-top: .45rem; font-size: .85rem; display: flex; gap: .5rem; flex-wrap: wrap; }

.pub-links a {
  border: 1px solid var(--rule);
  padding: .1rem .55rem;
  border-radius: 2px;
  background: var(--bg-raised);
}

.pub-links a:hover { border-color: var(--accent-hover); }

.me { font-weight: 500; color: var(--ink); }

/* -------------------------------- projects ------------------------------ */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  padding: 1.5rem 1.6rem 1.7rem;
  display: flex;
  flex-direction: column;
}

.project-card h3 { margin-top: 0; font-size: 1.2rem; }

.project-card h3 a { color: var(--ink); border: 0; }

.project-card h3 a:hover { color: var(--accent); }

.project-card p { font-size: .95rem; color: var(--ink-soft); }

.project-card .project-more { margin-top: auto; font-size: .9rem; }

.tagline {
  font-size: .85rem;
  color: var(--accent);
  margin-bottom: .5rem;
  display: block;
}

/* ---------------------------- project detail ---------------------------- */

.project-header { max-width: 44rem; margin-bottom: 2.5rem; }

.lede { font-size: 1.15rem; line-height: 1.7; color: var(--ink-soft); }

.project-body { max-width: 42rem; }

.project-body ul { padding-left: 1.2rem; }

.project-body li { margin-bottom: .5rem; }

.figure-note {
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  padding: 1.2rem 1.4rem;
  margin: 2rem 0;
}

.figure-note h4 {
  font-size: .95rem;
  margin: 0 0 .5rem;
}

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

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin: 2rem 0;
}

.stat {
  background: var(--bg-raised);
  padding: 1.1rem 1.2rem;
}

.stat b {
  font-family: "Roboto Slab", Georgia, serif;
  font-weight: 400;
  font-size: 1.5rem;
  display: block;
  color: var(--accent);
  line-height: 1.2;
}

.stat span { font-size: .85rem; color: var(--ink-soft); }

.back-link { font-size: .9rem; display: inline-block; margin-bottom: 1.5rem; }

/* --------------------------------- misc --------------------------------- */

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

.plain-list li {
  padding: .9rem 0;
  border-bottom: 1px solid var(--rule);
}

footer {
  border-top: 1px solid var(--rule);
  background: var(--bg-raised);
  color: var(--ink-soft);
  font-size: .85rem;
}

.footer-inner {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 46rem) {
  h1 { font-size: 2rem; }
  .about { grid-template-columns: 1fr; gap: 2rem; }
  .about-portrait { max-width: 13rem; }
  .project-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
  main { padding-top: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ------------------------------ social links ---------------------------- */

.social {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: .95rem;
}

.social a { color: var(--ink-soft); }

.social a:hover { color: var(--accent); }

.tbd {
  color: var(--ink-soft);
  font-style: italic;
  margin-top: 2rem;
}

/* ---------------------------- photo credit ------------------------------ */

.photo-credit {
  font-size: .7rem;
  font-weight: 300;
  color: #9a948a;
  margin-top: .4rem;
  line-height: 1.4;
}

/* social row sitting under the news table */

.social.social-below {
  margin-top: 2.2rem;
  padding-top: 1.4rem;
}
