/* STACK project page revamp — new component styles.
   Spec: docs/superpowers/specs/2026-04-20-stack-project-page-revamp-design.md
   All styles here are additive; we do not override index.css. */

/* Hero breathing room — push the title down from the top of the page. */
.hero .hero-body {
  padding-top: 3.5rem;
}

@media (max-width: 768px) {
  .hero .hero-body { padding-top: 2rem; }
}

/* Author cards — thumbnail photo above linked name, flex row, wraps on narrow. */
.author-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem 1.75rem;
  margin: 1rem 0 0.5rem;
}

.author-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  max-width: 120px;
}

.author-photo-wrapper {
  display: block;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: hidden;
  background: #f2f2f2;
  border: 1px solid #e0e0e0;
  position: relative;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.author-photo-wrapper:hover {
  transform: translateY(-1px);
}

.author-photo-wrapper img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-photo-wrapper .initials {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: 'Google Sans', sans-serif;
  font-size: 1.3rem;
  color: #8C1515;
  letter-spacing: 0.04em;
}

.author-photo-wrapper.no-photo img { display: none; }
.author-photo-wrapper.no-photo .initials { display: flex; }

.author-name {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.95rem;
  color: #000 !important;
  text-decoration: none;
  text-align: center;
  line-height: 1.25;
}

.author-name:hover {
  text-decoration: underline;
  color: #414141 !important;
}

.author-name sup {
  font-weight: 400;
  color: #8C1515;
}

@media (max-width: 600px) {
  .author-cards { gap: 0.9rem 1.1rem; }
  .author-photo-wrapper { width: 64px; height: 64px; }
  .author-card { max-width: 100px; }
  .author-name { font-size: 0.88rem; }
}

/* ICRA 2026 venue badge — small pill under the title, thin border, no fill. */
.venue-badge {
  display: inline-block;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: #8C1515;
  border: 1px solid #8C1515;
  border-radius: 999px;
  padding: 0.2em 0.9em;
  margin-top: 0.3em;
  margin-bottom: 0.8em;
}

/* Teaser strip: 3-column grid of autoplay clips below the hero.
   Desktop: larger tiles, 3-column.
   Mobile: single row, horizontal scroll with snap (carousel feel). */
.teaser-strip {
  padding: 1rem 1.5rem 2.5rem;
  max-width: 1600px;
  margin: 0 auto;
}

.teaser-caption {
  font-family: 'Google Sans', sans-serif;
  font-size: 1.15rem;
  color: #2c2c2c;
  margin-bottom: 1.25rem;
}

.teaser-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  max-width: 1400px;
  margin: 0 auto;
}

.teaser-tile {
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  background: #000;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.teaser-tile:hover {
  transform: translateY(-2px);
}

.teaser-tile video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.teaser-tile figcaption {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.9rem;
  color: #53565A;
  padding: 0.65rem 0.9rem;
  background: #fafafa;
  border-top: 1px solid #e0e0e0;
}

@media (max-width: 900px) {
  .teaser-strip {
    padding: 1rem 0 2rem;
  }
  .teaser-caption {
    padding: 0 1rem;
  }
  .teaser-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 0 1rem 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .teaser-tile {
    flex: 0 0 85%;
    scroll-snap-align: center;
  }
  .teaser-grid::-webkit-scrollbar {
    height: 4px;
  }
  .teaser-grid::-webkit-scrollbar-thumb {
    background: #cbcbcb;
    border-radius: 2px;
  }
}

/* TL;DR — three numbered blocks, hairline dividers, no card fill. */
.tldr-section {
  padding: 1.5rem 1rem 2rem;
}

.tldr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.tldr-block {
  padding-top: 1rem;
  border-top: 1px solid #cbcbcb;
}

.tldr-numeral {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.9rem;
  color: #8C1515;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.tldr-body h3 {
  font-family: 'Google Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c2c2c;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.tldr-body p {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.95rem;
  color: #53565A;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .tldr-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* Paper figures: clean presentation of images pulled from the paper. */
.paper-figure {
  margin: 0.5rem auto 1.25rem;
  max-width: 100%;
  text-align: center;
}

.paper-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid #e5e5e5;
}

.paper-figure figcaption {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.88rem;
  color: #53565A;
  line-height: 1.5;
  padding: 0.6rem 0.5rem 0;
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
}

/* Thumbnail strip: horizontal row of clickable video stills. */
.thumb-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0.75rem 0 1rem;
  margin-bottom: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.thumb {
  position: relative;
  flex: 0 0 180px;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.15s ease, transform 0.15s ease;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
}

.thumb:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.thumb.active {
  opacity: 1;
  border-color: #8C1515;
  box-shadow: 0 0 0 1px #8C1515;
}

.thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.78rem;
  color: #fff;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.6);
}

