:root {
  --primary: #1e3a5f;
  --primary-dark: #162c49;
  --primary-tint: #eef2f8;
  --primary-tint-border: #c9d6e8;
  --accent: #c64600;
  --accent-fill: #e87722;
  --stone: #75787b;
  --tag-talk: #5f7384;
  --recruiting: #8b0000;
  --text: #333333;
  --white: #ffffff;
}

html {
  scroll-behavior: smooth;
  font-size: 14px;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, #f3ede6 0, #f7f4f1 210px, #fbfaf7 100%);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

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

a:hover {
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
}

.wrap {
  width: min(1290px, calc(100% - 56px));
  margin: 0 auto;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-dark) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 8px rgba(35, 18, 22, 0.1);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-fill) 0%, #cf6f32 35%, #b9643b 70%, #996163 100%);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand a {
  color: var(--white);
  font-family: inherit;
  font-size: 1.7rem;
  letter-spacing: -0.01em;
  line-height: 1;
  text-decoration: none;
}

.brand span {
  color: var(--white);
  font-family: inherit;
  font-size: 0.98rem;
  letter-spacing: 0;
  opacity: 0.9;
  white-space: nowrap;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
}

.topnav a {
  color: var(--white);
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0;
  line-height: 1;
  padding: 9px 4px;
  opacity: 0.88;
  text-decoration: none;
}

.topnav a:hover {
  opacity: 1;
  text-decoration: none;
}

.topnav a.is-current {
  opacity: 1;
  position: relative;
}

.topnav a.is-current::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 1px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
}

.page {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0;
  padding: 118px 0 48px;
}

.sidebar {
  padding: 28px 20px 28px 0;
}

.content {
  min-width: 0;
  padding: 28px 0 28px 40px;
  border-left: 1px solid #d4cec7;
}

.profile-photo {
  width: 100%;
  max-width: 290px;
  margin-bottom: 14px;
  padding: 6px;
  border: 1px solid #d7c8ba;
  background: #efe5da;
  box-sizing: border-box;
}

.contact-block {
  margin-bottom: 14px;
}

.contact-title {
  margin: 0 0 6px;
  font-weight: normal;
}

.contact-text {
  margin: 0 0 4px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 22px;
}

.button-row a {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--primary);
  border-radius: 4px;
  background: var(--primary);
  color: var(--white);
  font-size: 0.9rem;
  line-height: 1.2;
  text-decoration: none;
}

.pub-tag,
.pub-tag-summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid var(--primary);
  border-radius: 4px;
  background: var(--primary);
  color: var(--white);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1;
  vertical-align: middle;
  box-sizing: border-box;
  text-decoration: none;
  white-space: nowrap;
}

.button-row a:hover,
.pub-tag:hover,
.pub-tag-summary:hover {
  background: var(--primary-dark);
  text-decoration: none;
}

.pub-tag--orange,
.pub-tag-summary.pub-tag--orange {
  border-color: var(--accent);
  background: var(--accent);
}

.pub-tag--stone,
.pub-tag-summary.pub-tag--stone {
  border-color: var(--stone);
  background: var(--stone);
}

.pub-tag--talk,
.pub-tag-summary.pub-tag--talk {
  border-color: var(--tag-talk);
  background: var(--tag-talk);
}

.pub-tag--award,
.pub-tag-summary.pub-tag--award {
  border-color: #ffd700;
  background: #ffd700;
  color: var(--primary);
  box-shadow: none;
}

.sidebar-section {
  margin-top: 24px;
}

.sidebar-section h2,
.section-title {
  margin: 0 0 16px;
  font-family: inherit;
  font-weight: normal;
  line-height: 1.1;
  color: var(--primary);
  letter-spacing: 0;
  position: relative;
  display: inline-block;
  padding-bottom: 8px;
}

.sidebar-section h2::after,
.section-title::after {
  content: "";
  display: block;
  width: 42px;
  height: 2px;
  margin-top: 8px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-fill) 100%);
}

.sidebar-section h2 {
  font-size: 1.8rem;
}

.section-title {
  font-size: 1.7rem;
}

