/* ═══════════ tokens ═══════════ */
:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-band: #f4f6f9;
  --text: #15171c;
  --text-muted: #565d6a;
  --text-faint: #8b929e;
  --rule: #e5e7ec;
  --rule-soft: #eef0f4;
  --accent: #2f54d8;
  --accent-soft: #eef2fe;
  --warm: #b0602c;
  --tag-bg: #f0f1f5;
  --max: 880px;
  --nav-h: 54px;

  /* per-domain hues, used by .work cards */
  --c-imaging: #4f62d8;
  --c-spectro: #7a4fc9;
  --c-trap:    #1c8e86;
  --c-fpga:    #38884e;
  --c-sim:     #b07529;
  --c-thermal: #c0564c;
  --c-quantum: #0d7fa3;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115; --bg-soft: #161920; --bg-band: #14171d;
    --text: #e7e9ee; --text-muted: #a2a9b6; --text-faint: #767e8c;
    --rule: #262a33; --rule-soft: #1e222a;
    --accent: #85a8f5; --accent-soft: #18203046;
    --warm: #d99a63;
    --tag-bg: #1c2029;
    --c-imaging: #8b99f2; --c-spectro: #ae8ceb; --c-trap: #4fc4b8;
    --c-fpga: #6dc186; --c-sim: #ddaa5e; --c-thermal: #ef8c82; --c-quantum: #5cbfe0;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115; --bg-soft: #161920; --bg-band: #14171d;
  --text: #e7e9ee; --text-muted: #a2a9b6; --text-faint: #767e8c;
  --rule: #262a33; --rule-soft: #1e222a;
  --accent: #85a8f5; --accent-soft: #18203046;
  --warm: #d99a63;
  --tag-bg: #1c2029;
  --c-imaging: #8b99f2; --c-spectro: #ae8ceb; --c-trap: #4fc4b8;
  --c-fpga: #6dc186; --c-sim: #ddaa5e; --c-thermal: #ef8c82; --c-quantum: #5cbfe0;
}

/* ═══════════ base ═══════════ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 70px; scrollbar-gutter: stable; }

body {
  position: relative;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* graph-paper dots behind the hero, fading out */
body::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 520px;
  pointer-events: none; z-index: 0;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--text-faint) 34%, transparent) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.6), transparent 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.6), transparent 100%);
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

p { margin: 0 0 1em; }

/* ═══════════ nav ═══════════ */
nav.top {
  position: sticky; top: 0; z-index: 20;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--rule-soft);
}
nav.top .wrap { display: flex; align-items: center; height: 100%; gap: 14px; }
.brand { font-weight: 600; font-size: 15px; color: var(--text); letter-spacing: -.01em; margin-right: auto; }
.brand:hover { text-decoration: none; }
.brand i {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-right: 7px; vertical-align: 1px;
  animation: blink 3.4s ease-in-out infinite;
}
@keyframes blink { 0%, 88%, 100% { opacity: 1; } 94% { opacity: .15; } }

nav.top .links { display: flex; gap: 20px; font-size: 14.5px; }
nav.top .links a { color: var(--text-muted); }
nav.top .links a:hover { color: var(--text); text-decoration: none; }

#theme {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 6px; border: 1px solid var(--rule);
  background: transparent; color: var(--text-faint);
  cursor: pointer; display: grid; place-items: center; padding: 0; line-height: 0;
  transition: color .16s ease, transform .3s cubic-bezier(.3,1.4,.5,1);
}
#theme:hover { color: var(--text); transform: rotate(35deg); }

/* ═══════════ masthead ═══════════ */
.masthead { display: flex; gap: 26px; align-items: flex-start; padding: 58px 0 0; }

.portrait {
  flex: 0 0 116px; width: 116px; height: 116px;
  border-radius: 50%; background: var(--bg-soft); border: 1px solid var(--rule);
  display: grid; place-items: center; overflow: hidden;
  font-size: 27px; font-weight: 500; color: var(--text-faint);
  transition: transform .35s cubic-bezier(.3,1.3,.5,1), border-color .2s ease;
}
.portrait:hover { transform: rotate(-4deg) scale(1.04); border-color: var(--accent); }
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ident { flex: 1 1 auto; min-width: 0; padding-top: 4px; }

h1 { margin: 0 0 6px; font-size: 36px; line-height: 1.1; font-weight: 600; letter-spacing: -.025em; }
.h1-cn { font-size: 21px; font-weight: 400; color: var(--text-faint); margin-left: 10px; letter-spacing: .04em; }

