:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --bg-soft: #f6f7fa;
  --header-bg: rgba(255,255,255,.82);
  --ink: #17171c;
  --body: #2b2b31;
  --muted: #6a6a73;
  --faint: #9a9aa3;
  --line: #e7e7eb;
  --line-strong: #d6d6dc;
  --accent: #3b5bdb;
  --accent-ink: #2f4bc2;
  --accent-soft: #eef1fc;
  --accent-line: #c5cff3;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --measure: 960px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0d14;
  --bg-elev: #13141c;
  --bg-soft: #151621;
  --header-bg: rgba(12,13,20,.8);
  --ink: #f3f3f8;
  --body: #d7d8df;
  --muted: #9b9ca7;
  --faint: #6e6f7d;
  --line: #22232d;
  --line-strong: #32333f;
  --accent: #7f8ff0;
  --accent-ink: #a1adf5;
  --accent-soft: rgba(127,143,240,.16);
  --accent-line: #3d4877;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--body); font: 17px/1.7 var(--sans); font-optical-sizing: auto; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: 'cv11', 'ss01'; }
::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
h1, h2, h3, h4, p, figure { margin: 0; }
.mono, time, .period, .experience-date, .venue, .paper-actions, .talk time, .brand, .minor-link, .repo-badge { font-family: var(--mono); font-feature-settings: normal; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--header-bg); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); }
.site-header nav { max-width: var(--measure); margin: auto; min-height: 60px; display: flex; justify-content: space-between; align-items: center; gap: 30px; font-size: 14px; }
.brand { font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink); padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px; line-height: 1; }
.brand:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.nav-links { display: flex; gap: 28px; }
.nav-links a { padding: 12px 0; color: var(--muted); white-space: nowrap; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.site-header a span { font-size: 12px; color: var(--faint); }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; color: var(--muted); border: 1px solid transparent; }
.theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
/* Figures and thumbnails always sit on white so their colours read correctly in both themes. */
.preview, .preview img, .preview-card-image, .lightbox img { background: #fff; }
/* Media badge shares the Code badge look; the X glyph and heart count sit inside it. */
.paper-actions .media-badge { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 3px 11px; color: var(--body); font-size: 11.5px; line-height: 1.5; background: var(--bg-soft); white-space: nowrap; text-transform: none; letter-spacing: 0; }
.paper-actions .media-badge:hover { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); text-decoration: none; }
.media-badge svg { width: 13px; height: 13px; flex-shrink: 0; }
.media-badge .like-count { font-variant-numeric: tabular-nums; font-weight: 500; font-size: 12px; }
.media-badge .badge-divider { align-self: stretch; border-left: 1px solid var(--line-strong); margin: 0 3px; }

.page { max-width: var(--measure); margin: 0 auto; padding-bottom: 20px; }

/* Hero banner */
.hero { position: relative; margin-top: 10px; height: 280px; background: var(--bg); isolation: isolate; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 2; touch-action: pan-y; }
.hero.ready 
/* About */
.about { padding-top: 40px; scroll-margin-top: 20px; }
h1 { font-size: 46px; line-height: 1.15; font-weight: 600; letter-spacing: -.025em; color: var(--ink); }
h1 span { font-weight: 300; }
.subtitle { font-size: 18px; color: var(--muted); margin-top: 8px; }
.subtitle a { color: var(--body); }
.about-body { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 56px; margin-top: 28px; }
.biography p { margin-bottom: 18px; font-size: 17px; line-height: 1.78; }
.biography p:last-child { margin-bottom: 0; }
.biography a { color: var(--accent-ink); text-decoration: underline; text-decoration-color: var(--accent-line); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.biography a:hover { text-decoration-color: var(--accent); }
.profile { padding-top: 0; }
.portrait-stack { position: relative; width: 100%; aspect-ratio: 1 / 1; }
.portrait-stack img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 10px; transition: opacity .3s ease; }
/* Illustrated by default; the photo takes over in dark mode or when the visitor flips the toggle. */
.portrait-real { opacity: 0; }
:root[data-theme="dark"] .profile .portrait-anime, .profile[data-portrait="real"] .portrait-anime { opacity: 0; }
:root[data-theme="dark"] .profile .portrait-real, .profile[data-portrait="real"] .portrait-real { opacity: 1; }
/* Toggle sits above the portrait, right-aligned. */
.portrait-toggle { display: inline-flex; align-items: center; gap: 5px; margin: 0 0 8px auto; padding: 3px 2px; border: 0; background: none; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.portrait-toggle:hover { color: var(--accent); }
.portrait-toggle svg { width: 12px; height: 12px; }
.profile { display: flex; flex-direction: column; }
/* Dark mode always shows the photo; the toggle is hidden there. */
:root[data-theme="dark"] .portrait-toggle { display: none; }
.social-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; margin-top: 16px; color: var(--muted); }

