/* ==========================================================================
   Pin board theme for KimHanjung.github.io
   Light or dark follows the visitor's system setting; the toggle saves a choice.
   ========================================================================== */

:root {
  --topbar-h: 64px;
  --gap: 16px;
  --pad-x: clamp(12px, 3vw, 40px);
  --board-max: 1360px;
  --r-pin: 16px;
  --r-card: 22px;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --bg: #ffffff;
  --bg-2: #f3f5f3;
  --bg-3: #e9ece9;
  --bg-hover: #dde2de;
  --line: #e1e6e2;
  --fg: #111412;
  --fg-2: #39423d;
  --muted: #626b66;
  --accent: #76b900;
  --accent-ink: #3e7100;
  --accent-soft: rgba(118, 185, 0, .15);
  --on-accent: #0b1400;
  --note-bg: #eef5e1;
  --award-bg: #fbf2df;
  --award-ink: #885600;
  --red: #d33a3a;
  --red-soft: rgba(211, 58, 58, .09);
  --mat: #ffffff;
  --media-bg: #0b0d0c;
  --scrim: rgba(8, 10, 9, .34);
  --dot: rgba(17, 20, 18, .10);
  --shadow-sm: 0 2px 10px rgba(16, 24, 20, .08);
  --shadow-lg: 0 30px 90px rgba(10, 16, 12, .28);
  /* robot dog */
  --bot-shell: #2f3532;
  --bot-panel: #48514c;
  --bot-face: #121514;
  --bot-leg: #3a413d;
  --bot-leg2: #262b28;
  --bot-joint: #98a29d;
  --bot-foot: #171a19;
  --bot-far: #79827d;
  --bot-far2: #959e99;
  --bot-eye: #8fe01c;
  --bot-shadow: rgba(16, 24, 20, .2);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e100f;
  --bg-2: #171a18;
  --bg-3: #222624;
  --bg-hover: #2d322f;
  --line: #262b28;
  --fg: #eef1ef;
  --fg-2: #c3ccc6;
  --muted: #8c9791;
  --accent: #76b900;
  --accent-ink: #a3e246;
  --accent-soft: rgba(118, 185, 0, .17);
  --on-accent: #0b1400;
  --note-bg: #162011;
  --award-bg: #231c0f;
  --award-ink: #f2c46d;
  --red: #ff6f6f;
  --red-soft: rgba(255, 111, 111, .11);
  --mat: #f3f4f2;
  --media-bg: #050606;
  --scrim: rgba(0, 0, 0, .4);
  --dot: rgba(238, 241, 239, .075);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, .4);
  --shadow-lg: 0 30px 90px rgba(0, 0, 0, .65);
  --bot-shell: #c3cac6;
  --bot-panel: #e2e7e4;
  --bot-face: #151817;
  --bot-leg: #b0b8b3;
  --bot-leg2: #9aa39e;
  --bot-joint: #eef2ef;
  --bot-foot: #5d6661;
  --bot-far: #5f6863;
  --bot-far2: #4c5450;
  --bot-eye: #9be52a;
  --bot-shadow: rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-h) + 76px);
  scrollbar-gutter: stable;
}
html.has-modal { overflow: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 400 15px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
kbd { font-family: var(--font-mono); }
.dim { color: var(--muted); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font: 600 14px var(--font-sans);
}
.skip-link:focus { top: 10px; }

/* ---------- buttons ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--bg-3); color: var(--fg);
  font: 600 14px/1 var(--font-sans); white-space: nowrap;
  transition: background-color .15s var(--ease), transform .15s var(--ease);
}
.pill:hover { background: var(--bg-hover); }
.pill:active { transform: scale(.97); }
.pill.is-primary { background: var(--accent); color: var(--on-accent); }
.pill.is-primary:hover { background: color-mix(in srgb, var(--accent) 86%, #000); }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0; flex: none;
  border: 0; border-radius: 50%; cursor: pointer; background: transparent; color: var(--fg-2);
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.icon-btn:hover { background: var(--bg-3); color: var(--fg); }
.motion-toggle .i-play { display: none; }
[data-motion="off"] .motion-toggle .i-play { display: block; }
[data-motion="off"] .motion-toggle .i-pause { display: none; }
[data-motion="off"] .motion-toggle { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 var(--pad-x);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  transition: box-shadow .2s var(--ease), background-color .25s var(--ease);
}
.topbar.is-scrolled { box-shadow: 0 1px 0 var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; color: var(--fg); border-radius: 10px; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px;
  background: var(--accent); color: var(--on-accent); border-radius: 11px;
  font: 700 12.5px/1 var(--font-mono); letter-spacing: .02em;
}
.brand-path { font: 500 13.5px var(--font-mono); }
.caret {
  display: inline-block; width: 7px; height: 14px; margin-left: 3px; vertical-align: -2px;
  background: var(--accent); animation: blink 1.1s steps(1) infinite;
}
.topbar-spacer { flex: 1; }
.topbar-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.cv-pill { margin-right: 6px; }

.search { position: relative; flex: 1 1 auto; max-width: 720px; margin: 0 auto; }
.search input {
  width: 100%; height: 46px; padding: 0 52px 0 46px;
  border: 0; border-radius: 999px; outline: none;
  background: var(--bg-3); color: var(--fg);
  font: 500 15px/1 var(--font-sans);
  -webkit-appearance: none; appearance: none;
  transition: background-color .15s var(--ease), box-shadow .15s var(--ease);
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input:hover { background: var(--bg-hover); }
.search input:focus { background: var(--bg); box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px var(--accent-soft); }
.search input::-webkit-search-cancel-button, .search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.search-ico { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-kbd {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  min-width: 24px; padding: 2px 7px; border: 1px solid color-mix(in srgb, var(--muted) 45%, transparent); border-radius: 7px;
  font: 500 12px/1.2 var(--font-mono); color: var(--muted); text-align: center; pointer-events: none;
}
.search-clear {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--fg-2); cursor: pointer;
}
.search-clear:hover { background: var(--bg-hover); color: var(--fg); }
.search-clear[hidden] { display: none; }
.search.has-q .search-kbd { display: none; }

/* ---------- profile header ---------- */
.profile {
  position: relative;
  overflow-x: clip; /* the avatar's detection readout must never widen the page on narrow screens */
  padding: calc(var(--topbar-h) + clamp(30px, 6vh, 60px)) var(--pad-x) 6px;
  text-align: center;
}
.profile::before {
  /* faint workcell dot grid behind the header */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--dot) 1.1px, transparent 1.6px);
  background-size: 22px 22px; background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 60% 85% at 50% 30%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 85% at 50% 30%, #000 30%, transparent 75%);
}
.profile-inner { position: relative; max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.avatar { position: relative; width: 132px; height: 132px; margin: 0; }
.avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6.5px color-mix(in srgb, var(--accent) 75%, transparent);
}
.avatar .det { inset: -14px; }
/* the detector's readout beside the box: certainly a person, and just barely a robot */
.avatar .det-tags { position: absolute; left: calc(100% + 8px); top: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.avatar .det-tags b { position: static; max-width: none; border-radius: 7px; }
.avatar .det-tags b:first-child { border-radius: 2px 7px 7px 7px; }
.avatar .det-tags .is-alt { background: var(--bg-3); color: var(--fg-2); }
.avatar:hover .det-tags .is-alt { animation: fade-in .3s var(--ease) .18s both; }
.avatar:hover .det { opacity: 1; }
.avatar:hover .det i { animation: lock .34s var(--ease) both; }
.name {
  margin-top: 22px;
  font: 700 clamp(2.1rem, 4.6vw, 3rem)/1.06 var(--font-sans);
  letter-spacing: -.028em; color: var(--fg);
}
.roles {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px;
  margin-top: 12px; font-size: 15.5px; color: var(--fg-2);
}
.roles strong { color: var(--fg); font-weight: 600; }
.roles .at { color: var(--accent-ink); font-family: var(--font-mono); }
.loc {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
  font: 12.5px var(--font-mono); color: var(--muted);
}
.tagline {
  margin-top: 16px; max-width: 30em;
  font: 500 clamp(1.08rem, 1.8vw, 1.32rem)/1.45 var(--font-sans); color: var(--fg);
  text-wrap: balance;
}
.status {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 16px;
  padding: 8px 15px; border-radius: 999px; background: var(--red-soft);
  font: 500 13.5px/1.35 var(--font-sans); color: var(--fg); text-align: left;
}
.pulse { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--red); animation: pulse 1.6s infinite; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }

