:root {
  --bg: #0f172a;
  --page: #eef5f7;
  --card: #ffffff;
  --card-tint: #f8fcfd;
  --card-tint-hover: #f2faf9;
  --border: #d7e5e8;
  --text: #0f172a;
  --muted: #64748b;
  --brand: #0f766e;
  --brand-faint: #f4fbfa;
  --brand-soft: #e6f5f3;
  --brand-ink: #0f3f3a;
  --accent: #d97706;
  --accent-soft: #fff7ed;
  --accent-ink: #8a4b00;
  --shadow: rgba(15, 23, 42, .07);
}

[data-theme="dark"] {
  --bg: #0b1220;
  --page: #0b1220;
  --card: #0f172a;
  --border: #1f2937;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --brand: #3b82f6;
  --brand-faint: #111827;
  --brand-soft: #172554;
  --brand-ink: #bfdbfe;
  --accent: #22c55e;
  --accent-soft: #052e16;
  --accent-ink: #bbf7d0;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 15px/1.75 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
}

a {
  color: var(--brand);
  overflow-wrap: anywhere;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.wrap {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 24px 22px 42px;
}

.page-stack {
  display: grid;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 20px var(--shadow);
}

.card-pad {
  padding: 20px;
}

.profile-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.profile-photo img {
  display: block;
  width: 150px;
  height: auto;
  border: 3px solid rgba(255, 255, 255, .82);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15, 118, 110, .14);
}

.profile-copy h1 {
  margin: 0 0 10px;
  font-size: 30px;
}

.profile-copy > ul:first-of-type {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-copy > ul:first-of-type li:last-child {
  grid-column: 1 / -1;
  width: fit-content;
  color: var(--brand-ink);
  font-weight: 700;
  white-space: nowrap;
}

.content-sheet {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 6px 20px var(--shadow);
}

.content-section {
  width: 100%;
  padding: 22px 26px;
}

.content-section + .content-section {
  border-top: 1px solid var(--border);
}

.prose h1 {
  margin: 0 0 8px;
  font-size: 26px;
}

.prose h2,
.pubs h2 {
  margin: 0 0 14px;
  color: #0f3f3a;
  font-size: 20px;
}

.prose h3 {
  margin: 14px 0 6px;
  font-size: 16px;
}

.prose p {
  margin: 10px 0;
}

.prose ul {
  margin: 8px 0 8px 20px;
}

.prose li,
.pub-item {
  break-inside: avoid;
}

.entry-card,
.pub-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-tint);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.entry-card:hover,
.pub-item:hover {
  transform: translateY(-2px) scale(1.008);
  border-color: color-mix(in srgb, var(--brand) 48%, var(--border));
  background: var(--card-tint-hover);
  box-shadow: 0 10px 24px rgba(15, 118, 110, .13);
}

.entry-card {
  margin-top: 10px;
  padding: 12px 14px;
}

.timeline-card {
  position: relative;
  overflow: hidden;
  padding: 15px 16px 14px 18px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--brand) 8%, transparent), transparent 44%),
    var(--card-tint);
}

.timeline-card::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 0;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
}

.entry-card-list {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.entry-card-list > .entry-card {
  margin-top: 0;
}

.entry-card h3 {
  margin-top: 0;
}

.timeline-card .entry-title {
  margin-bottom: 7px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
}

.entry-label,
.entry-period {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.entry-label {
  min-height: auto;
  padding: 0 0 2px;
  border: 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--brand) 50%, var(--border));
  border-radius: 0;
  background: transparent;
  color: var(--brand-ink);
}

.entry-period {
  padding: 3px 9px;
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  background: var(--accent-soft);
  color: var(--accent-ink);
  white-space: nowrap;
}

.timeline-card ul {
  margin-top: 10px;
  margin-left: 0;
  padding-left: 0;
  list-style: none;
}

.timeline-card li {
  position: relative;
  padding-left: 18px;
}

.timeline-card li + li {
  margin-top: 5px;
}

.timeline-card li::before {
  content: "";
  position: absolute;
  top: .72em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
}

#education .education-card:first-of-type ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 16px;
}

#education .education-card:first-of-type li + li {
  margin-top: 0;
}

.entry-card > :last-child {
  margin-bottom: 0;
}

.prose blockquote {
  margin: 12px 0;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: #10b98110;
}

.prose img {
  max-width: 160px;
  border-radius: 8px;
}

.prose a.citations-link {
  text-decoration: underline;
}

.prose > p:first-of-type > img {
  display: none;
}

.pub-group {
  margin-top: 16px;
}

.pub-group h3 {
  margin: 8px 0;
  font-size: 16px;
}

.count-badge {
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border));
  border-radius: 999px;
  background: var(--brand-soft);
  color: #0f3f3a;
  font-size: 12px;
}

.pub-list {
  display: grid;
  gap: 12px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.pub-list.has-top-mascot {
  padding-top: 18px;
}

.pub-item {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 15px 16px 14px 16px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--brand) 8%, transparent), transparent 44%),
    var(--card-tint);
}

