/* ==========================================================
   Joe (Jiazhou) Liang — personal site
   Modern editorial · warm light + bold dark
   ========================================================== */

:root {
  /* light (default) — cool editorial: paper white + ink black + electric indigo */
  --bg: #f1f2f5;
  --bg-2: #e6e8ed;
  --bg-3: #dadce4;
  --ink: #0e0f14;
  --ink-2: #2f3038;
  --ink-3: #6b6d78;
  --ink-4: #a8aab2;
  --rule: #cfd2da;
  --rule-2: #b8bbc5;
  --accent: #3d3df0;
  --accent-2: #5a5aff;
  --accent-soft: #d4d4ff;
  --gold: #c89b3f;
  --green: #4a7c4e;
  --blue: #2c5cb0;

  --serif: "Instrument Serif", "Newsreader", Georgia, serif;
  --serif-body: "Newsreader", "Source Serif 4", Georgia, serif;
  --sans: "Geist", "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;

  --maxw: 1240px;
  --gutter: clamp(20px, 4vw, 56px);
  --radius: 6px;
  --radius-lg: 18px;

  --ease: cubic-bezier(.7,0,.2,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
}

[data-theme="dark"] {
  --bg: #0a0b10;
  --bg-2: #12131a;
  --bg-3: #1c1d26;
  --ink: #f1f1eb;
  --ink-2: #c8c9c2;
  --ink-3: #82838c;
  --ink-4: #44454e;
  --rule: #24252e;
  --rule-2: #34353f;
  --accent: #7c7cff;
  --accent-2: #9a9aff;
  --accent-soft: #1f1f3a;
  --gold: #e6b85a;
  --green: #7fb583;
  --blue: #6b94de;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

/* film grain removed for cleaner look */

::selection { background: var(--accent); color: #fff; }
[data-theme="dark"] ::selection { background: var(--accent); color: #0c0b09; }

/* ===== typography ===== */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
}
h1 { font-size: clamp(56px, 11vw, 168px); }
h2 { font-size: clamp(36px, 6vw, 80px); }
h3 { font-size: clamp(22px, 2.6vw, 34px); line-height: 1.2; }
h4 { font-size: clamp(18px, 1.4vw, 22px); }

.italic { font-style: italic; }
.serif { font-family: var(--serif); }
.serif-body { font-family: var(--serif-body); }
.mono { font-family: var(--mono); }

p { font-size: 16px; line-height: 1.65; color: var(--ink-2); }
p.lead {
  font-family: var(--serif-body);
  font-weight: 300;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.4;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
}

a { color: inherit; text-decoration: none; transition: color .25s var(--ease); }
a:hover { color: var(--accent); }

.link-u {
  position: relative;
  display: inline-block;
  padding-bottom: 2px;
}
.link-u::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform-origin: right;
  transition: transform .5s var(--ease);
}
.link-u:hover::after { transform-origin: left; transform: scaleX(0); }
.link-u::before {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform .5s var(--ease) .08s;
}
.link-u:hover::before { transform: scaleX(1); }

/* ===== layout ===== */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 2;
}

section { padding: clamp(70px, 11vw, 140px) 0; position: relative; }
.section-rule + section { border-top: 1px solid var(--rule); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(40px, 6vw, 80px);
  flex-wrap: wrap;
}
.section-head .label { font-family: var(--mono); font-size: 12px; color: var(--ink-3); letter-spacing: 0.14em; text-transform: uppercase; }

/* ===== nav ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--rule); }

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent-2), var(--accent) 50%, color-mix(in srgb, var(--accent) 60%, #000));
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent), 0 8px 24px -8px var(--accent);
  animation: pulse 4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
  justify-content: center;
}
.nav-links a {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  position: relative;
  padding: 8px 0;
  transition: color .25s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::before {
  content: "";
  position: absolute;
  left: -12px; top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.nav-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle, .mobile-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .25s var(--ease);
}
.theme-toggle:hover { border-color: var(--ink); transform: rotate(20deg); color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; }
.mobile-toggle { display: none; }

@media (max-width: 820px) {
  .nav-inner { grid-template-columns: 1fr auto; }
  .mobile-toggle { display: inline-flex; }
  .nav-links {
    position: fixed; inset: 64px 0 auto 0;
    flex-direction: column;
    background: var(--bg);
    padding: 32px var(--gutter);
    border-bottom: 1px solid var(--rule);
    transform: translateY(-130%);
    transition: transform .4s var(--ease);
    gap: 18px;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { font-size: 14px; }
}

/* ===== buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .35s var(--ease);
  position: relative;
  overflow: hidden;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-1px); }
.btn .arrow { transition: transform .35s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }

/* ===== hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding: 140px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-bg canvas { width: 100%; height: 100%; opacity: 0.7; }
[data-theme="dark"] .hero-bg canvas { opacity: 0.55; }

/* mesh gradient blobs */
.mesh {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  mix-blend-mode: multiply;
  animation: drift 18s ease-in-out infinite;
}
[data-theme="dark"] .mesh { mix-blend-mode: screen; opacity: 0.35; }
.mesh.m1 { width: 540px; height: 540px; background: var(--accent); top: -120px; right: -80px; animation-delay: -0s; }
.mesh.m2 { width: 480px; height: 480px; background: var(--gold); bottom: -120px; left: -100px; animation-delay: -6s; }
.mesh.m3 { width: 380px; height: 380px; background: var(--blue); top: 30%; left: 40%; animation-delay: -12s; opacity: 0.35; }
@keyframes drift {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.1); }
  66% { transform: translate(-30px, 50px) scale(0.95); }
}