/* Sections */
.section { margin-top: 72px; scroll-margin-top: 30px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line-strong); }
h2 { font-size: 27px; letter-spacing: -.02em; font-weight: 600; line-height: 1.3; color: var(--ink); }
.minor-link { font-size: 12px; color: var(--muted); letter-spacing: .02em; }

/* Publications toolbar */
.publication-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-top: 14px; }
.search { display: flex; align-items: center; gap: 8px; color: var(--faint); }
.search input { width: 200px; background: transparent; border: 0; border-bottom: 1px solid var(--line-strong); padding: 6px 0; font-size: 14px; border-radius: 0; color: var(--ink); }
.search input:focus { outline: none; border-bottom-color: var(--accent); }
.topic-options { flex: 1 1 auto; font-size: 13px; color: var(--muted); padding-top: 6px; }
summary { cursor: pointer; }
.topic-options summary { width: fit-content; }
#topic-checkboxes { display: flex; flex-wrap: wrap; gap: 10px 24px; padding: 12px 0 2px; }
#topic-checkboxes label { display: flex; gap: 7px; align-items: center; }
input[type=checkbox] { accent-color: var(--accent); }

/* Publication groups */
.pub-group { display: grid; grid-template-columns: 124px minmax(0, 1fr); column-gap: 26px; position: relative; margin-top: 30px; }
.period { position: relative; padding-top: 4px; font-size: 13px; color: var(--muted); line-height: 1.5; letter-spacing: .02em; }
.period span { position: sticky; top: 76px; display: block; padding-right: 15px; }
.pub-group.timeline .group-content { position: relative; }
.pub-group.timeline .group-content:before { content: ''; position: absolute; left: -26px; top: 14px; bottom: -40px; border-left: 1px solid var(--line-strong); }
.pub-group.timeline .group-content:after { content: ''; position: absolute; width: 7px; height: 7px; border: 1px solid var(--accent); border-radius: 50%; background: var(--bg); top: 11px; left: -30px; box-shadow: 0 0 0 3px var(--bg); }
.pub-group.timeline:nth-child(2) .group-content:before { bottom: 10px; }
.group-title { font-size: 20px; font-weight: 600; letter-spacing: -.01em; line-height: 1.4; margin-bottom: 4px; color: var(--ink); }
.pub-group:not(.timeline) { border-top: 1px solid var(--line); padding-top: 28px; margin-top: 30px; }
/* Collapsible, compact group (surveys & tutorials): no thumbnails, closed by default. */
.group-fold > summary { display: flex; align-items: center; list-style: none; cursor: pointer; padding: 12px 0 4px; }
.group-fold > summary::-webkit-details-marker { display: none; }
.fold-meta { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.fold-meta svg { width: 14px; height: 14px; transition: transform .2s ease; }
.fold-less { display: none; }
.group-fold[open] .fold-more { display: none; }
.group-fold[open] .fold-less { display: inline; }
.group-fold[open] .fold-meta svg { transform: rotate(180deg); }
.group-fold > summary:hover .fold-meta { color: var(--accent); }
.group-fold[open] > summary { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.paper.compact { padding: 18px 0 20px; }
.paper.compact .paper-side { gap: 8px; }
.paper-kind { font-family: var(--mono); font-size: 11px; color: var(--faint); letter-spacing: .02em; }
.paper.compact h4 { font-size: 17px; }

/* Paper */
.paper { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 26px; padding: 26px 0 28px; border-bottom: 1px solid var(--line); }
.paper:last-child { border-bottom: 0; }
.paper-side { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.venue-badge { align-self: flex-start; font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .04em; line-height: 1.4; padding: 3px 8px; border-radius: 5px; background: var(--ink); color: var(--bg); }
.preview { display: flex; align-items: center; justify-content: center; align-self: start; width: 100%; aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: 9px; padding: 8px; background: #fff; cursor: zoom-in; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.preview:hover { border-color: var(--accent-line); box-shadow: 0 10px 28px -16px rgba(59,91,219,.45); transform: translateY(-1px); }
.preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.no-preview { display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line-strong); border-radius: 9px; aspect-ratio: 16 / 10; font-size: 11px; color: var(--faint); letter-spacing: .12em; width: 100%; font-family: var(--mono); }
.paper h4 { font-size: 18.5px; font-weight: 600; line-height: 1.45; margin-bottom: 7px; letter-spacing: -.01em; color: var(--ink); }
.paper h4 a:hover { text-decoration-color: var(--accent); }
.authors { font-size: 14.5px; color: var(--muted); line-height: 1.7; }
.authors .author { white-space: nowrap; }
.authors .me { color: var(--accent); font-weight: 600; }
.authors sup { font-size: 9px; }
.authors-toggle { font-size: 12px; color: var(--muted); text-decoration: underline; margin-left: 6px; }
.venue { font-size: 12.5px; color: var(--body); margin-top: 8px; letter-spacing: .01em; }
.venue .year { color: var(--muted); }
.venue .sep { color: var(--faint); padding: 0 .35em; }
.venue .year { color: var(--muted); }
.paper-note { font-size: 14px; color: var(--muted); margin-top: 6px; font-style: italic; }
.paper-note.highlight { display: inline-block; max-width: 100%; font-size: 13px; font-style: normal; font-weight: 500; letter-spacing: -.005em; color: var(--accent-ink); background: linear-gradient(90deg, var(--accent-soft), rgba(238,241,252,0)); border-left: 2px solid var(--accent); padding: 4px 12px 4px 10px; margin-top: 8px; border-radius: 0 8px 8px 0; line-height: 1.5; text-wrap: balance; }
/* Wrapping: balance multi-line headings, avoid orphaned last words in running text. */
h1, h2, .group-title, .paper h4, .experience-row h3, .talk div, .lightbox figcaption { text-wrap: balance; }
.biography p, .authors, .abstract, .paper-note, .talk div span { text-wrap: pretty; }
.paper-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: 12px; letter-spacing: .04em; }
.paper-actions > a:not(.repo-badge):not(.media-badge), .paper-actions > button { color: var(--muted); padding: 4px 0; text-transform: uppercase; }
.paper-actions > a:not(.repo-badge):not(.media-badge):hover, .paper-actions > button:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.repo-badge { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 3px 9px; color: var(--body); font-size: 11.5px; line-height: 1.5; background: var(--bg-soft); white-space: nowrap; }
.repo-badge:hover { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); text-decoration: none; }
.repo-badge svg { width: 13px; height: 13px; flex-shrink: 0; }
.repo-badge .star-count { font-variant-numeric: tabular-nums; font-weight: 500; font-size: 12px; }
.repo-badge .badge-divider { align-self: stretch; border-left: 1px solid var(--line-strong); margin: 0 1px; }
.abstract { grid-column: 1 / -1; background: var(--bg-soft); border-left: 2px solid var(--accent-line); border-radius: 0 8px 8px 0; padding: 18px 22px; font-size: 14.5px; color: var(--body); line-height: 1.8; }
.bibtex { grid-column: 1 / -1; position: relative; background: var(--bg-soft); border-left: 2px solid var(--accent-line); border-radius: 0 8px 8px 0; padding: 14px 56px 14px 18px; }
.bibtex pre { margin: 0; font: 12.5px/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--body); }
.copy-bibtex { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--bg-elev); color: var(--muted); }
.copy-bibtex:hover { color: var(--accent); border-color: var(--accent-line); }
.copy-bibtex svg { width: 15px; height: 15px; }
.copy-bibtex .icon-check { display: none; }
.copy-bibtex.copied { color: var(--accent); border-color: var(--accent-line); }
.copy-bibtex.copied .icon-copy { display: none; }
.copy-bibtex.copied .icon-check { display: block; }
.empty-state { padding: 35px 0; font-size: 15px; color: var(--muted); }
.empty-state button { text-decoration: underline; margin-top: 8px; }

