:root {
  --text: #111111;
  --muted: #5f6b76;
  --line: #d7dfe6;
  --link: #0f6680;
  --accent: #c98a00;
  --paper: #ffffff;
  --soft: #f7f9fb;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  padding-top: 58px;
  background: var(--paper);
  color: var(--text);
  font-family: Roboto, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0.75rem;
  z-index: 100;
  transform: translateY(-150%);
  background: #222;
  color: #fff;
  padding: 0.5rem 0.7rem;
  font-weight: 500;
}

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

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

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

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

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 50;
  border-bottom: 1px solid var(--accent);
  background: rgba(255, 255, 255, 0.97);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(800px, calc(100% - 2rem));
  min-height: 57px;
  margin: 0 auto;
  gap: 1rem;
}

.brand {
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1.05rem;
}

.site-header nav a {
  color: #333;
  font-size: 1rem;
  font-weight: 300;
}

.site-header nav a.active {
  color: var(--accent);
}

.page {
  width: min(800px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3.1rem 0 4.2rem;
}

.post-header {
  margin-bottom: 1.35rem;
}

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

h1 {
  margin-bottom: 0.35rem;
  font-size: 2.45rem;
  font-weight: 300;
  line-height: 1.16;
}

h2 {
  margin: 1.2rem 0 0.55rem;
  font-size: 1.9rem;
  font-weight: 400;
  line-height: 1.2;
}

h3 {
  margin: 0.35rem 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 500;
}

p {
  margin-bottom: 0.85rem;
}

.desc,
.tagline {
  margin-bottom: 0.6rem;
  font-size: 1rem;
  font-style: italic;
}

.profile {
  width: 230px;
  margin: 0 0 1rem 2rem;
  text-align: center;
}

.float-right {
  float: right;
}

.profile img,
.portrait-card img {
  display: block;
  width: 230px;
  height: 230px;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
  object-position: center 42%;
}

.profile .address,
.portrait-card p {
  margin-top: 0.75rem;
  color: var(--text);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88rem;
  line-height: 1.45;
  text-align: left;
}

.link-row,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.8rem 0 0;
}

.link-row a,
.footer-links a,
.more-link,
.cv-button {
  font-weight: 500;
}

.focus-lines {
  margin: 0;
  font-style: italic;
}

.focus-list,
.award-list,
.plain-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.25rem;
}

.awards-page h1 {
  margin-bottom: 0.7rem;
  font-size: 2rem;
}

.awards-page .award-list {
  gap: 0.55rem;
  font-size: 0.96rem;
  line-height: 1.45;
}

.awards-page .award-list strong {
  font-weight: 500;
}

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

.news-table th,
.news-table td {
  padding: 0.35rem 0.75rem 0.35rem 0;
  vertical-align: top;
  font-weight: 300;
}

.news-table th {
  width: 8.4rem;
  color: #000;
  font-weight: 500;
  white-space: nowrap;
}

.news-table td {
  color: var(--accent);
}

.publication-page h1 {
  font-size: 2.1rem;
}