.hero-inner { position: relative; z-index: 2; width: 100%; }

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
  animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: 0.4; } }

.hero-title {
  font-family: var(--serif);
  font-size: clamp(64px, 13.5vw, 220px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin: 0 0 30px;
  display: block;
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .word {
  display: inline-block;
  transform: translateY(110%);
  animation: rise 1s var(--ease-out) forwards;
}
.hero-title .line:nth-child(2) .word { animation-delay: 0.12s; }
.hero-title .accent { color: var(--accent); font-style: italic; }
@keyframes rise { to { transform: translateY(0); } }

.hero-sub {
  max-width: 720px;
  font-family: var(--serif-body);
  font-weight: 300;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.4;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 36px;
  opacity: 0;
  animation: fade-up 1s var(--ease-out) 0.5s forwards;
}
@keyframes fade-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.hero-meta {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  align-items: center;
  opacity: 0;
  animation: fade-up 1s var(--ease-out) 0.8s forwards;
}
.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hero-meta-item .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.hero-meta-item .v { font-family: var(--serif-body); font-size: 18px; color: var(--ink); }

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 40px;
  opacity: 0;
  animation: fade-up 1s var(--ease-out) 1s forwards;
}

.hero-socials {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-left: 8px;
  padding-left: 18px;
  border-left: 1px solid var(--rule);
}
.hero-socials a {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  transition: all .3s var(--ease);
  border: 1px solid transparent;
}
.hero-socials a:hover {
  color: var(--accent);
  border-color: var(--rule);
  transform: translateY(-2px);
}
.hero-socials svg { width: 18px; height: 18px; }
@media (max-width: 520px) {
  .hero-socials { margin-left: 0; padding-left: 0; border-left: none; }
}

/* scroll indicator */
.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 5;
  animation: cue-float 3.4s ease-in-out infinite;
}
.scroll-cue .scroll-word {
  display: inline-flex;
  gap: 1px;
  overflow: hidden;
}
.scroll-cue .scroll-word span {
  display: inline-block;
  animation: letter-wave 2.4s ease-in-out infinite;
}
.scroll-cue .scroll-word span:nth-child(1) { animation-delay: 0s; }
.scroll-cue .scroll-word span:nth-child(2) { animation-delay: 0.08s; }
.scroll-cue .scroll-word span:nth-child(3) { animation-delay: 0.16s; }
.scroll-cue .scroll-word span:nth-child(4) { animation-delay: 0.24s; }
.scroll-cue .scroll-word span:nth-child(5) { animation-delay: 0.32s; }
.scroll-cue .scroll-word span:nth-child(6) { animation-delay: 0.40s; }
@keyframes cue-float {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}
@keyframes letter-wave {
  0%, 60%, 100% { transform: translateY(0); color: var(--ink-3); }
  30% { transform: translateY(-3px); color: var(--accent); }
}
.scroll-cue .bar { width: 1px; height: 40px; background: linear-gradient(to bottom, transparent, var(--ink-3)); position: relative; overflow: hidden; }
.scroll-cue .bar::after {
  content: "";
  position: absolute;
  top: -40px; left: 0;
  width: 1px; height: 20px;
  background: var(--accent);
  animation: scroll-anim 2.4s var(--ease) infinite;
}
.scroll-cue .chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.scroll-cue .chev svg {
  width: 10px;
  height: 10px;
  animation: chev-bounce 1.8s ease-in-out infinite;
}
@keyframes chev-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(4px); opacity: 1; }
}
@keyframes scroll-anim { to { top: 100%; } }

