:root {
  --bg: #f4f8fc;
  --fg: #191816;
  --muted: #617283;
  --line: #d8e5f0;
  --soft: #ebf4fb;
  --accent: #5f86cf;
  --accent-soft: #4ba99e;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--fg);
  background:
    radial-gradient(circle at top right, rgba(95,134,207,.14), transparent 28%),
    radial-gradient(circle at 0% 22%, rgba(75,169,158,.12), transparent 24%),
    var(--bg);
}

body.home-page,
body.paper-page {
  color-scheme: light;
}

a { color: inherit; }

.site-shell {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
  padding: 16px 0 72px;
}

.paper-page-shell {
  padding: 18px 28px 72px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(47,73,109,.05);
}

body.paper-page .site-shell {
  width: min(1120px, calc(100% - 36px));
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(244,248,252,.72);
  backdrop-filter: blur(14px);
  box-shadow: none;
}

.paper-topbar {
  background: #fff;
}

.paper-topbar .site-stamp {
  grid-column: 3;
  justify-self: end;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .05em;
  text-decoration: none;
}

.monogram {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: visible;
  border-radius: 0;
  background: transparent;
}

.monogram-mark {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: none;
}

.tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  flex: none;
  padding: 7px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 560;
  text-decoration: none;
  white-space: nowrap;
}

.tab:hover,
.tab[aria-current="true"] {
  color: var(--fg);
}

.tab[aria-current="true"]::after {
  content: none;
}

.tab[aria-current="true"] {
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(95,134,207,.1);
}

.site-stamp {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.panel {
  scroll-margin-top: 96px;
}

.hero-panel {
  padding: 56px 0 40px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 190px;
  gap: 42px;
  align-items: center;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
}

h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(33px, 5.2vw, 52px);
  line-height: 1.02;
  letter-spacing: -.055em;
  font-weight: 540;
}

.statement {
  max-width: 660px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.45;
}

.statement strong,
.about-copy strong {
  color: var(--fg);
  font-weight: 700;
}

.primary-action {
  display: inline-flex;
  margin-top: 24px;
  padding: 12px 17px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(95,134,207,.16);
}

.primary-action:hover { opacity: .92; }

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 18px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.social-links a:hover { color: var(--accent); }

.social-links svg {
  width: 16px;
  height: 16px;
}

.profile-photo {
  position: relative;
  width: min(100%, 164px);
  aspect-ratio: 1 / 1;
  justify-self: center;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: none;
  background: transparent;
}

.profile-photo > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.profile-photo > span {
  position: absolute;
  inset: auto 12px 12px;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--fg);
  background: rgba(244,248,252,.92);
  font-size: 12px;
  text-align: center;
}

.profile-photo > img:not([hidden]) + span { display: none; }

.home-summary {
  display: grid;
  gap: 18px;
  margin-top: 30px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.52);
}

.section-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
}

.about-copy {
  margin: 0;
  color: var(--muted);
  font-size: clamp(14px, 1.55vw, 16px);
  line-height: 1.62;
}

.about-copy a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.interests {
  display: grid;
  grid-template-columns: 128px minmax(0,1fr);
  gap: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.label {
  color: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}

.interests > div {
  display: flex;
  flex-wrap: nowrap;
  gap: 0 16px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.interests > div::-webkit-scrollbar { display: none; }

.interests > div span {
  position: relative;
  font-size: 13px;
  font-weight: 560;
}

.interests > div span:not(:last-child)::after {
  content: "·";
  position: absolute;
  right: -12px;
  color: var(--accent);
}

.content-section {
  padding-top: 64px;
}

.heading {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.heading h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 560;
  letter-spacing: -.04em;
}

.publication-list { display: grid; gap: 18px; }
.loading { color: var(--muted); }

.year-group { padding-top: 24px; }

.year-group h3 {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  font-size: 13px;
  font-weight: 700;
}

.publication-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  padding-top: 14px;
}

.publication-card {
  display: grid;
  grid-template-columns: 104px minmax(0,1fr);
  gap: 18px;
  align-items: center;
  min-height: 166px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--fg);
  background: #fff;
  text-decoration: none;
  transition: .18s ease;
}

.publication-card:hover,
.publication-card:focus-visible {
  border-color: rgba(95,134,207,.28);
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(47,73,109,.08);
  outline: none;
}

