/* Fonts loaded via <link> in HTML for non-blocking parallel fetch */

/* ── Design tokens ──
   Light academic palette: white page, black text, ocean-teal links that
   turn coral on hover, neutral grey rules. The site is light-only. */
:root {
  color-scheme: light;
  --text: #1a1a1a;
  --text-muted: #4d4d4d;
  --text-faint: #6b6b6b;
  --link: #0d8073;
  --link-hover: #e5603f;
  --rule: #e2e2e2;
  --rule-soft: #eeeeee;
  --surface: #f4f8f7;
  --bg: #ffffff;
  --accent-strong: #b54708;
  --figure-bg: #ffffff;
  --figure-filter: none;
  /* Source Serif for the name, section headings and titles; Inter for
     reading. Noto Serif Devanagari covers the Nepali half of the name. */
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-display: 'Source Serif 4', 'Noto Serif Devanagari', Georgia, 'Times New Roman', serif;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Page controls ── */
/* Corner stack holding the page-level controls. Individual buttons
   are static within it, so adding another does not need new coordinates. */
.controls {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Markdown view (AI mode) ── */
/* Deliberately unstyled-looking: monospace source, wrapped rather than
   scrolled, so it reads as the page's underlying text. */
.md-view {
  margin: 0;
  padding: 40px 0 8px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text-muted);
}

.md-view[hidden] {
  display: none;
}

/* ── Human / AI voice toggle ── */
/* Reads as one pill: label and track share a light capsule, sized to sit in
   the fixed corner controls. */
.voice-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 5px 0 11px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 999px;
}

.voice-toggle:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.voice-label {
  /* Both words occupy the same box, so the pill does not resize on toggle
     and the track never shifts sideways. */
  display: inline-grid;
  place-items: center;
  min-width: 5ch;
}

.voice-track {
  position: relative;
  width: 34px;
  height: 19px;
  border-radius: 999px;
  background: #c9ced6;
}

.voice-thumb {
  position: absolute;
  top: 2.5px;
  left: 2.5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* Checked = AI voice: thumb travels the track's inner width. */
.voice-toggle[aria-checked="true"] .voice-track {
  background: var(--link);
}

.voice-toggle[aria-checked="true"] .voice-thumb {
  transform: translateX(15px);
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  letter-spacing: -0.005em;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  max-width: 840px;
  margin: 0 auto;
  padding: 0 20px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Typography ── */
a {
  color: var(--link);
  text-decoration: none;
}

a:focus,
a:hover {
  color: var(--link-hover);
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 2px;
}

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

strong {
  font-size: inherit;
}

.name {
  padding-top: 12px;
  margin: 0 0 10px;
  /* Scales with viewport so the Devanagari half never collides
     with the profile photo at mid widths. */
  font-family: var(--font-display);
  font-size: clamp(26px, 4.1vw, 35px);
  font-weight: 600;
  text-align: center;
  letter-spacing: -0.3px;
  line-height: 1.2;
  text-wrap: balance;
  color: var(--text);
}

/* ── Layout ── */
.header {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 36px 0 28px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 8px;
}

.header-info {
  flex: 1;
  min-width: 0;
}

/* :not(.name) so this never overrides the name's display size —
   it is more specific than .name and would otherwise win. */
.header-info > p:not(.name) {
  text-align: center;
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 4px;
}

/* Short bio under the role line. Left-aligned for reading, unlike the
   centred name and links around it. */
.header-info > p.header-bio {
  margin: 12px 0 14px;
  text-align: left;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  text-wrap: pretty;
}

.header-photo {
  flex-shrink: 0;
  width: 28%;
  max-width: 200px;
}

/* Ring is drawn with box-shadow rather than a border so it sits outside the
   image edge — a border would crop into the portrait at the rounding. */
.header-photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  box-shadow: 0 0 0 1px var(--rule), 0 0 0 6px var(--bg), 0 0 0 7px var(--rule-soft);
}

.header-photo a:hover img {
  box-shadow: 0 0 0 1px var(--link), 0 0 0 6px var(--bg), 0 0 0 7px var(--rule);
}

.header-photo a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 6px;
  border-radius: 50%;
}

.links {
  text-align: center;
  margin-top: 10px;
  font-size: 16px;
  font-weight: 600;
}

