/* ==========================================================================
   Tao Lu — personal site
   Plain CSS, no build step. Colors are tokens; dark mode redefines them.
   ========================================================================== */

:root {
  --bg: #f6f4ef;
  --bg-soft: #eeebe4;
  --card: #fbfaf7;
  --ink: #1c2030;
  --ink-2: #484c5c;
  --ink-3: #858999;
  --line: #e4e0d7;
  --line-2: #d4cfc4;
  --dot: rgba(28, 32, 48, 0.14);

  /* one color per research thread */
  --perc: #12907b;   /* perceive    · point clouds   */
  --recon: #6a4ff0;  /* reconstruct · 3D Gaussians   */
  --emb: #e9561f;    /* act         · world models   */

  /* buttons and active states */
  --accent: #5b47e0;
  --accent-strong: #4b38cc;
  --accent-ink: #4a39bf;
  --accent-soft: rgba(91, 71, 224, 0.11);

  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --cn: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;

  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #12152a;
  --bg-soft: #1b1f38;
  --card: #181b33;
  --ink: #eef0fa;
  --ink-2: #b6b9cf;
  --ink-3: #7f84a0;
  --line: #262b48;
  --line-2: #353b5c;
  --dot: rgba(255, 255, 255, 0.1);
  --perc: #3cc6ab;
  --recon: #a594ff;
  --emb: #ff8a5c;
  --accent: #6d5cf0;
  --accent-strong: #7d6df5;
  --accent-ink: #c6bdff;
  --accent-soft: rgba(143, 128, 255, 0.18);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12152a;
    --bg-soft: #1b1f38;
    --card: #181b33;
    --ink: #eef0fa;
    --ink-2: #b6b9cf;
    --ink-3: #7f84a0;
    --line: #262b48;
    --line-2: #353b5c;
    --dot: rgba(255, 255, 255, 0.1);
    --perc: #3cc6ab;
    --recon: #a594ff;
    --emb: #ff8a5c;
    --accent: #6d5cf0;
    --accent-strong: #7d6df5;
    --accent-ink: #c6bdff;
    --accent-soft: rgba(143, 128, 255, 0.18);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-2);
  transition: text-decoration-color 0.2s, color 0.2s;
}
a:hover { text-decoration-color: currentColor; }

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

::selection { background: color-mix(in srgb, var(--recon) 28%, transparent); }

img, canvas, svg { display: block; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }

.nav__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand__mark {
  position: relative;
  width: 24px;
  height: 24px;
  transition: transform 0.6s var(--ease);
}
.brand__mark i {
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] .brand__mark i { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand__mark i { mix-blend-mode: screen; }
}
.brand__mark i:nth-child(1) { left: 0; top: 7px; background: radial-gradient(closest-side, var(--perc), transparent); }
.brand__mark i:nth-child(2) { left: 9px; top: 0; background: radial-gradient(closest-side, var(--recon), transparent); }
.brand__mark i:nth-child(3) { left: 8px; top: 9px; background: radial-gradient(closest-side, var(--emb), transparent); }
.brand:hover .brand__mark { transform: rotate(120deg); }

.nav__links {
  display: flex;
  gap: 2px;
  margin-left: auto;
}
.nav__links a {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 14.5px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.nav__links a:hover { background: var(--bg-soft); color: var(--ink); }
.nav__links a.is-active { color: var(--ink); background: var(--bg-soft); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.3s var(--ease);
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn--sm { width: 30px; height: 30px; }
.icon-btn--sm svg { width: 15px; height: 15px; }

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

/* ---------- hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(32px, 7vw, 104px);
  align-items: center;
  padding-top: clamp(36px, 7vh, 72px);
  padding-bottom: clamp(56px, 9vh, 104px);
}

/* a faint "point cloud" grid behind the portrait */
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -64px;
  bottom: 0;
  right: 0;
  width: 46%;
  background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 1.6px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(closest-side at 70% 50%, #000 25%, transparent);
  mask-image: radial-gradient(closest-side at 70% 50%, #000 25%, transparent);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--ink-3);
  font: 500 12.5px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--perc);
}
.live::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--perc);
  animation: ping 2.4s var(--ease) infinite;
}
@keyframes ping {
  0% { transform: scale(0.5); opacity: 0.9; }
  80%, 100% { transform: scale(1.7); opacity: 0; }
}

