:root {
  --text: #1d2d3a;
  --muted: #557086;
  --line: #b8e1ff;
  --background: rgb(245, 251, 255);
  --soft-background: #d8f0ff;
  --accent: rgb(33, 145, 250);
  --accent-dark: #006eb8;
  --tab-blue: #bfe7ff;
  --tab-active: rgb(33, 145, 250);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: Aptos, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

html {
  overflow-y: scroll;
}

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

.text-link,
.text-link:visited {
  color: #000000;
}

.page,
.footer {
  width: min(1200px, 75vw);
  margin: 0 auto;
}

.about-layout,
.content-window {
  display: grid;
  padding: 28px;
  background: #dff0fc;
  border: 1px solid #b9ddf5;
  border-radius: 16px;
}

.about-layout {
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.profile-column {
  display: grid;
  gap: 18px;
  justify-items: center;
}

.content-window {
  gap: 0;
  background: #edf8ff;
  border-color: #d2ebfb;
}

.profile-photo {
  width: 220px;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

.tab-panel p {
  text-align: justify;
}

h1 {
  margin-bottom: 4px;
  font-size: 2rem;
  line-height: 1.2;
}

h2 {
  margin-bottom: 18px;
  font-size: 1.3rem;
}

.section-heading-line {
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-dark);
}

h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

h4 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.paper-meta {
  margin-bottom: 10px;
  color: var(--muted);
  font-style: italic;
  text-align: left;
}

.abstract {
  margin-top: 10px;
}

.abstract summary {
  display: inline-flex;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

.abstract summary:hover,
.abstract summary:focus-visible {
  color: var(--accent-dark);
}

.abstract p {
  margin: 10px 0 0;
  color: #234b68;
}

.subtitle {
  margin-bottom: 24px;
  color: var(--muted);
}

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-title-row h2 {
  margin-bottom: 0;
}

.cv-link {
  font-weight: 700;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 0;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background: rgba(245, 251, 255, 0.94);
  border-bottom: 1px solid var(--line);
}

.top-bar-inner {
  width: min(1200px, 75vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  min-height: 68px;
  padding: 16px 0;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.site-name {
  color: var(--tab-active);
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  font-size: 1.35rem;
  font-weight: 900;
}

.tab-button {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--tab-blue);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.tab-button:hover,
.tab-button:focus-visible {
  border-color: var(--accent-dark);
}

.tab-button.active {
  color: #ffffff;
  background: var(--tab-active);
  border-color: var(--tab-active);
}

.tab-panel {
  display: none;
  padding: 30px 0 42px;
}

.tab-panel.active {
  display: block;
}

article + article {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.teaching-group + .teaching-group {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.teaching-item + .teaching-item {
  margin-top: 14px;
}

.teaching-item h4 {
  margin-bottom: 2px;
  font-weight: 400;
}

.teaching-item p {
  margin-bottom: 0;
}

.footer {
  padding: 24px 0 36px;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
}

.footer p {
  margin-bottom: 0;
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .about-layout {
    grid-template-columns: 1fr;
  }

  .profile-photo {
    width: 180px;
  }

  .tab-button {
    flex: 1 1 auto;
  }
}

@media (max-width: 900px) {
  .page,
  .footer,
  .top-bar-inner {
    width: calc(100% - 32px);
  }
}