/* ── Sections ── */
.section {
  padding: 26px 0 8px;
}

/* Hairline runs the full column for structure; the short ochre dash over it
   marks the label itself, so the eye catches the heading before the rule. */
.section h2 {
  position: relative;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule-soft);
}

/* Sits beside a heading as a quiet aside — steps down to body weight and
   size so it reads as an annotation rather than part of the label. */
.h2-note {
  font-size: 15px;
  font-weight: 400;
  margin-left: 8px;
}

.section h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 34px;
  height: 2px;
  background: var(--link);
  opacity: 0.55;
}

/* ── Lede paragraph ── */
/* Standing prose under a heading. Slightly larger than body copy with a
   capped measure, so it reads as an intro rather than an entry body. */
.lede {
  font-size: 17px;
  line-height: 1.65;
  max-width: 68ch;
  color: var(--text);
}

/* ── Entry rows (experience, research, etc.) ── */
/* Top-aligned rather than centred: entries range from one role to several,
   and centring leaves the logo floating mid-block on the tall ones. The
   small top padding drops it onto the org title's optical centre. */
.entry {
  display: flex;
  gap: 20px;
  padding: 16px 0;
  align-items: flex-start;
}

/* Logo tiles: one square white plate per organisation, matching the
   figure plates below. Logos arrive as transparent PNGs, padded squares
   and full-bleed marks, so the tile, not the file, sets the size; the
   white ground also keeps dark-on-transparent logos visible. */
.entry-img {
  flex-shrink: 0;
  width: 125px;
  height: 125px;
  margin-top: 2px;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--figure-bg);
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.entry-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: var(--figure-filter);
}

/* Logo file carries a wide transparent margin: enlarge to match the others */
.entry-img.logo-zoom img {
  transform: scale(1.3);
}

/* Square mark designed to be shown edge to edge, like an app icon */
.entry-img.logo-fill {
  padding: 0;
}

.entry-img.logo-fill img {
  object-fit: cover;
}

.entry-body {
  flex: 1;
  min-width: 0;
  line-height: 1.55;
  font-size: 16px;
  /* Shared vertical axis for the org marker, the timeline rail and
     every role dot. Change this one value to move them all together. */
  --axis: 6px;
}

.entry-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
}

/* Organization heading. Everything in the entry hangs off one vertical
   axis, --axis, measured from the entry-body content edge. Markers are
   centred on it with translateX(-50%) rather than hand-computed offsets,
   so sizes can change without breaking alignment. */
.entry-body > .entry-title {
  position: relative;
  padding-left: calc(var(--axis) + 12px);
}

.entry-body > .entry-title::before {
  content: "";
  position: absolute;
  left: var(--axis);
  top: 0.62em;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
}

.entry-date {
  font-size: 15px;
  color: var(--text-muted);
  margin: 3px 0 6px;
}

/* ── Timeline (promotion progression) ── */
/* Rail centred on --axis. Drawn as a pseudo-element rather than a
   border so it can start and stop at the dot centres — a border would
   span the full box and overshoot past the last dot. */
.entry-timeline {
  position: relative;
  margin: 4px 0 12px calc(var(--axis) - 1px);
  padding-left: 11px;
}

.entry-timeline::before {
  content: "";
  position: absolute;
  left: 0;
  width: 2px;
  background: var(--rule);
  /* Spans exactly first-dot centre to last-dot centre. The bottom
     offset clears the last item's remaining line box below its dot. */
  top: 0.62em;
  bottom: calc(0.62em + 5px);
}

.timeline-item {
  position: relative;
  padding: 2px 0 10px 0;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

/* Single-role entries: no progression to trace, so no rail at all. */
.entry-timeline:has(.timeline-item:only-child)::before {
  display: none;
}

.entry-timeline:has(.timeline-item:only-child) {
  margin-bottom: 8px;
}

/* Centred on the rail: the item's content edge sits 11px past the
   timeline's padding edge, and the 2px rail straddles that edge, so
   its centre is 10px back. translate(-50%) centres the dot on it. */
.timeline-dot {
  position: absolute;
  left: -10px;
  top: 0.62em;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--text-faint);
}