.hero__name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.32em;
  margin: 18px 0 20px;
  color: var(--ink);
  font: 400 clamp(48px, 5.6vw, 68px) / 1 var(--serif);
  letter-spacing: -0.02em;
}
.hero__en { white-space: nowrap; }
.hero__cn {
  color: var(--ink-3);
  font: 500 0.36em / 1 var(--cn);
  letter-spacing: 0.1em;
}

.hero__lead {
  max-width: 23em;
  margin: 0 0 20px;
  color: var(--ink);
  font-size: clamp(19px, 1.9vw, 23px);
  line-height: 1.4;
  letter-spacing: -0.012em;
}

.verb {
  color: var(--c);
  font: italic 400 1.2em/1 var(--serif);
  letter-spacing: 0;
  text-decoration: underline dotted;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, var(--c) 55%, transparent);
  background: linear-gradient(color-mix(in srgb, var(--c) 20%, transparent), color-mix(in srgb, var(--c) 20%, transparent)) no-repeat 0 92% / 0% 0.42em;
  padding: 0 0.04em;
  transition: background-size 0.45s var(--ease), text-decoration-color 0.2s;
}
.verb:hover, .verb:focus-visible, .verb.is-on {
  background-size: 100% 0.42em;
  text-decoration-color: transparent;
}

.hero__bio {
  max-width: 35em;
  margin: 0 0 30px;
  font-size: 17px;
  line-height: 1.65;
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: 500 14.5px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease), border-color 0.2s, background 0.2s, box-shadow 0.25s;
}
.btn:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -14px rgba(0, 0, 0, 0.45);
}
.btn:active { transform: translateY(0); }
.btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn svg.fill { fill: currentColor; stroke: none; }
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 12px 24px -14px var(--accent);
}

.latest {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 30px 0 0;
  font-size: 14.5px;
  line-height: 1.5;
}
.latest__tag {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--emb);
  color: #fff;
  font: 600 10.5px/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- portrait ---------- */

.portrait {
  position: relative;
  justify-self: end;
  width: 270px;
  max-width: 100%;
  margin: 0;
}

.portrait__stage {
  position: relative;
  aspect-ratio: 689 / 886;
  touch-action: pan-y;
  cursor: crosshair;
}
.portrait__stage > img,
.portrait__stage > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.portrait__img {
  object-fit: cover;
  border-radius: 24px;
  transition: opacity 0.6s var(--ease);
}
.js .portrait__img { opacity: 0; }
.js .portrait.no-gl .portrait__img { opacity: 1; }
.portrait__gl, .portrait__photo {
  transition: opacity 0.6s var(--ease);
  /* let the bust fade out instead of ending on a hard crop */
  -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent 99%);
  mask-image: linear-gradient(to bottom, #000 80%, transparent 99%);
}
.portrait__photo { opacity: 0; }
.portrait[data-mode="photo"] .portrait__photo { opacity: 1; }
.portrait[data-mode="photo"] .portrait__gl { opacity: 0; }

/* detector-style bounding box, because why not */
.bbox {
  position: absolute;
  inset: -10px;
  pointer-events: none;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 0.6s var(--ease), transform 0.9s var(--ease), inset 0.5s var(--ease);
}
.portrait.is-fit .bbox { opacity: 1; transform: none; }
.portrait__stage:hover .bbox { inset: -6px; }
.bbox i {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--emb);
}
.bbox i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 7px; }
.bbox i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 7px; }
.bbox i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 7px; }
.bbox i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 7px; }
.bbox__label {
  position: absolute;
  top: -21px;
  left: 0;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--emb);
  color: #fff;
  font: 500 10.5px/1.3 var(--mono);
  white-space: nowrap;
}

.portrait.no-gl .hud__controls,
.portrait.no-gl .bbox { display: none; }