/* Experience */
.experience-row { display: grid; grid-template-columns: 190px 1fr auto; gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.experience-date, .location { font-size: 13px; color: var(--muted); padding-top: 4px; }
.experience-row h3 { font-size: 17.5px; font-weight: 600; color: var(--ink); }
.experience-row p { font-size: 14.5px; color: var(--muted); }
.earlier { font-size: 14px; color: var(--muted); margin-top: 16px; }
.earlier summary { padding: 6px 0; }
.earlier .experience-row { color: var(--body); }

/* Talks: scrollable list */
.talk-list { max-height: 400px; overflow-y: auto; padding: 0 18px 44px 0; margin-top: 4px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; -webkit-mask-image: linear-gradient(#000 calc(100% - 48px), transparent); mask-image: linear-gradient(#000 calc(100% - 48px), transparent); }
.talk-list::-webkit-scrollbar { width: 6px; }
.talk-list::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.talk-list:focus-visible { outline-offset: 2px; }
.talk { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 20px; padding: 17px 0; border-bottom: 1px solid var(--line); font-size: 16px; line-height: 1.55; }
.talk time { font-size: 13px; color: var(--muted); padding-top: 3px; }
.talk div span { display: block; font-size: 13.5px; color: var(--faint); margin-top: 3px; }
.talk a:hover { text-decoration-color: var(--accent); }

footer { margin-top: 80px; padding: 24px 0; border-top: 1px solid var(--line-strong); display: flex; gap: 24px; font-size: 13px; color: var(--muted); }
footer a:last-child { margin-left: auto; }
.visitors-link { display: inline-flex; align-items: center; color: var(--faint); }
.visitors-link svg { width: 15px; height: 15px; }
.visitors-link:hover { color: var(--accent); }
/* The tracker widget stays in the DOM (so visits are counted) but is clipped out of view. */
.visitor-tracker { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* Dialogs */
dialog { width: min(720px, calc(100% - 32px)); max-height: 85dvh; overflow: auto; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px; padding: 26px 28px; color: var(--body); box-shadow: 0 30px 80px -30px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(10,12,24,.55); backdrop-filter: blur(4px); }

.lightbox { width: auto; max-width: min(1200px, 96vw); max-height: 96dvh; background: transparent; border: 0; padding: 0; overflow: visible; box-shadow: none; }
.lightbox::backdrop { background: color-mix(in srgb, var(--bg) 72%, transparent); }
.lightbox figure { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lightbox img { display: block; max-width: 94vw; max-height: 82dvh; width: auto; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: clamp(10px, 2vw, 22px); box-shadow: 0 30px 90px -20px rgba(20,24,60,.35), 0 2px 6px rgba(0,0,0,.06); }
.lightbox figcaption { font-family: var(--mono); font-size: 12.5px; color: var(--body); text-align: center; max-width: 80ch; letter-spacing: .01em; line-height: 1.6; padding: 6px 14px; background: var(--header-bg); border-radius: 8px; }
.lightbox-close { position: fixed; top: 18px; right: 22px; color: var(--ink); font-size: 32px; line-height: 1; width: 44px; height: 44px; border-radius: 50%; background: var(--header-bg); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.lightbox-close:hover { background: var(--bg-elev); border-color: var(--accent); color: var(--accent); }
.lightbox[open] { animation: lightbox-in .22s ease-out; }
@keyframes lightbox-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

[hidden] { display: none !important; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip:focus { position: fixed; padding: 8px 14px; background: var(--ink); color: var(--bg); top: 5px; left: 5px; z-index: 30; }

/* Hover link previews */
.authors a { color: inherit; text-decoration: none; }
.authors a:hover, .authors a:focus-visible { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.paper-actions .media-link { display: inline-flex; align-items: center; gap: 5px; }
.media-link svg { width: 13px; height: 13px; }
.link-preview { position: fixed; z-index: 50; width: min(360px, calc(100vw - 24px)); max-height: min(480px, calc(100dvh - 24px)); overflow: auto; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 48px -16px rgba(0,0,0,.25); font-size: 13.5px; line-height: 1.65; }
.preview-card-image { height: 160px; background: #fff; border-bottom: 1px solid var(--line); }
.preview-card-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.author-preview-image { height: 130px; }
.preview-card-body { padding: 16px 18px 17px; }
.preview-card-source { display: flex; justify-content: space-between; gap: 15px; font-size: 10px; color: var(--faint); margin-bottom: 8px; font-family: var(--mono); letter-spacing: .1em; }
.preview-card-source span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; letter-spacing: 0; text-transform: none; }
.preview-card-body h3 { font-size: 16px; line-height: 1.45; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.preview-card-subtitle { font-size: 12.5px; color: var(--body); margin-bottom: 7px; }
.preview-card-note { font-size: 11.5px; color: var(--faint); margin: 8px 0 4px; }
.preview-card-description { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.preview-card-open { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; margin-top: 13px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--accent-ink); }

/* Responsive */
@media(max-width:1040px) {
  .page, .site-header nav { margin-left: 36px; margin-right: 36px; }
  .about-body { grid-template-columns: minmax(0,1fr) 190px; gap: 36px; }
  .pub-group { grid-template-columns: 104px minmax(0,1fr); gap: 22px; }
  .paper { grid-template-columns: 130px minmax(0,1fr); gap: 20px; }
}
@media(max-width:760px) {
  .page, .site-header nav { margin-left: 26px; margin-right: 26px; }
  body { font-size: 16px; }
  .hero { height: 230px; }
  h1 { font-size: 40px; }
  .about-body { grid-template-columns: minmax(0,1fr) 150px; gap: 26px; }
  .biography p { font-size: 16px; }
  .pub-group { grid-template-columns: 86px minmax(0,1fr); gap: 20px; }
  .period { font-size: 12px; }
  .group-title { font-size: 18px; }
  .paper { grid-template-columns: 110px minmax(0,1fr); gap: 16px; }
  .paper h4 { font-size: 17px; }
  .authors { font-size: 14px; }
  .pub-group.timeline .group-content:before { left: -18px; }
  .pub-group.timeline .group-content:after { left: -22px; }
  .experience-row { grid-template-columns: 150px 1fr auto; gap: 12px; }
  .location { font-size: 12px; }
}
@media(max-width:560px) {
  .page, .site-header nav { margin-left: 20px; margin-right: 20px; }
  .site-header nav { min-height: 54px; gap: 18px; font-size: 13.5px; }
  .nav-links { gap: 18px; }
  .hero { margin-top: 6px; height: 180px; }
    .about { padding-top: 28px; position: relative; }
  h1 { font-size: 34px; max-width: calc(100% - 96px); }
  .subtitle { font-size: 15px; max-width: calc(100% - 96px); }
  .about-body { display: flex; flex-direction: column; gap: 0; margin-top: 26px; }
  .profile { display: contents; }
  .portrait-stack { width: 80px; position: absolute; right: 0; top: 26px; }
  .portrait-toggle { position: absolute; right: 0; top: 0; margin: 0; padding: 1px 6px; font-size: 8.5px; gap: 3px; }
  .portrait-toggle svg { width: 10px; height: 10px; }
  .portrait-stack { top: 26px; }
  .social-links { justify-content: flex-start; margin-top: 20px; font-size: 13.5px; gap: 22px; }
  .biography p { font-size: 16px; line-height: 1.75; margin-bottom: 14px; }
  .section { margin-top: 52px; }
  h2 { font-size: 24px; }
  .publication-toolbar { gap: 10px; }
  .search input { width: 130px; font-size: 13px; }
  .pub-group { display: block; margin-top: 30px; }
  .period { margin-bottom: 8px; font-size: 12px; }
  .period span { padding: 0; position: static; }
  .group-title { font-size: 18px; margin-bottom: 0; }
  .pub-group.timeline .group-content:before, .pub-group.timeline .group-content:after { display: none; }
  .pub-group + .pub-group { border-top: 1px solid var(--line-strong); padding-top: 24px; }
  .paper { grid-template-columns: minmax(0,1fr); padding: 22px 0 24px; gap: 10px; }
  /* Phones: badge only, no thumbnail. */
  .paper-side { flex-direction: row; align-items: flex-start; gap: 14px; }
  .preview, .no-preview { display: none; }
  .paper h4 { font-size: 17px; line-height: 1.5; }
  .paper-actions { gap: 8px 14px; font-size: 11.5px; }
  .abstract { margin-top: 12px; padding: 14px; font-size: 14px; }
  .experience-row { grid-template-columns: 1fr auto; gap: 4px 14px; padding: 18px 0; }
  .experience-date { grid-column: 1 / -1; font-size: 12px; }
  .location { font-size: 11px; }
  .experience-row h3 { font-size: 16.5px; }
  .experience-row p { font-size: 14px; }
  .talk-list { max-height: 360px; }
  .talk { grid-template-columns: 62px minmax(0,1fr); gap: 14px; font-size: 15px; }
  .talk time { font-size: 12px; }
  .talk div span { font-size: 12.5px; }
  footer { font-size: 12px; gap: 13px; margin-top: 48px; }
  }
@media(max-width:360px) {
  .page, .site-header nav { margin-left: 16px; margin-right: 16px; }
  .search input { width: 105px; }
  h1 { font-size: 30px; }
  .portrait-stack { width: 68px; }
  .portrait-toggle { top: 100px; }
}
@media(prefers-reduced-motion:reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
