:root {
  color-scheme: light;
  --page: #f7f8fa;
  --paper: #ffffff;
  --ink: #111827;
  --body: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;
  --rule: #e5e7eb;
  --rule-strong: #d1d5db;
  --accent: #1d4ed8;
  --accent-dark: #1e3a8a;
  --accent-soft: #eff6ff;
  --teal: #0f766e;
  --radius: 8px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page: #080d16;
  --paper: #101827;
  --ink: #f8fafc;
  --body: #cbd5e1;
  --muted: #94a3b8;
  --faint: #64748b;
  --rule: #263244;
  --rule-strong: #3b4a60;
  --accent: #8ab4ff;
  --accent-dark: #bfdbfe;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --teal: #5eead4;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(247, 248, 250, 0.92), rgba(247, 248, 250, 0.98)),
    repeating-linear-gradient(
      90deg,
      rgba(17, 24, 39, 0.035) 0,
      rgba(17, 24, 39, 0.035) 1px,
      transparent 1px,
      transparent 72px
    ),
    repeating-linear-gradient(
      180deg,
      rgba(17, 24, 39, 0.028) 0,
      rgba(17, 24, 39, 0.028) 1px,
      transparent 1px,
      transparent 72px
    ),
    var(--page);
  color: var(--body);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 15px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[data-theme="dark"] body {
  background:
    linear-gradient(180deg, rgba(8, 13, 22, 0.94), rgba(8, 13, 22, 0.985)),
    repeating-linear-gradient(
      90deg,
      rgba(148, 163, 184, 0.06) 0,
      rgba(148, 163, 184, 0.06) 1px,
      transparent 1px,
      transparent 72px
    ),
    repeating-linear-gradient(
      180deg,
      rgba(148, 163, 184, 0.045) 0,
      rgba(148, 163, 184, 0.045) 1px,
      transparent 1px,
      transparent 72px
    ),
    var(--page);
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
  transition:
    color 150ms ease,
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

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

a:focus-visible {
  outline: 3px solid rgba(29, 78, 216, 0.24);
  outline-offset: 3px;
}

p {
  margin: 0 0 0.68em;
}

p:last-child {
  margin-bottom: 0;
}

strong {
  color: var(--ink);
  font-weight: 650;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.top-bar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--teal), #7c3aed, var(--accent));
  background-size: 260% 100%;
  animation: accent-flow 7s linear infinite;
}

.site-layout {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 26px 24px 86px;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 54px;
  margin: -26px -24px 0;
  padding: 16px 24px 12px;
  border-bottom: 1px solid rgba(229, 231, 235, 0.92);
  background: rgba(247, 248, 250, 0.9);
  backdrop-filter: blur(14px);
  animation: nav-drop 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

html[data-theme="dark"] .sidebar {
  border-bottom-color: rgba(38, 50, 68, 0.9);
  background: rgba(8, 13, 22, 0.86);
}

.sidebar-label {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

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

.nav-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.sidebar-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.25;
}

.sidebar-nav a:hover {
  color: var(--ink);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--body);
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.theme-toggle:hover {
  border-color: #bfdbfe;
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.1);
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 3px solid rgba(29, 78, 216, 0.24);
  outline-offset: 3px;
}

.theme-icon {
  width: 14px;
  height: 14px;
}

.page-wrap {
  margin-top: 46px;
}

.profile-card {
  padding-bottom: 44px;
  border-bottom: 1px solid var(--rule);
  animation: fade-up 680ms cubic-bezier(0.22, 1, 0.36, 1) 80ms both;
}

.profile-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 38px;
  align-items: center;
}

.profile-text {
  min-width: 0;
}

.profile-name {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 15px;
  align-items: baseline;
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 3.35rem;
  font-weight: 760;
  line-height: 1.03;
  letter-spacing: 0;
}

.profile-name span {
  color: var(--muted);
  font-size: 1.02rem;
  font-weight: 650;
}

