:root {
  --paper: #fbfbfb;
  --ink: #191b21;
  --muted: #626b7a;
  --line: #dfe3ea;
  --blue: #164be6;
  --blue-soft: #edf2ff;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --serif: "EB Garamond", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "DM Mono", "Courier New", monospace;
  --shell: min(1180px, calc(100% - 5rem));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6.5rem; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--serif); font-size: 18px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
::selection { color: var(--ink); background: #dbe5ff; }
a { color: inherit; text-decoration: none; transition: color 180ms ease; }
button { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
button:not(:disabled), summary { cursor: pointer; }
a:focus-visible, button:focus-visible, summary:focus-visible, pre:focus-visible { outline: 2px solid var(--blue); outline-offset: 5px; border-radius: 3px; }
button[hidden] { display: none; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.035em; text-wrap: balance; }
h1 { margin-bottom: 1.25rem; font-size: clamp(3.8rem, 7vw, 5.75rem); line-height: 0.96; letter-spacing: -0.055em; }
h2 { font-size: clamp(2.8rem, 4.5vw, 4.2rem); line-height: 1.03; }
h3 { font-size: 1.6rem; line-height: 1.15; }
.page-shell { width: var(--shell); margin-inline: auto; }
.skip-link { position: fixed; top: 1rem; left: 1rem; z-index: 30; padding: 0.6rem 1rem; color: var(--blue); background: var(--paper); font-family: var(--sans); transform: translateY(-200%); }
.skip-link:focus { transform: none; }

/* ── Navigation ──────────────────────────────────── */
.site-header { display: grid; grid-template-columns: 1fr auto auto; gap: clamp(1.5rem, 4vw, 4rem); align-items: center; min-height: 6.5rem; }
.site-name { display: grid; place-items: center; width: 2rem; height: 2rem; color: var(--blue); }
.site-name .network-mark { width: 1.65rem; height: 1.65rem; }
.header-description, .site-nav, .section-label, .section-marker, .location, .mono-kicker, .paper-topline, .paper-year, .paper-bottomline, .figure-label, .timeline-date, .page-footer, .reading-bar { font-family: var(--mono); font-size: 0.69rem; font-weight: 400; line-height: 1.6; }
.header-description { color: var(--muted); }
.header-description a { color: var(--ink); font-weight: 500; }
.site-nav, .bar-nav { display: flex; gap: 1.5rem; align-items: center; }
.site-nav a, .bar-nav a { padding-block: 0.5rem; }
.site-nav a:first-child { color: var(--blue); }
.site-name:hover, .header-description a:hover, .site-nav a:hover, .bar-nav a:hover, .page-footer a:hover { color: var(--blue); }
.section-marker, .section-label { color: var(--blue); }
.section-label { margin-bottom: 1.9rem; }

/* ── Introduction ────────────────────────────────── */
.intro { padding-top: 2.5rem; padding-bottom: clamp(8rem, 12vw, 10rem); }
.intro-topline { display: flex; justify-content: space-between; align-items: baseline; }
.location { color: var(--muted); }
.intro-layout { position: relative; display: flex; align-items: center; min-height: clamp(33rem, 66svh, 42rem); padding-block: 2.75rem 3.5rem; isolation: isolate; }
.intro-center { position: relative; z-index: 1; width: min(46rem, calc(100% - 2rem)); margin-inline: auto; padding: clamp(1.6rem, 2.8vw, 2.15rem); border: 1px solid #8ea7d12e; border-radius: 1.7rem; background: linear-gradient(145deg, #ffffff55, #ffffff18 58%, #edf3ff30); box-shadow: inset 0 1px #ffffffd9, 0 20px 60px #28407812; backdrop-filter: blur(8px) saturate(135%); -webkit-backdrop-filter: blur(8px) saturate(135%); }
.mono-kicker { margin-bottom: 1rem; color: var(--muted); font-size: 0.65rem; }
.intro-lede { max-width: 41rem; margin-bottom: 0.95rem; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.28; letter-spacing: -0.02em; }
.intro-affiliation { max-width: 41rem; color: var(--muted); font-size: 1.02rem; line-height: 1.58; }
.intro-affiliation a { color: var(--muted); text-decoration: underline; text-decoration-color: #626b7a50; text-underline-offset: 3px; }
.intro-affiliation a:hover { color: var(--ink); text-decoration-color: currentColor; }
.link-row { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; }
.hero-links { margin-top: 1.35rem; }
.inline-link, summary, .timeline-link { color: var(--blue); font-family: var(--mono); font-size: 0.72rem; line-height: 1.6; }
.inline-link { display: inline-flex; align-items: baseline; gap: 0.45rem; text-decoration: underline; text-decoration-color: #164be655; text-underline-offset: 5px; transition: color 180ms, text-decoration-color 180ms; }
.inline-link:hover { text-decoration-color: currentColor; }
.inline-link > span { display: inline-block; transition: transform 240ms var(--ease); }
.inline-link:hover > span { transform: translate(2px, -2px); }
.secondary-link { color: var(--muted); text-decoration-color: #626b7a40; }
.secondary-link:hover { color: var(--blue); }
.intro-visual { position: absolute; z-index: 0; top: -0.5rem; bottom: 0; left: 50%; width: min(1200px, calc(100vw - 2rem)); overflow: hidden; contain: paint; cursor: crosshair; transform: translateX(-50%); }
.intro-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ── Publications ────────────────────────────────── */
.section { position: relative; padding-block: clamp(5.5rem, 9vw, 8.5rem); }
.section-publications { border-top: 1px solid var(--line); }
.section + .section { border-top: 1px solid var(--line); }
.section-heading { margin-bottom: 3rem; }
.paper-featured { padding: clamp(1.5rem, 3vw, 2.8rem); border: 1px solid #d5deef; border-radius: 1rem; background: linear-gradient(125deg, #f4f7fd 0%, #fcfdff 70%); }
.paper-topline { display: flex; flex-wrap: wrap; gap: 0.65rem 0.85rem; align-items: center; margin-bottom: 1.9rem; }
.venue-badge { display: inline-block; padding: 0.4rem 0.8rem; border: 1px solid #164be63d; border-radius: 5px; color: var(--blue); background: var(--blue-soft); font-size: 0.8rem; font-weight: 500; }
.venue-status { color: var(--muted); font-size: 0.65rem; }
.paper-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 0.64fr); gap: clamp(1.5rem, 3vw, 3rem); align-items: center; }
.paper-featured h3 { max-width: 42rem; font-size: clamp(2rem, 3.1vw, 2.7rem); line-height: 1.12; text-wrap: pretty; }
.paper-featured h3 > span { color: #424b5e; }
.paper-authors { margin-top: 1rem; color: var(--muted); font-family: var(--sans); font-size: 0.75rem; line-height: 1.7; }
.paper-authors a:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.paper-description { max-width: 39rem; margin-top: 1rem; color: #505c6e; font-size: 1.07rem; line-height: 1.55; }
.paper-details { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.75rem; margin-top: 1.4rem; }
.upcoming-link { color: var(--muted); text-decoration-color: #626b7a40; }
.coming-soon { color: var(--muted); font-family: var(--mono); font-size: 0.61rem; line-height: 1.6; }
summary { display: flex; align-items: center; gap: 0.75rem; width: fit-content; padding-block: 0.35rem; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary > span { transition: transform 220ms var(--ease); }
details[open] > summary > span { transform: rotate(45deg); }
.paper-figure { padding: 1rem 0; }
.swm-animation { display: block; width: 100%; max-width: 25rem; height: auto; aspect-ratio: 23 / 20; margin: 0.6rem auto 0; }
.swm-animation:focus-visible { outline: 2px solid var(--blue); outline-offset: -3px; }
.paper-bottomline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid #dfe5ef; color: var(--muted); font-size: 0.61rem; }
.paper-scope { color: #5b6882; }
.paper-row { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 2.5rem; margin-top: 2rem; padding: 2rem 0.5rem 0; }
.paper-year { padding-top: 0.25rem; color: var(--ink); }
.paper-year > span { display: block; margin-top: 0.45rem; color: var(--muted); font-size: 0.62rem; }
.paper-row h3 { max-width: 47rem; font-size: clamp(1.55rem, 2.4vw, 2rem); line-height: 1.16; text-wrap: pretty; }
.paper-row .paper-authors { margin-top: 0.75rem; }
.paper-row .paper-description { margin-top: 0.8rem; }
.paper-links { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 1.8rem; margin-top: 1.1rem; }
.citation-details { flex: 1; min-width: 0; }
.citation-details pre { max-width: 100%; overflow-x: auto; margin: 0.8rem 0 0; padding: 1rem; border: 1px solid var(--line); border-radius: 0.5rem; color: #425169; background: #f1f4f9; font-family: var(--mono); font-size: 0.68rem; line-height: 1.7; tab-size: 2; }

/* ── Research and repositories ───────────────────── */
.section-prose { max-width: 42rem; margin-top: 1.2rem; color: var(--muted); font-size: 1.13rem; line-height: 1.6; }
.research-layout { display: grid; grid-template-columns: minmax(0, 0.65fr) minmax(0, 1.35fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.research-layout .section-heading { margin-bottom: 0; }
.project-list { border-top: 1px solid var(--line); }
.project-row { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 1rem clamp(1.5rem, 3vw, 2.5rem); align-items: start; padding-block: 1.8rem; border-bottom: 1px solid var(--line); }
.project-row h3 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); line-height: 1.18; text-wrap: pretty; }
.project-meta { margin-top: 0.6rem; color: var(--muted); font-family: var(--sans); font-size: 0.72rem; line-height: 1.6; }
.project-description { max-width: 44rem; color: var(--muted); font-size: 1.07rem; line-height: 1.55; }
.project-links { margin-top: 1rem; }
.all-repositories { margin-top: 1.5rem; }
.section-anchor { position: absolute; top: 0; }

/* ── Background and contact ──────────────────────── */
.section-layout { display: grid; grid-template-columns: minmax(0, 0.67fr) minmax(0, 1.33fr); gap: clamp(3rem, 7vw, 7rem); }
.timeline { border-top: 1px solid var(--line); }
.timeline-row { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 1.8rem; padding-block: 1.5rem; border-bottom: 1px solid var(--line); }
.timeline-date { padding-top: 0.2rem; color: var(--muted); font-size: 0.65rem; }
.timeline-date > span { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.58rem; line-height: 1.7; }
.timeline-current .timeline-date { color: var(--blue); }
.timeline-current .timeline-date > span::before { display: inline-block; width: 5px; height: 5px; margin-right: 0.5rem; margin-bottom: 1px; border-radius: 50%; background: var(--blue); content: ""; }
.timeline-row h3 { margin-bottom: 0.35rem; font-size: 1.4rem; line-height: 1.15; text-wrap: pretty; }
.timeline-row p { margin-bottom: 0.5rem; color: #475877; font-family: var(--mono); font-size: 0.65rem; line-height: 1.6; }
.timeline-row > div:not(.timeline-date) > span { color: var(--muted); font-size: 0.97rem; line-height: 1.5; }
.timeline-row a:not(.timeline-link) { text-decoration: underline; text-decoration-color: #626b7a50; text-underline-offset: 3px; }
.timeline-row a:not(.timeline-link):hover { color: var(--blue); }
.timeline-link { display: block; width: fit-content; margin-top: 0.75rem; color: var(--muted); font-size: 0.64rem; }
.timeline-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.contact-content h2 { margin-bottom: 0.6rem; }
.contact-channels { text-align: center; }
.contact-channels .link-row { justify-content: center; }
.contact-email { display: inline-block; max-width: 100%; margin-block: 1rem 1.8rem; color: var(--blue); font-size: clamp(1.2rem, 2.1vw, 1.65rem); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.contact-email > span { display: inline-block; margin-left: 0.2rem; font-size: 1.1rem; transition: transform 240ms var(--ease); }
.contact-email:hover > span { transform: translate(2px, -2px); }
.contact-alt-email { margin: -1rem 0 1.8rem; color: var(--muted); font-family: var(--sans); font-size: 0.9rem; line-height: 1.6; overflow-wrap: anywhere; }
.contact-alt-email a { color: var(--muted); text-decoration: underline; text-decoration-color: #626b7a50; text-underline-offset: 3px; }
.contact-alt-email a:hover { color: var(--blue); text-decoration-color: currentColor; }
.contact-section .section-layout { grid-template-columns: minmax(0, 0.45fr) minmax(0, 1.55fr); gap: clamp(2rem, 5vw, 4rem); }
.page-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-block: 1.5rem 2.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.62rem; }

/* ── Reading navigation and motion ───────────────── */
.reading-bar { position: fixed; top: 1rem; left: 50%; z-index: 10; display: flex; justify-content: space-between; gap: 2.5rem; align-items: center; width: min(42rem, calc(100% - 2rem)); min-height: 3.4rem; padding: 0.5rem 1.4rem; border: 1px solid #dfe3ead9; border-radius: 0.85rem; background: #fbfbfbf2; box-shadow: 0 5px 24px #2332500b; opacity: 0; visibility: hidden; transform: translate(-50%, -1rem); transition: opacity 300ms, transform 450ms var(--ease), visibility 300ms; }
.reading-bar.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.bar-name { display: grid; flex: 0 0 1.5rem; place-items: center; width: 1.5rem; height: 1.7rem; color: var(--blue); }
.network-mark { display: block; width: 1.45rem; height: 1.45rem; overflow: visible; }
.network-edges { fill: none; stroke: #aeb8c7; stroke-linecap: round; stroke-width: 0.85; }
.network-input { fill: var(--paper); stroke: #748095; stroke-width: 1.05; }
.network-input.network-filled { fill: var(--ink); stroke: var(--ink); }
.network-hidden { fill: #e4eaf2; stroke: #8795a9; stroke-width: 0.9; }
.network-output { fill: var(--ink); stroke: var(--paper); stroke-width: 0.65; }
.bar-nav { gap: 1.4rem; color: var(--muted); }
.bar-nav a[aria-current="location"] { color: var(--blue); }
.progress-line { position: absolute; bottom: -4px; left: 1.3rem; right: 1.3rem; height: 9px; overflow: hidden; pointer-events: none; }
.progress-line::before { position: absolute; top: calc(50% - 0.5px); right: 0; left: 0; height: 1px; background-image: radial-gradient(circle, #939eaf 0.7px, transparent 0.85px); background-size: 5px 1px; content: ""; }
#progress-fill { position: absolute; top: calc(50% - 0.75px); left: 0; z-index: 1; width: 100%; height: 1.5px; border-radius: 2px; background: var(--blue); transform: scaleX(0); transform-origin: left; }
.reveal { transition: opacity 650ms var(--ease), transform 650ms var(--ease), border-color 250ms, box-shadow 250ms; }
.reveal.is-pending { opacity: 0; transform: translateY(14px); }
@media (hover: hover) and (pointer: fine) {
  .theme-row:hover { border-color: #c1ceeb; box-shadow: 0 7px 22px #233f7707; transform: translateY(-2px); }
}

/* ── Responsive layout ───────────────────────────── */
@media (max-width: 1000px) {
  .site-header { grid-template-columns: 1fr auto; gap: 0.5rem 1.5rem; padding-block: 1.5rem; }
  .header-description { grid-column: 1; grid-row: 2; font-size: 0.6rem; }
  .site-nav { grid-column: 2; grid-row: 1 / 3; }
  .intro-center { width: min(44rem, calc(100% - 2rem)); }
  h1 { font-size: clamp(3.6rem, 7vw, 5.25rem); }
  .paper-layout { gap: 1.5rem; grid-template-columns: minmax(0, 1fr) minmax(260px, 0.55fr); }
  .section-layout { grid-template-columns: minmax(0, 0.6fr) minmax(0, 1.4fr); gap: 3rem; }
  .timeline-row { grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1.1rem; }
}
@media (max-width: 760px) {
  :root { --shell: min(100% - 2.5rem, 40rem); }
  html { scroll-padding-top: 6rem; }
  .site-header { padding-block: 1.3rem; }
  .site-nav { gap: 1rem; font-size: 0.63rem; }
  .header-description { font-size: 0.56rem; }
  .header-description span { display: none; }
  .intro { padding-top: 1.7rem; padding-bottom: 6rem; }
  .intro-layout { flex-direction: column; gap: 1.25rem; min-height: 0; padding-block: 1.8rem 1.5rem; }
  .intro-center { width: min(100%, 42rem); padding: 1.6rem; }
  .intro-visual { position: relative; order: 1; top: auto; bottom: auto; left: auto; flex-shrink: 0; width: 100%; height: clamp(10rem, 30vw, 13rem); transform: none; }
  h1 { font-size: clamp(3.45rem, 10.5vw, 5rem); }
  .intro-lede { font-size: clamp(1.55rem, 5.3vw, 2rem); }
  .section { padding-block: 4.75rem; }
  .section-label { margin-bottom: 1.4rem; font-size: 0.65rem; }
  .section-heading { margin-bottom: 2rem; }
  h2 { font-size: clamp(2.65rem, 7.6vw, 3.7rem); }
  .paper-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .paper-featured { padding: 1.6rem; }
  .paper-featured h3 { font-size: clamp(1.9rem, 5.7vw, 2.65rem); }
  .paper-topline { margin-bottom: 1.5rem; }
  .paper-figure { max-width: 25rem; width: 100%; margin-inline: auto; padding: 1.2rem 0 0; border-top: 1px solid #dfe5ef; }
  .paper-bottomline { margin-top: 1.2rem; font-size: 0.56rem; }
  .paper-row { grid-template-columns: 1fr; gap: 0.8rem; margin-top: 1.5rem; padding: 1.5rem 0 0; }
  .paper-year { display: flex; gap: 0.75rem; align-items: baseline; }
  .paper-year > span { margin: 0; }
  .paper-row h3 { font-size: 1.75rem; }
  .section-layout { grid-template-columns: 1fr; gap: 2.5rem; }
  .section-prose { max-width: 34rem; }
  .research-layout { grid-template-columns: 1fr; gap: 2rem; }
  .project-row { grid-template-columns: 1fr; gap: 0.85rem; padding-block: 1.5rem; }
  .project-body { padding-left: 1rem; border-left: 1px solid var(--line); }
  .timeline-row { grid-template-columns: 7rem minmax(0, 1fr); gap: 1.5rem; }
  .contact-section .section-layout { grid-template-columns: 1fr; gap: 0; }
  .contact-email { font-size: 1.3rem; }
  .reading-bar { gap: 1rem; min-height: 3.2rem; padding-inline: 1rem; }
  .bar-nav { gap: 1.35rem; font-size: 0.65rem; }
}
@media (max-width: 400px) {
  :root { --shell: calc(100% - 2rem); }
  .site-nav { gap: 0.75rem; font-size: 0.6rem; }
  .location, .section-marker { font-size: 0.59rem; }
  .mono-kicker { font-size: 0.58rem; }
  h1 { font-size: 3.2rem; }
  .intro-center { padding: 1.4rem 1.2rem; }
  .hero-links { gap: 1.15rem; }
  .hero-links .inline-link { font-size: 0.66rem; }
  .paper-featured { padding: 1.25rem; }
  .timeline-row { grid-template-columns: 1fr; gap: 0.5rem; }
  .timeline-date { display: flex; gap: 0.75rem; align-items: baseline; }
  .timeline-date > span { margin-top: 0; }
  .timeline-date br { display: block; }
  .reading-bar { gap: 0.5rem; padding-inline: 0.75rem; }
  .bar-nav { gap: 0.7rem; font-size: 0.6rem; }
  .page-footer { gap: 0.7rem; font-size: 0.57rem; }
  .page-footer > span:nth-child(2) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .intro-visual { cursor: default; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal.is-pending { opacity: 1; transform: none; }
  .inline-link:hover > span, .contact-email:hover > span { transform: none; }
}
