/* ==========================================================================
   Wenze Ren — personal academic site
   Palette sampled from the portrait photo:
   vermilion temple wall · celadon roof tiles · warm stone.
   ========================================================================== */

:root {
  /* Photo-matched colours (stay the same in dark mode) */
  --wall: #B94D40;
  --wall-deep: #9C3F34;
  --on-wall: #FBF6EE;
  --on-wall-2: rgba(251, 246, 238, 0.78);
  --on-wall-line: rgba(251, 246, 238, 0.28);

  /* Page */
  --bg: #F5F1EA;
  --bg-raised: #FBF9F5;
  --bg-sunken: #ECE6DC;
  --ink: #1D1A17;
  --ink-2: #4F4841;
  --ink-3: #7E746A;
  --line: #E1D9CD;
  --line-strong: #CBC0B1;
  --accent: #A8402F;
  --accent-soft: rgba(185, 77, 64, 0.1);
  --celadon: #4A695E;
  --celadon-soft: rgba(79, 110, 99, 0.12);
  --shadow-sm: 0 1px 2px rgba(29, 26, 23, 0.1);
  --shadow: 0 1px 2px rgba(29, 26, 23, 0.06), 0 14px 36px -18px rgba(29, 26, 23, 0.3);
  --shadow-photo: 0 1px 2px rgba(29, 26, 23, 0.08), 0 34px 64px -34px rgba(29, 26, 23, 0.5);
  --red: #B94D40;

  --font-display: "Cormorant Garamond", "Noto Serif SC", "Songti SC", Georgia, serif;
  --font-sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-zh: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;

  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 56px);
  --header-h: 68px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Small roof-line ornament (the temple's upturned eaves) */
  --roof: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 14'%3E%3Cpath d='M1.5 12.2c4.6.5 8.3-.8 11.6-3.1L24 2.2l10.9 6.9c3.3 2.3 7 3.6 11.6 3.1' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='24' cy='2' r='1.4'/%3E%3C/svg%3E");
  /* Plaster grain for the vermilion surfaces */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151311;
    --bg-raised: #1D1A17;
    --bg-sunken: #100E0D;
    --ink: #EFE8DE;
    --ink-2: #C0B6AB;
    --ink-3: #93897F;
    --line: #2D2825;
    --line-strong: #433C37;
    --accent: #EE8E7B;
    --accent-soft: rgba(238, 142, 123, 0.12);
    --celadon: #98BBAE;
    --celadon-soft: rgba(152, 187, 174, 0.13);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
    --shadow-photo: 0 1px 2px rgba(0, 0, 0, 0.4), 0 34px 64px -30px rgba(0, 0, 0, 0.85);
    --red: #D8604E;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #151311;
  --bg-raised: #1D1A17;
  --bg-sunken: #100E0D;
  --ink: #EFE8DE;
  --ink-2: #C0B6AB;
  --ink-3: #93897F;
  --line: #2D2825;
  --line-strong: #433C37;
  --accent: #EE8E7B;
  --accent-soft: rgba(238, 142, 123, 0.12);
  --celadon: #98BBAE;
  --celadon-soft: rgba(152, 187, 174, 0.13);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
  --shadow-photo: 0 1px 2px rgba(0, 0, 0, 0.4), 0 34px 64px -30px rgba(0, 0, 0, 0.85);
  --red: #D8604E;
  color-scheme: dark;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--wall); color: var(--on-wall); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: -64px; left: 16px; z-index: 100;
  padding: 10px 16px; border-radius: 8px;
  background: var(--ink); color: var(--bg);
  font-weight: 600; text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 16px; }