/* ---------- filter chips ---------- */
/* the sentinel holds the space above the chip bar; once it scrolls under the top bar, the bar is stuck */
.chips-sentinel { display: block; height: 26px; }
.chips-bar {
  position: sticky; top: var(--topbar-h); z-index: 40;
  padding: 10px var(--pad-x);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  transition: box-shadow .2s var(--ease);
}
.chips-bar.is-stuck { box-shadow: 0 1px 0 var(--line); }
.chips {
  display: flex; justify-content: flex-start; gap: 8px;
  max-width: var(--board-max); margin: 0 auto;
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
/* auto margins centre the row while it fits and fall to zero once it scrolls, so no chip is cut off */
.chip:first-child { margin-left: auto; }
.chip:last-child { margin-right: auto; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--bg-3); color: var(--fg);
  font: 600 14px/1 var(--font-sans); white-space: nowrap;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.chip:hover { background: var(--bg-hover); }
.chip[aria-current="true"] { background: var(--fg); color: var(--bg); }
.chip:focus-visible { outline-offset: -2px; }
.chip-n { font: 500 12px/1 var(--font-mono); opacity: .55; }
.chip.is-empty { opacity: .45; }

/* ---------- board: a column of titled sections ---------- */
.board {
  --sec-gap: clamp(44px, 5vw, 64px);
  --card-min: 210px;
  --card-max: 320px;
  display: flex; flex-direction: column; gap: var(--sec-gap);
  max-width: var(--board-max); margin: 0 auto; padding: 12px var(--pad-x) 0;
}
.board:focus { outline: none; }
.board [hidden] { display: none !important; }
.sec { min-width: 0; }
.sec-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px;
  margin-bottom: 18px; padding-bottom: 11px; border-bottom: 1px solid var(--line);
}
.sec-title {
  display: flex; align-items: baseline; gap: 9px;
  font: 700 clamp(1.3rem, 2vw, 1.55rem)/1.15 var(--font-sans); letter-spacing: -.02em; color: var(--fg);
}
.sec-n { font: 500 13px/1 var(--font-mono); letter-spacing: 0; color: var(--muted); }
.sec-note { margin-left: auto; font: 12px/1.4 var(--font-mono); color: var(--muted); }
.sec-note sup { color: var(--accent-ink); }