.section-title--compact {
  margin-bottom: 0;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.view-toggle {
  display: inline-flex;
  border: 1px solid #c9c2bb;
  border-radius: 4px;
  overflow: hidden;
}

.view-toggle button {
  border: 0;
  border-right: 1px solid #c9c2bb;
  background: #f8f5f2;
  color: var(--text);
  padding: 6px 12px;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.view-toggle button:last-child {
  border-right: 0;
}

.view-toggle button.is-active {
  background: var(--primary);
  color: var(--white);
}

.news-list,
.simple-list,
.year-publication-list {
  margin: 0;
  padding-left: 34px;
}

.news-list {
  padding-left: 18px;
}

.news-list li {
  margin-bottom: 12px;
}

.content-section+.content-section {
  margin-top: 40px;
  padding-top: 8px;
  border-top: 1px solid #ebe2d9;
}

.about-copy p {
  margin: 0 0 22px;
  font-size: 0.96rem;
  line-height: 1.5;
}

.recruiting-note {
  color: var(--recruiting);
  font-weight: 700;
}

.year-publication-list li {
  margin-bottom: 12px;
}

.publication-title-line {
  line-height: 1.32;
}

.publication-title {
  font-weight: normal;
}

.publication-topic-inline {
  color: var(--accent);
  font-weight: normal;
  margin-right: 6px;
}

.publication-authors,
.publication-venue,
.publication-extra {
  margin-top: 2px;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 6px;
  align-items: center;
}

.pub-links details {
  display: inline-block;
}

.pub-links details summary {
  list-style: none;
  cursor: pointer;
}

.pub-links details[open] summary {
  margin-bottom: 6px;
}

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

.bibtex-pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  border: 1px solid #c9c2bb;
  background: #fbf9f7;
  color: #222222;
  white-space: pre-wrap;
  font-size: 0.88rem;
  line-height: 1.35;
}

.simple-list li {
  margin-bottom: 14px;
}

.year-block {
  margin-bottom: 28px;
}

.publication-year {
  font-family: inherit;
  font-size: 1.3rem;
  margin: 0 0 10px;
  font-weight: normal;
  color: var(--primary);
}

.topic-heading {
  font-family: inherit;
  font-size: 1.3rem;
  margin: 0 0 10px;
  font-weight: normal;
  color: var(--primary);
}

.service-year {
  font-family: inherit;
  font-size: 1.3rem;
  margin: 0 0 10px;
  font-weight: normal;
  color: var(--primary);
}

.service-year-block {
  margin-bottom: 24px;
}

.teaching-group {
  margin-bottom: 24px;
}

.teaching-group>h3 {
  margin: 0 0 12px;
}

#service-list,
#honors-list,
#patents-list,
#teaching-list {
  list-style: none;
  padding-left: 0;
}

.service-year-block>ul {
  margin: 0;
  padding-left: 24px;
}

.service-year-block>ul>li {
  margin-bottom: 8px;
}

.content-section {
  scroll-margin-top: 110px;
}

strong.self-name {
  color: #000000;
}

.corresponding-marker {
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 1024px) {
  .page {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding-right: 0;
    padding-bottom: 12px;
  }

  .content {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid #cfcfcf;
    padding-top: 24px;
  }
}

@media (max-width: 760px) {
  html {
    font-size: 14px;
  }

  body {
    font-size: 14px;
  }

  .wrap {
    width: min(100% - 24px, 1290px);
  }

  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
    min-height: unset;
  }

  .brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .brand a {
    font-size: 1.75rem;
  }

  .topnav {
    gap: 10px;
  }

  .sidebar-section h2,
  .section-title {
    font-size: 1.5rem;
  }

  .section-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

.collapsible-heading {
  cursor: pointer;
  user-select: none;
}

.collapsible-heading:hover {
  opacity: 0.8;
}

.collapse-icon {
  display: inline-block;
  transition: transform 0.2s ease;
  vertical-align: middle;
  margin-bottom: 2px;
}

.is-collapsed .collapse-icon {
  transform: rotate(-90deg);
}

.is-collapsed>*:not(h2):not(.section-heading-row) {
  display: none !important;
}

