:root {
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #555555;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-border: #e5e5e5;
  --color-tag-bg: #f0f4ff;
  --color-tag-text: #1e40af;
  --color-placeholder: #9ca3af;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --max-width: 1280px;
  --sidebar-width: 252px;
  --page-padding-x: 2.25rem;
  --page-padding-y: 2.5rem;
  --layout-gap: 2.75rem;
  --pub-figure-width: 248px;
  --hero-photo-size: 194px;
  --lightbox-max-width: min(98vw, 1680px);
  --lightbox-max-height: calc(100dvh - 3rem);
  --header-height: 56px;
  --section-gap: 3.5rem;
  --radius: 6px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/*
 * 布局容器默认不可选中，避免双击空白时浏览器选中整段文字；
 * 下方显式列出的正文元素仍可正常拖选复制。
 */
main,
.page-layout,
.sidebar,
.main-content,
section,
.pub-layout,
.pub-aside,
.pub-body,
.pub-list,
.pub-item,
.pub-header,
.pub-badges,
.pub-links,
.pub-figure,
.timeline,
.hero,
.hero-body,
.interest-tags,
.nav,
.site-header,
.site-footer {
  -webkit-user-select: none;
  user-select: none;
}

main p,
main h1,
main h2,
main h3,
main h4,
main h5,
main h6,
main li,
.pub-title,
.pub-authors,
.pub-tldr,
.about-text,
.hero-bio,
.hero-name,
.hero-affiliation,
.timeline-title,
.timeline-subtitle,
.timeline-detail,
.project-name,
.project-desc,
.award-item,
.section-title,
.interest-desc,
.news-item {
  -webkit-user-select: text;
  user-select: text;
}

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

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

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

/* Header & Nav */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding-x);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-brand {
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

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

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  flex: 1;
}

.nav-links a {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  text-decoration: none;
}

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

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius);
  font-family: inherit;
}

.lang-btn:hover {
  color: var(--color-accent);
}

.lang-btn.active {
  color: var(--color-accent);
  font-weight: 600;
}

.lang-divider {
  color: var(--color-border);
  font-size: 0.75rem;
}

/* Main layout */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--page-padding-y) var(--page-padding-x) 4rem;
}

.page-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--layout-gap);
}

.sidebar .section {
  margin-bottom: 2rem;
}

.sidebar .section:last-child {
  margin-bottom: 0;
}

.main-content .section {
  margin-bottom: var(--section-gap);
}

.main-content .section:last-child {
  margin-bottom: 0;
}

.section {
  margin-bottom: var(--section-gap);
}

.section-title {
  font-size: 1.375rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border);
  letter-spacing: -0.01em;
}

/* Hero (sidebar: photo + intro stacked vertically) */

.hero {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: 0;
}

.hero-photo {
  width: var(--hero-photo-size);
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-border);
}

.hero-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

.hero-affiliation {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin: 0 0 0.75rem;
}

.hero-bio {
  margin: 0 0 1rem;
  color: var(--color-text);
}

.hero-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.hero-links a {
  font-size: 0.9rem;
}

.hero-cv {
  margin-top: 0.75rem;
}

