:root {
  --accent: #2d4a7a;
  --accent-light: #e8eef6;
  --text-muted: #555;
  --border: #dde2ea;
  --pico-font-size: 16px;
}

/* ── Layout ── */
body {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Lucide icons ── */
[data-lucide] {
  display: inline-block;
  vertical-align: -0.15em;
  width: 1em;
  height: 1em;
}

.nav-icon {
  width: 1.1rem;
  height: 1.1rem;
  margin-right: 0.3rem;
  vertical-align: -0.2em;
  stroke-width: 2;
}

.about-links [data-lucide],
.about-link-icon {
  width: 0.95rem;
  height: 0.95rem;
  margin-right: 0.25rem;
  vertical-align: -0.1em;
}

/* ── Nav ── */
header > nav {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-muted: #aaa;
    --border: #3a3f4b;
    --accent-light: #1e2a3a;
    --accent: #7aa2d4;
  }

  header > nav {
    background: rgba(24, 24, 27, 0.95);
  }
}

header > nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

header > nav ul:first-child li strong {
  font-size: 1.05rem;
  color: var(--accent);
}

header > nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

header > nav a:hover,
header > nav a.nav-active {
  color: var(--accent);
  text-shadow: 0 0 0.6px currentColor;
}

/* ── Sections ── */
section {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
}

section:last-of-type {
  border-bottom: none;
}

section h2 {
  color: var(--accent);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent-light);
}

/* ── About ── */
#about {
  border-bottom: none;
}

.about-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.about-photo-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.about-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
}

.about-photo-placeholder {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 2.5rem;
}

.about-links {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

.about-links a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  text-decoration: none;
  transition: color 0.15s;
}

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

.about-text-col {
  padding-top: 0.25rem;
}

.about-name {
  margin: 0 0 0.3rem;
  font-size: 1.8rem;
  line-height: 1.2;
}

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

/* ── News ── */
.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.news-list li {
  display: flex;
  gap: 1.2rem;
  font-size: 0.93rem;
  line-height: 1.5;
  align-items: baseline;
}

.news-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
  min-width: 5.5rem;
}

@media (max-width: 620px) {
  header > nav {
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.6rem 0;
  }

  header > nav ul:last-child {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 1rem;
  }

  header > nav a {
    font-size: 0.85rem;
  }
}

@media (max-width: 560px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-photo-col {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .about-photo, .about-photo-placeholder {
    width: 120px;
    height: 120px;
  }
  .about-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem 1.2rem;
  }
}

/* ── Publications ── */
.pub-year-group {
  margin-bottom: 2rem;
}

.pub-year {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.6rem;
  padding: 0;
  border: none;
}


#publications-list article {
  display: flex;
  gap: 1rem;
  padding: 0.9rem 0.9rem 0.9rem 1rem;
  border-left: 3px solid var(--accent);
  background: transparent;
  margin-bottom: 0.75rem;
  border-radius: 0 4px 4px 0;
  transition: background 0.15s;
}

#publications-list article:hover {
  background: var(--accent-light);
}

.pub-number {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  min-width: 1.5rem;
  padding-top: 2px;
}

.pub-title {
  display: block;
  margin-bottom: 0.2rem;
}

.pub-authors {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.pub-citation {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.pub-links {
  margin-left: 0.5rem;
}

.pub-links a,
.pub-links .bibtex-btn {
  color: var(--accent);
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 500;
}

.pub-links a:hover {
  text-decoration: underline;
}

.pub-links a + .bibtex-btn::before,
.pub-links .bibtex-btn + a::before,
.pub-links a + a::before {
  content: ' · ';
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Under review badge ── */
.status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #f0f0f0;
  border: 1px solid #ccc;
  padding: 0.1rem 0.38rem;
  border-radius: 3px;
  vertical-align: 0.12em;
  margin-right: 0.35rem;
  letter-spacing: 0.02em;
}

/* ── Journal badges ── */
.journal-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  padding: 0.1rem 0.38rem;
  border-radius: 3px;
  vertical-align: 0.12em;
  margin-right: 0.35rem;
}

/* ── BibTeX button ── */
.bibtex-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}

.bibtex-btn:hover {
  text-decoration: underline;
}

.bibtex-btn.copied {
  color: var(--text-muted);
  cursor: default;
}

/* ── Publication expandable description ── */
.pub-details {
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.4rem;
}

.pub-details summary {
  font-size: 0.82rem;
  color: var(--accent);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

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

.pub-details summary::before {
  content: '▸';
  font-size: 0.7rem;
  transition: transform 0.15s;
}

.pub-details[open] summary::before {
  transform: rotate(90deg);
}

.pub-details p {
  margin: 0.5rem 0 0.2rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Project title link (card) ── */
.project-title-link {
  color: inherit;
  text-decoration: none;
}

.project-title-link:hover strong {
  color: var(--accent);
}

/* ── Project detail page ── */
.back-link {
  display: inline-block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.back-link:hover {
  color: var(--accent);
}

.project-detail-title {
  font-size: 1.8rem;
  margin: 0 0 0.75rem;
}

.project-detail-links {
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.project-detail-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.project-detail-links a:hover {
  text-decoration: underline;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.project-detail-img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
  object-fit: cover;
}

.project-details {
  margin-top: 1rem;
  line-height: 1.7;
}

.project-details p {
  margin-bottom: 1rem;
}

.project-inline-figure {
  margin: 1.5rem 0;
  text-align: center;
}

.project-inline-figure img {
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.project-inline-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Projects ── */
#projects-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  padding: 0;
  transition: box-shadow 0.15s;
}

.project-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.project-body {
  padding: 1rem 1.1rem;
}

.project-card:hover {
  box-shadow: 0 2px 12px rgba(45, 74, 122, 0.1);
}

.project-card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0;
  background: none;
  border: none;
}

.project-links {
  font-size: 0.85rem;
}

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

.project-links a:hover {
  text-decoration: underline;
}

.project-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 0.6rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0;
  background: none;
  border: none;
}

.project-tags kbd {
  font-size: 0.78rem;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid #c5d3e8;
  border-radius: 3px;
  padding: 0.15rem 0.45rem;
  font-family: inherit;
  box-shadow: none;
}

/* ── Tutorials ── */
#tutorials-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tutorial-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  background: #fff;
  transition: box-shadow 0.15s;
}

.tutorial-card:hover {
  box-shadow: 0 2px 12px rgba(45, 74, 122, 0.1);
}

.tutorial-card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0;
  background: none;
  border: none;
}

.tutorial-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.tutorial-date {
  color: var(--text-muted);
}

.tutorial-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.tutorial-link:hover {
  text-decoration: underline;
}

.tutorial-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 0.6rem;
}

/* ── CV ── */

/* ── Page padding (single-section pages) ── */
main > section {
  padding-top: 2.5rem;
}

.cv-button {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  text-decoration: none;
  padding: 0.55rem 1.4rem;
  border-radius: 4px;
  font-size: 0.95rem;
  transition: background 0.15s;
}

.cv-button:hover {
  background: #1e3459;
}

.cv-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

#cv-frame {
  width: 100%;
  border: none;
  height: 85vh;
  display: block;
}

/* ── Visitor map ── */
#visitors {
  border-bottom: none;
  padding: 2rem 0 1rem;
  display: flex;
  justify-content: center;
}

#map-widget {
  display: flex;
  justify-content: center;
}

#map-widget img {
  width: 300px;
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

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

footer a:hover {
  text-decoration: underline;
}