.eyebrow {
  display: flex; align-items: center; gap: 14px;
  font: 500 0.74rem/1.3 var(--font-mono);
  letter-spacing: 0.16em; text-transform: uppercase;
}
.eyebrow::before {
  content: ""; flex: 0 0 32px; height: 1px;
  background: currentColor; opacity: 0.7;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed; inset: 0 0 auto; z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--gutter);
  color: var(--ink);
  border-bottom: 1px solid transparent;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.site-header.is-scrolled {
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  backdrop-filter: saturate(1.3) blur(14px);
  border-bottom-color: var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__seal {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 7px;
  background: var(--wall); color: var(--on-wall);
  font: 600 15px/1 var(--font-display); letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 2px var(--wall), inset 0 0 0 3.2px rgba(251, 246, 238, 0.7);
}
.brand__name {
  font: 600 1.3rem/1 var(--font-display); letter-spacing: 0.01em;
  opacity: 0; transform: translateX(-6px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.is-solid .brand__name { opacity: 1; transform: none; }

.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav__links { display: flex; align-items: center; gap: 2px; margin-right: 6px; }
.site-nav__links a {
  display: block; padding: 8px 14px; border-radius: 999px;
  font-size: 0.93rem; font-weight: 600; letter-spacing: 0.01em;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.site-nav__links a:hover,
.site-nav__links a[aria-current="true"] { background: var(--accent-soft); color: var(--accent); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}
.icon-btn:hover { background: var(--bg-sunken); }
.icon-btn svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}

.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

.nav-toggle { display: none; }

@media (max-width: 880px) {
  .nav-toggle { display: inline-grid; }
  .site-nav__links {
    position: absolute; top: calc(100% + 6px); right: var(--gutter);
    flex-direction: column; align-items: stretch;
    min-width: 210px; margin: 0; padding: 8px;
    border: 1px solid var(--line); border-radius: 14px;
    background: var(--bg-raised); color: var(--ink);
    box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s var(--ease), visibility 0.2s;
  }
  .site-header.is-open .site-nav__links { opacity: 1; visibility: visible; transform: none; }
  .site-nav__links a { padding: 11px 14px; border-radius: 9px; }
}

/* ---------- Hero ---------- */

.hero {
  --hero-maxw: 1180px;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  align-items: start;
  align-content: center;
  column-gap: clamp(32px, 6vw, 96px);
  min-height: min(100vh, 1000px);
  min-height: min(100svh, 1000px);
  padding:
    calc(var(--header-h) + clamp(8px, 1.6vh, 24px))
    max(var(--gutter), calc((100% - var(--hero-maxw)) / 2))
    clamp(40px, 7vh, 72px);
}

.hero__photo {
  position: relative;
  justify-self: start;
  width: min(100%, 440px);
  width: min(100%, 440px, calc((100svh - var(--header-h) - 160px) * 0.8));
  aspect-ratio: 4 / 5;
  animation: photo-in 1.4s var(--ease) both;
}
.hero__photo img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 42%;
  border-radius: 18px;
  background: var(--bg-sunken);
  box-shadow: var(--shadow-photo);
}

.hero__panel {
  display: flex; flex-direction: column; gap: clamp(28px, 5vh, 44px);
  min-width: 0;
}
.hero__content { max-width: 620px; }
.hero__content > * { animation: rise 1s var(--ease) both; }
.hero__content > :nth-child(1) { animation-delay: 0.15s; }
.hero__content > :nth-child(2) { animation-delay: 0.25s; }
.hero__content > :nth-child(3) { animation-delay: 0.4s; }
.hero__content > :nth-child(4) { animation-delay: 0.52s; }

.hero .eyebrow {
  gap: 12px;
  font-family: var(--font-sans); font-weight: 600;
  font-size: 0.9rem; letter-spacing: 0.1em;
  color: var(--accent);
  text-wrap: balance;
}
.hero .eyebrow::before { flex-basis: 24px; }

/* English and Chinese names read at the same visual size;
   Latin letters look smaller than CJK glyphs at equal font-size, hence the 1.3x */
.hero__name {
  --name-size: clamp(1.6rem, 2.8vw, 2.4rem);
  margin: clamp(10px, 1.8vh, 18px) 0 clamp(16px, 2.6vh, 26px);
  font-weight: 500;
}
.hero__en {
  display: block;
  font-family: var(--font-display);
  font-size: calc(var(--name-size) * 1.3);
  line-height: 1; letter-spacing: -0.005em;
}
.hero__en em { font-style: italic; color: var(--red); }
.hero__zh {
  display: block;
  margin-top: 0.42em;
  font-family: var(--font-zh); font-weight: 500;
  font-size: var(--name-size);
  line-height: 1; letter-spacing: 0.24em;
  color: var(--ink-2);
}

.hero__bio { max-width: 62ch; }
.hero__bio p { font-size: 1.02rem; line-height: 1.65; color: var(--ink-2); }
.hero__bio p:first-child { color: var(--ink); }
.hero__bio p + p { margin-top: 0.8em; }

.hero__bio a,
.news a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  transition: text-decoration-color 0.2s;
}
.hero__bio a:hover,
.news a:hover { text-decoration-color: currentColor; }


.hero__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(24px, 4vh, 36px); }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 18px 0 15px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--ink);
  font-size: 0.95rem; font-weight: 600; letter-spacing: 0.01em;
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.25s var(--ease);
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.btn svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.btn svg.is-filled { fill: currentColor; stroke: none; }
.btn--solid { background: var(--wall); border-color: var(--wall); color: var(--on-wall); }