/* Sections that share a row grow in proportion to their card count (--n), so every card in the row
   comes out the same width; a row that cannot fit them all at --card-min wraps instead. */
.sec-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: var(--sec-gap) var(--gap); }
.sec-row > .sec {
  display: flex; flex-direction: column;
  flex: var(--n) 1 calc(var(--n) * var(--card-min) + (var(--n) - 1) * var(--gap));
}

.grid { display: grid; gap: var(--gap); }
.grid-papers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px var(--gap); align-items: start; }
/* auto rows stretch to fill a section made taller by its neighbour, so a shared row has one card height */
.grid-cards { flex: 1; grid-template-columns: repeat(var(--n, 2), minmax(0, var(--card-max))); }
.group + .group { margin-top: 36px; }
.group-title {
  display: flex; align-items: center; gap: 9px; margin-bottom: 14px;
  font: 600 11.5px/1.3 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink);
}
.group-title::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--accent); }
.group-n { color: var(--muted); letter-spacing: .04em; }

/* entrance, and pins coming back after a filter or search */
.board.is-animated .pin, .board.is-animated .sec-about { transition: opacity .35s var(--ease), translate .45s var(--ease); }
.board .is-entering { opacity: 0; translate: 0 14px; }
.board.is-intro .pin, .board.is-intro .about-card { animation: pin-in .55s var(--ease) both; animation-delay: var(--d, 0ms); }

.board-empty { display: grid; justify-items: center; gap: 14px; padding: 40px 16px 8px; text-align: center; color: var(--fg-2); }
.board-empty p { font-size: 16px; }

