/* Adam Fisch — personal academic website */

:root {
  --bg: #fffefd;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-subtle: #f9f8f5;
  --bg-nav: #1b2a3d;
  --text: #111418;
  --text-secondary: #2b313b;
  --text-muted: #57606e;
  --border: rgba(34, 30, 24, 0.1);
  --border-strong: rgba(34, 30, 24, 0.2);
  --accent: #24518c;
  --accent-deep: #1b3a63;
  --accent-soft: rgba(36, 81, 140, 0.075);
  --accent-border: rgba(36, 81, 140, 0.22);
  --warm: #9a541e;
  --warm-bg: rgba(154, 84, 30, 0.08);
  --warm-border: rgba(154, 84, 30, 0.24);
  --teal: #0f766e;
  --teal-soft: rgba(15, 118, 110, 0.1);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 18px 44px rgba(15, 23, 42, 0.09);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 880px;
  --font-serif: "Avenir Next", "Avenir", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: "Avenir Next", "Avenir", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.64;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

.ambient-bg {
  display: none;
}

a {
  color: var(--accent-deep);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent);
}

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

h1, h2, h3, .hero-role, .page-subtitle {
  text-wrap: balance;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Header (Deep Slate Navy) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-nav);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}

.site-brand {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: #f8fafc;
  letter-spacing: -0.01em;
}

.site-brand:hover {
  color: #cbd5e1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: rgba(241, 245, 249, 0.78);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: #ffffff;
}

.nav-links a.active {
  position: relative;
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: #a8c5e8;
  border-radius: 2px;
}

.page-intro {
  padding: 42px 0 24px;
}

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3.4vw, 2.45rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.page-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Hero ---------- */
.hero {
  padding: 52px 0 44px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 184px 1fr;
  gap: 44px;
  align-items: start;
}

.hero-photo-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding-top: 4px;
}

.hero-links-col {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.side-link:hover {
  background: var(--bg-subtle);
  color: var(--accent);
}

.side-link svg {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.side-link:hover svg {
  color: var(--accent);
}

.side-link-static:hover {
  background: transparent;
  color: var(--text-secondary);
}

.side-link-static:hover svg {
  color: var(--text-muted);
}

.hero-photo {
  width: 176px;
  height: 176px;
  object-fit: cover;
  object-position: center 18%;
  border-radius: 50%;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: block;
}

.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.6vw, 2.55rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
}

.hero-role {
  font-size: 0.96rem;
  color: var(--text-muted);
  margin: 0 0 18px;
}

.hero-bio p {
  font-size: 0.945rem;
  line-height: 1.66;
  color: var(--text-secondary);
  text-align: justify;
  text-justify: inter-word;
  text-wrap: pretty;
  hyphens: manual;
  margin: 0 0 12px;
}

.hero-bio p:last-child {
  margin-bottom: 0;
}

.hero-bio strong {
  color: var(--text);
  font-weight: 600;
}

.hero-bio a {
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

.hero-bio a:hover {
  text-decoration-color: var(--accent);
}

/* ---------- Sections ---------- */
.section {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.section-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Selected Highlights (Single Column) ---------- */
.featured-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.featured-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.featured-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-border);
}

.featured-body {
  padding: 16px 20px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.featured-meta .cite-badge {
  margin-left: auto;
  margin-right: -6px;
}

.featured-title {
  font-family: var(--font-serif);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 8px;
}

.featured-title a {
  color: inherit;
}

.featured-title a:hover {
  color: var(--accent);
}

.featured-hook {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.56;
  text-wrap: pretty;
  margin: 0 0 10px;
  flex: 1;
}

.featured-hook a,
.earlier-note a,
.pub-tldr a,
.demo-desc a {
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

.featured-hook a:hover,
.earlier-note a:hover,
.pub-tldr a:hover,
.demo-desc a:hover {
  text-decoration-color: var(--accent);
}

.featured-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.featured-footer strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.featured-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

.section-lead {
  font-size: 0.94rem;
  color: var(--text-secondary);
  margin: -10px 0 16px;
}

.earlier-heading {
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 28px 0 10px;
}

.earlier-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.earlier-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title venue"
    "note venue"
    "authors details";
  column-gap: 20px;
  row-gap: 4px;
  align-items: start;
  padding: 14px 10px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease;
}

.earlier-row:last-child {
  border-bottom: none;
  padding-bottom: 4px;
}

.earlier-row:hover {
  background: var(--bg-subtle);
}

.earlier-title {
  grid-area: title;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text);
}

.earlier-title:hover {
  color: var(--accent);
}

.earlier-note {
  grid-area: note;
  font-size: 0.86rem;
  line-height: 1.52;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.earlier-authors {
  grid-area: authors;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.earlier-authors strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.earlier-details {
  grid-area: details;
  justify-self: end;
  align-self: end;
}

.earlier-right {
  grid-area: venue;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding-top: 2px;
  white-space: nowrap;
}

.earlier-venue {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.earlier-cite {
  font-size: 0.76rem;
  margin-right: -6px;
}

/* ---------- Interactive Demos (Stacked Light Cards) ---------- */
.demos-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-bottom: 56px;
}

.demo-card-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text);
}

.chalk-shell {
  background: var(--bg-card);
  color: var(--text);
  border-radius: var(--radius);
  padding: 24px 26px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.demo-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: justify;
  text-justify: inter-word;
  text-wrap: pretty;
  hyphens: manual;
  margin: 0 0 14px;
}

.demo-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--bg-subtle);
  padding: 10px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
  font-size: 0.84rem;
}

