:root {
  --bg: #0b0e14;
  --panel: #0f131a;
  --card: #121722;
  --tab: #171d29;
  --border: #232a38;
  --text: #e6e8ee;
  --muted: #8b93a5;
  --accent: #7ee787;      /* terminal green */
  --accent-2: #79c0ff;    /* link blue */
  --accent-3: #d2a8ff;    /* purple for keys */
  --warn: #f2cc60;
  --accent-soft: rgba(126, 231, 135, 0.1);
  --radius: 12px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6f8;
    --panel: #eceef2;
    --card: #ffffff;
    --tab: #f0f2f5;
    --border: #d9dde5;
    --text: #1a1d24;
    --muted: #5b6273;
    --accent: #1a7f37;
    --accent-2: #0b62c4;
    --accent-3: #8250df;
    --warn: #9a6700;
    --accent-soft: rgba(26, 127, 55, 0.08);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.65 Inter, system-ui, -apple-system, sans-serif;
}
.mono { font-family: var(--mono); }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.shell { max-width: 960px; margin: 0 auto; }
.social { display: flex; gap: 4px; flex-wrap: wrap; margin: 10px 0 0 -8px; }
.social a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--muted); }
.social a:hover { background: var(--tab); color: var(--accent); }
.social svg { width: 18px; height: 18px; fill: currentColor; }

main { padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
#human { display: flex; flex-direction: column; gap: 22px; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.hero-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
/* business card: a light "paper" card in both themes, so the logo keeps its colors */
.vcard-wrap { perspective: 1200px; min-width: 0; }
.vcard {
  --paper: #fbfaf6; --ink: #1d1b19; --ink-2: #5d5853; --red: #c4122f; --line: #e6e1d8;
  position: relative; overflow: hidden; border-radius: 16px; padding: 26px 28px 30px;
  background: radial-gradient(circle at var(--gx, 30%) var(--gy, 0%), #ffffff 0%, var(--paper) 55%), var(--paper);
  color: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 18px 40px rgba(0, 0, 0, .28), 0 2px 6px rgba(0, 0, 0, .12);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s ease-out; transform-style: preserve-3d;
}
.vc-logos { position: absolute; top: 20px; right: 24px; display: flex; flex-direction: column; align-items: center; gap: 34px; }
.vc-logo { display: block; width: 190px; height: auto; }
.vc-logo-se { width: 150px; }
.vc-top { display: flex; gap: 24px; align-items: center; padding-right: 196px; min-height: 196px; }
.who { min-width: 0; }
.vcard h1 { color: var(--ink); }
.vcard .role { color: var(--ink-2); }
.vcard .group { color: var(--ink); margin-bottom: 0; }
.vcard .group a { color: var(--red); }
.vc-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.vcard .contact { margin: 0; }
.vcard .contact dt { color: var(--red); }
.vcard .contact dd { color: var(--ink); overflow-wrap: normal; }
.vcard .contact .pin { width: 15px; height: 15px; fill: var(--red); vertical-align: -3px; }
.vcard .supervisor { color: var(--ink-2); font-size: 13.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.vcard .contact a { color: var(--ink); text-decoration-color: color-mix(in srgb, var(--red) 45%, transparent); }
.vcard .contact a:hover { color: var(--red); }
.vcard .social { margin: 0; flex: none; }
.vcard .social a { color: var(--ink-2); }
.vcard .social a:hover { background: color-mix(in srgb, var(--red) 10%, transparent); color: var(--red); }
.vc-stripe { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: linear-gradient(90deg, var(--red), #5a0f09); }
.ring {
  flex: none; padding: 4px; border-radius: 50%;
  background: conic-gradient(from 210deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
}
.avatar { display: block; width: 160px; height: 160px; border-radius: 50%; object-fit: cover; border: 4px solid var(--bg); }
.vcard .avatar { border-color: var(--paper); }
.vcard .ring { background: conic-gradient(from 210deg, var(--red), #e8a33d, #5a0f09, var(--red)); }
.contact { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 12px 0 0; font-size: 12.5px; }
.contact dt { color: var(--accent-3); }
.contact dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.contact a { color: var(--accent-2); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent-2) 40%, transparent); text-underline-offset: 3px; }
.contact a:hover { text-decoration-color: currentColor; }
#cites-src a { color: inherit; }

.cites-details { margin: 20px 0 0; border: 1px solid var(--border); border-radius: 10px; background: var(--tab); }
.cites-details > summary {
  list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding: 10px 14px; font-size: 12.5px; color: var(--muted); border-radius: 10px;
}
.cites-details > summary::-webkit-details-marker { display: none; }
.cites-details > summary:hover { color: var(--text); }
.cites-details > summary:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.cites-details > summary b { color: var(--accent); }
.cs-key { color: var(--accent-3); }
.cs-hint { margin-left: auto; color: var(--accent-2); }
.cs-hint::before { content: "▸ show breakdown"; }
.cites-details[open] .cs-hint::before { content: "▾ hide breakdown"; }
.cites-details .cites { margin: 0 10px 10px; }
.cites .term-head a { color: #8b93a5; }
.cites .term-head a:hover { color: #7ee787; }
.cites { background: #0a0d12; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.bars { padding: 12px 14px 12px; display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: #c9d1d9; }
.bar-row { display: grid; grid-template-columns: 36px 1fr 34px; gap: 10px; align-items: center; }
.yr { color: #8b93a5; }
.n { text-align: right; color: #e6e8ee; }
.cells { display: grid; grid-template-columns: repeat(40, 1fr); gap: 2px; height: 12px; }
.cell { border-radius: 2px; background: #1a2030; }
.cell.lit { background: #7ee787; box-shadow: 0 0 6px rgba(126, 231, 135, .35); }
.cites:not(.on) .cell.lit { background: #1a2030; box-shadow: none; }
.cites.on .cell.lit { animation: bin-on .25s ease-out both; animation-delay: calc(var(--r) * 350ms + var(--k) * 22ms); }
.cites.on .cell.tip { animation: bin-on .25s ease-out both, bin-tip 1.6s ease-in-out infinite; animation-delay: calc(var(--r) * 350ms + var(--k) * 22ms), calc(var(--r) * 350ms + var(--k) * 22ms + 400ms); }
@keyframes bin-on { from { background: #1a2030; box-shadow: none; transform: scaleY(.4); } 60% { background: #c5f7c9; transform: scaleY(1.25); } to { background: #7ee787; transform: none; } }
@keyframes bin-tip { 50% { background: #c5f7c9; box-shadow: 0 0 12px rgba(126, 231, 135, .8); } }
.bar-row:hover .cell.lit { background: #a8f0ad; }
h1 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; }
.role { margin: 4px 0 0; color: var(--muted); }
.group { margin: 2px 0 12px; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 11.5px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border); color: var(--accent-3); background: var(--tab); }

.term-head { display: flex; justify-content: space-between; font-size: 11px; color: #8b93a5; padding: 7px 12px; border-bottom: 1px solid #1d2330; }
.t-prompt { color: #e6e8ee; font-weight: 500; }
.cursor { display: inline-block; width: 8px; height: 15px; background: #7ee787; vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- file cards ---------- */
.file { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tab {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px;
  padding: 9px 16px; background: var(--tab); border-bottom: 1px solid var(--border);
}
.tab .ic { color: var(--accent-2); font-weight: 700; font-size: 11px; min-width: 18px; }
.badge { font-size: 10.5px; padding: 1px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.body { padding: 18px 22px 22px; }
.body > p:first-child { margin-top: 0; }
.body h3 { font-size: 12.5px; font-weight: 500; color: var(--accent-3); margin: 22px 0 10px; }
.body h3:first-child { margin-top: 0; }
.muted { color: var(--muted); font-size: 14px; }

.pub { padding: 11px 0; border-top: 1px dashed var(--border); }
.body h3 + .pub { border-top: 0; padding-top: 0; }
.pub .venue { font-size: 11px; color: var(--warn); }
.pub .title { font-weight: 600; }
.pub .title a { color: var(--text); }
.pub .title a:hover { color: var(--accent-2); }
.pub .authors { color: var(--muted); font-size: 13.5px; }
.pub .authors strong { color: var(--text); font-weight: 600; }

.banner-sub { color: var(--text); opacity: .8; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 14px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.topics { margin: 0; padding-left: 20px; }
.topics li { margin: 3px 0; }
.checks { list-style: none; margin: 0 0 12px; padding: 0; }
.checks li { display: flex; gap: 10px; margin: 5px 0; }
.box { color: var(--accent); flex: none; }
/* thesis guidelines: same pill as "Show full profile", in the terminal colors of the sections */
.cta { display: inline-flex; align-items: center; gap: 10px; margin-top: 6px; padding: 10px 10px 10px 18px; border-radius: 999px;
  border: 1.5px solid transparent; font-size: 13px; font-weight: 500; color: var(--text);
  background: linear-gradient(var(--panel), var(--panel)) padding-box,
              conic-gradient(from var(--spin), var(--accent), var(--accent-2), var(--accent-3), var(--accent)) border-box;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s ease; }
.cta .prompt { color: var(--accent); }
.cta .go { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #06130a; font-weight: 700; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.cta:hover, .cta:focus-visible, .anim .file.in .cta.rise:hover, .anim .file.in .cta.rise:focus-visible {
  text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 26px -8px color-mix(in srgb, var(--accent) 60%, transparent); outline: none; }
.cta:hover .go, .cta:focus-visible .go { transform: translate(2px, -2px) rotate(8deg); }
.anim .cta { animation: spin 6s linear infinite; }

.course { display: grid; grid-template-columns: 128px 1fr; gap: 14px; padding: 7px 0; border-top: 1px dashed var(--border); line-height: 1.45; }
.course:first-child { border-top: 0; padding-top: 0; }
.semester { font-size: 12px; color: var(--accent-3); padding-top: 2px; }
.course .title { font-weight: 600; }
.sub { color: var(--muted); font-size: 13.5px; }
.kind { color: var(--accent); font-size: 12px; }

.entry { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 10px 0; border-top: 1px dashed var(--border); }
.entry.has-logo { grid-template-columns: 64px 1fr auto; align-items: center; }
.entry-logo { width: 64px; height: 44px; object-fit: contain; padding: 5px 6px; border-radius: 8px; background: #ffffff; border: 1px solid var(--border); transition: transform .2s; }
.entry:hover .entry-logo { transform: scale(1.06); }
.body h3 + .entry { border-top: 0; padding-top: 0; }
.entry .title { font-weight: 600; }
.entry .side { color: var(--muted); font-size: 12px; text-align: right; }

/* paper links + bibtex */
.plinks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.plinks a, .bib-btn {
  font: 500 11px var(--mono); padding: 2px 8px; border-radius: 5px; cursor: pointer;
  border: 1px solid var(--border); background: var(--tab); color: var(--muted);
}
.plinks a:hover, .bib-btn:hover, .bib-btn[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.bib { position: relative; margin-top: 8px; }
.bib pre { margin: 0; padding: 12px 14px; border-radius: 8px; background: #0a0d12; color: #c9d1d9; font-size: 11.5px; line-height: 1.55; overflow-x: auto; }
.bib-src { font-size: 11px; color: var(--muted); margin-top: 4px; text-align: right; }
.bib-src a { color: var(--muted); text-decoration: underline; }
.bib-copy { position: absolute; top: 8px; right: 8px; font-size: 11px; padding: 2px 8px; border-radius: 5px; border: 1px solid #2a3140; background: #121722; color: #c9d1d9; cursor: pointer; }

/* changelog */
.news-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip { font: inherit; font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: none; color: var(--muted); cursor: pointer; }
.chip span { opacity: .6; margin-left: 2px; }
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip[aria-pressed="true"] { color: var(--text); border-color: var(--tc, var(--accent)); background: color-mix(in srgb, var(--tc, var(--accent)) 14%, transparent); }
.t-paper { --tc: var(--accent-2); }
.t-talk { --tc: var(--warn); }
.t-teaching { --tc: var(--accent-3); }
.t-career { --tc: var(--accent); }
.log { list-style: none; margin: 0; padding: 0 0 0 4px; border-left: 2px solid var(--border); }
.log .item { position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 6px 0 6px 16px; line-height: 1.5; }
.log .item::before { content: ""; position: absolute; left: -7px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--card); border: 2px solid var(--tc, var(--accent)); transition: transform .2s; }
.log .item:nth-child(2)::before { background: var(--tc); box-shadow: 0 0 8px var(--tc); }
.log .item:hover::before { transform: scale(1.35); background: var(--tc, var(--accent)); }
.log .item[data-type="paper"] { --tc: var(--accent-2); }
.log .item[data-type="talk"] { --tc: var(--warn); }
.log .item[data-type="teaching"] { --tc: var(--accent-3); }
.log .item[data-type="career"] { --tc: var(--accent); }
.log .yr-mark { position: relative; margin: 10px 0 4px -15px; font-size: 11px; font-weight: 700; color: var(--muted); }
.log .yr-mark:first-child { margin-top: 0; }
.log .yr-mark::before { content: ""; display: inline-block; width: 10px; height: 2px; margin-right: 6px; vertical-align: middle; background: var(--border); }
.log .when { color: var(--muted); font-size: 12px; padding-top: 2px; white-space: nowrap; }
.log .tag { display: inline-block; font-size: 10.5px; padding: 0 7px; margin-right: 8px; border-radius: 999px; color: var(--tc); border: 1px solid color-mix(in srgb, var(--tc) 50%, transparent); vertical-align: 1px; }
.log .what a { color: var(--text); }
.log .what a:hover { color: var(--accent-2); }
.more { margin-top: 10px; font-size: 12px; padding: 5px 10px; border-radius: 6px; border: 1px dashed var(--border); background: none; color: var(--muted); cursor: pointer; }
.more:hover { color: var(--accent); border-color: var(--accent); }

.feed-empty { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 8px; background: #0a0d12; color: #6e7687; font-size: 12.5px; }
.feed-empty .t-prompt { color: #e6e8ee; }
.feed-empty .cursor { margin-top: 2px; }

/* research diagram */
.diagram { margin: 16px 0 0; padding: 10px; }
.diagram { perspective: 1100px; }
.diagram svg { display: block; width: 100%; height: auto; font-family: var(--mono); font-size: 12px;
  transform: rotateX(var(--dx, 22deg)) rotateY(var(--dy, 0deg)); transform-origin: 50% 60%;
  transition: transform .35s ease-out; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .28)); }
.d-grid { fill: var(--border); }
.diagram .d-floor { stroke: var(--border); stroke-width: 1; }
.diagram .d-side { fill: color-mix(in srgb, var(--border) 78%, #000); stroke: none; }
.diagram .d-agent .d-side { fill: color-mix(in srgb, var(--accent) 60%, #000); }
.diagram .d-code .d-side { fill: color-mix(in srgb, var(--accent-2) 60%, #000); }
.d-file rect { fill: var(--tab); stroke: var(--border); }
.d-file text, .d-agent text { fill: var(--text); }
.d-agent rect { fill: color-mix(in srgb, var(--accent) 12%, var(--card)); stroke: var(--accent); }
.d-code rect { stroke: var(--accent-2); }
.d-sub { fill: var(--muted) !important; font-size: 10.5px; }
.d-head { fill: var(--accent); }
.d-more circle { fill: var(--muted); }
.d-flow { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-opacity: .55; }
.d-pulse { fill: var(--accent); }
.d-ic { fill: none; stroke: var(--muted); stroke-width: 1.1; stroke-linejoin: round; }
.d-file rect { transition: stroke .2s; }
.d-file:hover rect:not(.d-side) { stroke: var(--accent-2); }
.d-live { fill: var(--accent); animation: live 1.6s ease-in-out infinite; }
@keyframes live { 50% { opacity: .25; } }
.d-add { fill: var(--accent); fill-opacity: .7; font-size: 10px; }
.d-del { fill: #f85149; fill-opacity: .7; font-size: 10px; }
.d-code .d-diff rect, .d-file:hover .d-diff rect { stroke: none; }
.d-code .d-diff rect.d-add { fill: var(--accent); }
.d-code .d-diff rect.d-del { fill: #f85149; }
.d-warn circle { fill: #f85149; }
.d-warn text { fill: #fff; font-size: 11px; font-weight: 700; }
.d-drift { fill: none; stroke: #f85149; stroke-width: 1.6; stroke-dasharray: 3 5; }
.d-conflict { fill: none; stroke: #f85149; stroke-width: 2; }
.d-label { fill: var(--muted); font-size: 11.5px; }
.d-bad { fill: #f85149; }

/* command palette */
.palette { position: fixed; inset: 0; z-index: 50; background: rgba(5, 8, 12, .55); backdrop-filter: blur(3px); display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; }
.pal-box { width: min(620px, 100%); background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--accent); }
.pal-in input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 14px var(--mono); }
.pal-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; font-size: 13px; }
.pal-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.pal-list li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-list li[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.pal-list .hint { color: var(--muted); font-size: 11.5px; flex: none; }
.pal-list .none { color: var(--muted); cursor: default; }
.pal-foot { padding: 7px 14px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); }

/* colophon footer */
.colophon { margin-top: 8px; padding: 16px 4px 4px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--muted); text-align: center; }
.c-head { display: flex; gap: 8px; align-items: center; letter-spacing: .12em; font-size: 11px; margin-bottom: 8px; }
.c-head .ic { color: var(--accent); }
.colophon dl { display: flex; justify-content: center; flex-wrap: wrap; gap: 3px 8px; margin: 0; }
.colophon dt { color: var(--accent-3); }
.colophon dt::before { content: "// "; color: var(--border); }
.colophon dd { margin: 0; }
.colophon a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.colophon a:hover { color: var(--accent-2); }
.colophon .c-copy { margin: 0 0 4px; }

/* scroll animations (only with body.anim, which is not set for reduced motion) */
.anim #human .file { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.anim #human .file.in { opacity: 1; transform: none; }
.anim .rise { opacity: 0; transform: translateY(10px); transition: opacity .45s ease, transform .45s ease; transition-delay: calc(180ms + var(--i) * 70ms); }
.anim .file.in .rise { opacity: 1; transform: none; }
.anim .path-txt.typing::after { content: "▍"; color: var(--accent); animation: blink .8s steps(1) infinite; }
.anim .diagram [data-step] { opacity: 0; transition: opacity .5s ease; transition-delay: calc(250ms + var(--s) * 200ms); }
.anim .file.in .diagram [data-step] { opacity: 1; }
.box { transition: color .3s; }
.box.done { color: var(--accent); font-weight: 700; }
.anim .hero { animation: hero-in .8s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes hero-in { from { opacity: 0; transform: translateY(12px); } }
@property --ring { syntax: "<angle>"; inherits: false; initial-value: 210deg; }
.anim .vcard .ring { background: conic-gradient(from var(--ring), var(--red), #e8a33d, #5a0f09, var(--red)); animation: ring 10s linear infinite; }
@keyframes ring { to { --ring: 570deg; } }


/* ---------- small screens ---------- */
@media (max-width: 760px) {
  main { padding: 16px 16px 32px; }
  .vcard { padding: 20px 18px 24px; }
  .vc-logos { position: static; flex-direction: row; align-items: center; justify-content: space-between; gap: 40px; margin-bottom: 14px; }
  .vc-logo { width: 120px; }
  .vc-logo-se { width: 100px; }
  .vc-top { flex-direction: column; align-items: flex-start; padding-right: 0; gap: 14px; min-height: 0; }
  .vc-bottom { flex-direction: column; align-items: flex-start; }
  .body { padding: 16px; }
  .course { grid-template-columns: 1fr; gap: 2px; }
  .entry { grid-template-columns: 1fr; gap: 2px; }
  .entry.has-logo { grid-template-columns: 48px 1fr; }
  .entry.has-logo .side { grid-column: 2; }
  .entry-logo { width: 48px; height: 34px; padding: 3px 4px; }
  .entry .side { text-align: left; }
  .log .item { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse, .cursor, .d-live { animation: none; }
  .d-pulses { display: none; }
  .cites.on .cell.lit, .cites.on .cell.tip { animation: none; }
}

/* top navigation bar */
.topnav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topnav-in { max-width: 960px; margin: 0 auto; padding: 0 28px; height: 48px; display: flex; align-items: center; gap: 24px; }
.nav-links { display: flex; gap: 4px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { padding: 6px 10px; border-radius: 8px; font-size: 14px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.nav-links a:hover { color: var(--text); background: var(--panel); }
.nav-links a.on { color: var(--text); background: var(--panel); }
@media (max-width: 640px) {
  .topnav-in { padding: 0 8px; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 6px 4px; font-size: 12.5px; }
}

/* landing: only the card, centered, until "show full profile" is clicked */
/* "Show full profile": Inter like the name on the card, with a turning red-gold border like the photo ring */
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.expand { display: none; justify-self: center; margin-top: 14px; padding: 12px 22px 12px 26px; border-radius: 999px;
  border: 1.5px solid transparent; cursor: pointer; font: 600 15px/1 Inter, system-ui, sans-serif; letter-spacing: .01em; color: var(--text);
  background: linear-gradient(var(--panel), var(--panel)) padding-box,
              conic-gradient(from var(--spin), #c4122f, #e8a33d, #5a0f09, #c4122f) border-box;
  box-shadow: 0 0 0 0 rgba(196, 18, 47, 0);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s ease, color .2s; }
.expand .arr { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: 10px; border-radius: 50%;
  background: #c4122f; color: #fff; font-size: 13px; vertical-align: middle; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.expand:hover, .expand:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 28px -6px rgba(196, 18, 47, .55); outline: none; }
.expand:hover .arr, .expand:focus-visible .arr { transform: translateY(3px); }
.expand:active { transform: translateY(0) scale(.96); }
.landing .expand { display: inline-block; }
.landing .topnav, .landing #human, .landing .colophon { display: none; }
.landing main { min-height: 100vh; min-height: 100svh; justify-content: center; }
.anim.landing .expand { animation: expand-in .7s .9s cubic-bezier(.2, .8, .2, 1) backwards, spin 6s linear infinite, glow 2.8s 1.6s ease-in-out infinite; }
.anim.landing .expand .arr { animation: nudge 1.6s 1.6s ease-in-out infinite; }
.anim.landing .expand:hover .arr { animation: none; }
@keyframes expand-in { from { opacity: 0; transform: translateY(14px) scale(.94); filter: blur(4px); } }
@keyframes spin { to { --spin: 360deg; } }
@keyframes glow { 50% { box-shadow: 0 0 22px -4px rgba(196, 18, 47, .45); } }
@keyframes nudge { 50% { transform: translateY(3px); } }
.opening .topnav { animation: nav-in .5s .15s cubic-bezier(.2, .8, .2, 1) both; }
.opening #human, .opening .colophon { animation: hero-in .7s .3s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes nav-in { from { opacity: 0; transform: translateY(-100%); } }
#human:focus { outline: none; }
/* landing: photo at double size (320px, capped to fit narrow phones); shrinks back when the profile opens */
.avatar { transition: width .65s cubic-bezier(.2, .8, .2, 1), height .65s cubic-bezier(.2, .8, .2, 1); }
.landing .avatar { width: min(320px, 100vw - 92px); height: min(320px, 100vw - 92px); }
@media (prefers-reduced-motion: reduce) { .avatar { transition: none; } }
/* live background (bg.js): fixed behind everything, fainter once the profile is open */
.bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: .75; transition: opacity 1.2s ease; }
body:not(.landing) .bg { opacity: .4; }

/* monthly citations: columns of the same cells as the yearly rows */
.months-head { border-top: 1px solid #1d2330; }
.months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; padding: 12px 14px 10px; font-size: 11px; color: #c9d1d9; }
.mcol { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.mcol .n { text-align: center; }
.mcells { display: flex; flex-direction: column-reverse; gap: 2px; width: 100%; max-width: 26px; height: 96px; }
.mcells .cell { flex: 1; }
.mcol:hover .cell.lit { background: #a8f0ad; }
.mo { color: #8b93a5; font-size: 10px; }
.myr { color: #5b6273; font-size: 9.5px; min-height: 1.2em; }
@media (max-width: 640px) {
  .months { gap: 3px; padding: 10px 8px 8px; }
  .mo { font-size: 9px; }
}
/* copyright notice under the publications */
.pub-notice { position: relative; margin: 20px 0 0; padding: 12px 16px 14px 18px; border: 1px solid var(--border); border-left: 3px solid var(--accent-3);
  border-radius: 8px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent-3) 9%, transparent), transparent 70%); }
.pub-notice p { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.65; }
.pn-head { display: flex; align-items: center; gap: 8px; color: var(--accent-3); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.pn-icon { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 13px; letter-spacing: 0;
  color: var(--accent-3); border: 1px solid currentColor; animation: pn-glow 3.2s ease-in-out infinite; }
@keyframes pn-glow { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-3) 18%, transparent); } }
@media (prefers-reduced-motion: reduce) { .pn-icon { animation: none; } }