.portrait__hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 8px;
  margin-top: 18px;
  color: var(--ink-3);
  font: 400 11.5px/1.3 var(--mono);
}
.hud__stat { flex: 1 1 100%; min-width: 0; font-variant-numeric: tabular-nums; }
.hud__controls { display: inline-flex; align-items: center; gap: 8px; flex: none; }

.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}
.seg button {
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  font: 500 11.5px/1 var(--mono);
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); }

[data-replay]:hover { transform: rotate(-200deg); }

/* ---------- sections ---------- */

.section { padding-block: clamp(64px, 10vw, 120px); }

.section__head { margin-bottom: clamp(32px, 5vw, 56px); }
.section__head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 32px;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--ink-3);
  font: 500 12.5px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.kicker span { color: var(--ink); }
.kicker::after {
  content: "";
  flex: 0 0 48px;
  height: 1px;
  background: var(--line-2);
}

.section__title {
  margin: 0 0 16px;
  color: var(--ink);
  font: 400 clamp(46px, 6.4vw, 80px) / 0.98 var(--serif);
  letter-spacing: -0.02em;
}
.section__title em, .contact__title em {
  padding-right: 0.06em;
  margin-right: -0.03em;
  background: linear-gradient(95deg, var(--perc), var(--recon) 48%, var(--emb));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section__sub {
  max-width: 38em;
  margin: 0;
  font-size: 18px;
}

.section__note {
  margin: 0 0 6px;
  color: var(--ink-3);
  font: 400 12.5px/1.7 var(--mono);
  text-align: right;
}

/* ---------- research arc ---------- */

.arc {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.arc__card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  transition: transform 0.4s var(--ease), border-color 0.3s, box-shadow 0.4s var(--ease);
}
.arc__card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--c) 45%, var(--line));
  box-shadow: 0 28px 50px -32px color-mix(in srgb, var(--c) 70%, transparent);
}

.arc__viz {
  position: relative;
  height: 210px;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(120% 95% at 50% 100%, color-mix(in srgb, var(--c) 11%, transparent), transparent 72%);
}
.arc__viz canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.arc__viz canvas[data-viz="arm"] { cursor: pointer; }
.arc__viz canvas[data-viz="lidar"] { cursor: ew-resize; }
.arc__hint {
  position: absolute;
  top: 12px;
  right: 14px;
  color: var(--ink-3);
  font: 400 11px/1 var(--mono);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.arc__card:hover .arc__hint { opacity: 1; }

.arc__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 22px 24px 24px;
}
.arc__meta {
  display: flex;
  justify-content: space-between;
  margin: 0 0 8px;
  color: var(--ink-3);
  font: 400 12px/1 var(--mono);
}
.arc__meta span:first-child { color: var(--c); font-weight: 500; }
.arc__title {
  margin: 0 0 12px;
  color: var(--ink);
  font: 400 42px/1 var(--serif);
  letter-spacing: -0.01em;
}
.arc__desc { margin: 0 0 18px; font-size: 15.5px; }
.arc__works {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 20px;
}
.arc__works a {
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 10%, transparent);
  color: color-mix(in srgb, var(--c) 78%, var(--ink));
  font: 500 12px/1.3 var(--mono);
  text-decoration: none;
  transition: background 0.2s;
}
.arc__works a:hover { background: color-mix(in srgb, var(--c) 22%, transparent); }
.arc__more {
  display: inline-flex;
  gap: 6px;
  align-self: flex-start;
  margin-top: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 500 14.5px/1.4 var(--sans);
  cursor: pointer;
}
.arc__more span { transition: transform 0.3s var(--ease); }
.arc__more:hover span { transform: translateX(5px); }