.profile-text p {
  max-width: 760px;
  color: var(--body);
  font-size: 1.02rem;
}

.profile-text p a {
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.profile-photo-wrap {
  justify-self: end;
}

.profile-photo {
  display: block;
  width: 190px;
  height: 245px;
  border: 1px solid var(--rule-strong);
  border-radius: 14px;
  background: var(--paper);
  object-fit: cover;
  transition:
    box-shadow 220ms ease,
    filter 220ms ease,
    transform 220ms ease;
}

html[data-theme="dark"] .profile-photo {
  background: #0f172a;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.profile-photo:hover {
  box-shadow: 0 16px 42px rgba(29, 78, 216, 0.18);
  filter: saturate(1.06) contrast(1.03);
  transform: rotate(-1.5deg) scale(1.03);
}

.social-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

.social-nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--body);
  font-size: 0.9rem;
  font-weight: 650;
}

.social-nav a:hover {
  border-color: #bfdbfe;
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.12);
  transform: translateY(-2px);
}

.link-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.link-icon use[href="#icon-github"] {
  fill: currentColor;
  stroke: none;
}

.site-section {
  margin-top: 46px;
  animation: fade-up 680ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.site-section:nth-of-type(1) {
  animation-delay: 180ms;
}

.site-section:nth-of-type(2) {
  animation-delay: 260ms;
}

.site-section:nth-of-type(3) {
  animation-delay: 340ms;
}

.site-section:nth-of-type(4) {
  animation-delay: 420ms;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.section-heading::after {
  display: block;
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--rule), rgba(29, 78, 216, 0.28), var(--rule));
  background-size: 220% 100%;
  animation: line-flow 9s ease-in-out infinite;
  content: "";
}

.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.22rem;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.22;
}

.publication-list {
  display: grid;
  gap: 0;
}

.publication {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  margin-inline: -14px;
  padding: 22px 14px;
  border-bottom: 1px solid var(--rule);
  border-radius: 8px;
  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.publication:hover {
  background: rgba(255, 255, 255, 0.55);
  transform: translateX(2px);
}

html[data-theme="dark"] .publication:hover {
  background: rgba(148, 163, 184, 0.055);
}

.publication-teaser {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #eef2f7;
  object-fit: cover;
  transform-origin: center;
  transition:
    box-shadow 220ms ease,
    filter 220ms ease,
    transform 220ms ease;
}

html[data-theme="dark"] .publication-teaser {
  background: #111827;
}

.publication:hover .publication-teaser {
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.13);
  filter: saturate(1.08) contrast(1.03);
  transform: scale(1.025);
}

.publication-body {
  min-width: 0;
}

.publication-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.publication-badge,
.publication-achievement {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 780;
  line-height: 1;
}

.publication-badge {
  max-width: 100%;
  margin-bottom: 7px;
  padding: 4px 12px;
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(239, 246, 255, 0.78)) padding-box,
    linear-gradient(135deg, rgba(29, 78, 216, 0.62), rgba(15, 118, 110, 0.48)) border-box;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 8px 20px rgba(29, 78, 216, 0.08);
  color: var(--accent-dark);
  letter-spacing: 0.035em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: normal;
}

html[data-theme="dark"] .publication-badge {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.74)) padding-box,
    linear-gradient(135deg, rgba(138, 180, 255, 0.72), rgba(94, 234, 212, 0.54)) border-box;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.16);
  color: #dbeafe;
}

.publication-meta .publication-badge {
  margin-bottom: 0;
}

.publication-achievement {
  padding: 0 10px;
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(236, 253, 245, 0.82)) padding-box,
    linear-gradient(135deg, rgba(15, 118, 110, 0.46), rgba(132, 204, 22, 0.42)) border-box;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(15, 118, 110, 0.07);
  color: var(--teal);
}

html[data-theme="dark"] .publication-achievement {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(20, 83, 45, 0.24)) padding-box,
    linear-gradient(135deg, rgba(94, 234, 212, 0.5), rgba(132, 204, 22, 0.38)) border-box;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 10px 22px rgba(0, 0, 0, 0.14);
  color: #99f6e4;
}