@media (min-width: 960px) {
  .grid-papers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 699px) {
  .sec-row > .sec { flex-basis: 100%; }
  .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.pin { position: relative; }
.kicker {
  display: flex; align-items: center; gap: 7px;
  font: 600 11px/1.3 var(--font-mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-ink);
}

/* paper pins */
.pin-paper { display: flex; flex-direction: column; }
.pin-visual {
  /* no stacking context here, so the hover buttons can sit above the pin's full-size link */
  position: relative; order: -1; overflow: hidden;
  aspect-ratio: 16 / 9; border-radius: var(--r-pin);
  background: var(--mat);
}
/* the poster sits behind the video too: while a browser has no decoded frame to show (just started, paused
   before the first frame, looping, resuming), the video is transparent, and this keeps that from reading as black */
.pin-visual.is-video { background: var(--media-bg) var(--poster, none) center / cover no-repeat; }
.pin-visual::before {
  /* hairline edge drawn above the media, so white figures and white video frames keep their outline */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 7%, transparent);
}
.pin-visual img, .pin-visual video { width: 100%; height: 100%; }
.pin-visual img { object-fit: contain; padding: 10px; }
.pin-visual video { object-fit: cover; }
.pin-visual::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: var(--scrim); opacity: 0; transition: opacity .2s var(--ease);
}
.pin-body { display: flex; flex-direction: column; padding: 12px 4px 0; }
.pin-title { font: 600 15px/1.36 var(--font-sans); color: var(--fg); text-wrap: pretty; }
.pin-open { color: inherit; outline: none; }
.pin-open::after {
  /* the title link covers the whole pin, so a click anywhere opens it */
  content: ""; position: absolute; inset: 0; z-index: 2; border-radius: var(--r-pin);
}
.pin-open:focus-visible::after { outline: 3px solid var(--accent); outline-offset: 3px; }
.pin-authors {
  margin-top: 5px; font-size: 12.5px; line-height: 1.45; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pin-authors .me { color: var(--fg); font-weight: 600; }
.pin-authors sup, .cu-authors sup, .cu-eq sup { color: var(--accent-ink); font-size: .74em; margin-left: 1px; }
/* the venue reads first, though the title comes first for screen readers */
.pin-meta { order: -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.venue {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
  font: 600 10.5px/1.45 var(--font-mono); letter-spacing: .07em; text-transform: uppercase;
}
.pin-noteline {
  margin-top: 6px; font-size: 12px; line-height: 1.4; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pin-noteline.is-award, .cu-note.is-award { color: var(--award-ink); font-weight: 600; }
.pin-noteline.is-award::before, .cu-note.is-award::before { content: "★ "; }


.pin-actions {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 3;
  display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px;
  opacity: 0; transform: translateY(6px); pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.act {
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 13px; border-radius: 999px;
  background: rgba(255, 255, 255, .94); color: #111;
  font: 600 13px/1 var(--font-sans); pointer-events: auto;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  transition: background-color .15s var(--ease), transform .15s var(--ease);
}
.act:hover { background: #fff; transform: translateY(-1px); }
.act.is-primary { margin-left: auto; background: var(--accent); color: var(--on-accent); }
.act.is-primary:hover { background: #86cc0a; }
.act:focus-visible { outline: 2.5px solid #fff; outline-offset: 2px; }

/* detection frame: corner brackets plus a label, used on hover and in the closeup */
.det { position: absolute; inset: 9px; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .15s var(--ease); }
.det i { position: absolute; width: 18px; height: 18px; border: 2.5px solid var(--accent); }
.det i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 7px; transform-origin: 0 0; }
.det i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 7px; transform-origin: 100% 0; }
.det i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 7px; transform-origin: 0 100%; }
.det i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 7px; transform-origin: 100% 100%; }
.det b {
  position: absolute; left: 0; top: 0; max-width: calc(100% - 64px);
  padding: 3px 8px; border-radius: 7px 7px 7px 2px;
  background: var(--accent); color: var(--on-accent);
  font: 600 10.5px/1.4 var(--font-mono); letter-spacing: .05em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.pin-paper:hover .pin-visual::after, .pin-paper:focus-within .pin-visual::after { opacity: 1; }
.pin-paper:hover .det, .pin-paper:focus-within .det { opacity: 1; }
.pin-paper:hover .det i, .pin-paper:focus-within .det i { animation: lock .34s var(--ease) both; }
.pin-paper:hover .pin-actions, .pin-paper:focus-within .pin-actions { opacity: 1; transform: none; }
.pin-paper:hover .det b, .pin-paper:focus-within .det b { max-width: calc(100% - 6px); }
@media (hover: none) {
  /* touch: tapping a pin opens its detail view, which holds the links */
  .pin-actions, .pin-paper .det { display: none; }
}
html:not(.js) .pin-actions { opacity: 1; transform: none; }

/* about card: two columns of text on wide screens */
.about-card { padding: 24px 28px 26px; border-radius: var(--r-card); background: var(--note-bg); }
@media (min-width: 960px) {
  .about-card { columns: 2; column-gap: 56px; padding: 26px 32px 28px; }
  /* keep each paragraph whole, so no sentence breaks across the columns */
  .about-card > * { break-inside: avoid; }
}
.prose { font-size: 15.5px; line-height: 1.72; color: var(--fg-2); }
.prose p + p { margin-top: .85em; }
.prose strong { color: var(--fg); font-weight: 600; }
.prose a {
  color: var(--fg); font-weight: 500;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent);
}
.prose a:hover { text-decoration-color: var(--accent); color: var(--accent-ink); }
.prose .callout {
  padding: 11px 15px; border-radius: 14px; color: var(--fg);
  background: linear-gradient(var(--red-soft), var(--red-soft)), var(--bg);
}
.prose .callout strong { color: var(--red); }

/* organization pins (experience, education) */
.pin-org { border-radius: var(--r-pin); overflow: hidden; background: var(--bg-2); }
.org-cover {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 22px;
  min-height: 128px; padding: 16px 18px 18px;
  background-color: var(--org);
  color: #fff;
  background-image: radial-gradient(color-mix(in srgb, currentColor 24%, transparent) 1.1px, transparent 1.6px);
  background-size: 14px 14px;
}
@supports (color: oklch(from red l c h)) {
  /* black or white text, whichever reads better on the organization's color */
  .org-cover { color: oklch(from var(--org) clamp(0, (0.66 - l) * 1000, 1) 0 0); }
}
.org-cover .kicker { order: -1; color: inherit; opacity: .85; }
.org-name { font: 700 22px/1.14 var(--font-sans); letter-spacing: -.012em; text-wrap: balance; }
.org-body { display: grid; gap: 5px; padding: 14px 18px 17px; }
.org-role { font: 600 15px/1.35 var(--font-sans); color: var(--fg); }
.org-meta { font: 12px/1.55 var(--font-mono); color: var(--muted); }
.org-stint { display: block; }
.org-stint + .org-stint { margin-top: 5px; }
.org-when { display: block; font-size: 11px; opacity: .85; }
.org-people { margin-top: 3px; font-size: 13.5px; line-height: 1.55; color: var(--fg-2); }
.org-people a, .svc-link a {
  color: var(--fg); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent);
}
.org-people a:hover, .svc-link a:hover { color: var(--accent-ink); text-decoration-color: var(--accent); }
.org-key { display: block; font: 600 10.5px/1.6 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* service + award pins */
.pin-card { display: flex; flex-direction: column; padding: 18px 18px 20px; border-radius: var(--r-pin); background: var(--bg-2); }
.pin-card .kicker { order: -1; }
.pin-card .medal { order: -2; }
.pin-service .card-title { margin-top: 0; }
.card-title { margin-top: 8px; font: 700 19px/1.25 var(--font-sans); color: var(--fg); letter-spacing: -.01em; text-wrap: balance; }
.card-sub { margin-top: 4px; font-size: 14px; color: var(--fg-2); }
.svc-group { margin-top: 14px; }
.svc-kind { font: 600 10.5px/1.5 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.svc-items { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.svc-link { font: 600 16px/1.4 var(--font-sans); }
.svc-note { display: block; margin-top: 2px; font: 400 13px/1.4 var(--font-sans); color: var(--muted); }
.tag {
  display: inline-flex; align-items: center; height: 28px; padding: 0 11px; border-radius: 999px;
  background: var(--bg); color: var(--fg-2); font: 500 12.5px/1 var(--font-mono);
}
.pin-award { background: var(--award-bg); }
.pin-award .kicker { color: var(--award-ink); }
.medal { color: var(--award-ink); margin-bottom: 12px; }

/* ---------- closeup (pin detail) ---------- */
.closeup {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0;
  padding: 40px 32px; border: 0; background: transparent; color: var(--fg);
  overflow-y: auto; overscroll-behavior: contain;
}
/* auto margins centre the card, and let it start at the top once it is taller than the screen */
.closeup[open] { display: flex; flex-direction: column; animation: fade-in .2s var(--ease); }
.closeup::backdrop { background: rgba(6, 8, 7, .62); }
.cu-card {
  position: relative; flex: none; width: min(1120px, 100%); margin: auto;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, 1fr);
  grid-template-areas: "media info" "more more";
  background: var(--bg); border-radius: 32px; box-shadow: var(--shadow-lg);
  animation: rise-in .28s var(--ease);
}
.cu-media { grid-area: media; align-self: start; padding: 16px 0 16px 16px; }
.cu-frame {
  position: relative; overflow: hidden; border-radius: 22px;
  aspect-ratio: var(--ar, 1.7778); max-height: calc(100vh - 112px); max-height: calc(100dvh - 112px);
  background: var(--mat);
}
.cu-frame.is-video { background: var(--media-bg); }
.cu-frame.is-video .cu-slot { background: var(--poster, none) center / contain no-repeat; }
.cu-frame::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 8%, transparent);
}
.cu-slot { position: absolute; inset: 0; }
.cu-slot img, .cu-slot video { width: 100%; height: 100%; object-fit: contain; }
.cu-slot img { padding: clamp(12px, 2.4vw, 24px); }
.cu-frame .det { inset: 12px; opacity: 1; }
.cu-frame .det i { animation: lock .4s var(--ease) both; }
.cu-frame.is-image .det { opacity: .6; }
.cu-nav {
  position: absolute; top: 50%; z-index: 3; transform: translateY(-50%);
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer;
  background: color-mix(in srgb, var(--bg) 92%, transparent); color: var(--fg); box-shadow: var(--shadow-sm);
  transition: transform .15s var(--ease), background-color .15s var(--ease);
}
.cu-nav:hover { background: var(--bg); transform: translateY(-50%) scale(1.06); }
.cu-prev { left: 14px; }
.cu-next { right: 14px; }
.cu-nav[hidden] { display: none; }
.cu-close {
  position: fixed; top: 16px; right: 16px; z-index: 5;
  display: grid; place-items: center; width: 46px; height: 46px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer; background: var(--bg); color: var(--fg); box-shadow: var(--shadow-sm);
  transition: background-color .15s var(--ease), transform .15s var(--ease);
}
.cu-close:hover { background: var(--bg-3); transform: scale(1.05); }
.cu-info { grid-area: info; min-width: 0; padding: 30px 32px 24px; }
.cu-kicker { font: 600 11.5px/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); }
.cu-title { margin-top: 12px; font: 700 clamp(1.4rem, 2.2vw, 1.85rem)/1.2 var(--font-sans); letter-spacing: -.018em; text-wrap: balance; }
.cu-venue { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 14px; }
.cu-note { font-size: 13.5px; line-height: 1.4; color: var(--muted); }
.cu-authors { margin-top: 14px; font-size: 15px; line-height: 1.6; color: var(--fg-2); }
.cu-authors .me { color: var(--fg); font-weight: 600; }
.cu-eq { margin-top: 4px; font: 12px var(--font-mono); color: var(--muted); }
.cu-eq[hidden] { display: none; }
.cu-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.cu-links .pill svg { margin-right: -3px; }
.cu-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tag-btn {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--bg-2); color: var(--fg-2); font: 500 12.5px/1 var(--font-mono);
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.tag-btn::before { content: "#"; margin-right: 1px; color: var(--accent-ink); }
.tag-btn:hover { background: var(--accent-soft); color: var(--fg); }
.cu-share { margin-top: 18px; }
.cu-more { grid-area: more; margin: 0 16px; padding: 18px 0 22px; border-top: 1px solid var(--line); }
.cu-more[hidden] { display: none; }
.cu-more-title { font: 700 16px/1.3 var(--font-sans); }
.cu-more-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; gap: 14px; margin-top: 12px; }
.more-card { display: block; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; border-radius: 14px; }
.more-thumb {
  position: relative; display: block; aspect-ratio: var(--ar, 1.7778); overflow: hidden; border-radius: 12px; background: var(--mat);
}
.more-thumb::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 8%, transparent);
}
.more-thumb.is-video { background: var(--media-bg); }
.more-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; transition: transform .3s var(--ease); }
.more-thumb.is-video img { object-fit: cover; padding: 0; }
.more-card:hover .more-thumb img { transform: scale(1.04); }
.more-name { display: block; margin-top: 6px; font: 600 13.5px/1.3 var(--font-sans); color: var(--fg); }
.more-venue { display: block; margin-top: 2px; font: 500 11px/1.3 var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 6;
  padding: 11px 18px; border-radius: 999px; background: var(--fg); color: var(--bg);
  font: 600 14px/1.2 var(--font-sans); white-space: nowrap; pointer-events: none;
  max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translate(-50%, 12px); transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- footer, back to top ---------- */
.site-foot {
  max-width: var(--board-max); margin: clamp(48px, 8vh, 88px) auto 0; padding: 18px var(--pad-x) 40px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px;
  font: 12px var(--font-mono); color: var(--muted); text-align: center;
}
.to-top {
  position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 45;
  display: grid; place-items: center; width: 50px; height: 50px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer; background: var(--bg); color: var(--fg);
  box-shadow: 0 4px 22px rgba(0, 0, 0, .16), 0 0 0 1px var(--line);
  opacity: 0; transform: translateY(14px); pointer-events: none; visibility: hidden;
  transition: opacity .2s var(--ease), transform .2s var(--ease), background-color .15s var(--ease), visibility 0s linear .2s;
}
.to-top.is-on { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.to-top:hover { background: var(--bg-3); }

/* ---------- robots (robot.js): a dog and a humanoid wander along the bottom of the window ---------- */
/* a fixed strip that clips them at the window edges, so walking on and off screen never scrolls the page */
.bots {
  --bot-scale: .92;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 44; height: 150px;
  overflow: hidden; pointer-events: none;
}
.bot { position: absolute; left: 0; bottom: max(2px, env(safe-area-inset-bottom)); will-change: transform; }
.bot-dog { z-index: 2; width: calc(112px * var(--bot-scale)); height: calc(76px * var(--bot-scale)); }
.bot-hum { z-index: 1; width: calc(80px * var(--bot-scale)); height: calc(94px * var(--bot-scale)); }
.bot-flip { width: 100%; height: 100%; transition: transform .2s var(--ease); }
.bot svg { width: 100%; height: 100%; overflow: visible; }
/* only the drawn robot takes the pointer; clicks pass through the rest of its box */
.bot-hit { pointer-events: visiblePainted; cursor: pointer; }
.bot-shell { fill: var(--bot-shell); }
.bot-panel { fill: var(--bot-panel); }
.bot-face { fill: var(--bot-face); }
.bot-joint { fill: var(--bot-joint); }
.bot-stripe { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; }
.bot-led { fill: var(--accent); }
.bot-eye { fill: var(--bot-eye); transform-box: fill-box; transform-origin: center; transition: transform .08s linear; }
.bot-happy { fill: none; stroke: var(--bot-eye); stroke-width: 1.7; stroke-linecap: round; opacity: 0; }
.bot-thigh, .bot-calf, .bot-upper, .bot-fore { stroke-linecap: round; }
.bot-thigh { stroke: var(--bot-leg); stroke-width: 7; }
.bot-calf { stroke: var(--bot-leg2); stroke-width: 4.6; }
.bot-hum .bot-thigh { stroke-width: 6.4; }
.bot-hum .bot-calf { stroke-width: 5; }
.bot-upper { stroke: var(--bot-leg); stroke-width: 5.2; }
.bot-fore { stroke: var(--bot-leg2); stroke-width: 4.2; }
.bot-knee, .bot-hip, .bot-elbow, .bot-shoulder { fill: var(--bot-joint); }
.bot-foot, .bot-sole, .bot-hand { fill: var(--bot-foot); }
.is-far .bot-thigh, .is-far .bot-upper { stroke: var(--bot-far); }
.is-far .bot-calf, .is-far .bot-fore { stroke: var(--bot-far2); }
.is-far .bot-knee, .is-far .bot-foot, .is-far .bot-sole, .is-far .bot-elbow, .is-far .bot-hand { fill: var(--bot-far2); }
.bot-shadow { fill: var(--bot-shadow); }
.bot.is-blink .bot-eye, .bot.is-sleep .bot-eye { transform: scaleY(.15); }
.bot.is-hover .bot-eye { opacity: 0; }
.bot.is-hover .bot-happy { opacity: 1; }
.bot .det b { top: auto; bottom: calc(100% + 5px); left: -2px; max-width: none; }
.bot-dog .det { inset: 22% 10% 3% 10%; }
.bot-hum .det { inset: 10% 26% 2% 26%; }
.bot.is-hover .det { opacity: 1; }
.bot.is-hover .det i { animation: lock .34s var(--ease) both; }
/* sleep z's rise from the head */
.bot-z { position: absolute; display: none; color: var(--muted); font: 700 12px/1 var(--font-mono); pointer-events: none; }
.bot.is-sleep .bot-z { display: block; }
.bot-dog .bot-z { left: 66%; top: 4%; }
.bot-dog.is-left .bot-z { left: 12%; }
.bot-hum .bot-z { left: 56%; top: 24%; }
.bot-hum.is-left .bot-z { left: 20%; }
.bot-z i { position: absolute; font-style: normal; animation: bot-z 2.7s var(--ease) infinite backwards; }
.bot-z i:nth-child(1) { left: 0; top: 16px; font-size: 10px; }
.bot-z i:nth-child(2) { left: 8px; top: 6px; font-size: 12px; animation-delay: .9s; }
.bot-z i:nth-child(3) { left: 17px; top: -5px; font-size: 14px; animation-delay: 1.8s; }
@keyframes bot-z { 0% { opacity: 0; transform: translate(-4px, 8px); } 25%, 70% { opacity: .9; } 100% { opacity: 0; transform: translate(4px, -10px); } }
@media (max-width: 640px) { .bots { --bot-scale: .74; height: 120px; } }
@media print { .bots { display: none; } }

/* ---------- CV page ---------- */
.page-plain .plain { max-width: calc(1000px + 2 * var(--pad-x)); margin: 0 auto; padding: calc(var(--topbar-h) + 28px) var(--pad-x) 0; }
.plain-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-bottom: 18px; }
.plain-title { font: 700 clamp(1.7rem, 3.4vw, 2.3rem)/1.1 var(--font-sans); letter-spacing: -.02em; }
.cv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.cv-note { margin-right: auto; font: 12.5px var(--font-mono); color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; height: 38px; padding: 0 15px; border-radius: 999px;
  background: var(--bg-3); color: var(--fg); font: 600 13.5px/1 var(--font-sans);
  transition: background-color .15s var(--ease);
}
.btn:hover { background: var(--bg-hover); }
.cv-frame { overflow: hidden; border-radius: var(--r-card); background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.cv-frame iframe { display: block; width: 100%; height: min(1200px, 80vh); border: 0; }

/* ---------- motion ---------- */
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@keyframes lock { from { transform: scale(1.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pin-in { from { opacity: 0; translate: 0 18px; } }
@keyframes reveal { to { opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(18px) scale(.985); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
/* the visitor pressed "pause animations" in the top bar */
[data-motion="off"] .caret, [data-motion="off"] .pulse { animation: none; }
[data-motion="off"] .board.is-intro .pin, [data-motion="off"] .board.is-intro .about-card { animation: none; }
[data-motion="off"] *, [data-motion="off"] *::before, [data-motion="off"] *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important;
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .brand-path { display: none; }
  .topbar { gap: 12px; }
}

@media (max-width: 760px) {
  .closeup { padding: 0; }
  .cu-card {
    width: 100%; min-height: 100%; margin: 0; border-radius: 0; box-shadow: none;
    grid-template-columns: minmax(0, 1fr); grid-template-areas: "media" "info" "more";
    align-content: start;
  }
  .cu-media { padding: 0; }
  .cu-frame { border-radius: 0; max-height: 64vh; max-height: 64svh; }
  .cu-frame::before { display: none; }
  .cu-info { padding: 22px 18px 8px; }
  .cu-more { margin: 14px 18px 0; padding-bottom: 48px; }
  .cu-more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cu-close { top: max(12px, env(safe-area-inset-top)); right: 12px; width: 42px; height: 42px; }
  .cu-nav { width: 40px; height: 40px; }
  .cu-prev { left: 10px; }
  .cu-next { right: 10px; }
}

@media (max-width: 640px) {
  :root { --topbar-h: 58px; --gap: 10px; --r-pin: 14px; --r-card: 18px; }
  body { font-size: 15px; }
  .topbar { gap: 8px; }
  .brand-mark { width: 36px; height: 36px; }
  .cv-pill { display: none; }
  .icon-btn { width: 38px; height: 38px; }
  .search input { height: 42px; padding: 0 44px 0 40px; font-size: 16px; }
  .search-ico { left: 14px; }
  .search-kbd { display: none; }
  .profile { padding-top: calc(var(--topbar-h) + 26px); }
  .avatar { width: 108px; height: 108px; }
  .roles { flex-direction: column; gap: 2px; font-size: 14.5px; }
  .tagline { font-size: 1.05rem; }
  .status { font-size: 13px; padding: 7px 13px; }
  .links { gap: 6px; }
  .links .pill { height: 36px; padding: 0 13px; font-size: 13.5px; }
  .chips-sentinel { height: 18px; }
  .chips-bar { padding: 8px 0; }
  .chips { justify-content: flex-start; padding: 0 var(--pad-x); scroll-padding-inline: var(--pad-x); }
  .chip { height: 36px; padding: 0 14px; font-size: 13.5px; }
  .pin-body { padding: 8px 4px 2px; }
  .pin-title { font-size: 13.5px; line-height: 1.33; }
  .pin-authors { font-size: 11.5px; -webkit-line-clamp: 2; }
  .venue { font-size: 9.5px; padding: 2px 7px; }
  .pin-noteline { font-size: 11px; }
  .about-card { padding: 18px 18px 20px; }
  .sec-head { margin-bottom: 14px; padding-bottom: 9px; }
  .grid-papers { row-gap: 22px; }
  .group + .group { margin-top: 28px; }
  .group-title { margin-bottom: 11px; }
  .prose { font-size: 15px; line-height: 1.68; }
  .org-cover { min-height: 104px; padding: 13px 13px 14px; gap: 16px; }
  .org-name { font-size: 17px; }
  .org-body { padding: 11px 13px 13px; }
  .org-role { font-size: 13.5px; }
  .org-meta { font-size: 11px; }
  .org-people { font-size: 12.5px; }
  .pin-card { padding: 14px 13px 15px; }
  .card-title { font-size: 16px; }
  .card-sub { font-size: 13px; }
  .svc-link { font-size: 14.5px; }
  .tag { height: 25px; padding: 0 8px; font-size: 11px; }
  .site-foot { flex-direction: column; padding-bottom: 84px; }
}
