:root {
  --bg: #fdfdfb;
  --text: #22252a;
  --muted: #6b7280;
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.12);
  --rule: #e5e7eb;
  --card: #f4f4f1;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --text: #e7e9ec;
    --muted: #9aa3ad;
    --accent: #34c7b5;
    --accent-soft: rgba(52, 199, 181, 0.14);
    --rule: #2b3138;
    --card: #1c2126;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", "Fira Code", Menlo,
    Consolas, monospace;
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  max-width: 52rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 4vw, 1.75rem);
}

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  margin-bottom: 0.35rem;
}

.tagline {
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.tagline a {
  color: inherit;
  text-decoration-color: var(--rule);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s ease;
}

a:hover {
  text-decoration-color: currentColor;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.profile-pic {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--accent-soft);
}

.icon-links {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
}

.icon-links a {
  color: var(--muted);
  display: inline-flex;
}

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

.icon-links svg {
  width: 21px;
  height: 21px;
}

/* Nav */
nav.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.75rem;
  font-size: 0.9em;
}

nav.site-nav a {
  color: var(--text);
}

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

/* Sections */
section {
  margin-bottom: 3rem;
}

h2 {
  font-size: 1.35rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.4rem;
  position: relative;
}

h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2.25rem;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

h3 {
  font-size: 1.05rem;
  margin: 1.4rem 0 0.6rem;
}

p {
  margin-bottom: 0.9rem;
}

ul {
  list-style: none;
}

/* Generic item lists (publications, talks, teaching, cv) */
.items li {
  margin-bottom: 1.1rem;
}

.items .title {
  font-weight: 600;
}

.items .meta {
  display: block;
  color: var(--muted);
  font-size: 0.88em;
  margin-top: 0.1rem;
}

.items .meta em {
  font-style: italic;
}

/* Compact lists (talks, cv, teaching details) */
.compact li {
  margin-bottom: 0.55rem;
  padding-left: 1.1rem;
  position: relative;
}

.compact li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.65;
}

.compact .meta {
  color: var(--muted);
  font-size: 0.88em;
}

/* News */
.news li {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.news .date {
  flex-shrink: 0;
  width: 5.8rem;
  color: var(--accent);
  font-size: 0.85em;
  font-weight: 600;
  padding-top: 0.2em;
}

/* Publication year groups */
.year-label {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 1.5rem 0 0.7rem;
}

/* Footer */
footer {
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
  color: var(--muted);
  font-size: 0.85em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 540px) {
  .site-header {
    flex-direction: column-reverse;
    align-items: flex-start;
  }

  .profile-pic {
    width: 110px;
    height: 110px;
  }

  .news li {
    flex-direction: column;
    gap: 0;
  }
}
