:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --text: #172033;
  --muted: #526173;
  --border: #dfe6ee;
  --accent: #2563eb;
  --accent-soft: #e8f0ff;
  --link: #1d4ed8;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --max-width: 1160px;
  --sidebar-width: 300px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

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

a:hover,
a:focus {
  text-decoration: underline;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 62px;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.site-title {
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 750;
  white-space: nowrap;
}

.site-title:hover,
.site-title:focus {
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  font-size: 0.93rem;
}

.site-nav a {
  color: var(--muted);
  font-weight: 600;
}

.site-nav a:hover,
.site-nav a:focus,
.site-nav a.is-active {
  color: var(--accent);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--text);
}

.page-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 0;
  width: min(var(--max-width), calc(100% - 40px));
  margin: 34px auto 42px;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.profile-sidebar {
  position: sticky;
  top: 86px;
  align-self: start;
  min-height: calc(100vh - 120px);
  padding: 30px 26px;
  border-right: 1px solid var(--border);
  background: var(--surface-muted);
}

.profile-avatar {
  display: block;
  width: 148px;
  max-width: 100%;
  height: auto;
  margin-bottom: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.profile-name {
  margin: 0;
  color: var(--text);
  font-size: 1.8rem;
  line-height: 1.2;
}

.profile-title,
.profile-affiliation {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.5;
}

.profile-links {
  display: grid;
  gap: 11px;
  margin: 24px 0;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  list-style: none;
}

.profile-links li {
  display: grid;
  gap: 3px;
}

.profile-label {
  color: #7b8794;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-summary h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.page-content {
  min-width: 0;
  padding: 36px 48px 44px;
}

.page-content h1 {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 2.1rem;
  line-height: 1.2;
}

.page-content h2 {
  margin: 38px 0 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 1.38rem;
  line-height: 1.3;
}

.page-content h1 + h2,
.page-content h1:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.page-content h3 {
  margin: 26px 0 8px;
  color: var(--text);
  font-size: 1.08rem;
}

.page-content p {
  margin: 0 0 14px;
}

.page-content ul,
.page-content ol {
  margin: 0 0 18px;
  padding-left: 1.25rem;
}

.page-content li {
  margin: 5px 0;
}

.page-content strong {
  color: var(--text);
}

.page-content code {
  padding: 0.12rem 0.28rem;
  border-radius: 4px;
  background: #eef2f7;
  color: #0f172a;
  font-size: 0.9em;
}

.headerlink {
  margin-left: 0.35rem;
  color: #94a3b8;
  font-size: 0.82em;
  opacity: 0;
}

h1:hover .headerlink,
h2:hover .headerlink,
h3:hover .headerlink {
  opacity: 1;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 16px;
  width: min(var(--max-width), calc(100% - 40px));
  margin: 0 auto 28px;
  color: #7b8794;
  font-size: 0.88rem;
}

@media (max-width: 860px) {
  .site-header {
    flex-wrap: wrap;
    padding: 0 18px;
  }

  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    display: none;
    flex-basis: 100%;
    justify-content: flex-start;
    gap: 14px;
    padding: 0 0 16px;
    overflow-x: auto;
  }

  body.nav-open .site-nav {
    display: flex;
  }

  .page-shell {
    grid-template-columns: 1fr;
    width: min(100% - 24px, var(--max-width));
    margin-top: 18px;
  }

  .profile-sidebar {
    position: static;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .page-content {
    padding: 28px 22px 34px;
  }

  .page-content h1 {
    font-size: 1.75rem;
  }

  .site-footer {
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }
}

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

  .site-header {
    min-height: 58px;
  }

  .profile-sidebar {
    padding: 24px 20px;
  }

  .profile-avatar {
    width: 118px;
  }
}