/* Roles are listed newest-first, so filling the first dot marks where the
   progression currently stands. Only meaningful when there is a progression
   to trace — on single-role entries the rail is hidden and a filled dot
   would just be a stray mark. */
.entry-timeline:not(:has(.timeline-item:only-child)) .timeline-item:first-child .timeline-dot {
  background: var(--link);
  border-color: var(--link);
}

.timeline-content {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
}

.timeline-content .entry-title {
  font-size: 17px;
  font-weight: 700;
}

.timeline-content .entry-title::after {
  content: "·";
  margin: 0 7px;
  font-weight: 400;
  color: var(--text-faint);
}

.timeline-content .entry-date {
  margin: 0;
  white-space: nowrap;
}

/* Secondary detail under a role, e.g. the course a TA taught. */
.timeline-note {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 1px;
}

/* ── Education ── */
/* Deliberately logo-less and rail-less: two degrees need no progression
   to trace, so each is just school / degree · years / department. */
.edu {
  padding: 12px 0;
  line-height: 1.55;
}

.edu:first-of-type {
  padding-top: 4px;
}

.edu-school {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.edu-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  margin-top: 2px;
  font-size: 16px;
}

.edu-date {
  font-size: 15px;
  color: var(--text-muted);
  white-space: nowrap;
}

.edu-degree::after {
  content: "·";
  margin: 0 7px;
  color: var(--text-faint);
}

.edu-dept {
  font-size: 15px;
  color: var(--text-muted);
}

/* Thesis: a thin rule, a small label, the title in the paper-title face,
   and the venue as one muted line. */
.thesis {
  margin-top: 12px;
  padding: 1px 0 2px 14px;
  border-left: 2px solid #9fcfc8;
}

.thesis-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.thesis-title {
  display: block;
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  text-wrap: balance;
}

.thesis-title:hover,
.thesis-title:focus-visible {
  color: var(--link);
}

.thesis-venue {
  margin-top: 3px;
  font-size: 15px;
  color: var(--text-muted);
}

.thesis-venue .nowrap {
  white-space: nowrap;
}

/* Leave room above the card when the thesis link jumps to it. */
#quality-judges {
  scroll-margin-top: 24px;
}

/* ── Project meta line ── */
.project-meta {
  font-size: 15px;
  color: var(--text-muted);
}

/* ── Paper cards ── */
.paper {
  display: flex;
  gap: 20px;
  padding: 16px 0;
  align-items: flex-start;
}

.paper-img {
  flex-shrink: 0;
  width: 170px;
  position: relative;
  overflow: hidden;
}

.paper-img img {
  width: 100%;
  display: block;
  border-radius: 4px;
  border: 1px solid var(--rule-soft);
}

.paper:hover .paper-img img {
  border-color: var(--rule);
}

/* Figure plates (Publications, Achievements): every image sits on the same
   white plate, letterboxed with object-fit so a 3:1 system diagram and a 1:1
   logo read at the same visual weight. The plate is white
   because the images themselves are drawn on white. */
.figures .paper-img {
  width: 220px;
  aspect-ratio: 3 / 2;
  margin-top: 4px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--figure-bg);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.figures .paper-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  filter: var(--figure-filter);
}

/* Achievement logos carry their own generous white margin */
.achievements .paper-img {
  padding: 4px;
}

/* Project artwork is an illustration, not a diagram: give it room. */
.projects .paper-img {
  padding: 18px;
}

.publications .paper-img {
  cursor: zoom-in;
}

/* Small "expand" glyph so the plate reads as clickable */
.publications .paper-img::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E") center / 13px no-repeat;
  opacity: 0;
}

.publications .paper-img:hover,
.publications .paper-img:focus-visible {
  border-color: var(--text-faint);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.publications .paper-img:hover::after,
.publications .paper-img:focus-visible::after {
  opacity: 1;
}

.publications .paper-img:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

/* ── Figure lightbox ── */
.lightbox {
  max-width: min(1200px, 94vw);
  max-height: 92vh;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(3px);
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 64px);
  margin: 0 auto;
  padding: 16px;
  background: var(--figure-bg);
  filter: var(--figure-filter);
  cursor: zoom-out;
}

.lightbox-caption {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--rule);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.lightbox-caption span {
  flex: 1;
  min-width: 0;
}