/* ---------- publications ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: 500 14px/1 var(--sans);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent-ink);
}
.chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip__n { font: 500 11.5px/1 var(--mono); opacity: 0.55; }

.pubs__group {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 24px;
  border-top: 1px solid var(--line);
}
.pubs__year {
  position: sticky;
  top: 80px;
  align-self: start;
  margin: 0;
  padding-top: 20px;
  color: var(--ink-3);
  font: 400 46px/1 var(--serif);
  letter-spacing: -0.01em;
}
.pubs__list { margin: 0; padding: 6px 0 18px; list-style: none; }

.pub {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 20px;
  margin: 0 -14px;
  padding: 18px 14px;
  border-radius: 18px;
  transition: background 0.25s;
}
.pub:hover { background: var(--card); }
.pub.is-enter { animation: rise 0.55s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.pub.is-flash { animation: flash 2s var(--ease); }

@keyframes rise {
  from { opacity: 0; translate: 0 10px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes flash {
  0%, 30% { background: color-mix(in srgb, var(--c) 16%, transparent); }
  100% { background: transparent; }
}

.pub__glyph {
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--c) 16%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--c) 7%, var(--card));
}
.pub__glyph svg {
  width: 100%;
  height: 100%;
  transition: transform 0.8s var(--ease);
}
.pub:hover .pub__glyph svg { transform: scale(1.14) rotate(8deg); }

.pub__title {
  margin: 0 0 6px;
  color: var(--ink);
  font: 400 17px/1.38 var(--sans);
  letter-spacing: -0.005em;
}
.pub__title b { font-weight: 600; }
.pub__title a {
  color: inherit;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
  transition: background-size 0.4s var(--ease);
}
.pub__title a:hover { background-size: 100% 1px; }

.pub__authors {
  margin: 0 0 6px;
  color: var(--ink-3);
  font-size: 14.5px;
  line-height: 1.55;
}
.pub__authors .me {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--c) 55%, transparent);
}
.pub__expand {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font: inherit;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}

.pub__tldr {
  margin: 0 0 10px;
  font-size: 14.5px;
  line-height: 1.55;
}

.pub__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}
.venue {
  padding: 3px 8px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  color: var(--ink-2);
  font: 500 11.5px/1.4 var(--mono);
  letter-spacing: 0.02em;
}
.venue.is-pub {
  border-color: color-mix(in srgb, var(--c) 32%, transparent);
  background: color-mix(in srgb, var(--c) 11%, transparent);
  color: color-mix(in srgb, var(--c) 72%, var(--ink));
}
.award {
  color: var(--emb);
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pub__links { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; }
.pub__links a {
  color: var(--ink-2);
  font: 500 13px/1.4 var(--mono);
  text-decoration: none;
}
.pub__links a:hover { color: var(--ink); text-decoration: underline; }
.pub__links a::after { content: " ↗"; opacity: 0.45; }

.pubs__empty { padding: 32px 0; color: var(--ink-3); }

/* ---------- contact ---------- */

.contact { padding-block: clamp(24px, 6vw, 72px) clamp(56px, 9vw, 112px); }

.contact__inner {
  --mx: 50%;
  --my: 50%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(36px, 7vw, 88px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--card);
}
/* three slow-drifting Gaussians */
.contact__inner::before,
.contact__inner::after,
.contact__glow {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(8px);
  pointer-events: none;
}
.contact__inner::before {
  width: 520px;
  height: 360px;
  right: -120px;
  top: -140px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--recon) 26%, transparent), transparent);
  animation: drift 16s ease-in-out infinite alternate;
}
.contact__inner::after {
  width: 460px;
  height: 320px;
  right: 18%;
  bottom: -180px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--emb) 22%, transparent), transparent);
  animation: drift 19s ease-in-out -6s infinite alternate-reverse;
}
.contact__glow {
  width: 420px;
  height: 420px;
  left: var(--mx);
  top: var(--my);
  translate: -50% -50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--perc) 20%, transparent), transparent);
  opacity: 0;
  transition: opacity 0.6s, left 0.6s var(--ease), top 0.6s var(--ease);
}
.contact__inner:hover .contact__glow { opacity: 1; }
@keyframes drift {
  from { transform: translate(0, 0) rotate(0deg) scale(1); }
  to { transform: translate(-80px, 60px) rotate(25deg) scale(1.15); }
}

