/* One serif family everywhere (Lora, as on enxinsong.com).
   Palette: near-white page, warm near-black text, indigo accent, pale lavender details. */
:root {
  --bg: #fcfcfe;
  --card: #fff;
  --ink: #1d1d22;
  --muted: #5f6272;
  --line: #e9e7f2;
  --accent: #3f4fb0;
  --accent-hover: #2b3784;
  --accent-soft: #efedfc;
  --tag-bg: #ece7fd;
  --tag-ink: #4a35ad;
  --tag-line: #dcd4f8;
  --hl-bg: #fbe9e6;
  --hl-ink: #ad3a25;
  --font: "Lora", "Noto Serif SC", Georgia, "Songti SC", "SimSun", serif;
  --spotlight: #ad3a25;
  --logo-bg: transparent;
  --hex-shadow: #ece6fd;
  --deco-1: #f3f0fe;
  --deco-2: #f0eefc;
  --deco-4: #f3f2fd;
  /* Rounded hexagon used as a mask for the portrait and its shadow. */
  --hexagon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 115.47'%3E%3Cpolygon points='50.00,8.08 93.00,32.91 93.00,82.56 50.00,107.39 7.00,82.56 7.00,32.91' fill='black' stroke='black' stroke-width='14' stroke-linejoin='round'/%3E%3C/svg%3E");
  /* A rounder hexagon for the small marks before section titles. */
  --hexagon-round: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 115.47'%3E%3Cpolygon points='50.00,17.32 85.00,37.53 85.00,77.94 50.00,98.15 15.00,77.94 15.00,37.53' fill='black' stroke='black' stroke-width='30' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: light;
}

/* Dark theme: chosen with the toggle, or following the device when no choice is saved. */
:root[data-theme="dark"] {
  --bg: #15161c;
  --card: #1c1d25;
  --ink: #e7e8ee;
  --muted: #a3a8b6;
  --line: #2b2d38;
  --accent: #a3b0f5;
  --accent-hover: #c7cffd;
  --accent-soft: #232842;
  --tag-bg: #29254a;
  --tag-ink: #cdc2fb;
  --tag-line: #3a3566;
  --hl-bg: #3a2320;
  --hl-ink: #f4a28f;
  --spotlight: #f4a28f;
  --logo-bg: #fff;
  --hex-shadow: #3a3160;
  --deco-1: #1f1c30;
  --deco-2: #1b1e2a;
  --deco-4: #191b24;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15161c;
    --card: #1c1d25;
    --ink: #e7e8ee;
    --muted: #a3a8b6;
    --line: #2b2d38;
    --accent: #a3b0f5;
    --accent-hover: #c7cffd;
    --accent-soft: #232842;
    --tag-bg: #29254a;
    --tag-ink: #cdc2fb;
    --tag-line: #3a3566;
    --hl-bg: #3a2320;
    --hl-ink: #f4a28f;
    --spotlight: #f4a28f;
    --logo-bg: #fff;
    --hex-shadow: #3a3160;
    --deco-1: #1f1c30;
    --deco-2: #1b1e2a;
    --deco-4: #191b24;
    color-scheme: dark;
  }
}

