/* ==========================================================================
   adivakaruni.github.io
   The "instrument" palette: a cool high-key ground, one cobalt accent for
   everything clickable, teal for where the work landed and amber reserved for
   status. IBM Plex Sans for reading, IBM Plex Mono for data and labels.
   Self-contained: no theme CSS, no icon fonts, no web-font requests to Google.
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("../fonts/plex-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("../fonts/plex-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: italic;
  font-weight: 100 700;
  font-display: swap;
  src: url("../fonts/plex-sans-latin-italic.woff2") format("woff2");
}
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/plex-mono-latin-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/plex-mono-latin-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/plex-mono-latin-600.woff2") format("woff2"); }

/* ---------- Palette ---------- */
:root {
  color-scheme: only light;
  --bg:          #f3f5f9;
  --panel:       #ffffff;
  --tint:        #f4f6fe;
  --ink:         #0b1017;
  --body:        #4a5665;
  --muted:       #687584;
  --accent:      #2743e0;
  --accent-soft: rgba(39, 67, 224, 0.10);
  --venue:       #0a7a68;
  --venue-soft:  rgba(10, 122, 104, 0.10);
  --signal:      #b45309;
  --signal-soft: rgba(180, 83, 9, 0.10);
  --rule:        #e4e8ef;
  --rule-2:      #cfd6e1;
  --on-accent:   #ffffff;
  --shadow:      0 1px 2px rgba(11, 16, 23, 0.04), 0 12px 32px -20px rgba(15, 29, 69, 0.35);
  --pop-shadow:  0 2px 6px rgba(11, 16, 23, 0.08), 0 24px 48px -16px rgba(15, 29, 69, 0.45);

  /* The profile column: light, with a faint cobalt wash and the teal name */
  --side-top:    #eaf0fd;
  --side-bottom: #ffffff;
  --name:        #0b6e6e;

  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem;

  --side-w: 18.5rem;
  --right: 17.5rem;
  --prose: 42rem;
}
/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--body);
  font-family: var(--sans); font-size: 1rem; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
svg { fill: currentColor; }
main:focus { outline: none; }
::selection { background: var(--accent); color: #fff; }
a { color: var(--accent); text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px;
}
.skip {
  position: absolute; left: var(--s4); top: -3rem; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: var(--s2) var(--s3); border-radius: 3px;
  font-family: var(--mono); font-size: 0.75rem;
}
.skip:focus { top: var(--s3); }

/* ---------- Shell: navy profile column | stage ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }

.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--side-top) 0%, var(--side-bottom) 55%);
  border-right: 1px solid var(--rule);
  color: var(--body);
  scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent;
}
.side::before { /* a thin cobalt edge along the top */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--accent);
}
.side__inner { min-height: 100%; display: flex; flex-direction: column; padding: var(--s6) 1.75rem var(--s5); }
.side__photo img {
  width: 7.25rem; height: 7.25rem; object-fit: cover; object-position: 50% 22%;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 1px var(--rule-2), 0 0 0 7px rgba(39, 67, 224, 0.07), 0 14px 30px -16px rgba(15, 29, 69, 0.45);
}
.side__id { margin-top: var(--s4); }
.side__name { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
.side__name a { color: var(--name); transition: color 0.15s ease; }
.side__name a:hover { color: var(--accent); }
.side__role { margin-top: var(--s2); font-size: 0.875rem; line-height: 1.45; color: var(--ink); }
.side__role a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); transition: border-color 0.15s ease; }
.side__role a:hover { border-bottom-color: var(--accent); }
.side__place {
  margin-top: var(--s2); display: flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.06em; color: var(--muted);
}
.side__place svg { width: 0.65rem; height: 0.65rem; }
.side__lede {
  margin-top: var(--s4); padding-left: var(--s3);
  border-left: 2px solid var(--accent);
  font-size: 0.8125rem; line-height: 1.55; color: var(--body);
}
.side__cv {
  margin-top: var(--s5); align-self: flex-start;
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--mono); font-size: 0.625rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--on-accent); background: var(--accent); border: 1px solid var(--accent);
  padding: 0.6em 0.95em; border-radius: 3px;
  box-shadow: 0 8px 18px -12px rgba(39, 67, 224, 0.8);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.side__cv svg { width: 0.75rem; height: 0.75rem; }
