/*
  Tiantian Zhang — Academic Homepage CSS
  Minimal academic style for the custom homepage markup generated earlier.

  Install option A:
    Copy this file to assets/css/tiantian-home.css to replace the current style.

  Install option B:
    Copy this file to assets/css/tiantian-academic.css and change the stylesheet line in
    _pages/about.md to:
      <link rel="stylesheet" href="{{ '/assets/css/tiantian-academic.css' | relative_url }}">
*/

:root {
  --bg: #ffffff;
  --paper: #ffffff;
  --ink: #1f2933;
  --muted: #5f6b7a;
  --line: #dfe5ec;
  --line-soft: #edf1f5;
  --accent: #1f5d9d;
  --accent-deep: #123f6d;
  --accent-soft: #f3f7fb;
  --gold: #8a6a18;
  --shadow: none;
  --radius: 6px;
  --max: 980px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body,
button,
input,
textarea {
  font: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

img {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid rgba(31, 93, 157, 0.45);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 100;
  transform: translateY(-140%);
  border-radius: 4px;
  background: var(--accent-deep);
  color: #fff;
  padding: 8px 12px;
  font-weight: 600;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Header / navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  width: min(100% - 32px, var(--max));
  min-height: 58px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  color: var(--ink);
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.logo:hover {
  color: var(--ink);
  text-decoration: none;
}

.logo span:first-child {
  font-size: 1rem;
}

.logo span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 450;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted);
  padding: 7px 9px;
  border-radius: 0;
  font-size: 0.92rem;
  transition: color 120ms ease, background 120ms ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-deep);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

main {
  min-height: calc(100vh - 150px);
}

.section,
.hero,
.page-hero {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
}

/* Homepage hero: academic, not theatrical */
.hero {
  min-height: auto;
  display: block;
  text-align: left;
  padding: 58px 0 34px;
  border-bottom: 1px solid var(--line-soft);
}

.hero-inner {
  max-width: 820px;
}

.kicker,
.eyebrow,
.work-topline,
.paper-status,
.paper-area {
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.kicker {
  display: block;
  width: fit-content;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: 0;
  padding: 0 0 0 10px;
  font-size: 0.8rem;
  font-weight: 650;
}

.hero h1,
.page-hero h1 {
  margin: 14px 0 12px;
  color: var(--ink);
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: clamp(2.35rem, 6vw, 4.4rem);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.hero h1 .tight,
.page-hero h1 .tight {
  letter-spacing: 0;
}

.hero-copy,
.page-hero p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.hero-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--accent-deep);
  font-size: 0.92rem;
  font-weight: 600;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.button:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--accent);
  text-decoration: none;
}

.button.primary {
  color: #fff;
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.button.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.button.secondary {
  background: #fff;
}

.scroll-note {
  display: none;
}

/* Sections */
.section {
  padding: 40px 0;
  border-bottom: 1px solid var(--line-soft);
}

.section-heading {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

h2,
h3,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 9px;
  color: var(--ink);
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: clamp(1.45rem, 3.1vw, 2.05rem);
  line-height: 1.22;
  font-weight: 500;
}

h3 {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.32;
  font-weight: 650;
}

p {
  margin-bottom: 0.8rem;
}

.lead {
  color: var(--muted);
  font-size: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.paper-card,
.work-card,
.callout {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

.card {
  padding: 18px;
}

.card p,
.work-card p,
.paper-desc {
  color: var(--muted);
}

.card-link {
  transition: border-color 120ms ease, background 120ms ease;
}

.card-link:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-width: 0;
  margin: 0 0 9px;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.number::before {
  content: "[";
}

.number::after {
  content: "]";
}

/* Profile */
.profile-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.portrait {
  width: 132px;
  height: 132px;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: #f6f8fa;
  display: grid;
  place-items: center;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-fallback {
  color: var(--accent-deep);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.role {
  color: var(--accent-deep) !important;
  font-weight: 650;
  margin-bottom: 5px !important;
}

.badge-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 8px;
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 550;
}

/* Research / work / publication cards */
.work-list,
.paper-list,
.timeline {
  display: grid;
  gap: 13px;
}

.work-card,
.paper-card {
  padding: 20px;
  transition: border-color 120ms ease, background 120ms ease;
}

.work-card:hover,
.paper-card:hover {
  transform: none;
  box-shadow: none;
  border-color: #c8d4df;
}

.work-card.featured {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
}

.work-card.placeholder {
  border-style: dashed;
  background: #fff;
}

.work-topline,
.paper-status,
.paper-area {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 4px;
  padding: 0 7px;
  margin-bottom: 8px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-size: 0.7rem;
  font-weight: 700;
}

.work-card h3,
.paper-title {
  margin-bottom: 7px;
  color: var(--ink);
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: clamp(1.18rem, 2.4vw, 1.55rem);
  line-height: 1.25;
  font-weight: 500;
}

.authors,
.paper-authors {
  color: var(--ink) !important;
  font-weight: 600;
  margin-bottom: 7px !important;
}

.paper-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.paper-area {
  color: var(--gold);
  background: #fbf8ed;
}

.link-row,
.paper-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 13px;
}

.text-link,
.disabled-link,
.soft-label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 4px;
  padding: 0 9px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.84rem;
  font-weight: 600;
}

.text-link {
  color: var(--accent-deep);
}

.text-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.disabled-link,
.soft-label {
  color: var(--muted);
  background: #f8fafc;
}

/* Timeline */
.timeline-item {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 20px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 16px 0 0;
  background: transparent;
}

.timeline-item.card {
  box-shadow: none;
}

.timeline-item .term {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: none;
}

/* Mission / callout / footer */
.mission-band {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.mission-band strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  line-height: 1.25;
  font-weight: 500;
}

.mission-band p {
  margin: 0;
  color: var(--muted);
}

.mission-mark {
  display: none;
}

.callout {
  padding: 22px;
  background: #f8fafc;
}

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

.site-footer {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  padding: 24px 0 40px;
  color: var(--muted);
  border-top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.footer-wordmark {
  color: var(--ink);
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.95rem;
}

@media (max-width: 840px) {
  .nav-wrap {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
    gap: 9px;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .section-heading,
  .timeline-item,
  .mission-band {
    grid-template-columns: 1fr;
  }

  .grid,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 38px;
  }
}

@media (max-width: 600px) {
  html {
    font-size: 15px;
  }

  .section,
  .hero,
  .page-hero,
  .nav-wrap,
  .site-footer {
    width: min(100% - 24px, var(--max));
  }

  .profile-card {
    grid-template-columns: 1fr;
  }

  .portrait {
    width: 108px;
    height: 108px;
  }

  .nav-links a {
    padding-left: 0;
    padding-right: 10px;
  }

  .card,
  .paper-card,
  .work-card,
  .callout,
  .mission-band {
    padding: 16px;
  }

  .timeline-item {
    padding-left: 0;
    padding-right: 0;
  }
}

@media print {
  .site-header,
  .hero-actions,
  .scroll-note,
  .site-footer {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .section,
  .hero {
    width: 100%;
    padding: 18px 0;
    border-bottom: 1px solid #ccc;
  }
}