/* ===== marquee ===== */
.marquee {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 28px 0;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  z-index: 2;
  background: var(--bg);
}
.marquee-track {
  display: inline-flex;
  gap: 60px;
  animation: marquee 50s linear infinite;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(28px, 4vw, 48px);
  color: var(--ink);
  letter-spacing: -0.01em;
}
.marquee-track span { display: inline-flex; align-items: center; gap: 60px; }
.marquee-track span::after {
  content: "✦";
  color: var(--accent);
  font-style: normal;
  font-size: 0.6em;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ===== news list ===== */
.news-list { display: flex; flex-direction: column; gap: 0; }
.news-item {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
  align-items: center;
  transition: padding-left .3s var(--ease);
  position: relative;
}
.news-item:last-child { border-bottom: 1px solid var(--rule); }
.news-item:hover { padding-left: 12px; }
.news-item:hover .news-thumb { transform: scale(1.02); }
.news-item:hover .news-title { color: var(--accent); }

.news-thumb {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--rule);
  transition: transform .4s var(--ease);
}
.news-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-thumb .news-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(45deg, var(--bg-3), var(--bg-3) 8px, var(--bg-2) 8px, var(--bg-2) 16px);
}
.news-thumb .news-placeholder svg { width: 28px; height: 28px; color: var(--ink-4); }
.news-thumb .tag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(6px);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--rule);
}
.news-thumb .tag.accent { background: var(--accent); color: #fff; border-color: var(--accent); }

.news-body { min-width: 0; }
.news-date {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.news-date .pill {
  display: inline-flex;
  padding: 2px 8px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-2);
  font-weight: 500;
}
.news-title {
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 6px;
  transition: color .3s var(--ease);
}
.news-blurb { font-size: 15px; color: var(--ink-2); line-height: 1.55; max-width: 60ch; }
.news-blurb a { color: var(--accent); }
.news-blurb a:hover { text-decoration: underline; }

.news-arrow {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  transition: all .3s var(--ease);
  flex-shrink: 0;
}
.news-arrow svg { width: 14px; height: 14px; }
.news-item:hover .news-arrow { background: var(--accent); color: #fff; border-color: var(--accent); transform: translate(3px,-3px); }

@media (max-width: 820px) {
  .news-item { grid-template-columns: 1fr; }
  .news-thumb { aspect-ratio: 16/9; max-width: 100%; }
  .news-arrow { display: none; }
}

/* ===== publication card (bibbase style) ===== */
.pubs { display: flex; flex-direction: column; gap: 0; }

.pub {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--rule);
  position: relative;
  transition: padding-left .3s var(--ease);
}
.pub:last-child { border-bottom: 1px solid var(--rule); }
.pub:hover { padding-left: 12px; }
.pub:hover .pub-num { color: var(--accent); }

.pub-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.1em;
  padding-top: 6px;
  transition: color .3s var(--ease);
}
.pub-venue-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}

.pub-body { min-width: 0; }
.pub-title {
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
  color: var(--ink);
}
.pub-authors {
  font-family: var(--serif-body);
  font-size: 16px;
  color: var(--ink-2);
  line-height: 1.55;
  margin-bottom: 12px;
}
.pub-authors .me { color: var(--ink); font-weight: 600; }
.pub-authors .equal { color: var(--accent); }