.tagline { margin: 0 0 14px; color: var(--text-muted); font-size: 16.5px; }

/* hand-drawn-ish highlight */
.mark {
  color: var(--text);
  background-image: linear-gradient(
    transparent 48%,
    color-mix(in srgb, var(--accent) 26%, transparent) 48%,
    color-mix(in srgb, var(--accent) 26%, transparent) 94%,
    transparent 94%);
  background-repeat: no-repeat;
  background-size: 0% 100%;
  animation: swipe .7s .5s cubic-bezier(.4,0,.2,1) forwards;
  padding: 0 2px;
}
@keyframes swipe { to { background-size: 100% 100%; } }

.social { display: flex; flex-wrap: wrap; gap: 6px 13px; font-size: 14.5px; align-items: center; }
.social .sep { color: var(--rule); }

/* ═══════════ bio ═══════════ */
.lede { margin-top: 32px; }
.lede p { font-size: 16.5px; line-height: 1.7; }
.lede p:last-child { margin-bottom: 0; }

.now {
  margin-top: 26px; padding: 13px 16px;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 6px 6px 0;
  font-size: 15px; color: var(--text-muted);
}
.now b { color: var(--text); font-weight: 600; }
.now p { margin: 0; }

/* ═══════════ sections ═══════════ */
section { padding-top: 56px; }

.head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; }
.head h2 {
  font-size: 20px; font-weight: 600; letter-spacing: -.015em;
  margin: 0; color: var(--text);
}
.head h2::before {
  content: attr(data-n) " ";
  font-family: var(--mono); font-size: 12px; font-weight: 400;
  color: var(--text-faint); margin-right: 9px; letter-spacing: 0;
  vertical-align: 2px;
}
.head .note { font-size: 14px; color: var(--text-faint); margin-left: auto; text-align: right; }

/* ═══════════ work grid ═══════════ */
.grid-work { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.work {
  --c: var(--accent);
  border: 1px solid var(--rule); border-radius: 9px; overflow: hidden;
  background: var(--bg); display: flex; flex-direction: column;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.work:hover {
  border-color: color-mix(in srgb, var(--c) 55%, var(--rule));
  transform: translateY(-3px);
  box-shadow: 0 6px 22px -14px color-mix(in srgb, var(--c) 80%, transparent);
}
.work.imaging { --c: var(--c-imaging); }
.work.spectro { --c: var(--c-spectro); }
.work.trap    { --c: var(--c-trap); }
.work.fpga    { --c: var(--c-fpga); }
.work.sim     { --c: var(--c-sim); }
.work.thermal { --c: var(--c-thermal); }
.work.quantum { --c: var(--c-quantum); }

.work.featured { grid-column: 1 / -1; flex-direction: row; }
.work.featured .thumb {
  flex: 0 0 292px; aspect-ratio: auto;
  border-bottom: 0; border-right: 1px solid var(--rule-soft);
}
.work.featured .body { padding: 17px 20px 18px; }
.work.featured h3 { font-size: 18.5px; margin-bottom: 4px; }
.work.featured p.desc { font-size: 15px; }
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--c); display: block; margin-bottom: 5px;
}

.thumb { aspect-ratio: 8 / 5; overflow: hidden; position: relative; background: var(--bg-soft); border-bottom: 1px solid var(--rule-soft); }
.thumb svg,
.thumb img,
.thumb video {
  width: 100%; height: 100%; display: block;
  color: var(--c);          /* svg line art picks up the card hue */
  object-fit: cover;        /* photos and video fill the frame, cropped from the centre */
}
/* nudge the visible part of a photo, e.g. style="--pos: 50% 20%" on the .thumb */
.thumb img, .thumb video { object-position: var(--pos, 50% 50%); }

/* a still that swaps to video on hover */
.thumb.swap video { position: absolute; inset: 0; opacity: 0; transition: opacity .25s ease; }
.thumb.swap { position: relative; }
.work:hover .thumb.swap video { opacity: 1; }

.work .body { padding: 14px 16px 15px; display: flex; flex-direction: column; flex: 1; }
.work h3 { margin: 0 0 3px; font-size: 16px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; }
.work h3 a { color: var(--text); }

.work .meta {
  margin: 0 0 7px; font-size: 12px; color: var(--text-faint);
  font-family: var(--mono); letter-spacing: -.01em;
}
.work .meta b { color: var(--c); font-weight: 500; }
.work p.desc { margin: 0 0 11px; font-size: 14.5px; color: var(--text-muted); line-height: 1.55; }

