/* ============================================================
   DE²TR — project page stylesheet
   Based on the Academic Project Page Template
   (https://github.com/eliahuhorwitz/Academic-project-page-template),
   itself adopted from Nerfies. Palette adapted to the paper's
   dual-evidence identity (teal = semantic, coral = boundary).
   ============================================================ */

:root {
  --primary-color: #0A7E8C;        /* paper teal-dark */
  --primary-hover: #07616C;
  --secondary-color: #64748b;
  --accent-color: #0E9FAE;         /* paper teal */
  --accent-coral: #E8517E;         /* paper coral */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --background-primary: #ffffff;
  --background-secondary: #f8fafc;
  --background-accent: #f1f5f9;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --gradient-accent: linear-gradient(135deg, #0E9FAE 0%, #E8517E 100%);
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  background-color: var(--background-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;          /* prevent any stray element from causing horizontal scroll */
}

/* responsive images: never wider than their container */
img { max-width: 100%; height: auto; }

/* text accents: the paper's dual-evidence coding */
.txt-teal { color: var(--primary-color); }
.txt-coral { color: var(--accent-coral); }
.txt-gold { color: #B8760B; font-weight: 600; }

/* ---- buttons (template) ---- */
.button {
  border-radius: var(--border-radius) !important;
  font-weight: 600 !important;
  transition: var(--transition) !important;
  border: 2px solid transparent !important;
  position: relative;
  overflow: hidden;
}
.button.is-dark {
  background: var(--text-primary) !important;
  border: none !important;
  color: white !important;
  box-shadow: var(--shadow-md);
}
.button.is-dark:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: var(--primary-color) !important;
}
.button.is-dark:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}
.btn-disabled {
  opacity: .55;
  cursor: not-allowed;
}
.btn-disabled:hover {
  transform: none !important;
  box-shadow: var(--shadow-md) !important;
  background: var(--text-primary) !important;
}

.link-block a { margin: 8px 4px; }

/* ---- hero ---- */
.hero { position: relative; overflow: hidden; }
.hero.is-light {
  background: var(--background-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}
.hero-body { padding: 4rem 1.5rem; }
.teaser .hero-body { padding-top: 2rem; padding-bottom: 4rem; }
.publication-header .hero-body { padding: 5rem 1.5rem 3rem; }

.publication-title {
  font-family: 'Inter', sans-serif !important;
  font-weight: 800 !important;
  color: var(--text-primary) !important;
  margin-bottom: 2rem !important;
  line-height: 1.1 !important;
}
.publication-title .title-line { display: block; }

.publication-banner {
  max-height: 70vh;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  margin: 2rem 0;
}
.publication-banner img {
  border-radius: var(--border-radius-lg);
  width: 100%;
}
.teaser-caption {
  max-width: 900px; margin: 1rem auto 0;
  text-align: left; font-size: 1rem; line-height: 1.7;
}

.publication-authors {
  font-family: 'Inter', sans-serif !important;
  font-weight: 500;
  margin-bottom: 1rem;
}
.publication-authors a {
  color: var(--primary-color) !important;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  position: relative;
}
.publication-authors a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: var(--gradient-accent);
  transition: var(--transition);
}
.publication-authors a:hover::after { width: 100%; }
.publication-authors a:hover { color: var(--primary-hover) !important; }
.author-block { display: inline-block; margin-right: 0.5rem; }

.publication-venue {
  color: var(--text-secondary);
  width: fit-content;
  font-weight: 600;
  background: var(--background-accent);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  margin: 1rem auto 1.5rem;
  display: inline-block;
}

/* ---- section titles (template: centered + gradient underline) ---- */
.title.is-3 {
  font-family: 'Inter', sans-serif !important;
  font-weight: 700 !important;
  color: var(--text-primary);
  margin-bottom: 2rem !important;
  position: relative;
  padding-bottom: 1rem;
}
.title.is-3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

/* ---- content ---- */
.content.has-text-justified {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}
.content.has-text-justified p { margin-bottom: 1.5rem; }

.method-intro { margin-bottom: 1.8rem !important; }
.fig-caption { font-size: 0.9rem; color: var(--text-secondary); margin-top: 0.6rem; }