.side__cv:hover { background: var(--panel); color: var(--accent); }
.side__links {
  list-style: none; margin-top: var(--s5); padding-top: var(--s4);
  border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.2rem var(--s3);
}
.side__links a {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.22rem 0;
  font-size: 0.8125rem; color: var(--body); transition: color 0.15s ease;
}
.side__links svg { width: 0.85rem; height: 0.85rem; flex: none; color: var(--muted); transition: color 0.15s ease; }
.side__links a:hover, .side__links a:hover svg { color: var(--accent); }
.side__foot {
  margin-top: auto; padding-top: var(--s6);
  font-family: var(--mono); font-size: 0.5625rem; letter-spacing: 0.05em; color: var(--muted);
}
.side__foot a { color: var(--muted); border-bottom: 1px solid var(--rule-2); }
.side__foot a:hover { color: var(--accent); }

/* ---------- Stage: papers sheet | widgets ---------- */
.stage {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--right); column-gap: var(--s5);
  align-items: start;
  max-width: 78rem; width: 100%; margin: 0 auto;
  padding: var(--s5) var(--s6) var(--s6);
}
.sheet {
  background: var(--panel); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0 var(--s5) var(--s4);
  min-width: 0;
}

/* Tabs */
.tabs {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s4);
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
  margin: 0 calc(-1 * var(--s5)); padding: 0 var(--s4) 0 var(--s5);
  border-radius: 10px 10px 0 0;
}
.tabs__list { display: flex; gap: var(--s5); flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs__list::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.95rem 0 0.85rem;
  font-family: var(--mono); font-size: 0.6875rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
  color: var(--muted); transition: color 0.15s ease;
}
.tab:hover { color: var(--ink); }
.tab__count {
  min-width: 1.35rem; text-align: center;
  font-size: 0.5625rem; font-weight: 600; letter-spacing: 0.02em; line-height: 1.6;
  color: var(--muted); background: var(--bg); border-radius: 999px; padding: 0 0.4rem;
  font-variant-numeric: tabular-nums;
}
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent);
}
.tab[aria-selected="true"] .tab__count { color: var(--on-accent); background: var(--accent); }
.panel { padding-top: var(--s3); }
.panel__title {
  font-family: var(--mono); font-size: 0.6875rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.2em; color: var(--accent);
  margin: var(--s5) 0 var(--s2);
}
.js .panel__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.js .panel:not(.is-active) { display: none; }