.pub-venue {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.pub-venue .tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  color: var(--ink-2);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.pub-venue .tag.top { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
[data-theme="dark"] .pub-venue .tag.top { color: var(--accent-2); }
.pub-venue .year { color: var(--ink-3); }

.pub-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.pub-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .25s var(--ease);
  font-weight: 500;
}
.pub-btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pub-btn svg { width: 12px; height: 12px; }
.pub-btn.accent { color: var(--accent); border-color: var(--accent); }
.pub-btn.accent:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.pub-aside {
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
}

.pub-expand {
  grid-column: 2 / -1;
  margin-top: 18px;
  display: none;
  padding: 18px 22px;
  background: var(--bg-2);
  border-radius: var(--radius);
  border: 1px solid var(--rule);
}
.pub-expand.open { display: block; animation: fade-up .35s var(--ease-out); }
.pub-expand h5 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
  font-weight: 500;
}
.pub-expand p { font-family: var(--serif-body); font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.pub-expand pre {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-wrap: break-word;
  background: var(--bg);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  overflow-x: auto;
  position: relative;
}
.pub-expand .copy {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all .2s ease;
}
.pub-expand .copy:hover { background: var(--ink); color: var(--bg); }

@media (max-width: 820px) {
  .pub { grid-template-columns: 1fr; gap: 14px; }
  .pub-aside { text-align: left; order: 0; }
  .pub-num { padding-top: 0; }
}

/* ===== filter bar (publications page) ===== */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  align-items: center;
}
.filter-bar .label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-right: 6px; }
.filter-chip {
  padding: 8px 16px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .25s var(--ease);
  font-weight: 500;
}
.filter-chip:hover { border-color: var(--ink); color: var(--ink); }
.filter-chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ===== about / resume page ===== */
.about-hero {
  padding: 180px 0 80px;
  position: relative;
}
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}
@media (max-width: 880px) { .about-grid { grid-template-columns: 1fr; } }

.portrait {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--rule);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait .placeholder {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background:
    linear-gradient(135deg, transparent 49%, var(--rule) 49%, var(--rule) 51%, transparent 51%),
    var(--bg-3);
  background-size: 28px 28px, auto;
}
.portrait .placeholder svg { width: 56px; height: 56px; opacity: 0.45; }

.portrait-caption {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
}

/* timeline */
.timeline {
  border-left: 1px solid var(--rule);
  margin-left: 12px;
  padding-left: 36px;
  position: relative;
}
.tl-item {
  position: relative;
  padding-bottom: 48px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -42px;
  top: 8px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  transition: transform .3s var(--ease);
}
.tl-item:hover::before { transform: scale(1.4); background: var(--accent); }
.tl-date {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.tl-title {
  font-family: var(--serif);
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.2;
  margin-bottom: 4px;
}
.tl-org {
  font-family: var(--serif-body);
  font-style: italic;
  color: var(--accent);
  margin-bottom: 12px;
  font-size: 17px;
}
.tl-detail {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.6;
}
.tl-detail ul { list-style: none; padding: 0; margin-top: 8px; }
.tl-detail ul li {
  padding-left: 18px;
  position: relative;
  margin-bottom: 6px;
}
.tl-detail ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* skill chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  letter-spacing: 0.04em;
  transition: all .25s var(--ease);
}
.chip:hover { background: var(--ink); color: var(--bg); transform: translateY(-2px); }
.chip.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
[data-theme="dark"] .chip.accent { color: var(--accent-2); }

/* awards grid */
.awards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.award {
  padding: 22px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  transition: transform .35s var(--ease), border-color .35s var(--ease);
  position: relative;
  overflow: hidden;
}
.award:hover { transform: translateY(-4px); border-color: var(--accent); }
.award::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 0%; height: 2px;
  background: var(--accent);
  transition: width .5s var(--ease);
}
.award:hover::before { width: 100%; }
.award-year { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 8px; }
.award-title { font-family: var(--serif); font-size: 18px; line-height: 1.25; margin-bottom: 4px; }
.award-org { font-family: var(--serif-body); font-style: italic; font-size: 14px; color: var(--ink-3); }