.btn-cv {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.btn-cv:hover {
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
}

/* About Me */

.about-text {
  margin: 0 0 1.5rem;
  color: var(--color-text);
  font-size: 0.95rem;
}

.about-text .pub-author-link,
.about-text .pub-author-self {
  color: var(--color-accent-hover);
  font-weight: 600;
}

.about-text .pub-author-link {
  text-decoration: none;
}

.about-text .pub-author-link:hover {
  text-decoration: underline;
}

.about-tags-label {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* Research interest tags */

.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.interest-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  border-radius: 999px;
}

.interest-desc {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* Education & Experience */

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

.timeline-item {
  margin-bottom: 1.25rem;
  padding-left: 1rem;
  border-left: 2px solid var(--color-border);
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 0.15rem;
}

.timeline-title {
  font-weight: 600;
  margin: 0;
}

.timeline-date {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.timeline-subtitle {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.timeline-detail {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* Publications */

.pub-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border);
}

.pub-section-head .section-title {
  margin: 0;
  padding: 0;
  border: none;
  flex: 1;
  min-width: 0;
}

.pub-menu {
  position: relative;
  flex-shrink: 0;
}

.pub-menu-btn {
  appearance: none;
  border: none;
  background: none;
  padding: 0.15rem 0.35rem;
  margin: 0;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.pub-menu-btn:hover,
.pub-menu-btn:focus-visible {
  opacity: 1;
  color: var(--color-text);
}

.pub-menu-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.pub-menu-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 20;
  min-width: min(17rem, calc(100vw - 2rem));
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.pub-menu-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.pub-menu-field:last-of-type {
  margin-bottom: 0.5rem;
}

.pub-menu-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.pub-menu-field select {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg);
  color: var(--color-text);
  font: inherit;
  font-size: 0.85rem;
}

.pub-menu-field select:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.pub-menu-note {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.pub-menu-actions {
  margin-bottom: 0.5rem;
}

.pub-menu-refresh {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  color: var(--color-accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pub-menu-refresh:hover:not(:disabled) {
  color: var(--color-accent-hover);
}

.pub-menu-refresh:disabled {
  opacity: 0.55;
  cursor: wait;
  text-decoration: none;
}

.pub-empty-msg {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

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

.pub-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.pub-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.pub-item-has-figure .pub-layout {
  grid-template-columns: var(--pub-figure-width) minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
}

.pub-aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.pub-aside .pub-header {
  justify-content: center;
  margin-bottom: 0;
  width: 100%;
}

.pub-aside .pub-badges {
  justify-content: center;
}

.pub-figure {
  width: 100%;
  display: flex;
  justify-content: center;
}

.pub-figure img,
.pub-figure-zoomable {
  width: 100%;
  max-width: var(--pub-figure-width);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  object-fit: contain;
}

.pub-figure-zoomable {
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  -webkit-user-drag: none;
  user-drag: none;
}

.pub-figure-zoomable:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

.pub-figure-zoomable:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.pub-aside .pub-links {
  justify-content: center;
  width: 100%;
}

.pub-body {
  min-width: 0;
}

.pub-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.pub-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.pub-year {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.pub-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pub-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  line-height: 1.4;
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
}

.pub-badge-venue {
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
}

.pub-badge-status {
  background: #fef3c7;
  color: #92400e;
}

.pub-badge-accepted {
  background: #dcfce7;
  color: #166534;
}

.pub-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 0.25rem;
}

.pub-authors {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.pub-author-link {
  color: var(--color-text-muted);
  text-decoration: none;
}

.pub-author-link:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.pub-author-self {
  color: var(--color-text);
  font-weight: 600;
}

.pub-tldr {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

.pub-tldr-label {
  font-weight: 600;
  color: var(--color-text);
  margin-right: 0.35rem;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-accent);
  text-decoration: none;
  line-height: 1.2;
}

.pub-link-icon {
  display: inline-flex;
  flex-shrink: 0;
  width: 0.875rem;
  height: 0.875rem;
}

.pub-link-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.pub-link-label {
  line-height: 1.2;
}

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

/* News (sidebar) */

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

.news-item {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

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

.news-date {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.1rem;
}

/* Projects */

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

.project-item {
  margin-bottom: 1rem;
}

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

.project-name {
  font-weight: 600;
  margin: 0 0 0.15rem;
}

.project-desc {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.project-links {
  margin-top: 0.25rem;
}

/* Awards */

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

.award-item {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.award-year {
  color: var(--color-text-muted);
  margin-right: 0.5rem;
}

/* Optional / placeholder sections */

.section-optional .placeholder-msg {
  color: var(--color-placeholder);
  font-style: italic;
  font-size: 0.95rem;
  margin: 0;
}

/* Contact */

.contact-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.contact-links a {
  font-size: 0.95rem;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Sidebar news: compact list for narrow column */

.sidebar .section-title {
  font-size: 1.125rem;
}

/* Lightbox */

body.lightbox-open {
  overflow: hidden;
}

body.fun-no-select {
  user-select: none;
  -webkit-user-select: none;
}

body.fun-no-select * {
  user-select: none;
  -webkit-user-select: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}

.lightbox-chip {
  z-index: 1003;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.92);
  pointer-events: auto;
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.lightbox-close {
  position: fixed;
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.lightbox-close svg {
  width: 1rem;
  height: 1rem;
  display: block;
  flex-shrink: 0;
}

.lightbox-close:hover {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(255, 255, 255, 0.28);
}

.lightbox-stage {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  pointer-events: auto;
  cursor: zoom-out;
  padding: 1rem 0.75rem 0.25rem;
}

.lightbox-img {
  max-width: var(--lightbox-max-width);
  max-height: var(--lightbox-max-height);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  transform-origin: center center;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  user-drag: none;
  touch-action: none;
}

.lightbox-img.is-dragging {
  cursor: grabbing;
}

.lightbox-zoom-toast {
  position: fixed;
  left: 50%;
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.lightbox-zoom-toast.is-visible {
  opacity: 1;
  visibility: visible;
}

.lightbox-zoom-level {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  line-height: 1;
  white-space: nowrap;
}

/* Emoji easter egg */

.emoji-charge-holder {
  position: fixed;
  z-index: 902;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(calc(1 + var(--charge, 0) * 0.55));
  transition: transform 0.08s ease-out;
}

.emoji-charge-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(36px + var(--charge, 0) * 48px);
  height: calc(36px + var(--charge, 0) * 48px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid transparent;
  opacity: 0;
  transition: opacity 0.15s ease, width 0.1s ease, height 0.1s ease;
}

.emoji-charge-holder.is-charging .emoji-charge-ring {
  opacity: 1;
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 calc(4px + var(--charge, 0) * 10px) rgba(37, 99, 235, 0.12);
}

.emoji-charge-emoji {
  position: relative;
  display: block;
  font-size: calc(1.35rem + var(--charge, 0) * 0.9rem);
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
}

.emoji-particle {
  position: fixed;
  z-index: 900;
  pointer-events: none;
  font-size: 1.35rem;
  line-height: 1;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}

.emoji-float-tip {
  position: fixed;
  z-index: 901;
  pointer-events: none;
  transform: translate(-50%, -50%);
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  animation: float-tip-pop 1s ease forwards;
}

.emoji-combo-tip {
  background: var(--color-accent);
  color: #fff;
}

.emoji-miss-tip {
  background: rgba(100, 116, 139, 0.75);
  color: #f8fafc;
  animation-duration: 0.85s;
}

.emoji-crit-tip {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  animation: crit-tip-pop 1.5s ease forwards;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.45);
}

@keyframes float-tip-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -62%) scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -95%) scale(0.92);
  }
}

@keyframes crit-tip-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -65%) scale(1.25);
  }
  40% {
    opacity: 1;
    transform: translate(-50%, -68%) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -100%) scale(0.9);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox,
  .pub-figure-zoomable {
    transition: none;
  }

  .emoji-float-tip {
    animation: none;
    opacity: 0;
  }
}

/* Responsive */

@media (min-width: 900px) {
  .page-layout {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    gap: var(--layout-gap);
    align-items: start;
  }

  .sidebar {
    position: sticky;
    top: calc(var(--header-height) + 1.25rem);
  }

  .main-content {
    min-width: 0;
  }
}

@media (max-width: 899px) {
  .hero-photo {
    margin: 0 auto;
  }

  .hero-body {
    text-align: center;
  }

  .hero-links {
    align-items: center;
  }
}

@media (max-width: 640px) {
  :root {
    --page-padding-x: 1.125rem;
    --page-padding-y: 2rem;
    --layout-gap: 2rem;
    --hero-photo-size: 163px;
  }

  .nav {
    flex-wrap: wrap;
    height: auto;
    padding: 0.75rem var(--page-padding-x);
    gap: 0.75rem;
  }

  .site-header {
    height: auto;
  }

  .nav-links {
    order: 3;
    width: 100%;
  }

  .timeline-header {
    flex-direction: column;
    gap: 0;
  }

  .pub-item-has-figure .pub-layout {
    grid-template-columns: 1fr;
  }

  .pub-aside {
    max-width: min(100%, 320px);
    margin: 0 auto;
  }
}

@media print {
  .site-header,
  .lang-switch,
  .site-footer {
    display: none;
  }

  body {
    background: #fff;
  }

  main {
    padding: 0;
  }

  a {
    color: inherit;
    text-decoration: underline;
  }
}