.exp img[src*="GT"] {
  background: var(--logo-bg);
  border-radius: 4px;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a:hover,
a:focus-visible {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

p {
  margin: 0 0 12px;
}

p,
.pub-title {
  text-wrap: pretty;
}

strong {
  font-weight: 600;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
  padding: 12px 24px;
}

.topbar-name {
  color: var(--ink);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .01em;
}

.topbar-name:hover,
.topbar-name:focus-visible {
  color: var(--accent);
  text-decoration: none;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.theme-toggle .icon-sun,
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

.topbar-links a {
  color: var(--muted);
  font-size: 16.5px;
  font-weight: 500;
}

.topbar-links a:hover,
.topbar-links a:focus-visible,
.topbar-links a.active {
  color: var(--accent);
  text-decoration: none;
}

.topbar-links a.active {
  text-decoration: underline 2px;
  text-underline-offset: 8px;
}

/* Layout */
.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px 40px;
}

section {
  margin-top: 60px;
}

h2 {
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.3;
}

h2::before {
  content: "";
  display: inline-block;
  width: .5em;
  aspect-ratio: 1 / 1.1547;
  margin: 0 .42em .1em 0;
  background: var(--accent);
  opacity: .32;
  -webkit-mask: var(--hexagon-round) center / 100% 100% no-repeat;
  mask: var(--hexagon-round) center / 100% 100% no-repeat;
  vertical-align: middle;
}

h2 .note {
  margin-left: 10px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
  white-space: nowrap;
}

.date {
  color: var(--muted);
  font-size: 16.5px;
  white-space: nowrap;
}

.badge {
  color: var(--spotlight);
  font-weight: 600;
}

/* Intro: profile column on the left, bio on the right (after enxinsong.com). */
.intro {
  position: relative;
  display: flex;
  gap: 48px;
  align-items: flex-start;
}

.intro > :not(.intro-deco) {
  position: relative;
  z-index: 1;
}

/* Soft hexagons behind the intro, echoing the honeycomb portrait. */
.intro-deco {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.deco {
  position: absolute;
  aspect-ratio: 1 / 1.1547;
  -webkit-mask: var(--hexagon) center / 100% 100% no-repeat;
  mask: var(--hexagon) center / 100% 100% no-repeat;
}

.deco-1 {
  width: 300px;
  top: -70px;
  left: -110px;
  background: var(--deco-1);
}

.deco-2 {
  width: 220px;
  right: -90px;
  bottom: -40px;
  background: var(--deco-2);
}

.deco-4 {
  width: 120px;
  top: -30px;
  right: -40px;
  background: var(--deco-4);
}

.profile {
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

/* Honeycomb-cell portrait (a nod to Georgia Tech's Yellow Jackets) with an offset purple hexagon behind it. */
.portrait-hex {
  position: relative;
  width: 210px;
  aspect-ratio: 1 / 1.1547;
  margin: 0 0 18px -18px;
}

.portrait-hex::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hex-shadow);
  -webkit-mask: var(--hexagon) center / 100% 100% no-repeat;
  mask: var(--hexagon) center / 100% 100% no-repeat;
  transform: translate(18px, 14px);
  transition: transform .4s ease;
}

.portrait-hex:hover::before {
  transform: translate(22px, 18px);
}

.portrait {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-mask: var(--hexagon) center / 100% 100% no-repeat;
  mask: var(--hexagon) center / 100% 100% no-repeat;
}

.name {
  margin: 0;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.3;
}

.name-zh {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: .15em;
}

.role,
.location {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
}

.role {
  margin-top: 4px;
  white-space: nowrap;
}

.location {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.location svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  opacity: .8;
}

.about {
  flex: 1;
  min-width: 0;
  padding-top: 8px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin-top: 20px;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16.5px;
}

.links a svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* News */
.news {
  margin: 0;
  padding: 0;
  list-style: none;
}

.news li {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  padding: 4px 0;
}

.news .date {
  padding-top: 1px;
}

.news p {
  margin: 0;
}

/* Publications */
.pub {
  display: flex;
  gap: 28px;
  padding: 26px 0;
}

.pub + .pub {
  border-top: 1px solid var(--line);
}

/* The frame takes the image's own shape, so every figure is shown in full. */
.pub-media {
  flex: 0 0 250px;
  align-self: flex-start;
  display: flex;
  justify-content: center;
  padding: 12px;
  border: 1px solid var(--tag-line);
  border-radius: 16px;
  background: var(--card);
}

.pub-media img,
.pub-media video {
  display: block;
  max-width: 100%;
  max-height: 250px;
  border-radius: 6px;
}

.pub-media video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.pub-body {
  flex: 1;
  min-width: 0;
}

.pub-title {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
}

.pub-title:hover,
.pub-title:focus-visible {
  color: var(--accent);
}

.authors {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.55;
}

.authors a {
  color: var(--muted);
}

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

.authors strong {
  color: var(--ink);
  text-decoration: underline 3px var(--tag-line);
  text-underline-offset: 4px;
  text-decoration-skip-ink: none;
}

/* Venue and award tags above the title. */
.venue {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tag {
  padding: 1px 13px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.7;
}

.tag-hl {
  background: var(--hl-bg);
  color: var(--hl-ink);
}

a.tag:hover,
a.tag:focus-visible {
  color: var(--hl-ink);
  text-decoration: none;
  filter: brightness(.97);
}

.summary {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.55;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.pub-links a {
  padding: 2px 16px;
  border: 1px solid var(--tag-line);
  border-radius: 999px;
  background: var(--card);
  font-size: 15.5px;
  line-height: 1.7;
  transition: background-color .2s, border-color .2s;
}

.pub-links a:hover,
.pub-links a:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

/* Experience */
.exp {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 20px;
  align-items: center;
  padding: 10px 0;
}

.exp img {
  width: 90px;
  height: 52px;
  object-fit: contain;
}

.exp-title {
  color: var(--ink);
  font-weight: 600;
}

.exp p {
  margin: 0;
  color: var(--muted);
  font-size: 16.5px;
}

/* Honors */
.plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.plain-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0;
}

/* Footer */
footer {
  margin-top: 72px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}

.click-emoji {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  user-select: none;
  font-size: 19px;
  line-height: 1;
  transform: translate(-50%, -50%);
  animation: emoji-float 1.35s cubic-bezier(.2, .75, .25, 1) forwards;
}

@keyframes emoji-float {
  0% { opacity: 0; transform: translate(-50%, -35%) scale(.72) rotate(-8deg); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -115px) scale(1.22) rotate(12deg); }
}

@media (max-width: 760px) {
  /* Clip the decoration at the screen edge so phones never scroll sideways. */
  .intro-deco {
    inset: -36px -16px 0;
    overflow: hidden;
  }

  .deco-1 {
    width: 240px;
    top: -40px;
    left: -90px;
  }

  .deco-2 {
    width: 170px;
    right: -70px;
    bottom: auto;
    top: 140px;
  }

  .deco-4 {
    display: none;
  }

  .topbar-inner {
    padding: 8px 16px;
  }

  .topbar-name {
    font-size: 17px;
  }

  .topbar-links {
    gap: 14px;
  }

  .topbar-links a:not([href="#publications"]):not([href="#news"]) {
    display: none;
  }

  .page {
    padding: 32px 16px 32px;
  }

  .intro {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }

  .profile {
    flex-basis: auto;
  }

  /* Phones are too narrow for one row, so use two even rows. */
  .links {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 6px 32px;
  }

  .portrait-hex {
    width: 180px;
  }

  h2 .note {
    display: block;
    margin: 2px 0 0;
  }

  section {
    margin-top: 48px;
  }

  .pub {
    flex-direction: column;
    gap: 14px;
  }

  .pub-media {
    flex-basis: auto;
    width: 100%;
  }

  .pub-media img {
    max-height: 300px;
  }

  .news li {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .exp {
    grid-template-columns: 64px 1fr;
  }

  .exp img {
    width: 64px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