/* ---------- Paper list: a mono index in the gutter, a hairline rail ---------- */
.pub-list { list-style: decimal; padding-left: 1.85rem; margin: 0; }
.pub-list--plain { list-style: none; }
.pub-list > li {
  position: relative;
  border-left: 1px solid var(--rule);
  padding: 0.6rem 0.8rem 0.65rem;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.pub-list > li:hover { background: var(--tint); border-left-color: var(--accent); }
.pub-list > li::marker { font-family: var(--mono); font-size: 0.6875rem; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.pub-list > li:hover::marker { color: var(--accent); }

.publication-title { display: block; font-size: 0.96875rem; font-weight: 600; line-height: 1.32; letter-spacing: -0.012em; color: var(--ink); text-wrap: pretty; }
.publication-title a { color: inherit; transition: color 0.15s ease; }
.publication-title a:hover { color: var(--accent); }
.status {
  display: inline-block; white-space: nowrap; vertical-align: 0.12em; margin-left: var(--s2);
  font-family: var(--mono); font-size: 0.5625rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.18em 0.45em; border-radius: 2px;
}
.status--review   { color: var(--signal); background: var(--signal-soft); }
.status--accepted { color: var(--venue);  background: var(--venue-soft); }

.meta { display: block; margin-top: 0.15rem; font-size: 0.8125rem; line-height: 1.4; }
.meta:empty { display: none; }
.venue { font-family: var(--mono); font-size: 0.75rem; font-weight: 500; color: var(--venue); }
.venue + .authors::before { content: "·"; margin: 0 0.45rem; color: var(--rule-2); }
.authors { color: var(--body); }
.authors a { color: var(--body); border-bottom: 1px solid var(--rule-2); transition: border-color 0.15s ease, color 0.15s ease; }
.authors a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.dates { display: block; margin-top: 0.05rem; font-family: var(--mono); font-size: 0.625rem; line-height: 1.4; color: var(--muted); font-variant-numeric: tabular-nums; }

.pub-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.35rem; margin-top: 0.4rem; }
.pub-links a {
  font-family: var(--mono); font-size: 0.59375rem; font-weight: 500; line-height: 1.4;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink); background: var(--panel);
  border: 1px solid var(--rule-2); border-radius: 2px; padding: 0.2em 0.5em;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.pub-links a:hover { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.pub-links a.media { color: var(--muted); border-color: var(--rule); }
.pub-links a.media:hover { color: var(--on-accent); }
.media-label { margin-left: 0.4rem; font-family: var(--mono); font-size: 0.5625rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }

.abstract-toggle, .fig-toggle {
  display: none; align-items: center; gap: 0.4rem;
  padding: 0; border: 0; background: none; cursor: pointer;
  font-family: var(--mono); font-size: 0.625rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.js .abstract-toggle, .js .fig-toggle { display: inline-flex; }
.abstract-toggle { margin-right: 0.3rem; }
.abstract-toggle::before {
  content: ""; width: 0; height: 0;
  border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform 0.18s ease;
}
.abstract-toggle:hover, .abstract-toggle[aria-expanded="true"] { color: var(--accent); }
.abstract-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }

/* The designated hover target for a paper's key figure */
.fig-toggle {
  margin-right: 0.3rem; padding: 0.22em 0.55em; border-radius: 2px;
  color: var(--accent); background: var(--accent-soft); cursor: zoom-in;
}
.fig-toggle svg { width: 0.75rem; height: 0.75rem; }
.fig-toggle:hover, .fig-toggle[aria-expanded="true"] { color: var(--on-accent); background: var(--accent); }

.fig-count {
  margin-left: 0.1rem; min-width: 1.1rem; padding: 0 0.3rem; border-radius: 999px; text-align: center;
  font-size: 0.5625rem; font-weight: 600; line-height: 1.5; letter-spacing: 0;
  color: var(--accent); background: var(--panel);
}
.fig-toggle:hover .fig-count, .fig-toggle[aria-expanded="true"] .fig-count { color: var(--accent); background: #ffffff; }

/* Looping slideshow of a paper's key figures or main tables */
.figpop {
  margin-top: 0.6rem; max-width: 42rem;
  background: var(--panel); border: 1px solid var(--rule-2); border-radius: 8px;
  padding: 0.6rem 0.65rem 0.55rem;
}
.slide + .slide { margin-top: 1rem; }
.slide figcaption { padding: 0 0.15rem 0.45rem; font-size: 0.75rem; line-height: 1.4; color: var(--body); }
.slide figcaption b { font-family: var(--mono); font-size: 0.625rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.slide__img img { width: 100%; height: auto; border-radius: 4px; background: #fff; }
.figpop__nav { display: none; }

.js .figpop {
  position: absolute; z-index: 40; margin: 0;
  width: min(42rem, calc(100vw - 1.5rem));
  box-shadow: var(--pop-shadow);
}
.js .figpop--tables { width: min(46rem, calc(100vw - 1.5rem)); }
.js .figpop:not(.is-open) { display: none; }
.js .figpop__frame { position: relative; height: min(29rem, 62vh); }
.js .figpop--tables .figpop__frame { height: min(31rem, 64vh); }
.js .slide {
  position: absolute; inset: 0; margin: 0; display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}
.js .slide.is-current { opacity: 1; visibility: visible; transition: opacity 0.35s ease; }
.js .slide__img { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.js .figpop--figures .slide__img img { width: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
/* Tables are read, not glanced at: full width, scroll if tall. */
.js .figpop--tables .slide__img { align-items: flex-start; overflow-y: auto; }
.js .figpop__nav {
  position: relative; display: flex; align-items: center; gap: 0.5rem;
  margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--rule);
}
.figpop__step {
  width: 1.6rem; height: 1.6rem; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--rule-2); border-radius: 4px; background: var(--panel); cursor: pointer;
  font-size: 1rem; line-height: 1; color: var(--ink);
}
.figpop__step:hover { border-color: var(--accent); color: var(--accent); }
.figpop__dots { display: flex; gap: 0.3rem; }
.dot { width: 0.5rem; height: 0.5rem; padding: 0; border: 0; border-radius: 50%; background: var(--rule-2); cursor: pointer; }
.dot.is-current { background: var(--accent); }
.figpop__count { margin-left: auto; font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.04em; color: var(--muted); }
.figpop__timer { position: absolute; left: 0; top: -1px; height: 2px; width: 0; background: var(--accent); opacity: 0.55; }
.figpop.is-playing .figpop__timer { animation: slide-timer var(--slide-ms, 4500ms) linear forwards; }
@keyframes slide-timer { from { width: 0; } to { width: 100%; } }
@media (prefers-reduced-motion: no-preference) {
  .js .figpop.is-open { animation: pop 0.14s ease-out; }
  @keyframes pop { from { opacity: 0; transform: translateY(4px); } }
}

.abstract {
  max-width: var(--prose); margin-top: 0.45rem; padding: 0.6rem 0.8rem;
  background: var(--tint); border-radius: 4px;
  font-size: 0.8125rem; line-height: 1.6; color: var(--body);
}
.js .abstract:not(.is-open) { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .abstract.is-open { animation: unfold 0.18s ease-out; }
  @keyframes unfold { from { opacity: 0; transform: translateY(-3px); } }
}

/* About tab */
.prose { max-width: var(--prose); padding: var(--s3) 0 var(--s2) 0.1rem; }
.prose p { font-size: 0.9375rem; line-height: 1.62; color: var(--body); }
.prose p + p { margin-top: var(--s3); }
.prose a { border-bottom: 1px solid var(--accent-soft); transition: border-color 0.15s ease; }
.prose a:hover { border-bottom-color: var(--accent); }

/* ---------- Widgets ---------- */
.widgets { position: sticky; top: var(--s5); display: grid; gap: var(--s3); }
.widget {
  background: var(--panel); border: 1px solid var(--rule); border-top: 3px solid var(--accent);
  border-radius: 8px; box-shadow: var(--shadow);
  padding: 0.8rem 0.95rem 0.9rem;
}
.widget__kicker {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.5625rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted);
}
.widget__badge {
  display: inline-flex; align-items: center; gap: 0.35em;
  font-weight: 600; color: var(--on-accent); background: var(--accent);
  padding: 0.25em 0.45em; border-radius: 2px;
}
.widget__badge::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.widget__title { margin-top: 0.4rem; font-size: 0.9375rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.012em; }
.widget__title a { color: var(--ink); transition: color 0.15s ease; }
.widget__title a:hover { color: var(--accent); }
.widget__desc { margin-top: 0.35rem; font-size: 0.75rem; line-height: 1.45; color: var(--body); }
.widget__try { margin-top: 0.4rem; font-size: 0.75rem; line-height: 1.45; color: var(--muted); }
.widget__try a { border-bottom: 1px solid var(--accent-soft); }
.widget__try a:hover { border-bottom-color: var(--accent); }
.widget__go {
  margin-top: 0.6rem; display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--mono); font-size: 0.59375rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
}
.widget__go::after { content: "→"; transition: transform 0.15s ease; }
.widget__go:hover::after { transform: translateX(3px); }

.stat { margin-top: 0.55rem; padding: 0.55rem 0.7rem 0.6rem; background: var(--tint); border-radius: 6px; }
.stat[hidden] { display: none; }
.stat__value { font-family: var(--sans); font-size: 2rem; font-weight: 600; line-height: 1.05; letter-spacing: -0.03em; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat__label { margin-top: 0.2rem; font-size: 0.71875rem; line-height: 1.35; color: var(--ink); }
.stat__note { margin-top: 0.25rem; font-family: var(--mono); font-size: 0.5625rem; letter-spacing: 0.03em; color: var(--muted); }

.widget--contact { border-top-color: var(--rule-2); }
.widget__email { display: inline-block; margin-top: 0.45rem; font-size: 0.8125rem; border-bottom: 1px solid var(--accent-soft); }
.widget__email:hover { border-bottom-color: var(--accent); }
.address { margin-top: var(--s2); font-family: var(--mono); font-size: 0.6875rem; line-height: 1.6; color: var(--muted); }

/* ---------- Plain pages (404) ---------- */
.masthead { background: var(--panel); border-bottom: 1px solid var(--rule); border-top: 3px solid var(--accent); }
.masthead__inner { max-width: 60rem; margin: 0 auto; padding: 0 var(--s6); height: 3.25rem; display: flex; align-items: center; gap: var(--s4); }
.masthead__name { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.02em; color: var(--name); margin-right: auto; }
.plain__main { max-width: 60rem; margin: 0 auto; padding: var(--s7) var(--s6); min-height: 60vh; }
.plain__title { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.025em; color: var(--ink); margin-bottom: var(--s4); }
.site-footer { border-top: 1px solid var(--rule); }
.site-footer__inner { max-width: 60rem; margin: 0 auto; padding: var(--s3) var(--s6); display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.625rem; color: var(--muted); }
.site-footer a { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  :root { --side-w: 16.5rem; --right: 16rem; }
  .side__inner { padding-left: 1.5rem; padding-right: 1.5rem; }
  .side__links { grid-template-columns: 1fr; }
  .stage { padding: var(--s5) var(--s5) var(--s6); column-gap: var(--s4); }
}
/* Medium screens: widgets move under the papers, side by side. */
@media (max-width: 1100px) {
  .stage { grid-template-columns: minmax(0, 1fr); row-gap: var(--s4); }
  .widgets { position: static; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); align-items: start; }
}
/* Phones: the profile becomes a compact header. */
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: relative; height: auto; overflow: visible; }
  .side__inner { padding: var(--s5) var(--s4) var(--s4); display: grid; grid-template-columns: 4.75rem minmax(0, 1fr); column-gap: var(--s4); align-items: center; }
  .side__photo img { width: 4.75rem; height: 4.75rem; box-shadow: 0 0 0 1px var(--rule-2), 0 0 0 5px rgba(39, 67, 224, 0.07); }
  .side { border-right: 0; border-bottom: 1px solid var(--rule); }
  .side__id { margin-top: 0; }
  .side__name { font-size: 1.25rem; }
  .side__lede, .side__cv, .side__links, .side__foot { grid-column: 1 / -1; }
  .side__links { grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); margin-top: var(--s4); }
  .side__inner { padding: var(--s5) var(--s4) var(--s4); }
  .side__foot { display: none; }
  .stage { padding: var(--s3) var(--s3) var(--s5); }
  .sheet { padding: 0 var(--s3) var(--s3); border-radius: 8px; }
  .tabs { margin: 0 calc(-1 * var(--s3)); padding: 0 var(--s2) 0 var(--s3); }
  .tabs__list {
    gap: 0.9rem; padding-right: 1.2rem;
    -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent);
    mask-image: linear-gradient(90deg, #000 82%, transparent);
  }
  .tab { letter-spacing: 0.05em; padding: 0.85rem 0 0.75rem; }
  .pub-list { padding-left: 1.55rem; }
  .pub-list > li { padding: 0.55rem 0.2rem 0.6rem 0.55rem; }
  .status { margin: 0.2rem 0 0; display: table; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .side, .widgets, .tabs, .abstract-toggle, .fig-toggle, .figpop { display: none !important; }
  .shell, .stage { display: block; padding: 0; }
  .sheet { border: 0; box-shadow: none; }
  .js .panel:not(.is-active) { display: block; }
  .abstract { display: none !important; }
  body { background: #fff; }
}