/* ===== stats ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 32px 0;
}
.stat { padding: 8px; }
.stat .n {
  font-family: var(--serif);
  font-size: clamp(48px, 6vw, 84px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 8px;
}
.stat .l { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.stat .l::before { content: "→ "; color: var(--accent); }

/* ===== research interest cards (index) ===== */
.research {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.research-card {
  padding: 36px 32px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  transition: background .35s var(--ease);
  cursor: default;
}
.research-card:hover { background: var(--bg-2); }
.research-card .num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.14em;
  margin-bottom: 24px;
}
.research-card h3 {
  margin-bottom: 12px;
  transition: transform .4s var(--ease);
}
.research-card:hover h3 { transform: translateX(4px); }
.research-card p { font-size: 14px; color: var(--ink-2); }
.research-card .accent-dot {
  position: absolute;
  top: 32px;
  right: 32px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.research-card:hover .accent-dot { opacity: 1; }

/* ===== contact ===== */
.contact-hero { padding: 180px 0 60px; }
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-list { list-style: none; padding: 0; margin-top: 32px; }
.contact-list li {
  border-top: 1px solid var(--rule);
  padding: 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  transition: padding-left .3s var(--ease);
  cursor: pointer;
}
.contact-list li:last-child { border-bottom: 1px solid var(--rule); }
.contact-list li:hover { padding-left: 12px; }
.contact-list .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.contact-list .v { font-family: var(--serif-body); font-size: clamp(18px, 1.8vw, 22px); color: var(--ink); }
.contact-list li:hover .v { color: var(--accent); }
.contact-list .ext {
  width: 16px; height: 16px;
  color: var(--ink-3);
  transition: transform .3s var(--ease), color .3s var(--ease);
}
.contact-list li:hover .ext { transform: translate(2px, -2px); color: var(--accent); }

.contact-card {
  padding: 32px;
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}
.contact-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 0deg, transparent, var(--accent), transparent, transparent);
  opacity: 0.15;
  animation: rotate 20s linear infinite;
  pointer-events: none;
}
@keyframes rotate { to { transform: rotate(360deg); } }
.contact-card-inner { position: relative; z-index: 2; }

/* ===== footer ===== */
footer {
  border-top: 1px solid var(--rule);
  padding: 60px 0 40px;
  margin-top: 80px;
  position: relative;
  z-index: 2;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}
.footer-brand { font-family: var(--serif); font-style: italic; font-size: 22px; }
.footer-socials { display: flex; gap: 14px; }
.footer-socials a {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  transition: all .3s var(--ease);
}
.footer-socials a:hover { color: var(--bg); background: var(--ink); border-color: var(--ink); transform: translateY(-3px); }
.footer-socials svg { width: 16px; height: 16px; }
.footer-meta {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-wrap: wrap;
  gap: 12px;
}

/* ===== reveal anim ===== */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
[data-reveal].in {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
[data-reveal-stagger].in > * { opacity: 1; transform: translateY(0); }
[data-reveal-stagger].in > *:nth-child(1) { transition-delay: 0s; }
[data-reveal-stagger].in > *:nth-child(2) { transition-delay: .08s; }
[data-reveal-stagger].in > *:nth-child(3) { transition-delay: .16s; }
[data-reveal-stagger].in > *:nth-child(4) { transition-delay: .24s; }
[data-reveal-stagger].in > *:nth-child(5) { transition-delay: .32s; }
[data-reveal-stagger].in > *:nth-child(6) { transition-delay: .4s; }
[data-reveal-stagger].in > *:nth-child(7) { transition-delay: .48s; }
[data-reveal-stagger].in > *:nth-child(8) { transition-delay: .56s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal], [data-reveal-stagger] > * { opacity: 1; transform: none; }
}

/* ===== utilities ===== */
.spacer-s { height: 24px; }
.spacer-m { height: 48px; }
.spacer-l { height: 80px; }

.two-col {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }
.two-col .label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); position: sticky; top: 100px; }