/* round icon links next to the main button, with a small label on hover */
.icon-link {
  position: relative;
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--ink);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.25s var(--ease);
}
.icon-link:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.icon-link svg {
  width: 19px; height: 19px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-link svg.is-filled { fill: currentColor; stroke: none; }
.icon-link::after {
  content: attr(aria-label);
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  padding: 5px 9px; border-radius: 6px;
  background: var(--ink); color: var(--bg);
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.15s, transform 0.15s;
}
.icon-link:hover::after,
.icon-link:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }

/* narrow phones: main button on its own row, the four icons together below it */
@media (max-width: 420px) {
  .hero__links > li:first-child { flex-basis: 100%; }
}
.btn--solid:hover { background: var(--wall-deep); border-color: var(--wall-deep); color: var(--on-wall); }

@media (max-width: 760px) {
  .hero {
    grid-template-columns: minmax(0, 1fr); row-gap: 36px;
    min-height: 0;
    padding: calc(var(--header-h) + 12px) var(--gutter) 24px;
  }
  .hero .eyebrow { letter-spacing: 0.08em; }
}

/* ---------- Sections ---------- */

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(80px, 11vw, 136px) var(--gutter) 0;
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: 32px clamp(32px, 6vw, 88px);
}
.section__head { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; }
.section__index {
  display: flex; align-items: center; gap: 12px;
  font: 500 0.74rem/1 var(--font-mono); letter-spacing: 0.16em;
  color: var(--accent);
}
.section__index::after {
  content: ""; width: 48px; height: 14px;
  background: currentColor;
  -webkit-mask: var(--roof) center / contain no-repeat;
  mask: var(--roof) center / contain no-repeat;
}
.section__title {
  margin-top: 16px;
  font: 500 clamp(2.5rem, 4.4vw, 3.6rem)/1 var(--font-display);
  letter-spacing: -0.01em;
}
.section__aside { margin-top: 18px; font-size: 0.92rem; line-height: 1.7; color: var(--ink-3); }
.section__aside a { color: var(--accent); font-weight: 600; text-decoration: none; }
.section__aside a:hover { text-decoration: underline; }
.section__body { min-width: 0; }

@media (max-width: 960px) {
  .section { grid-template-columns: minmax(0, 1fr); }
  .section__head { position: static; }
}

/* ---------- News ---------- */

.news__year + .news__year { margin-top: 40px; }
.news__year.is-entering { animation: part-in 0.45s var(--ease) both; }
.news__label {
  margin-bottom: 18px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font: 500 2rem/1 var(--font-display); font-variant-numeric: lining-nums;
}
.news__items { display: grid; gap: 14px; }
.news__items li { position: relative; padding-left: 22px; color: var(--ink-2); }
.news__items li::before {
  content: ""; position: absolute; left: 2px; top: 0.66em;
  width: 6px; height: 6px;
  background: var(--wall); transform: rotate(45deg);
}
.news strong { font-weight: 600; color: var(--ink); }
.news a strong { color: inherit; }


/* ---------- Publications ---------- */



/* year navigation, under the section title in the sticky column */
.year-nav {
  display: grid; gap: 2px;
  max-width: 170px; margin-top: 36px;
  border-left: 1px solid var(--line);
}
.year-nav a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-left: -1px; padding: 7px 0 7px 16px;
  border-left: 2px solid transparent;
  font: 500 1.4rem/1.1 var(--font-display); font-variant-numeric: lining-nums;
  color: var(--ink-3); text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}
.year-nav a:hover { color: var(--ink); }
.year-nav a[aria-current="true"] { color: var(--accent); border-left-color: var(--accent); }
.year-nav__label {
  margin: 16px 0 4px 16px;
  font: 500 0.62rem/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
}


@media (max-width: 960px) {
  .year-nav { display: flex; flex-wrap: wrap; gap: 8px; max-width: none; margin-top: 22px; border-left: 0; }
  .year-nav a {
    gap: 8px; margin: 0; padding: 6px 12px;
    border: 1px solid var(--line-strong); border-radius: 999px;
    font-size: 1.1rem;
  }
  .year-nav a[aria-current="true"] { border-color: var(--accent); }
  .year-nav__label { flex-basis: 100%; margin: 6px 0 0; }
}