.lightbox-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  cursor: pointer;
}

.lightbox-close:hover {
  color: var(--text);
  border-color: var(--text-faint);
}

.lightbox-close:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.paper-body {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  line-height: 1.55;
}

/* Titles read as headings, not links: same dark ink whether or not the
   paper has a URL yet, turning blue only on hover when it does. */
.papertitle {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

a:hover .papertitle,
a:focus-visible .papertitle {
  color: var(--link);
}

.paper-body em {
  color: var(--text-muted);
}

.oral {
  color: var(--accent-strong);
  font-weight: 700;
}

/* Conference tier badge shown beside the venue */
.venue-rank {
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Author list: own name set in Inter Black so it stands out by weight alone */
.paper-body > strong {
  color: var(--text);
  font-weight: 900;
}

/* ── Collapsible abstracts ── */
details {
  margin-top: 8px;
}

details summary {
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
  user-select: none;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 15px;
  line-height: 1;
  border: 1.5px solid var(--rule);
  border-radius: 3px;
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 400;
  flex-shrink: 0;
}

details summary:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 3px;
  color: var(--text);
}

details[open] summary::before {
  content: "−";
}

details summary:hover {
  color: var(--text);
}

details summary:hover::before {
  border-color: var(--text-faint);
  color: var(--text);
}

details p {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: justify;
  hyphens: auto;
}

/* ── Back to top ── */
.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 6;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--rule);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.to-top[hidden] {
  display: none;
}

.to-top:hover {
  color: var(--link);
  border-color: var(--link);
}

.to-top svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Recent news ── */
/* Compact, scannable rows: a date and one sentence. The box is sized (in
   home.js) to show exactly the five newest; the rest scroll. */
.news {
  position: relative;
  margin-top: 4px;
}

.news-viewport {
  max-height: 210px; /* fallback; home.js fits it to five entries */
  overflow-y: auto;
  padding-right: 14px;
  overscroll-behavior: contain;
}

.news-viewport:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Always-visible scrollbar, so it is obvious the list holds more. Custom
   ::-webkit-scrollbar styles opt out of macOS's auto-hiding overlay bars in
   Chrome and Safari; the standard properties are left to Firefox only,
   because Chrome lets them override (and so disable) the custom bar. */
.news-viewport::-webkit-scrollbar {
  width: 8px;
}

.news-viewport::-webkit-scrollbar-track {
  background: var(--surface);
  border-radius: 8px;
}

.news-viewport::-webkit-scrollbar-thumb {
  background: #b9bec6;
  border-radius: 8px;
}

.news-viewport::-webkit-scrollbar-thumb:hover {
  background: #8f959e;
}

@supports (-moz-appearance: none) {
  .news-viewport {
    scrollbar-width: thin;
    scrollbar-color: #b9bec6 var(--surface);
  }
}

.news-list {
  list-style: none;
}

/* Date in a fixed column so the sentences start on one straight edge. */
.news-item {
  display: grid;
  grid-template-columns: 84px 1fr;
  column-gap: 14px;
  align-items: baseline;
  padding: 6px 10px;
  border-radius: 6px;
}

.news-date {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text-muted);
}

.news-text {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--text);
}

/* New entries: a soft highlight and a teal date led by a dot.
   Add class="news-item is-new" to mark an item; remove it when it ages out. */
.news-item.is-new {
  background: #e8f6f3;
}

.news-item.is-new .news-date {
  color: var(--link);
}

.news-item.is-new .news-date::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  vertical-align: 1px;
  border-radius: 50%;
  background: var(--link);
}

/* ── Sub-page nav ── */
/* Breadcrumb at the top of secondary pages (miscellaneous/index.html). Padded
   on the right so it never runs under the fixed corner controls. */
.page-nav {
  display: flex;
  gap: 8px;
  padding: 22px 56px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-faint);
}

.page-nav [aria-current="page"] {
  color: var(--text);
}

/* ── Miscellaneous entries ── */
.misc-item {
  display: flex;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule-soft);
  align-items: flex-start;
}

.misc-item:last-child {
  border-bottom: none;
}

.misc-img {
  flex-shrink: 0;
  width: 170px;
}

