/*
  Personal academic website styles.
  Plain CSS only: no build tools, no dependencies.
*/

:root {
  --text: #221d18;
  --muted: #695f56;
  --border: #ddd4ca;
  --background: #fffaf3;
  --soft-background: #f6efe6;
  --link: #7a3218;
  --visited: #5a3f78;
  --max-width: 928px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", Times, serif;
  line-height: 1.68;
  color: var(--text);
  background: var(--background);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.site-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.name {
  margin: 0 0 0.3rem;
  font-size: 2.35rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.lede {
  max-width: 880px;
  margin-top: 0.8rem;
}

.site-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.36rem;
  margin-top: 1.1rem;
  font-size: 0.9rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.38rem;
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--link);
  background: var(--soft-background);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus {
  text-decoration: underline;
}

.site-nav a[aria-current="page"] {
  border-color: var(--link);
}

.nav-icon {
  display: inline-block;
  width: 0.92em;
  height: 0.92em;
  flex: 0 0 auto;
  background-color: var(--icon-color, currentColor);
  vertical-align: -0.08em;
  -webkit-mask-image: var(--icon-url);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-image: var(--icon-url);
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.icon-intro {
  --icon-url: url("../icons/intro.svg");
}

.icon-news {
  --icon-url: url("../icons/news.svg");
}

.icon-preprints {
  --icon-url: url("../icons/preprints.svg");
}

.icon-publications {
  --icon-url: url("../icons/publications.svg");
}

.icon-blog {
  --icon-url: url("../icons/blog.svg");
}

.icon-google-scholar {
  --icon-url: url("../icons/google-scholar.svg");
  --icon-color: #4285f4;
}

.icon-researchmap {
  --icon-url: url("../icons/researchmap.svg");
  --icon-color: #008c8c;
}

.icon-github {
  --icon-url: url("../icons/github.svg");
  --icon-color: #181717;
}

.icon-linkedin {
  --icon-url: url("../icons/linkedin.svg");
  --icon-color: #0a66c2;
}

.icon-x {
  --icon-url: url("../icons/x.svg");
  --icon-color: #000000;
}

h2 {
  margin-top: 2.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.45rem;
  line-height: 1.3;
}

h3 {
  margin: 0 0 0.25rem;
  font-size: 1.12rem;
  line-height: 1.35;
}

p {
  margin: 0.55rem 0 1rem;
}

a {
  color: var(--link);
}

a:visited {
  color: var(--visited);
}

.muted {
  color: var(--muted);
}

.label {
  font-weight: 700;
}

.paper,
.news-item,
.post-preview,
.post {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}

.paper:last-child,
.news-item:last-child,
.post-preview:last-child,
.post:last-child {
  border-bottom: none;
}

.paper-entry {
  font-weight: 600;
}

.paper-detail {
  margin: 0.55rem 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(246, 239, 230, 0.45);
}

.paper-detail summary {
  position: relative;
  padding: 0.45rem 2.3rem 0.45rem 0.85rem;
  cursor: pointer;
  list-style: none;
  color: var(--link);
}

.paper-detail summary::-webkit-details-marker {
  display: none;
}

.paper-detail summary::after {
  content: "+";
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
}

.paper-detail[open] summary {
  border-bottom: 1px solid var(--border);
}

.paper-detail[open] summary::after {
  content: "−";
}

.paper-detail summary:hover,
.paper-detail summary:focus {
  text-decoration: underline;
}

.paper-detail summary:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.paper-detail p {
  margin: 0;
  padding: 0.7rem 0.85rem 0;
}

.paper-detail p:last-child {
  padding-bottom: 0.85rem;
}

.paper-figure {
  margin: 0.9rem 0 1rem;
}

.paper-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.paper-figure figcaption {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.publication-note {
  margin-top: 0.8rem;
}

.paper-meta,
.post-meta {
  color: var(--muted);
  font-size: 0.96rem;
}

.paper-links,
.post-links {
  font-size: 0.96rem;
}

.note {
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--border);
  background: var(--soft-background);
  color: var(--muted);
}

.contact-line {
  margin-top: 1.25rem;
}

.compact-section {
  margin-top: 2.35rem;
}

.compact-list {
  margin: 0.45rem 0 0.2rem;
  padding: 0;
  list-style: none;
  font-size: 0.98rem;
}

.compact-item {
  margin: 0.12rem 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.45;
}

.compact-date {
  display: inline-block;
  min-width: 5.6rem;
  color: var(--muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.compact-title {
  font-weight: 700;
}

.compact-description {
  color: var(--muted);
}

.compact-more {
  margin-top: 0.35rem;
  font-size: 0.96rem;
}

.news-item h3 {
  margin-top: 0;
}

.news-date {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.blog-article {
  max-width: 780px;
}


.blog-article h2 {
  margin-top: 2.2rem;
}

code {
  padding: 0.08rem 0.22rem;
  border-radius: 4px;
  background: var(--soft-background);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.95em;
}

pre {
  padding: 1rem;
  overflow-x: auto;
  border-radius: 6px;
  background: var(--soft-background);
}

pre code {
  padding: 0;
  background: none;
}

blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 980px) {
  .site-nav {
    flex-wrap: wrap;
  }
}

@media (max-width: 650px) {
  .container {
    padding-top: 1.4rem;
  }

  .name {
    font-size: 1.9rem;
  }

  .site-nav {
    gap: 0.45rem;
  }

  .site-nav a {
    padding: 0.16rem 0.48rem;
  }
}