.demo-control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-control-group label {
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.demo-control-group input[type="range"] {
  accent-color: #2c5282;
  width: 130px;
  cursor: pointer;
}

.demo-val {
  font-size: 0.82rem;
  color: var(--accent-deep);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
}

.demo-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.demo-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.demo-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.demo-metrics {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.demo-metric strong {
  color: var(--text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.demo-papers {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.demo-papers a {
  color: var(--accent-deep);
}

.demo-papers a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* First-Price Auction Routing Demo */
.demo-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.demo-title-row .demo-card-title {
  margin: 0;
}

.demo-subhead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 6px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.demo-subhead {
  font-family: var(--font-serif);
  font-size: 1.04rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.market-stage svg {
  display: block;
  width: 100%;
  height: auto;
}

.market-stage {
  background-color: #fdfdfb;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 16px 14px;
  margin-bottom: 14px;
}

.market-caption {
  text-align: center;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 8px;
}

.math {
  font-style: italic;
}

.stage-prompt {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text);
  padding: 0 4px 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.stage-label {
  color: var(--text-muted);
  font-weight: 500;
}

/* Conformal Risk Control claim-filtering list */
.crc-claims {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.crc-claim {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-size: 0.84rem;
  transition: opacity 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.crc-claim.kept {
  border-color: rgba(44, 82, 130, 0.22);
}

.crc-claim.kept.halluc {
  border-color: rgba(161, 92, 36, 0.35);
  background: #fdf9f5;
}

.crc-claim.filtered {
  background: #f4f6f9;
  border-color: transparent;
}

.crc-claim.filtered .crc-text {
  color: var(--text-muted);
  text-decoration: line-through;
}

.crc-score {
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #2c5282;
  background: #edf2f7;
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
}

.crc-claim.filtered .crc-score {
  color: var(--text-muted);
  background: #e6ebf1;
}

.crc-claim.kept.halluc .crc-score {
  color: #854a1b;
  background: #f6e7d8;
}

.crc-text {
  color: var(--text);
  line-height: 1.4;
}

.crc-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.crc-badge.kept {
  color: #25594b;
  background: #edf6f3;
}

.crc-badge.halluc {
  color: #854a1b;
  background: #f6e7d8;
}

.crc-badge.filtered {
  color: var(--text-muted);
  background: #e6ebf1;
}

.crc-output {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text);
}

.crc-out-halluc {
  background: #f6e7d8;
  color: #854a1b;
  padding: 1px 3px;
  border-radius: 3px;
}

.phase-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.phase-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d5dce6;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.phase-dot:hover {
  background: #94a3b8;
}

.phase-dot.active {
  width: 22px;
  background: #2c5282;
}

/* Reward Hacking Demo method toggles */
.rh-controls {
  gap: 8px 12px;
}

.rh-toggles {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rh-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  opacity: 0.72;
}

.rh-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
  opacity: 0.95;
}

.rh-toggle.is-active {
  color: var(--text);
  border-color: rgba(44, 82, 130, 0.42);
  background: #ffffff;
  font-weight: 600;
  opacity: 1;
}

.rh-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.rh-dot-single {
  background: #a15c24;
}

.rh-dot-ensemble {
  background: #2c5282;
}

.rh-dot-pessimistic {
  background: #2f6f5e;
}

#rh-svg {
  user-select: none;
}

.service-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.58;
}

.service-list li {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.service-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.service-list strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Editorial Hairline Publications ---------- */
.pub-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 26px;
}

.pub-poster-figure {
  margin: 40px auto 0;
  max-width: 340px;
  text-align: center;
}

.pub-poster-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(17, 20, 24, 0.04);
}

.pub-poster-figure figcaption {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.pub-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.pub-search {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.89rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pub-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.award-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.award-toggle.active {
  background: var(--warm-bg);
  border-color: var(--warm-border);
  color: var(--warm);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.filter-pill {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0;
  font-family: var(--font-sans);
  font-size: 0.81rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.filter-pill:hover {
  color: var(--accent);
}

.filter-pill.active {
  color: var(--accent-deep);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.year-group {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 18px;
  padding: 16px 0 22px;
  border-top: 1px solid var(--border);
}

.year-group:first-child {
  border-top: none;
  padding-top: 0;
}

.year-heading {
  position: sticky;
  top: 76px;
  align-self: start;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: #8a94a3;
  font-variant-numeric: tabular-nums;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pub-list {
  display: flex;
  flex-direction: column;
}

.pub-card {
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.pub-card:last-child {
  border-bottom: none;
}

.pub-card:hover {
  background: var(--bg-card);
}

.pub-card.open {
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  margin: 8px 0;
}

.pub-summary {
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.pub-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
}

.pub-title {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.38;
  margin: 0 0 4px;
}

.pub-card:hover .pub-title {
  color: var(--accent);
}

.pub-authors {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.48;
  margin: 0 0 7px;
}

.pub-authors strong {
  color: var(--text);
  font-weight: 600;
}

.pub-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.venue-badge {
  font-size: 0.77rem;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border: 1px solid var(--accent-border);
}

.venue-badge.preprint {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-color: var(--border);
}

.award-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--warm-bg);
  color: var(--warm);
  border: 1px solid var(--warm-border);
}

.pub-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pub-link-btn {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  white-space: nowrap;
}

.pub-link-btn:hover {
  border-color: var(--accent-border);
  color: var(--accent);
}

.pub-chevron {
  width: 27px;
  height: 27px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: transform 0.2s ease, color 0.15s ease, border-color 0.15s ease;
}

.pub-card:hover .pub-chevron {
  border-color: var(--accent-border);
  color: var(--accent);
}

.pub-card.open .pub-chevron {
  transform: rotate(180deg);
  border-color: var(--accent-border);
  color: var(--accent);
}

.pub-details {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.pub-card.open .pub-details {
  display: block;
}

.pub-tldr {
  font-size: 0.89rem;
  color: var(--text-secondary);
  margin: 12px 0 12px;
  line-height: 1.58;
  text-align: justify;
  text-justify: inter-word;
  text-wrap: pretty;
  hyphens: manual;
}

.pub-detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pub-tag {
  font-size: 0.72rem;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
}

.pub-tag:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.bibtex-toggle, .copy-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
}

.bibtex-toggle:hover, .copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.bibtex-box {
  display: none;
  margin-top: 10px;
}

.bibtex-box.show {
  display: block;
}

.bibtex-pre {
  margin: 0;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--text-secondary);
  overflow-x: auto;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.92rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 30px 0 44px;
  margin-top: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.footer-inner > :nth-child(2) {
  text-align: center;
}

.footer-inner > :last-child {
  text-align: right;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .year-group {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .year-heading {
    position: static;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
  }
}

@media (max-width: 680px) {
  .container {
    padding: 0 18px;
  }
  .hero {
    padding-top: 32px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .hero-grid > * {
    min-width: 0;
  }
  /* Photo on the left, links in a 2x3 grid to its right */
  .hero-photo-col {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding-top: 0;
  }
  .hero-photo {
    width: 74px;
    height: 74px;
    flex-shrink: 0;
  }
  .hero-links-col {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: start;
    gap: 2px 10px;
    min-width: 0;
  }
  .side-link {
    padding: 5px 4px;
    gap: 6px;
    font-size: 0.78rem;
    white-space: nowrap;
  }
  .side-link svg {
    width: 13.5px;
    height: 13.5px;
  }
  /* Sliders stretch to the card width instead of pushing values off-screen */
  .demo-control-group {
    width: 100%;
  }
  .demo-control-group input[type="range"] {
    flex: 1;
    min-width: 0;
    width: auto;
  }
  /* Keep captions in view while the diagram scrolls sideways */
  .market-caption,
  .phase-dots,
  .stage-prompt {
    position: sticky;
    left: 0;
  }
  /* Justification looks ragged in a narrow column */
  .hero-bio p,
  .demo-desc,
  .pub-tldr {
    text-align: left;
  }
  .pub-summary {
    grid-template-columns: 1fr;
  }
  .pub-right {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .pub-right .cite-badge {
    margin-right: 0;
  }
  .nav-links {
    gap: 14px;
  }
  .site-brand {
    font-size: 1.05rem;
  }
  .chalk-shell {
    padding: 18px 16px;
  }
  .market-stage {
    overflow-x: auto;
    padding: 12px;
  }
  .market-stage svg {
    min-width: 600px;
  }
  .earlier-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title title"
      "note note"
      "authors authors"
      "venue details";
  }
  .earlier-right {
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 6px;
  }
  .footer-inner > :last-child {
    text-align: center;
  }
}

/* Demos page: clean editorial jump bar under the title */
.demo-index {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  margin-top: 18px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.demo-index-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-right: 4px;
}

.demo-index a {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--accent-deep);
  text-decoration: none;
  transition: color 0.15s ease;
}

.demo-index a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.demo-index-sep {
  color: var(--border-strong);
  user-select: none;
}

.chalk-shell {
  scroll-margin-top: 76px;
}

/* ---------- Project Page (MARVIN) ---------- */
.project-intro {
  padding-bottom: 20px;
}

.back-link {
  display: inline-block;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 14px;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--accent);
}

.project-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin: 0 0 8px;
}

.project-meta {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin: 0 0 16px;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.project-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.project-btn:hover {
  border-color: var(--accent-border);
  color: var(--accent);
}

.project-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.project-btn.primary:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #ffffff;
}

.project-section {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

.project-section:first-of-type {
  border-top: none;
  padding-top: 8px;
}

.project-heading {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
}

.project-prose p {
  font-size: 0.945rem;
  line-height: 1.66;
  color: var(--text-secondary);
  text-align: justify;
  text-justify: inter-word;
  text-wrap: pretty;
  hyphens: manual;
  margin: 0 0 14px;
}

.project-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 18px 0;
}

.project-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0 0;
}

.project-figure {
  margin: 18px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.project-grid-2 .project-figure,
.project-grid-3 .project-figure {
  margin: 0;
}

.project-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.project-grid-2 .project-figure img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.project-grid-3 .project-figure img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.project-figure-diagram {
  background: #ffffff;
}

.project-figure-diagram img {
  padding: 18px 20px 8px;
}

.project-figure figcaption {
  padding: 10px 14px 12px;
  font-size: 0.81rem;
  line-height: 1.48;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

@media (max-width: 680px) {
  .project-prose p {
    text-align: left;
  }
  .project-grid-2,
  .project-grid-3 {
    grid-template-columns: 1fr;
  }
}