/* ---- carousel (template) ---- */
.results-carousel { overflow: hidden; padding: 1rem 0; }
.results-carousel .item {
  margin: 1rem;
  overflow: hidden;
  padding: 1.5rem;
  font-size: 0;
  background: var(--background-primary);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border: 1px solid var(--border-color);
}
.results-carousel .item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.results-carousel .item img,
.results-carousel video {
  margin: 0;
  border-radius: var(--border-radius);
  width: 100%;
  height: auto;
}
/* tall supplementary figures: display large so details stay readable;
   the (a)+(b) page is a single composite of the same form, so every page
   of the carousel shares the same display size */
#results-carousel .item img {
  width: auto; max-width: 100%; max-height: 90vh;
  margin: 0 auto; display: block;
}

/* ---- lightbox (click a carousel image to view full-size) ---- */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(15, 22, 36, 0.93);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; cursor: zoom-out;
  padding: 2rem;
}
.lightbox-overlay img {
  max-width: 96vw; max-height: 86vh; width: auto; height: auto;
  border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  background: #fff;
}
.lightbox-hint { color: #cbd5e1; font-size: 0.8rem; margin-top: 0.9rem; }
.results-carousel .subtitle {
  font-size: 1rem !important;
  color: var(--text-secondary);
  margin-top: 1rem;
  font-weight: 500;
}
.slider-pagination .slider-page { background: var(--primary-color); border-radius: 50%; }
.slider-pagination .slider-page.is-active { background: var(--primary-hover); transform: scale(1.2); }

/* ---- tables (three-line / booktabs style) ---- */
.table-wrapper { margin: 0 auto 2.5rem; }
.narrow-table { max-width: 680px; }
.table-title {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  text-align: center;
}
.table-note { font-size: 0.85rem; color: var(--text-secondary); margin: 0.4rem 0 0.9rem; }
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;   /* smooth inertia scrolling on iOS */
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.result-table {
  margin: 0 auto;
  min-width: 720px;
  width: 100%;
  table-layout: fixed;   /* deterministic column widths -> header groups center exactly */
  font-size: 0.85rem;
  border-collapse: collapse;
}
.narrow-table .result-table { min-width: 0; width: 100%; }
/* component ablation table: keep it compact so it fits the is-6 column without scrolling */
.result-table.ablation-table { min-width: 0; width: 100%; }
.result-table thead th {
  background: transparent !important;
  color: var(--text-primary) !important;
  border: none !important;
  font-weight: 700;
  text-align: center !important;   /* !important: beats Bulma's .table th:not([align]) { text-align: inherit } */
  vertical-align: middle !important; /* Bulma top-aligns th; multi-row (rowspan) headers must center vertically */
  padding: 0.5rem 0.55rem;
}
.result-table thead tr:first-child th { border-top: 2.4px solid #1E293B !important; }
.result-table thead tr:last-child th { border-bottom: 1.2px solid #1E293B !important; }
/* rowspan header cells (Method, Backbone, N, DEF, ...) span the full header height;
   give them the header underline too so the three-line table is complete */
.result-table thead th[rowspan] { border-bottom: 1.2px solid #1E293B !important; }
/* internal partial rules under grouped header cells (booktabs \cmidrule) — plain
   border-bottom, universally supported (a gradient-background variant painted the
   whole header dark in some browsers) */
.result-table thead th.cmid { border-bottom: 1.2px solid #1E293B !important; }
/* continuous internal rule spanning several groups (booktabs \cmidrule{2-13}) */
.result-table thead th.cmid-full { border-bottom: 1.2px solid #1E293B !important; }
.result-table tbody td {
  border: none !important;
  text-align: center !important;
  padding: 0.4rem 0.55rem;
}
.result-table tbody tr:last-child td { border-bottom: 2.4px solid #1E293B !important; }
.result-table tbody tr:hover td { background: #F8FAFC; }
.result-table th.th-method { text-align: left !important; }
.result-table tbody td:first-child { text-align: left !important; font-weight: 500; }
/* venue/year tag after method names (e.g. "M-DETR NeurIPS'21") */
.method-venue {
  font-size: 0.78em;
  font-weight: 400;
  color: var(--text-secondary);
  white-space: nowrap;
  margin-left: 0.35em;
}
/* the four 2x2 discussion tables: center their first column too */
.narrow-table .result-table tbody td:first-child { text-align: center !important; }
.result-table tbody td b { color: var(--text-primary); }
.result-table tbody td u { text-decoration-color: var(--primary-color); text-underline-offset: 3px; }
.result-table tr.ours td { background: #E0F4F7 !important; font-weight: 600; }
.result-table tr.ours-best td { background: linear-gradient(0deg, rgba(14,159,174,.10), rgba(14,159,174,.10)), #E0F4F7 !important; }
.table-foot {
  margin-top: 0.9rem; font-size: 0.85rem; color: var(--text-secondary);
  border-left: 3px solid var(--primary-color); padding-left: 0.8rem;
}
.table-foot b { color: var(--text-primary); }
.mini-note { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.6rem; }

/* ---- waterfall ---- */
.waterfall { display: flex; flex-direction: column; gap: 1.05rem; justify-content: center; padding: 0.6rem 0; }
.wf-row { display: grid; grid-template-columns: 172px 1fr; gap: 0.9rem; align-items: center; }
.wf-label { font-size: 0.82rem; color: var(--text-primary); font-weight: 500; text-align: right; line-height: 1.35; }
.wf-track { position: relative; height: 26px; }
.wf-bar { height: 100%; border-radius: 7px; min-width: 4px; }
.wf-gray   { background: #D6E1EF; }
.wf-teal-a { background: linear-gradient(90deg, #7CDBE4, #2FB8C5); }
.wf-teal-b { background: linear-gradient(90deg, #35C4D1, #0E9FAE); }
.wf-teal-c { background: linear-gradient(90deg, #0E9FAE, #0A7E8C); }
.wf-coral  { background: linear-gradient(90deg, #E8517E, #C23361); }
.wf-val {
  position: absolute; left: calc(var(--w, 0%) + 8px); top: 50%; transform: translateY(-50%);
  font-family: 'SF Mono', 'Monaco', 'Roboto Mono', monospace; font-weight: 600;
  font-size: 0.8rem; color: var(--text-primary); white-space: nowrap;
}
.wf-delta {
  position: absolute; left: calc(var(--w, 0%) + 62px); top: 50%; transform: translateY(-50%);
  font-size: 0.74rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap;
}
.wf-total {
  margin-top: 0.4rem; font-size: 0.84rem; color: var(--text-secondary);
  border-top: 1px dashed var(--border-color); padding-top: 0.9rem;
}
.wf-total b { font-family: 'Inter', sans-serif; font-size: 1.35rem; color: #C23361; }

/* ---- interactive demo ---- */
#demo.section { padding-top: 2rem; padding-bottom: 2rem; }
.case-selector {
  display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center;
  padding: 0; margin: 1rem 0 1rem;
}
.case-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: 'Inter', sans-serif; font-size: 0.86rem; font-weight: 600; color: var(--text-primary);
  background: #fff; border: 1px solid var(--border-color); border-radius: 999px;
  padding: 0.34rem 0.95rem; cursor: pointer; transition: var(--transition);
}
.case-chip:hover { border-color: var(--primary-color); color: var(--primary-color); }
.case-chip.active { background: var(--text-primary); border-color: var(--text-primary); color: #fff; }

/* video row on top (compact, one-screen friendly) */
.case-video-row {
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1rem 1.2rem 1.1rem;
  margin-bottom: 1rem;
}
.case-query {
  font-family: 'Inter', sans-serif; font-weight: 700; font-size: 1.05rem;
  color: var(--text-primary); line-height: 1.4; margin-bottom: 0.6rem;
}
.case-video {
  display: block; margin: 0 auto;
  width: auto; max-width: 100%; max-height: 42vh;
  border-radius: var(--border-radius); background: #101827;
}

/* three columns below the video: GT+preds | curve | top-5 frames */
.case-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1.15fr);
  gap: 1rem;
  align-items: stretch;
}
.case-col {
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  padding: 0.9rem 1rem;
  display: flex; flex-direction: column;
}
.case-segs-col { display: flex; flex-direction: column; gap: 0.6rem; }
.case-segs { display: flex; flex-direction: column; gap: 0.5rem; }
.seg-hint { font-size: 0.76rem; font-weight: 600; color: var(--text-secondary); }
.seg-row { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.seg {
  display: inline-flex; align-items: center; gap: 0.45rem;
  border-radius: 10px; padding: 0.36rem 0.7rem; font-size: 0.83rem;
  font-family: inherit;
}
.seg-gt {
  background: #E0F4F7; border: 1px solid #C4E9EE; color: var(--primary-color);
  font-family: 'SF Mono', 'Monaco', 'Roboto Mono', monospace; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.seg-gt:hover { box-shadow: 0 4px 12px -5px rgba(14,159,174,.5); transform: translateY(-1px); }
.seg-gt.playing { outline: 3px solid rgba(14,159,174,.35); }
.seg-none {
  background: var(--background-accent); border: 1px dashed var(--border-color);
  color: var(--text-light); font-size: 0.78rem;
}
.seg-pred {
  cursor: pointer; font-weight: 600;
  background: linear-gradient(90deg, #E8517E, #C23361); color: #fff; border: none;
  box-shadow: 0 6px 16px -8px rgba(194,51,97,.55);
  transition: var(--transition);
}
.seg-pred:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -8px rgba(194,51,97,.6); }
.seg-pred.playing { outline: 3px solid rgba(232,81,126,.35); }
.seg-pred .seg-play { font-size: 0.7rem; }
.seg-pred .seg-time { font-family: 'SF Mono', 'Monaco', 'Roboto Mono', monospace; }
.seg-iou {
  background: rgba(255,255,255,.22); border-radius: 6px;
  font-family: 'SF Mono', 'Monaco', 'Roboto Mono', monospace;
  font-size: 0.7rem; font-weight: 600; padding: 0.06rem 0.38rem;
}
.case-status { font-size: 0.75rem; color: var(--text-light); min-height: 1em; margin-top: auto; }

.case-curve-col { justify-content: center; }
.curve-box {
  border: 1px solid var(--border-color); border-radius: var(--border-radius);
  padding: 0.35rem; background: #fff;
}
#caseCurve { width: 100%; height: 170px; display: block; }
.curve-legend {
  display: flex; gap: 0.8rem; flex-wrap: wrap; justify-content: center; margin-top: 0.5rem;
  font-size: 0.74rem; color: var(--text-secondary);
}
.curve-legend span { display: inline-flex; align-items: center; gap: 0.3rem; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-teal { background: rgba(14,159,174,.25); border: 1px solid var(--accent-color); }
.sw-coral { background: rgba(232,81,126,.22); border: 1px dashed var(--accent-coral); }
.sw-gold { background: #F1A63C; border-radius: 50%; }

.top5 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; align-content: start; }
.frame-btn {
  position: relative; padding: 0; border: 2px solid var(--border-color); border-radius: 8px;
  overflow: hidden; cursor: pointer; background: #101827;
  transition: var(--transition);
}
.frame-btn img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.frame-btn:hover {
  transform: translateY(-3px); border-color: #F1A63C;
  box-shadow: 0 10px 20px -10px rgba(241,166,60,.5);
}
.frame-btn.playing { border-color: var(--accent-coral); box-shadow: 0 0 0 3px rgba(232,81,126,.3); }
.frame-time {
  position: absolute; left: 0; bottom: 0;
  background: rgba(15,22,36,.78); color: #fff;
  font-family: 'SF Mono', 'Monaco', 'Roboto Mono', monospace;
  font-size: 0.6rem; font-weight: 600; padding: 0.08rem 0.35rem;
  border-top-right-radius: 6px;
}
.frame-rank {
  position: absolute; top: 0; right: 0;
  background: #F1A63C; color: var(--text-primary);
  font-family: 'SF Mono', 'Monaco', 'Roboto Mono', monospace;
  font-size: 0.62rem; font-weight: 700; padding: 0.06rem 0.35rem;
  border-bottom-left-radius: 6px;
}
.case-tip {
  text-align: center; font-size: 0.8rem; color: var(--text-secondary);
  margin-top: 0.85rem; margin-bottom: 0;
}

/* ---- bibtex (template) ---- */
pre {
  background: var(--background-accent) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--border-radius) !important;
  padding: 1.5rem !important;
  font-size: 0.9rem !important;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
code {
  background: var(--background-accent) !important;
  color: var(--text-primary) !important;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace !important;
}
.bibtex-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem;
}
.bibtex-header .title { margin-bottom: 0 !important; }
.copy-bibtex-btn {
  background: var(--primary-color); color: white; border: none;
  border-radius: var(--border-radius); padding: 0.75rem 1rem;
  font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.copy-bibtex-btn:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.copy-bibtex-btn.copied { background: #10b981; }
.copy-bibtex-btn.copied .copy-text::after { content: "ied!"; }

/* ---- footer + scroll-to-top (template) ---- */
.footer { background: var(--background-secondary); border-top: 1px solid var(--border-color); padding: 3rem 1.5rem; }
.footer .content { color: var(--text-secondary); line-height: 1.7; }
.footer a { color: var(--primary-color); text-decoration: none; transition: var(--transition); }
.footer a:hover { color: var(--primary-hover); text-decoration: underline; }

.scroll-to-top {
  position: fixed; bottom: 2rem; right: 2rem;
  width: 50px; height: 50px;
  background: var(--primary-color); color: white;
  border: none; border-radius: 50%;
  cursor: pointer; opacity: 0; visibility: hidden;
  transition: var(--transition); z-index: 999;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; box-shadow: var(--shadow-lg);
}
.scroll-to-top:hover { background: var(--primary-hover); transform: translateY(-3px); box-shadow: var(--shadow-xl); }
.scroll-to-top.visible { opacity: 1; visibility: visible; }

/* ---- animation + accessibility (template) ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero, .section { animation: fadeInUp 0.6s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .hero, .section { animation: none; }
  html { scroll-behavior: auto; }
}
.button:focus, a:focus { outline: 2px solid var(--primary-color); outline-offset: 2px; }

/* ---- responsive (template) ---- */
@media screen and (max-width: 768px) {
  /* Bulma's .hero is display:flex; its .container child (flex item, min-width:auto)
     otherwise blows out to the wide table's min-content width on mobile.
     Force it to the viewport so .table-scroll can scroll the table instead. */
  .hero .container { width: 100% !important; max-width: 100% !important; min-width: 0 !important; }
  .hero-body { padding: 2rem 1rem; }
  .publication-header .hero-body { padding: 2rem 1rem 1.5rem; }
  .publication-title { font-size: 1.9rem !important; line-height: 1.25 !important; margin-bottom: 1.5rem !important; }
  .publication-authors { font-size: 1rem !important; }
  .button { margin: 0.25rem !important; font-size: 0.875rem !important; }
  .results-carousel .item { margin: 0.5rem; padding: 0.75rem; }
  .teaser .hero-body { padding: 1rem; }
  .content.has-text-justified { font-size: 1rem; text-align: left; }  /* justified text looks bad on narrow screens */
  .case-bottom { grid-template-columns: 1fr; }
  .top5 { grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
  #caseCurve { height: 220px; }
  .wf-row { grid-template-columns: 118px 1fr; }
  .table-title { font-size: 0.95rem; }
  .table-note { font-size: 0.78rem; }
  .result-table { font-size: 0.78rem; }
  .result-table thead th, .result-table tbody td { padding: 0.35rem 0.45rem; }
  .case-query { font-size: 1rem; }
  .case-tip { font-size: 0.75rem; }
  .case-chip { font-size: 0.8rem; padding: 0.3rem 0.8rem; }
}
@media screen and (max-width: 480px) {
  .publication-title { font-size: 1.35rem !important; }
  .hero-body { padding: 1.5rem 0.75rem; }
  .publication-header .hero-body { padding: 1.5rem 0.75rem 1rem; }
  .link-block { display: block; margin-bottom: 0.5rem; }
  .button { width: 100%; justify-content: center; font-size: 0.85rem !important; }
  .top5 { grid-template-columns: repeat(3, 1fr); }
  .publication-venue { font-size: 0.8rem; padding: 0.4rem 0.75rem; }
  .wf-row { grid-template-columns: 92px 1fr; gap: 0.5rem; }
  .wf-label { font-size: 0.72rem; }
  .case-video-row { padding: 0.75rem; }
  .case-bottom { gap: 0.75rem; }
  .case-tip { font-size: 0.72rem; }
  #caseCurve { height: 200px; }
}

/* medium phones / small screens */
@media screen and (min-width: 481px) and (max-width: 600px) {
  .publication-title { font-size: 1.6rem !important; }
}

/* ---- print ---- */
@media print {
  .scroll-to-top { display: none; }
  .hero, .section { animation: none; }
  .button { background: transparent !important; color: var(--text-primary) !important; box-shadow: none !important; }
}