.publication-note {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.bibliography {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.publication {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0;
}

.publication.no-preview {
  grid-template-columns: minmax(0, 1fr);
}

.pub-preview {
  margin: 0;
}

.pub-preview img {
  display: block;
  width: 145px;
  height: 104px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  object-fit: contain;
}

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

.publication h2,
.publication h3 {
  margin-top: 0.1rem;
  margin-bottom: 0.25rem;
  font-size: 1rem;
  font-weight: 500;
  overflow-wrap: break-word;
}

.publication p {
  margin-bottom: 0.35rem;
  overflow-wrap: break-word;
}

.pub-meta {
  color: #9d3c4d;
  font-size: 0.9rem;
  font-weight: 500;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.pub-links a {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.12rem 0.45rem;
  color: var(--link);
  font-size: 0.82rem;
  font-weight: 500;
}

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

.year-heading {
  margin: 1.35rem 0 0.2rem;
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 400;
}

.research-map {
  margin: 1rem 0 0;
  padding: 0.45rem;
  border: 1px solid var(--line);
  background: var(--soft);
}

.research-map img {
  display: block;
  width: 100%;
  max-height: 210px;
  object-fit: cover;
  object-position: center;
}

.software-list {
  display: grid;
  gap: 1rem;
}

.cv-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  margin-top: 0.25rem;
  border: 1px solid var(--link);
  padding: 0.45rem 0.65rem;
}

.connect-body {
  min-height: 100vh;
  padding-top: 0;
  background: #f7f9fb;
}

.scan-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
}

.scan-panel {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 1.2rem;
  text-align: center;
}

.scan-kicker {
  margin-bottom: 0.25rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scan-panel h1 {
  margin-bottom: 0.25rem;
  font-size: 2.2rem;
  font-weight: 400;
}

.scan-title,
.scan-topic {
  margin-bottom: 0.45rem;
}

.scan-title {
  font-weight: 500;
}

.scan-topic,
.contact-note {
  color: var(--muted);
}

.qr-block {
  margin: 0.9rem 0 0.65rem;
}

.qr-block img {
  display: block;
  width: min(78vw, 340px);
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line);
}

.qr-block figcaption {
  margin-top: 0.55rem;
  font-size: 1.05rem;
  font-weight: 500;
}

.scan-link {
  display: inline-block;
  max-width: 100%;
  margin-bottom: 0.85rem;
  overflow-wrap: anywhere;
  font-size: 0.94rem;
  font-weight: 500;
}

.scan-actions,
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
}

.scan-actions a,
.quick-actions a {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.42rem 0.65rem;
  font-weight: 500;
}

.quick-actions {
  justify-content: flex-start;
  margin: 0.35rem 0 1rem;
}

.quick-actions .primary-action {
  border-color: var(--link);
  background: var(--link);
  color: #fff;
}

.contact-hero {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.contact-hero img {
  display: block;
  width: 118px;
  height: 118px;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
  object-position: center 42%;
}

.compact-list {
  gap: 0.35rem;
}

.site-footer {
  border-top: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.site-footer .footer-inner {
  width: min(800px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.4rem 0;
  font-size: 0.85rem;
}

.site-footer a {
  color: #fff;
}

.not-found {
  min-height: 48vh;
}

@media (max-width: 760px) {
  body {
    padding-top: 0;
  }

  .site-header {
    position: static;
  }

  .nav-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.75rem 0;
  }

  .site-header nav {
    justify-content: flex-start;
    gap: 0.7rem;
  }

  .page {
    padding-top: 1.3rem;
  }

  .publication-page {
    width: min(800px, calc(100% - 0.75rem));
  }

  .publication-page h1 {
    font-size: 1.65rem;
  }

  .publication-note {
    font-size: 0.86rem;
    line-height: 1.4;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.45rem;
  }

  .profile,
  .float-right {
    float: none;
    width: 150px;
    margin: 0 0 1rem;
  }

  .profile img,
  .portrait-card img {
    width: 150px;
    height: 150px;
  }

  .news-table th,
  .news-table td {
    display: block;
    width: auto;
    padding: 0.15rem 0;
  }

  .publication {
    grid-template-columns: 1fr;
    gap: 0.55rem;
    padding: 0.7rem 0;
  }

  .publication h2,
  .publication h3 {
    font-size: 0.95rem;
    line-height: 1.28;
  }

  .publication p {
    font-size: 0.92rem;
    line-height: 1.42;
  }

  .pub-meta {
    font-size: 0.78rem;
    line-height: 1.3;
  }

  .pub-preview img {
    width: 100%;
    max-width: 260px;
    height: auto;
    max-height: 150px;
  }

  .pub-links a {
    padding: 0.08rem 0.38rem;
    font-size: 0.78rem;
  }

  .site-footer {
    position: static;
  }

  .scan-page {
    align-items: start;
    padding: 0.7rem;
  }

  .scan-panel {
    padding: 0.95rem;
  }

  .qr-block img {
    width: min(86vw, 330px);
  }

  .contact-hero {
    grid-template-columns: 1fr;
  }

  .contact-hero img {
    width: 96px;
    height: 96px;
  }
}
