:root {
  --bg: #ffffff;
  --bg-alt: #f4f4f2;
  --text: #1f2320;
  --text-muted: #6b706c;
  --accent: #0b6f6a;
  --border: #e7e5e0;

  --sidebar-bg: #12867f;
  --sidebar-text: #ffffff;
  --sidebar-text-muted: rgba(255, 255, 255, 0.78);
  --sidebar-border: rgba(255, 255, 255, 0.22);

  --sidebar-width: 280px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181a;
    --bg-alt: #1b1f21;
    --text: #ecefec;
    --text-muted: #9aa39f;
    --accent: #45d6cb;
    --border: #2a2f30;
    --sidebar-bg: #0d6b66;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-weight: normal;
  color: var(--text);
  line-height: 1.25;
}

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

a:hover {
  text-decoration: underline;
}

/* Layout */

.layout {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

/* Sidebar */

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
}

.sidebar-top .sidebar-name {
  font-size: 1.5rem;
  font-weight: 700;
}

.sidebar-top .sidebar-role {
  font-size: 0.95rem;
  color: var(--sidebar-text-muted);
  margin-top: 0.15rem;
}

.sidebar-nav {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sidebar-nav a {
  color: var(--sidebar-text-muted);
  font-weight: 600;
  font-size: 0.98rem;
}

.sidebar-nav a:hover {
  color: var(--sidebar-text);
  text-decoration: none;
}

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

.sidebar-bottom {
  margin-top: 2.5rem;
}

.sidebar-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid var(--sidebar-border);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Georgia, serif;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.65);
  overflow: hidden;
}

.sidebar-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-bottom .sidebar-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}

.sidebar-address {
  font-size: 0.88rem;
  color: var(--sidebar-text-muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-links a {
  color: var(--sidebar-text);
  font-size: 0.88rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Content */

.content {
  flex: 1;
  padding: 3rem 0 4rem 3.5rem;
  min-width: 0;
}

.content-body {
  padding-right: 3.5rem;
  max-width: 900px;
}

.hero {
  width: 100%;
  aspect-ratio: 16 / 3;
  border-radius: 10px 0 0 10px;
  overflow: hidden;
  margin-bottom: 1.75rem;
  background: linear-gradient(135deg, var(--sidebar-bg), #0a3f3c);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  text-align: center;
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 2.5rem;
  padding-right: 3.5rem;
}

.intro a {
  color: var(--accent);
  font-weight: 600;
}

.content h1 {
  font-size: 2rem;
  margin: 0 0 1.5rem;
}

.content > h1 {
  padding-right: 3.5rem;
}

.placeholder {
  color: var(--accent);
  font-style: italic;
}

section.block {
  margin-bottom: 2.75rem;
}

section.block h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.pub-jump {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.pub-entry {
  margin-bottom: 1.75rem;
}

.pub-entry .pub-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
  color: var(--accent);
}

.pub-entry .pub-meta {
  color: var(--text-muted);
  font-size: 0.93rem;
  margin: 0;
}

.pub-entry .pub-links {
  margin: 0.35rem 0 0;
}

.pub-entry .pub-links a {
  font-size: 0.88rem;
  margin-right: 1rem;
  color: var(--text-muted);
  text-decoration: underline;
}

.pill {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.pub-abstract {
  margin-top: 0.5rem;
  font-size: 0.92rem;
}

.pub-abstract summary {
  cursor: pointer;
  color: var(--text-muted);
  list-style: none;
}

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

.pub-abstract summary::before {
  content: "▸ ";
  color: var(--accent);
}

.pub-abstract[open] summary::before {
  content: "▾ ";
}

.pub-abstract summary:hover {
  color: var(--accent);
}

.pub-abstract p {
  margin: 0.6rem 0 0;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
  color: var(--text-muted);
}

.teaching-group h3 {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 1.75rem 0 0.75rem;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 600;
}

.teaching-group:first-of-type h3 {
  margin-top: 0;
}

.course {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}

.course:last-child {
  border-bottom: none;
}

.course .course-title {
  font-weight: 600;
  margin: 0 0 0.15rem;
}

.course .course-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.cv-actions {
  margin-bottom: 1.75rem;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  font-size: 0.95rem;
}

.button:hover {
  opacity: 0.9;
  text-decoration: none;
}

.cv-embed {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  height: 70vh;
  background: var(--bg-alt);
}

.cv-embed embed,
.cv-embed object {
  width: 100%;
  height: 100%;
  border: none;
}

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

/* Responsive */

@media (max-width: 820px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    padding: 1.75rem 1.5rem;
  }

  .sidebar-nav {
    margin-top: 1.5rem;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
  }

  .sidebar-bottom {
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
  }

  .sidebar-photo {
    width: 84px;
    aspect-ratio: 1;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .sidebar-bottom .sidebar-name {
    margin-bottom: 0.3rem;
  }

  .content {
    padding: 2rem 0 3rem 1.5rem;
  }

  .content-body {
    padding-right: 1.5rem;
  }

  .intro {
    padding-right: 1.5rem;
  }

  .content > h1 {
    padding-right: 1.5rem;
  }

  .hero {
    display: none;
  }
}