/* the part picked in the left nav (First Author or a year); while searching, several are listed */
.pub-group + .pub-group { margin-top: 44px; }
.pub-group__head {
  display: flex; align-items: baseline; gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.pub-group__title { font: 500 2rem/1 var(--font-display); font-variant-numeric: lining-nums; }
.pub-group.is-entering { animation: part-in 0.45s var(--ease) both; }
@keyframes part-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.pub {
  display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 80px);
}
.pub:last-child { border-bottom: 0; }
.pub__side { padding-top: 2px; }

.badge {
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 9px;
  border: 1px solid transparent; border-radius: 6px;
  font: 500 0.7rem/1 var(--font-mono); letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge--journal { background: var(--wall); color: var(--on-wall); }
.badge--conference { background: var(--accent-soft); color: var(--accent); }
.badge--workshop { background: var(--celadon-soft); color: var(--celadon); }
.badge--preprint { border-color: var(--line-strong); color: var(--ink-3); }

.pub__title {
  font: 600 1.08rem/1.42 var(--font-sans); letter-spacing: -0.003em;
  color: var(--ink);
  text-wrap: pretty;
}
.pub__title a {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.35s var(--ease), color 0.2s;
}
.pub__title a:hover { color: var(--accent); background-size: 100% 1px; }
.pub__authors { margin-top: 6px; font-size: 0.95rem; line-height: 1.55; color: var(--ink-2); }
.pub__authors .me {
  color: var(--ink); font-weight: 700;
  text-decoration: underline; text-decoration-color: var(--wall);
  text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.pub__more {
  padding: 0; border: 0; background: none;
  color: var(--accent); font-size: inherit; font-weight: 600;
  cursor: pointer;
}
.pub__more:hover { text-decoration: underline; }
.pub__where { margin-top: 3px; font-size: 0.9rem; font-style: italic; color: var(--ink-3); }
.pub__note { font-style: normal; font-weight: 600; color: var(--celadon); }

.pub__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; }
.pub__flag {
  display: inline-flex; align-items: center; gap: 7px;
  margin-right: 4px;
  font: 500 0.66rem/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}
.pub__flag::before { content: ""; width: 6px; height: 6px; background: var(--wall); transform: rotate(45deg); }
.pub__links { display: flex; flex-wrap: wrap; gap: 6px; }
.plink {
  display: inline-flex; align-items: center;
  height: 26px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: 6px;
  font: 500 0.72rem/1 var(--font-mono);
  color: var(--ink-2); text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.plink:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.pub.is-flash { animation: flash 2.2s var(--ease); }
.pub-empty { padding: 32px 0; color: var(--ink-3); }

@media (max-width: 640px) {
  .pub { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}

/* ---------- Honors ---------- */

.honors__year {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px 32px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.honors__year:first-child { padding-top: 4px; border-top: 0; }
.honors__label { font: 500 2.1rem/1 var(--font-display); font-variant-numeric: lining-nums; }
.honors__items { display: grid; gap: 28px; }

.honor__title { font-size: 1.1rem; font-weight: 600; line-height: 1.4; }
.honor__title abbr { text-decoration: none; cursor: help; }
.honor__venue { font-weight: 400; color: var(--ink-3); }
.honor__results { display: grid; gap: 10px; margin-top: 12px; }
.honor__results li {
  display: grid; grid-template-columns: 88px minmax(0, 1fr);
  align-items: start; gap: 14px;
}
.honor__award {
  justify-self: start;
  display: inline-flex; align-items: center;
  height: 26px; padding: 0 10px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
  white-space: nowrap;
}
.honor__award--top { background: var(--wall); color: var(--on-wall); }
.honor__track { padding-top: 2px; font-size: 0.98rem; line-height: 1.5; color: var(--ink-2); }
.honor__paper {
  display: inline-flex; align-items: center; vertical-align: 1px;
  height: 24px; margin-left: 6px; padding: 0 9px;
  border: 1px solid var(--line-strong); border-radius: 6px;
  font: 500 0.7rem/1 var(--font-mono);
  color: var(--ink-2); text-decoration: none; white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.honor__paper:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

@media (max-width: 640px) {
  .honors__year { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Service ---------- */

.service__role {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font: 500 2rem/1 var(--font-display);
}
.service__list { display: grid; gap: 14px; margin-top: 20px; }
.service__row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 24px; align-items: baseline; }
.service__row dt {
  font: 500 0.66rem/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3);
}
.service__row dd { color: var(--ink-2); line-height: 1.55; }

@media (max-width: 640px) {
  .service__row { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Contact ---------- */

.contact {
  position: relative;
  margin-top: clamp(112px, 14vw, 176px);
  background: var(--wall); color: var(--on-wall);
  isolation: isolate; overflow: hidden;
}
.contact::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: var(--grain);
  opacity: 0.2; mix-blend-mode: multiply;
  pointer-events: none;
}
.contact__inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(72px, 10vw, 128px) var(--gutter);
}
.contact .eyebrow { color: var(--on-wall-2); }
.contact__title {
  margin-top: 18px;
  font: 500 clamp(2.8rem, 6vw, 5rem)/1 var(--font-display);
  letter-spacing: -0.015em;
}
.contact__text { margin-top: 18px; max-width: 46ch; font-size: 1.08rem; }
.contact__body {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start; gap: 44px clamp(40px, 7vw, 112px);
}
/* line the details up with the title rather than the small eyebrow above it */
.contact__details { padding-top: 40px; }
.contact__methods { display: grid; gap: 24px; }
.contact__method {
  display: grid; grid-template-columns: 84px minmax(0, 1fr);
  align-items: start; gap: 6px 20px;
}
.contact__method dt {
  padding-top: 0.7em;
  font: 500 0.66rem/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--on-wall-2);
}
.contact__method dd { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.contact__method a[data-email] {
  font: 500 clamp(1.1rem, 1.6vw, 1.3rem)/1.5 var(--font-sans);
  letter-spacing: 0.01em;
  color: var(--on-wall);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em;
  text-decoration-color: rgba(251, 246, 238, 0.45);
  overflow-wrap: anywhere;
  transition: text-decoration-color 0.2s;
}
.contact__method a[data-email]:hover { text-decoration-color: var(--on-wall); }
.contact__method--wechat dt { padding-top: 13px; }
.wechat__toggle {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px 0 16px;
  border: 1px solid rgba(251, 246, 238, 0.45); border-radius: 999px;
  color: var(--on-wall);
  font-size: 0.9rem; font-weight: 600;
  list-style: none; cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}
.wechat__toggle::-webkit-details-marker { display: none; }
.wechat__toggle:hover { background: rgba(251, 246, 238, 0.12); border-color: var(--on-wall); }
.wechat__toggle svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.25s var(--ease);
}
.wechat[open] .wechat__toggle svg { transform: rotate(180deg); }
.wechat__hide,
.wechat[open] .wechat__show { display: none; }
.wechat[open] .wechat__hide { display: inline; }
.wechat__panel {
  display: flex; align-items: center; gap: 18px;
  margin-top: 14px;
  animation: rise 0.45s var(--ease) both;
}
.wechat__panel img {
  width: 136px; height: 136px; padding: 8px;
  border-radius: 12px; background: #fff;
  box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.55);
}
.wechat__panel span { max-width: 18ch; font-size: 0.92rem; line-height: 1.5; color: var(--on-wall-2); }

.contact__links { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 26px; }
.contact__links a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.95rem; font-weight: 600;
  color: var(--on-wall); text-decoration: none;
  opacity: 0.88;
}
.contact__links a::after { content: "↗"; font-size: 0.85em; opacity: 0.7; }
.contact__links a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 0.2em; }

.site-footer { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.site-footer__inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: 22px 0 28px;
  border-top: 1px solid var(--on-wall-line);
  font-size: 0.84rem; color: var(--on-wall-2);
}

@media (max-width: 860px) {
  .contact__body { grid-template-columns: minmax(0, 1fr); }
  .contact__details { padding-top: 0; }
}

@media (max-width: 720px) {
  .contact__method { grid-template-columns: minmax(0, 1fr); }
  .contact__method dt { padding-top: 0; }
}

/* ---------- Motion ---------- */

.js .reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }

@keyframes photo-in { from { opacity: 0; transform: translateY(18px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes flash {
  0%, 35% { background-color: var(--accent-soft); box-shadow: -14px 0 0 var(--accent-soft), 14px 0 0 var(--accent-soft); }
  100% { background-color: transparent; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