.contact__title {
  margin: 0 0 18px;
  color: var(--ink);
  font: 400 clamp(60px, 10vw, 128px) / 0.92 var(--serif);
  letter-spacing: -0.025em;
}
.contact__text {
  max-width: 32em;
  margin: 0 0 34px;
  font-size: 18px;
}
.contact__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn--lg { height: 56px; padding: 0 24px; font-size: 17px; }
.btn--lg svg { width: 20px; height: 20px; }
.btn__hint {
  margin-left: 4px;
  font: 400 11.5px/1 var(--mono);
  opacity: 0.5;
}

/* ---------- footer & toast ---------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  padding-block: 26px 44px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font: 400 12.5px/1.5 var(--mono);
}
.footer a { color: var(--ink-2); text-decoration: none; }
.footer a:hover { color: var(--ink); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--ink);
  font: 500 14px/1.2 var(--sans);
  box-shadow: 0 16px 40px -18px rgba(28, 32, 48, 0.35);
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- theme switch (View Transitions) ---------- */

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* ---------- reveal on scroll ---------- */

.js [data-reveal]:not(.is-in) {
  opacity: 0;
  /* safety net: never leave content hidden if scripts fail */
  animation: show 0.6s 3s forwards;
}
.js [data-reveal].is-in { animation: reveal 0.9s var(--ease) both; }
.js .hero [data-reveal]:nth-child(2).is-in { animation-delay: 0.06s; }
.js .hero [data-reveal]:nth-child(3).is-in { animation-delay: 0.12s; }
.js .hero [data-reveal]:nth-child(4).is-in { animation-delay: 0.18s; }
.js .hero [data-reveal]:nth-child(5).is-in { animation-delay: 0.24s; }
.js .hero [data-reveal]:nth-child(6).is-in { animation-delay: 0.3s; }
.js .arc__card:nth-child(2).is-in { animation-delay: 0.1s; }
.js .arc__card:nth-child(3).is-in { animation-delay: 0.2s; }
@keyframes reveal {
  from { opacity: 0; translate: 0 18px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes show { to { opacity: 1; } }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  /* one column: name and tagline first, then the portrait, then the rest */
  .hero { grid-template-columns: 1fr; gap: 0; padding-top: 32px; }
  .hero__text { display: contents; }
  .hero::before { width: 100%; top: 120px; height: 560px; bottom: auto; }
  .eyebrow { order: 1; justify-self: start; }
  .hero__name { order: 2; }
  .hero__lead { order: 3; }
  .portrait { order: 4; justify-self: center; width: min(62vw, 240px); margin: 30px 0 36px; }
  .hero__bio { order: 5; }
  .hero__links { order: 6; }
  .latest { order: 7; }
  .portrait__hud { flex-wrap: wrap; }
  .arc { grid-template-columns: 1fr; }
  .arc__card { flex-direction: row; }
  .arc__viz { flex: 0 0 42%; height: auto; min-height: 240px; border-bottom: 0; border-right: 1px solid var(--line); }
}

@media (max-width: 720px) {
  .nav__links { display: none; }
  .brand { margin-right: auto; }
  .hero__bio { font-size: 16px; }
  .section__note { text-align: left; }
  .arc__card { flex-direction: column; }
  .arc__viz { flex: none; height: 200px; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .arc__title { font-size: 38px; }
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .filters::-webkit-scrollbar { display: none; }
  .pubs__group { grid-template-columns: 1fr; gap: 0; }
  .pubs__year { position: static; padding-top: 22px; font-size: 36px; }
  .pub { grid-template-columns: 52px minmax(0, 1fr); gap: 14px; margin: 0 -10px; padding: 14px 10px; }
  .pub__glyph { width: 52px; height: 52px; border-radius: 13px; }
  .pub__title { font-size: 16px; }
  .contact__inner { border-radius: 24px; }
  .btn__hint { display: none; }
  .btn--lg { height: 52px; padding: 0 18px; font-size: 15.5px; }
  .footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .nav, .portrait, .arc__viz, .filters, .toast, .contact__inner::before, .contact__inner::after { display: none !important; }
  .js [data-reveal] { opacity: 1 !important; animation: none !important; }
  body { background: #fff; }
}