.misc-img img {
  width: 100%;
  display: block;
  border-radius: 6px;
  border: 1px solid var(--rule-soft);
}

.misc-body {
  flex: 1;
  min-width: 0;
}

.misc-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
}

span.misc-title {
  color: var(--text);
}

.misc-date {
  font-size: 14px;
  color: var(--text-faint);
}

.misc-body p {
  margin-top: 6px;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ── From the Timeline (miscellaneous/timeline/) ── */
/* One section per conference. Each feed is a two-column wall (CSS columns,
   so posts of different heights pack without gaps) that drops to a single
   column once a column would be narrower than a readable tweet embed. */
.meme-feed {
  list-style: none;
  columns: 2 340px;
  column-gap: 20px;
  margin-top: 8px;
}

.meme-feed li {
  break-inside: avoid;
  margin-bottom: 20px;
}

.meme-feed .twitter-tweet {
  margin: 0 auto !important;
}

/* Unrendered tweet: shown while widgets.js loads, and left in place if it is
   blocked. X swaps the <blockquote> for a <div> once the embed renders, so
   this never styles the finished post. */
.meme-feed blockquote.twitter-tweet {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 16px;
  font-size: 14px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
}

.meme-li iframe {
  display: block;
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 10px;
}

.meme-li-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
}

/* Conference subtitle: plain annotation rather than part of the label. */
.meme-conf .h2-note {
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-faint);
}

/* Venue jump links, built by meme-feed.js from the .meme-conf sections. */
.meme-confs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.meme-confs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--rule);
  border-radius: 999px;
}

.meme-confs a:hover {
  border-color: var(--link-hover);
}

.meme-conf-count {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-faint);
}

.meme-conf {
  scroll-margin-top: 16px;
}

/* ── Conference deadlines (miscellaneous/deadlines/) ── */
/* Rendered by assets/js/deadlines.js: a twelve-month year summary, domain
   filters, then the conference list. Dates only, no countdowns. */
.dl-note {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-faint);
}

.dl-h2-note {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-faint);
}

/* ── 1. Year summary: one cell per month ── */
.dl-months {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}

.dl-month {
  min-height: 112px;
  padding: 10px 12px 12px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.dl-month:nth-child(4n + 1) {
  border-left: none;
}

.dl-month-now {
  background: var(--surface);
}

.dl-month-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}

.dl-month-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.dl-month-now .dl-month-name {
  color: var(--link);
}

.dl-month-year {
  font-size: 12px;
  color: var(--text-faint);
}

.dl-month-items {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.dl-month-empty {
  font-size: 14px;
  color: var(--rule);
}

/* Announced: solid teal. Expected: dashed outline. Passed: muted grey. */
.dl-chip {
  display: inline-block;
  padding: 1px 8px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.55;
  white-space: nowrap;
  border-radius: 999px;
}

.dl-chip-announced {
  color: #fff;
  background: var(--link);
  border: 1px solid var(--link);
}

.dl-chip-expected {
  font-weight: 500;
  color: var(--link);
  background: var(--bg);
  border: 1px dashed var(--link);
}

.dl-chip-passed {
  font-weight: 500;
  color: var(--text-faint);
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
}

a.dl-chip:hover {
  color: #fff;
  background: var(--link-hover);
  border: 1px solid var(--link-hover);
}

/* Year tabs sit on the heading's baseline, right-aligned. */
.dl-year-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--rule-soft);
}

.dl-year-head h2 {
  margin-bottom: 0;
  border-bottom: none;
}

.dl-year-tabs {
  display: inline-flex;
  margin-bottom: 8px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}

.dl-year-tab {
  padding: 4px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: none;
  cursor: pointer;
}

.dl-year-tab + .dl-year-tab {
  border-left: 1px solid var(--rule);
}

.dl-year-tab:hover {
  color: var(--link);
}

.dl-year-tab[aria-pressed="true"] {
  color: #fff;
  background: var(--link);
}

.dl-year-tab:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: -2px;
}

.dl-month-past .dl-month-name {
  color: var(--text-faint);
}

.dl-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-faint);
}

/* ── 2. Domain filters ── */
.dl-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.dl-filter {
  padding: 4px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--link);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
}

.dl-filter:hover {
  border-color: var(--link);
}