@media (max-width: 700px) {
  .thumb-strip {
    justify-content: flex-start;
    flex-wrap: nowrap;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .thumb { flex: 0 0 150px; }
}

/* BibTeX block with copy button. */
.bibtex-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.bibtex-copy {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.85rem;
  color: #53565A;
  background: #f2f2f2;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  padding: 0.3rem 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.bibtex-copy:hover {
  background: #e8e8e8;
}

.bibtex-copy.copied {
  background: #e8f5e8;
  border-color: #4CAF50;
  color: #2d6a2d;
}

.bibtex-block {
  font-family: "Courier", monospace;
  font-size: 0.85rem;
  color: #2f2f2f;
  background-color: #f7f7f7;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  white-space: pre;
  line-height: 1.45;
}

/* Results tables: clean academic style, horizontal scroll on narrow. */
.results-table-wrap {
  overflow-x: auto;
  margin: 0.75rem 0 1.5rem;
  -webkit-overflow-scrolling: touch;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.88rem;
  color: #2c2c2c;
  min-width: 640px;
}

.results-table thead th {
  font-weight: 600;
  text-align: center;
  padding: 0.5rem 0.6rem;
  border-bottom: 2px solid #2c2c2c;
  background: transparent;
}

.results-table thead tr:first-child th:not(.row-head) {
  border-bottom: 1px solid #cbcbcb;
  padding-bottom: 0.35rem;
}

.results-table thead tr.subhead th {
  font-weight: 500;
  font-size: 0.8rem;
  color: #555;
  padding-top: 0.4rem;
  padding-bottom: 0.5rem;
  border-bottom: 1.5px solid #2c2c2c;
}

.results-table tbody td {
  text-align: center;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid #eee;
}

.results-table td.row-head,
.results-table th.row-head {
  text-align: left;
  font-weight: 500;
  padding-left: 0.25rem;
  padding-right: 1rem;
  white-space: nowrap;
}

.results-table td.best {
  font-weight: 700;
  color: #000;
}

.results-table tr.ours {
  background: rgba(140, 21, 21, 0.04);
}

.results-table tr.ours td {
  border-bottom-color: #d8bebd;
}

.results-table tr.ours td.row-head {
  color: #8C1515;
  font-weight: 600;
}

.results-table tr.ablation-first td {
  border-top: 1.5px solid #2c2c2c;
}

/* Floating TOC — distill-style rail on the left gutter.
   Desktop (>=1400px): fixed rail, always visible.
   Tablet/mobile: collapsed by default, opens as a drawer via the hamburger. */
html { scroll-behavior: smooth; }

/* Tighten global max-widths ~10% so text is more readable on wide monitors. */
.container.is-max-widescreen,
.container.is-fullhd {
  max-width: 1080px !important;
}

/* Let the teaser strip and its grid stay a bit wider for the video showcase. */
.teaser-strip { max-width: 1360px; }
.teaser-grid  { max-width: 1200px; }
.tldr-grid    { max-width: 1080px; }

.toc {
  position: fixed;
  top: 96px;
  left: 24px;
  z-index: 40;
  width: 210px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  font-family: 'Google Sans', sans-serif;
  border-left: 1px solid #e2e2e2;
  padding: 0.25rem 0 0.25rem 1rem;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.toc-title {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 0.6rem;
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc ul ul {
  padding-left: 0.8rem;
  margin-top: 0.2rem;
  margin-bottom: 0.3rem;
  border-left: 1px solid #efefef;
}

.toc li {
  margin: 0;
  padding: 0;
}

.toc a {
  display: block;
  font-size: 0.85rem;
  color: #7a7a7a;
  text-decoration: none;
  padding: 0.25rem 0.5rem 0.25rem 0;
  line-height: 1.35;
  border-left: 2px solid transparent;
  margin-left: -1rem;
  padding-left: 0.85rem;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.toc ul ul a {
  font-size: 0.78rem;
  color: #9a9a9a;
}

.toc a:hover {
  color: #2c2c2c;
}

.toc a.active {
  color: #8C1515;
  border-left-color: #8C1515;
  font-weight: 600;
}

/* Hamburger toggle — only visible when TOC is in drawer mode (<1400px). */
.toc-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 60;
  width: 44px;
  height: 44px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.toc-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #2c2c2c;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

body.toc-open .toc-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.toc-open .toc-toggle span:nth-child(2) { opacity: 0; }
body.toc-open .toc-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.toc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.2);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

@media (max-width: 1399px) {
  .toc-toggle { display: flex; }

  .toc {
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    max-height: 100vh;
    padding: 4.5rem 1rem 2rem 1.5rem;
    background: #fff;
    border-left: none;
    border-right: 1px solid #e2e2e2;
    box-shadow: 2px 0 8px rgba(0,0,0,0.04);
    transform: translateX(-110%);
    z-index: 50;
  }

  body.toc-open .toc { transform: translateX(0); }
  body.toc-open .toc-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 500px) {
  .toc { width: 84vw; }
}