.publication-visual {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
}

.publication-visual img {
  width: auto;
  height: auto;
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.figure-placeholder {
  display: grid;
  gap: 6px;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  line-height: 1.35;
}

.figure-placeholder strong {
  color: var(--fg);
  font-size: 14px;
  font-weight: 650;
}

.figure-placeholder span { font-size: 12px; }

.figure-placeholder.compact {
  padding: 12px;
}

.figure-placeholder.compact strong { font-size: 12px; }
.figure-placeholder.compact span { font-size: 11px; }

.publication-title {
  display: block;
  margin-bottom: 9px;
  font-weight: 650;
  line-height: 1.35;
}

.publication-authors,
.publication-venue {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.publication-venue,
.paper-kicker {
  font-weight: 700;
}

.publication-authors strong { color: var(--accent); }

.paper-section {
  margin-top: 24px;
  padding: 28px 0 0;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.paper-back {
  display: flex;
  justify-content: flex-start;
  width: min(100%, 920px);
  margin: 0 auto 26px;
  color: var(--accent-soft);
  font-size: 14px;
  text-decoration: none;
}

.paper-back:hover { color: var(--accent); }

.paper-kicker {
  max-width: 860px;
  margin: 0 auto 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.paper-title {
  max-width: 950px;
  margin: 0 auto;
  font-size: clamp(24px, 3.6vw, 36px);
  line-height: 1.12;
  letter-spacing: -.05em;
  font-weight: 560;
  text-align: center;
}

.paper-authors {
  max-width: 920px;
  margin: 18px auto 0;
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
}

.paper-authors strong,
.timeline h3 { color: var(--fg); }

.paper-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin: 22px auto 0;
  font-size: 14px;
}

.paper-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 168px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  box-shadow: 0 10px 22px rgba(95,134,207,.18);
  font-weight: 650;
  text-decoration: none;
  transition: .18s ease;
}

.paper-actions a:hover,
.paper-actions a:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(95,134,207,.22);
  outline: none;
}

.paper-figure-stack {
  max-width: 920px;
  margin: 34px auto 0;
}

.paper-copy-block {
  max-width: 860px;
  margin: 26px auto 0;
}

.paper-copy-block h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 650;
}

.paper-abstract {
  margin: 0;
  color: var(--muted);
  line-height: 1.82;
}

.bibtex-card {
  max-width: 860px;
  margin: 28px auto 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.bibtex-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.bibtex-header h3 {
  margin: 0;
  font-size: 17px;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  box-shadow: 0 10px 22px rgba(95,134,207,.18);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: .18s ease;
}

.copy-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(95,134,207,.22);
}

.copy-button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: .7;
}

.paper-bibtex {
  width: 100%;
  min-height: 190px;
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  border: 1px solid rgba(95,134,207,.14);
  border-radius: 12px;
  background: #fff;
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.62;
  white-space: pre;
  resize: vertical;
  outline: none;
}

.main-figure {
  display: grid;
  place-items: center;
  min-height: 320px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.main-figure img {
  width: auto;
  height: auto;
  max-width: min(100%, 880px);
  max-height: 620px;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
}

.figure-caption {
  max-width: 860px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.abstract-visual {
  position: relative;
  display: block;
  width: 100%;
  min-height: 220px;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 24%, rgba(255,255,255,.72), transparent 18%),
    radial-gradient(circle at 78% 28%, rgba(255,255,255,.46), transparent 22%),
    linear-gradient(135deg, rgba(95,134,207,.92), rgba(75,169,158,.88));
  box-shadow: 0 18px 36px rgba(47,73,109,.1);
}

.abstract-visual > span {
  position: absolute;
  border-radius: 999px;
  opacity: .88;
}

.abstract-visual > span:nth-child(1) {
  top: 14%;
  left: 10%;
  width: 34%;
  height: 34%;
  border: 1.5px solid rgba(255,255,255,.64);
}

.abstract-visual > span:nth-child(2) {
  right: 12%;
  bottom: 16%;
  width: 40%;
  height: 40%;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.3);
}

.abstract-visual > span:nth-child(3) {
  left: 42%;
  top: 24%;
  width: 18%;
  height: 52%;
  border-radius: 32px;
  background: rgba(255,255,255,.18);
  transform: rotate(32deg);
}