/* Blogs Page specific styles */

.page-blogs {
  background: linear-gradient(180deg, #f7f4f1 0, #fbfaf7 350px, #ffffff 100%);
}

.blogs-shell {
  padding: 120px 0 60px;
}

.blogs-hero {
  display: flex;
  gap: 48px;
  align-items: flex-start;
  margin-bottom: 64px;
}

.blogs-hero__copy {
  flex: 1;
}

.blogs-eyebrow {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.9rem;
  margin: 0 0 12px;
}

#blogs-title {
  font-size: 2.8rem;
  line-height: 1.15;
  color: var(--primary);
  margin: 0 0 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.blogs-lead {
  font-size: 1.25rem;
  color: #4a4a4a;
  line-height: 1.6;
  max-width: 800px;
  margin: 0;
}

.blogs-section__intro {
  margin-bottom: 32px;
}

.blogs-section__intro p {
  font-size: 1.1rem;
  color: #555555;
  max-width: 600px;
  margin: 0;
  line-height: 1.5;
}

.blogs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid #e6e0d9;
}

.blog-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 26px 6px;
  border-bottom: 1px solid #e6e0d9;
  transition: background 0.2s ease;
}

.blog-row:hover {
  background: color-mix(in srgb, var(--primary) 3%, transparent);
}

.blog-row__main {
  min-width: 0;
}

.blog-row__eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--stone);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 0 0 6px;
}

.blog-row__heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 6px;
}

.blog-row__heading h3 {
  font-size: 1.5rem;
  line-height: 1.2;
  margin: 0;
  color: #222222;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.lead-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-tint);
  padding: 3px 10px;
  border-radius: 999px;
  margin-top: 4px;
  border: 1px solid var(--primary-tint-border);
}

.blog-row__heading .lead-badge {
  margin-top: 0;
}

.blog-row__desc {
  font-size: 1rem;
  color: #555555;
  line-height: 1.55;
  margin: 0;
  max-width: 72ch;
}

.blog-row__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.blog-row__actions .pub-tag {
  padding: 10px 16px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  transition: background 0.2s ease, transform 0.2s ease;
}

.blog-row__actions .pub-tag:hover {
  transform: translateY(-1px);
}

.project-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 10px 20px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--primary);
  box-sizing: border-box;
  text-decoration: none;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  transition: background 0.2s ease, transform 0.2s ease;
}

.project-button:hover {
  background: var(--primary-dark);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .blogs-hero {
    flex-direction: column;
    gap: 32px;
  }

  #blogs-title {
    font-size: 2.2rem;
  }
}

@media (max-width: 680px) {
  .blog-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .blog-row__actions {
    flex-wrap: wrap;
  }
}

/* Post pages (posts/*.html) */

.page-post {
  background: linear-gradient(180deg, #f7f4f1 0, #fbfaf7 350px, #ffffff 100%);
}

.post-shell {
  padding: 120px 0 60px;
}

.post {
  max-width: 800px;
}

.post-header {
  margin-bottom: 36px;
}

.post-meta {
  color: var(--stone);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 12px;
}

#post-title {
  font-size: 2.4rem;
  line-height: 1.15;
  color: var(--primary);
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.post-body {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #3d3d3d;
}

.post-body p {
  margin: 0 0 18px;
}

.post-body h2 {
  margin: 34px 0 14px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.post-body ul,
.post-body ol {
  margin: 0 0 18px;
  padding-left: 26px;
}

.post-body li {
  margin-bottom: 8px;
}

.post-body code {
  padding: 2px 6px;
  border-radius: 4px;
  background: #f5f1ec;
  border: 1px solid #e6e0d9;
  font-size: 0.92em;
}

.post-body pre {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #c9c2bb;
  background: #fbf9f7;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.45;
}

.post-body pre code {
  padding: 0;
  border: 0;
  background: none;
}

.post-body blockquote {
  margin: 0 0 18px;
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--accent-fill);
  color: #555555;
}

.post-body img {
  border-radius: 4px;
  margin: 6px 0 18px;
}

@media (max-width: 760px) {
  #post-title {
    font-size: 1.9rem;
  }
}