.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; font-size: 11.5px; font-family: var(--mono); }
.tags span, .tags a { padding: 2px 8px; border-radius: 20px; background: var(--tag-bg); color: var(--text-faint); }
.tags a { color: var(--c); }
.tags a:hover { background: color-mix(in srgb, var(--c) 12%, transparent); text-decoration: none; }

/* ═══════════ thumbnail animations (hover only) ═══════════ */
.thumb .draw { stroke-dasharray: 1; stroke-dashoffset: 0; }

.work:hover .cells      { animation: drift 5s ease-in-out infinite; }
.work:hover .rays       { animation: glow 2.4s ease-in-out infinite; }
.work:hover .bars > *   { animation: rise 1.9s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom; }
.work:hover .bars > :nth-child(1) { animation-delay: 0s }
.work:hover .bars > :nth-child(2) { animation-delay: .09s }
.work:hover .bars > :nth-child(3) { animation-delay: .18s }
.work:hover .bars > :nth-child(4) { animation-delay: .27s }
.work:hover .bars > :nth-child(5) { animation-delay: .36s }
.work:hover .bars > :nth-child(6) { animation-delay: .45s }
.work:hover .bars > :nth-child(7) { animation-delay: .54s }
.work:hover .bars > :nth-child(8) { animation-delay: .63s }
.work:hover .particle   { animation: jitter 1.1s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.work:hover .fall > *   { animation: drop 2.2s ease-out infinite; }
.work:hover .fall > :nth-child(1) { animation-delay: 0s }
.work:hover .fall > :nth-child(2) { animation-delay: .16s }
.work:hover .fall > :nth-child(3) { animation-delay: .32s }
.work:hover .fall > :nth-child(4) { animation-delay: .48s }
.work:hover .fall > :nth-child(5) { animation-delay: .64s }
.work:hover .wave       { animation: march 1.6s linear infinite; }
.work:hover .draw       { animation: trace 2.4s ease-in-out infinite; }
.work:hover .lattice > * { animation: twinkle 3s ease-in-out infinite; }
.work:hover .lattice > :nth-child(3n)   { animation-delay: .5s }
.work:hover .lattice > :nth-child(3n+1) { animation-delay: 1.1s }
.work:hover .membrane { animation: wobble 1.7s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.work:hover .gap > *   { animation: glow 1.7s ease-in-out infinite; }
.work:hover .contours > * { animation: breathe 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.work:hover .contours > :nth-child(2) { animation-delay: .2s }
.work:hover .contours > :nth-child(3) { animation-delay: .4s }
.work:hover .contours > :nth-child(4) { animation-delay: .6s }

@keyframes drift   { 0%,100% { transform: translate(0,0) } 50% { transform: translate(3px,-3px) } }
@keyframes glow    { 0%,100% { opacity: .35 } 50% { opacity: .8 } }
@keyframes rise    { 0%,100% { transform: scaleY(1) } 50% { transform: scaleY(.45) } }
@keyframes jitter  { 0%,100% { transform: translate(0,0) } 25% { transform: translate(2px,-1.5px) }
                     50% { transform: translate(-1.5px,2px) } 75% { transform: translate(1px,1.5px) } }
@keyframes drop    { 0% { opacity: 0 } 18% { opacity: 1 } 70% { opacity: 1 } 100% { opacity: 0 } }
@keyframes march   { to { transform: translateX(-32px) } }
@keyframes trace   { 0% { stroke-dashoffset: 1 } 55%, 100% { stroke-dashoffset: 0 } }
@keyframes twinkle { 0%,100% { opacity: .18 } 50% { opacity: .55 } }
@keyframes wobble  { 0%,100% { transform: translateY(0) scaleY(1) } 50% { transform: translateY(2.5px) scaleY(.9) } }
@keyframes breathe { 0%,100% { transform: scale(1); opacity: .35 } 50% { transform: scale(1.05); opacity: .7 } }

/* ═══════════ in-card media: the diagram slides out, photos slide in ═══════════ */
.thumb.has-media { cursor: zoom-in; touch-action: pan-y; }
.thumb.has-media.open { cursor: pointer; }

.thumb .track {
  display: flex; height: 100%;
  transition: transform .55s cubic-bezier(.2,.8,.2,1);
}
.thumb .slide { flex: 0 0 100%; height: 100%; position: relative; overflow: hidden; margin: 0; }

/* any aspect ratio fits: the whole image shows, a blurred copy of it fills the frame */
.thumb figure.slide { background: var(--bg-soft); }
.thumb figure.slide::before {
  content: ""; position: absolute; inset: -30px;
  background: var(--img, none) center / cover no-repeat;
  filter: blur(22px) saturate(1.15) brightness(.82);
}
.thumb figure.slide > img,
.thumb figure.slide > video {
  position: relative; width: 100%; height: 100%;
  object-fit: contain; display: block;
}
/* photos whose subject sits in the middle can fill the frame instead */
.thumb figure.slide > [data-fit="cover"] { object-fit: cover; }
.thumb figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 22px 12px 9px;
  font-size: 12px; line-height: 1.42; color: #eef0f3;
  background: linear-gradient(to bottom, rgba(8,10,14,0), rgba(8,10,14,.62) 32%, rgba(8,10,14,.86));
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
  text-wrap: pretty;
}
.thumb figcaption .n {
  font-family: var(--mono); font-size: 11px; margin-right: 6px;
  color: color-mix(in srgb, var(--c) 45%, white);
}

/* the whole frame is one big button: open, then next */
.thumb-hit {
  position: absolute; inset: 0; z-index: 2;
  background: transparent; border: 0; padding: 0; margin: 0;
  cursor: inherit;
}
.thumb-hit:focus-visible { outline: 2px solid var(--c); outline-offset: -2px; }

.thumb .count {
  position: absolute; right: 10px; bottom: 10px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px 3px 7px; border-radius: 20px;
  font-family: var(--mono); font-size: 11px; line-height: 1;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border: 1px solid var(--rule);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.thumb .count svg { width: 12px; height: 12px; color: inherit; }
.work:hover .thumb .count, .thumb:has(.thumb-hit:focus-visible) .count {
  color: var(--c); border-color: color-mix(in srgb, var(--c) 50%, var(--rule));
}
.thumb .count { z-index: 3; pointer-events: none; transition: opacity .2s ease, transform .2s ease, color .18s ease, border-color .18s ease; }
.thumb.open .count { opacity: 0; transform: translateY(6px); }

.thumb-ui { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .25s ease; }
.thumb.open .thumb-ui { opacity: 1; }
.thumb.open .thumb-ui button { pointer-events: auto; }

.thumb-ui .pill, .thumb-ui button {
  position: absolute;
  font-family: var(--mono); font-size: 11px; line-height: 1; color: #fff;
  background: rgba(10,12,16,.55); border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.thumb-ui svg { width: 13px; height: 13px; color: inherit; }
.thumb-ui .pill { top: 10px; left: 10px; padding: 5px 8px; border-radius: 20px; }
.thumb-ui button { display: grid; place-items: center; padding: 0; cursor: pointer; transition: background .15s ease, opacity .2s ease; }
.thumb-ui button:hover { background: rgba(10,12,16,.78); }
.thumb-ui button:focus-visible { outline: 2px solid color-mix(in srgb, var(--c) 60%, white); outline-offset: 2px; }
.thumb-ui .back { top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; }
.thumb-ui .nav  { top: 50%; width: 30px; height: 30px; border-radius: 50%; margin-top: -15px; opacity: 0; }
.thumb-ui .prev { left: 10px; }
.thumb-ui .next { right: 10px; }
.thumb.open:hover .nav, .thumb.open:focus-within .nav { opacity: 1; }
@media (hover: none) { .thumb.open .nav { opacity: .9; } }

/* ═══════════ lab band ═══════════ */
.band {
  margin-top: 56px;
  background: var(--bg-band);
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: 44px;
}
.band section { padding-top: 44px; }
.band .head h2::after {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--warm); margin-left: 9px; vertical-align: 3px;
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1 } 50% { transform: scale(1.5); opacity: .5 } }

.grid-lab { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.lab {
  padding: 15px 16px 14px;
  background: var(--bg); border: 1px solid var(--rule); border-radius: 8px;
  display: flex; flex-direction: column;
  transition: border-color .18s ease, transform .18s ease;
}
.lab:hover { border-color: color-mix(in srgb, var(--warm) 45%, var(--rule)); transform: translateY(-3px) rotate(-.4deg); }
.lab .kind {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--warm); margin-bottom: 6px;
}
.lab h3 { margin: 0 0 4px; font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; }
.lab h3 a { color: var(--text); }
.lab p { margin: 0; font-size: 14px; color: var(--text-muted); line-height: 1.55; }
.lab .go { margin-top: 10px; font-size: 13px; color: var(--warm); font-family: var(--mono); }
.lab:hover .go { text-decoration: underline; text-underline-offset: 2px; }

.lab.ghost {
  border: 1px dashed color-mix(in srgb, var(--warm) 40%, var(--rule));
  background: transparent;
  align-items: center; justify-content: center; text-align: center;
  color: var(--text-faint); font-size: 14px; min-height: 108px;
}
.lab.ghost:hover { transform: none; }
.lab.ghost i { font-style: normal; font-family: var(--mono); }

/* ═══════════ writing ═══════════ */
.posts { list-style: none; margin: 0; padding: 0; }
.posts li {
  display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--rule-soft);
}
.posts li:first-child { border-top: 1px solid var(--rule-soft); }
.posts .t { font-size: 15.5px; color: var(--text); }
.posts .t a { color: var(--text); }
.posts .t em { font-style: normal; display: block; font-size: 14px; color: var(--text-faint); }
.posts .d { font-size: 12.5px; color: var(--text-faint); white-space: nowrap; font-family: var(--mono); }

.empty {
  padding: 22px; border: 1px dashed var(--rule); border-radius: 8px;
  color: var(--text-faint); font-size: 15px; text-align: center;
}
.empty .cur {
  display: inline-block; width: 7px; height: 15px; vertical-align: -2px;
  background: var(--text-faint); margin-left: 3px;
  animation: caret 1.1s steps(1) infinite;
}
@keyframes caret { 0%,50% { opacity: 1 } 50.01%,100% { opacity: 0 } }

/* ═══════════ beyond ═══════════ */
.grid-beyond { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.beyond-card .ic {
  color: var(--text-faint); margin-bottom: 9px; display: block;
  transition: color .2s ease, transform .35s cubic-bezier(.3,1.3,.5,1);
}
.beyond-card:hover .ic { color: var(--accent); transform: translateY(-2px) rotate(-6deg); }
.beyond-card h3 { margin: 0 0 4px; font-size: 15.5px; font-weight: 600; }
.beyond-card p { margin: 0; font-size: 14.5px; color: var(--text-muted); line-height: 1.55; }

/* ═══════════ compact academic ═══════════ */
.compact { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.compact h3 {
  font-family: var(--mono);
  font-size: 11.5px; font-weight: 400; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-faint); margin: 0 0 13px; padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.pub { font-size: 14.5px; line-height: 1.55; }
.pub .title { font-weight: 600; color: var(--text); display: block; margin-bottom: 2px; }
.pub .authors { color: var(--text-muted); }
.pub .authors b { color: var(--text); font-weight: 600; }
.pub .venue { color: var(--text-faint); font-style: italic; display: block; }

.awards { list-style: none; margin: 0; padding: 0; font-size: 14.5px; }
.awards li {
  display: grid; grid-template-columns: 1fr auto; gap: 14px;
  padding: 5px 0; align-items: baseline; color: var(--text-muted);
}
.awards .when { color: var(--text-faint); font-size: 12px; white-space: nowrap; font-family: var(--mono); }

/* ═══════════ contact / footer ═══════════ */
.contact { padding-top: 56px; }
.contact p { font-size: 16.5px; color: var(--text-muted); }

footer {
  margin-top: 46px; padding: 20px 0 56px;
  border-top: 1px solid var(--rule);
  font-size: 12.5px; color: var(--text-faint); font-family: var(--mono);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
footer .egg { cursor: default; }
footer .egg::after { content: "  ·  no analytics, no cookies"; opacity: 0; transition: opacity .25s ease; }
footer .egg:hover::after { opacity: 1; }

/* ═══════════ responsive ═══════════ */
@media (max-width: 760px) {
  .grid-work, .grid-lab, .grid-beyond, .compact { grid-template-columns: 1fr; }
  .work.featured { flex-direction: column; }
  .work.featured .thumb {
    flex: none; aspect-ratio: 8 / 5;
    border-right: 0; border-bottom: 1px solid var(--rule-soft);
  }
  .compact { gap: 34px; }
}

@media (max-width: 620px) {
  nav.top .links { gap: 15px; font-size: 14px; }
  nav.top .links a.hide-sm { display: none; }
  .masthead { flex-direction: column; gap: 18px; padding-top: 40px; }
  .portrait { flex-basis: 88px; width: 88px; height: 88px; font-size: 22px; }
  h1 { font-size: 30px; }
  .h1-cn { font-size: 18px; margin-left: 8px; }
  .lede p, .contact p { font-size: 16px; }
  .head { flex-direction: column; gap: 4px; }
  .head .note { margin-left: 0; text-align: left; }
  .posts li, .awards li { grid-template-columns: 1fr; gap: 0; }
  footer .egg::after { content: ""; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .mark { background-size: 100% 100%; }
}