.dl-filter[aria-pressed="true"] {
  color: #fff;
  background: var(--link);
  border-color: var(--link);
}

.dl-filter:focus-visible,
.dl-chip:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* ── 3. Conference grid: one card per deadline, filtered by domain ── */
.dl-cards {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dl-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 10px;
  scroll-margin-top: 16px;
  transition: border-color 0.15s;
}

.dl-card:hover {
  border-color: var(--link);
}

.dl-card:target {
  border-color: var(--link-hover);
  box-shadow: 0 0 0 3px rgba(229, 96, 63, 0.15);
}

/* Calendar-page date block: month on top, day below. */
.dl-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--link);
  border-radius: 8px;
}

.dl-date-m {
  width: 100%;
  padding: 1px 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
  color: #fff;
  background: var(--link);
}

.dl-date-d {
  padding: 2px 0 3px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
}

.dl-card-tba .dl-date {
  border: 1px dashed var(--text-faint);
}

.dl-card-tba .dl-date-m {
  color: var(--text-muted);
  background: var(--surface);
}

.dl-date-tba {
  padding: 6px 0 7px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.dl-body {
  min-width: 0;
}

.dl-body > .dl-tag {
  float: right;
  margin: 2px 0 0 6px;
}

.dl-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
}


.dl-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.dl-card-tba .dl-name {
  color: var(--text);
}

.dl-card-tba .dl-name:hover {
  color: var(--link-hover);
}

.dl-tag {
  padding: 0 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text-faint);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.dl-sub {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-faint);
}

@media (prefers-reduced-motion: reduce) {
  .dl-card {
    transition: none;
  }
}

@media (max-width: 640px) {
  .dl-months {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dl-month {
    min-height: 92px;
  }

  .dl-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 641px) and (max-width: 820px) {
  .dl-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Footer ── */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 0 24px;
  border-top: 1px solid var(--rule-soft);
  margin-top: 20px;
}

.footer-flag {
  opacity: 0.85;
}

.footer-flag:hover {
  opacity: 1;
}

.footer-flag img {
  display: block;
  border-radius: 4px;
}

.footer-credit {
  font-size: 13px;
  color: var(--text-faint);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  body {
    font-size: 16px;
    padding: 0 16px;
  }

  .name {
    font-size: 25px;
  }

  .header {
    flex-direction: column-reverse;
    text-align: center;
    gap: 20px;
  }

  .header-photo {
    width: 50%;
    margin: 0 auto;
  }

  .entry {
    flex-direction: column;
    text-align: center;
  }

  .entry-img {
    width: 115px;
    height: 115px;
    margin: 0 auto;
  }

  .entry-timeline {
    text-align: left;
    display: inline-block;
  }

  /* Centred layout: drop the marker entirely. A hanging gutter has
     nothing to hang from once the text is centred. */
  .entry-body > .entry-title {
    padding-left: 0;
  }

  .entry-body > .entry-title::before {
    display: none;
  }

  .paper {
    flex-direction: column;
  }

  .paper-img {
    width: 100%;
    max-width: 220px;
    height: auto;
    margin: 0 auto;
  }

  /* Full-width plates: let height follow the figure instead of
     letterboxing wide diagrams into a mostly empty 3:2 box. Logos
     stay boxed and modest, since full width would dwarf the text. */
  .achievements .paper-img,
  .projects .paper-img {
    width: 100%;
    max-width: 280px;
  }

  /* Full-width plates: let height follow the figure instead of
     letterboxing wide diagrams into a mostly empty 3:2 box. */
  .publications .paper-img {
    width: 100%;
    max-width: none;
    aspect-ratio: auto;
  }

  .publications .paper-img img {
    height: auto;
  }

  details p {
    text-align: left;
  }

  .news-item {
    grid-template-columns: 1fr;
    padding: 7px 10px;
  }

  .misc-item {
    flex-direction: column;
  }

  .misc-img {
    width: 100%;
    max-width: 280px;
  }
}

/* ── Print (for CV-style printing) ── */
@media print {
  body {
    max-width: none;
    font-size: 11pt;
    color: #000;
  }

  a {
    color: #000;
  }

  details {
    display: none;
  }

  .footer-flag,
  .to-top,
  .controls,
  .lightbox {
    display: none;
  }
}