.publication h3 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 1.04rem;
  font-weight: 720;
  line-height: 1.38;
}

.publication p {
  margin: 0;
  color: var(--body);
  line-height: 1.62;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.publication-links a {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 0 11px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--body);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1;
}

html[data-theme="dark"] .publication-links a,
html[data-theme="dark"] .social-nav a,
html[data-theme="dark"] .theme-toggle {
  background: rgba(15, 23, 42, 0.76);
}

.publication-links a:hover {
  border-color: #bfdbfe;
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.1);
  transform: translateY(-1px);
}

.section-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.entry-list,
.award-list {
  display: grid;
  gap: 0;
}

.entry,
.award {
  border-bottom: 1px solid var(--rule);
  border-radius: 8px;
  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.entry:hover,
.award:hover {
  background: rgba(255, 255, 255, 0.45);
  transform: translateX(2px);
}

html[data-theme="dark"] .entry:hover,
html[data-theme="dark"] .award:hover {
  background: rgba(148, 163, 184, 0.055);
}

.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 178px;
  gap: 22px;
  align-items: center;
  margin-inline: -14px;
  padding: 18px 14px;
}

.education-entry {
  grid-template-columns: 60px minmax(0, 1fr) 178px;
}

.organization-entry {
  grid-template-columns: 116px minmax(0, 1fr) 178px;
}

.school-logo {
  display: block;
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.organization-logo {
  display: block;
  width: 104px;
  max-height: 36px;
  object-fit: contain;
}

.ant-logo-dark {
  display: none;
}

html[data-theme="dark"] .ant-logo-light {
  display: none;
}

html[data-theme="dark"] .ant-logo-dark {
  display: block;
}

.entry h3 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 720;
  line-height: 1.35;
}

.entry h3 a {
  color: inherit;
}

.entry h3 a:hover {
  color: var(--accent);
}

.organization-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.entry p {
  margin: 0;
  color: var(--body);
  line-height: 1.58;
}

.entry-note {
  color: var(--muted);
}

.entry-meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.45;
  text-align: right;
}

.award {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-inline: -14px;
  padding: 15px 14px;
}

.award span {
  color: var(--ink);
  font-weight: 650;
}

.award time {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

@media (max-width: 820px) {
  .site-layout {
    padding: 22px 16px 68px;
  }

  .sidebar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin: -22px -16px 0;
    padding: 15px 16px 12px;
  }

  .sidebar-nav {
    justify-content: flex-start;
    gap: 10px 16px;
  }

  .nav-cluster {
    justify-content: flex-start;
  }

  .page-wrap {
    margin-top: 34px;
  }

  .profile-card {
    padding-bottom: 36px;
  }

  .profile-name {
    font-size: 2.55rem;
  }

  .profile-inner {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .profile-photo-wrap {
    justify-self: start;
    order: -1;
  }

  .profile-photo {
    width: 140px;
    height: 178px;
  }

  .publication {
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
  }

  .publication-teaser {
    max-width: 360px;
  }

  .entry {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .education-entry {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 9px 14px;
  }

  .organization-entry {
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 9px 14px;
  }

  .education-entry .entry-meta,
  .organization-entry .entry-meta {
    grid-column: 2;
  }

  .school-logo {
    width: 46px;
    height: 46px;
  }

  .organization-logo {
    width: 88px;
    max-height: 32px;
  }

  .entry-meta {
    text-align: left;
  }
}

@media (max-width: 540px) {
  body {
    font-size: 14px;
  }

  .profile-name {
    font-size: 2rem;
  }

  .profile-text p {
    font-size: 1rem;
  }

  .social-nav {
    gap: 8px;
  }

  .award {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@keyframes accent-flow {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 260% 50%;
  }
}

@keyframes line-flow {
  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes nav-drop {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