.abstract-visual--graph {
  background:
    linear-gradient(135deg, rgba(95,134,207,.96), rgba(84,114,191,.9));
}

.abstract-visual--graph > span:nth-child(1) {
  width: 40%;
  height: 2px;
  top: 28%;
  left: 14%;
  border: 0;
  background: rgba(255,255,255,.72);
  box-shadow: 0 50px 0 rgba(255,255,255,.52);
}

.abstract-visual--graph > span:nth-child(2) {
  width: 14px;
  height: 14px;
  top: 24%;
  right: 18%;
  background: #fff;
}

.abstract-visual--graph > span:nth-child(3) {
  width: 18px;
  height: 18px;
  left: 34%;
  top: 48%;
  background: rgba(255,255,255,.92);
  transform: none;
}

.abstract-visual--environment,
.abstract-visual--collaboration,
.abstract-visual--spaces {
  background:
    radial-gradient(circle at 22% 28%, rgba(255,255,255,.64), transparent 18%),
    linear-gradient(140deg, rgba(75,169,158,.92), rgba(95,134,207,.86));
}

.abstract-visual--walking {
  background:
    linear-gradient(135deg, rgba(75,169,158,.9), rgba(95,134,207,.95));
}

.abstract-visual--walking > span:nth-child(1),
.abstract-visual--walking > span:nth-child(2) {
  border-radius: 24px;
  background: rgba(255,255,255,.18);
  border: 0;
}

.abstract-visual--walking > span:nth-child(1) {
  width: 18%;
  height: 62%;
  left: 24%;
  top: 18%;
  transform: skewX(-16deg);
}

.abstract-visual--walking > span:nth-child(2) {
  width: 18%;
  height: 62%;
  left: 52%;
  top: 18%;
  transform: skewX(-16deg);
}

.abstract-visual--walking > span:nth-child(3) {
  width: 52%;
  height: 2px;
  left: 24%;
  top: 50%;
  background: rgba(255,255,255,.62);
  border-radius: 999px;
  transform: none;
}

.timeline {
  margin: 0;
  padding: 18px 0 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 150px minmax(0,1fr);
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.timeline li > span,
.teaching-grid > div > span {
  color: var(--accent-soft);
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.timeline h3,
.teaching-grid h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 650;
}

.entry-title-primary,
.entry-title-affiliation {
  display: inline-flex;
  align-items: center;
}

.entry-title-affiliation {
  margin-left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(95,134,207,.1);
  font-size: .84em;
  font-weight: 620;
  letter-spacing: .01em;
  vertical-align: middle;
}

.timeline p,
.teaching-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.small { font-size: 13px; }

.teaching-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 0 28px;
  padding-top: 18px;
}

.teaching-grid > div {
  display: grid;
  grid-template-columns: 68px minmax(0,1fr);
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.notice {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
}

@media (max-width: 820px) {
  .site-shell {
    width: min(100% - 24px, 1160px);
    padding-top: 12px;
  }

  .paper-page-shell {
    padding: 16px 18px 56px;
    border-radius: 22px;
  }

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

  .paper-topbar .site-stamp {
    grid-column: auto;
    justify-self: start;
  }

  .tabs {
    justify-content: flex-start;
    width: 100%;
  }

  .tab[aria-current="true"]::after { bottom: -11px; }
  .hero { grid-template-columns: 1fr; }
  .profile-photo { grid-row: 1; width: min(58vw, 170px); }
  .home-summary,
  .publication-grid,
  .teaching-grid {
    grid-template-columns: 1fr;
  }

  .interests {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .timeline li {
    grid-template-columns: 104px minmax(0,1fr);
    gap: 16px;
  }

  .entry-title-affiliation {
    display: inline-flex;
    margin-top: 8px;
    margin-left: 0;
  }
}

@media (max-width: 520px) {
  .brand > span:last-child { font-size: 12px; }
  .site-stamp { font-size: 11px; }
  .publication-card {
    grid-template-columns: 78px minmax(0,1fr);
    min-height: 136px;
    padding: 14px;
  }

  .publication-visual {
    width: 78px;
    height: 78px;
  }

  .paper-section { padding: 20px 0 0; }
  .bibtex-header { align-items: flex-start; flex-direction: column; }
  .abstract-visual { min-height: 180px; }
}