.pub-item.has-pikachu {
  overflow: visible;
}

.pub-item.is-lightning-pub {
  overflow: visible;
}

.pikachu-mascot {
  position: absolute;
  z-index: 2;
  display: block;
  height: auto;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 5px 5px rgba(15, 23, 42, .18));
}

.pikachu-sitting {
  right: 14px;
  bottom: calc(100% - 4px);
  width: 76px;
}

.pikachu-lying {
  right: 12px;
  bottom: calc(100% - 6px);
  width: 102px;
}

.pub-item::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 0;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
}

.pub-item .num {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  padding-top: 2px;
  color: var(--accent);
  font-weight: 600;
  text-align: right;
}

.pub-item.is-lightning-pub .num {
  padding-top: 28px;
}

.pub-item > div {
  grid-column: 2;
  grid-row: 1;
}

.pub-item .title {
  font-size: 16px;
  font-weight: 600;
}

.pub-lightning {
  position: absolute;
  top: 7px;
  left: 8px;
  z-index: 3;
  display: block;
  width: 28px;
  height: 28px;
  transform: rotate(-8deg);
  transform-origin: 50% 50%;
  animation: lightning-jolt 3.2s ease-in-out infinite;
}

.pub-lightning svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter:
    drop-shadow(0 0 5px rgba(250, 204, 21, .55))
    drop-shadow(0 2px 2px rgba(15, 23, 42, .28));
}

.pub-lightning .bolt-glow {
  fill: #fef08a;
  opacity: .32;
  transform: scale(1.12);
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

.pub-lightning .bolt-body {
  stroke: #111827;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.pub-lightning .bolt-shine {
  fill: none;
  stroke: #fffbe6;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 8 34;
  stroke-dashoffset: 36;
  opacity: 0;
  animation: lightning-flow 2.7s ease-in-out infinite;
}

#education .education-lightning {
  top: 10px;
  right: 12px;
  left: auto;
  width: 30px;
  height: 30px;
  opacity: .96;
  animation: lightning-jolt 3.2s ease-in-out infinite;
}

#education .education-lightning svg {
  filter:
    drop-shadow(0 0 3px rgba(250, 204, 21, .36))
    drop-shadow(0 1px 1px rgba(15, 23, 42, .2));
}

#education .education-lightning .bolt-glow {
  opacity: .22;
}

#education .education-lightning .bolt-shine {
  animation: lightning-flow 2.7s ease-in-out infinite;
  opacity: 0;
  stroke-dashoffset: 36;
}

@keyframes lightning-flow {
  0%,
  18% {
    opacity: 0;
    stroke-dashoffset: 38;
  }

  28% {
    opacity: .95;
  }

  46% {
    opacity: .8;
    stroke-dashoffset: -18;
  }

  58%,
  100% {
    opacity: 0;
    stroke-dashoffset: -28;
  }
}

@keyframes lightning-jolt {
  0%,
  74%,
  100% {
    transform: rotate(-8deg) scale(1);
  }

  78% {
    transform: rotate(-13deg) scale(1.08);
  }

  81% {
    transform: rotate(-5deg) scale(1.02);
  }

  84% {
    transform: rotate(-8deg) scale(1.05);
  }
}

.pub-item .title a {
  color: var(--text);
  text-decoration: none;
}

.pub-item .title a:hover {
  text-decoration: underline;
}

.pub-item .title a.poster-link,
.pub-item .title a.code-link {
  margin-left: 6px;
  color: var(--brand);
}

.pub-item .authors,
.pub-item .venue {
  color: var(--text);
  font-size: 14px;
}

.pub-item .venue {
  margin-top: 2px;
}

@media (max-width: 760px) {
  .wrap {
    padding: 16px 14px 32px;
  }

  .profile-card {
    grid-template-columns: 1fr;
  }

  .profile-photo img {
    width: 150px;
    height: auto;
  }

  .profile-copy > ul:first-of-type {
    gap: 6px 18px;
  }

  .card-pad {
    padding: 16px;
  }

  .content-section {
    padding: 18px 16px;
  }

  .pub-item {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 8px;
  }

  .pub-item .num {
    text-align: right;
  }

  .pub-list.has-top-mascot {
    padding-top: 14px;
  }

  .pikachu-sitting {
    right: 10px;
    width: 68px;
  }

  .pikachu-lying {
    right: 8px;
    width: 90px;
  }
}

@media (max-width: 560px) {
  #education .education-card:first-of-type ul {
    grid-template-columns: 1fr;
  }

  .profile-copy > ul:first-of-type {
    grid-template-columns: 1fr;
  }

  .profile-copy > ul:first-of-type li:last-child {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pub-lightning,
  .pub-lightning .bolt-shine {
    animation: none;
  }

  .pub-lightning .bolt-shine {
    opacity: .55;
    stroke-dashoffset: 0;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .card {
    border: none;
    box-shadow: none;
  }

  .pikachu-mascot {
    display: none;
  }
}
