/* Project page for "Explicit Frictional Contact Modeling in Neural Garment Simulation" (WACV 2027).
 *
 * Sits on top of the Nerfies template's bulma.min.css + index.css and changes only what this page
 * needs: a light palette, the matrix of tiles, and the SVG overlay that replaces the annotations
 * the film used to burn into the picture.
 *
 * The one layout rule everything else follows: the coefficients of ONE method are a tight group
 * (2 px between tiles, so the eye reads them as one strip), and the method groups are set apart.
 * That is the arrangement of the paper's own qualitative figure and it is what makes the response
 * to mu readable without remembering the previous tile.
 */
:root {
  --ink: #26282d;
  --dim: #6a7078;
  --rule: #e3e5e9;
  --accent: #2c5fa8;
  --tile-bg: #fbfbfc;
  --page: #ffffff;
  --sans: 'Google Sans', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica,
          Arial, sans-serif;
}

body { background: var(--page); color: var(--ink); font-family: var(--sans); }
.section { padding: 2.2rem 1.5rem; }
.title, .subtitle { font-family: var(--sans); color: var(--ink); }
.publication-title { font-size: 2.1rem; line-height: 1.22; letter-spacing: -0.01em; }
.hero { background: var(--page); }
.hero-body { padding: 2.4rem 1.5rem 1.2rem; }
.venue { color: var(--dim); font-size: 0.95rem; margin-top: 0.7rem; }

/* ---- authors and links under the title ---------------------------------------------------- */
.publication-authors { font-size: 1.1rem; margin-top: 0.9rem; }
.publication-authors .author-block { margin: 0 0.3rem; }
.publication-affils { color: var(--dim); font-size: 0.92rem; margin-top: 0.25rem; }
.link-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin-top: 1.1rem; }
.link-btn {
  display: inline-block; padding: 0.38rem 1.1rem; border-radius: 999px;
  background: var(--ink); color: #fff !important; font-size: 0.92rem;
}
.link-btn:hover { background: var(--accent); }
.link-btn.is-pending { opacity: 0.45; pointer-events: none; cursor: default; }

/* a container wider than bulma's widest: nine tiles across need the room */
.container.is-max-wide { max-width: 1680px; margin: 0 auto; }

/* ---- the two showoff pairs, above the abstract ------------------------------------------- */
.teaser .hero-body { padding-top: 0.6rem; }
.pairs { display: grid; gap: 2.4rem; align-items: start; }
.pair-cells { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.pair-label { font-weight: 600; margin-top: 0.55rem; font-size: 1rem; }
.pair-note { color: var(--dim); font-size: 0.9rem; line-height: 1.45; margin-top: 0.15rem; }
.munote {
  margin: 1.5rem auto 0; max-width: 62rem; text-align: center;
  font-size: 1.02rem; color: var(--ink);
}

/* ---- a tile ------------------------------------------------------------------------------ */
.cell { margin: 0; }
.cell .mu {
  font-size: 0.84rem; color: var(--dim); text-align: center;
  padding-bottom: 0.22rem; line-height: 1.25;
}
.vwrap { position: relative; line-height: 0; }
.cell video {
  display: block; width: 100%; height: auto; aspect-ratio: var(--ar);
  background: var(--tile-bg); border-radius: 2px;
}
/* the overlay: same viewBox as the rendered frame, so it scales with the tile and nothing
 * distorts. It never takes a click -- the click belongs to the video, which toggles the block. */
svg.cue { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
svg.cue g[data-on] { opacity: 0; transition: opacity 0.4s ease; }
svg.cue g[data-on].on { opacity: 1; }
svg.cue g[data-on].blink { animation: cue-blink 0.5s steps(1, end) 4; }
@keyframes cue-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ---- a comparison block ------------------------------------------------------------------ */
.blockset .title.is-3 { margin-bottom: 0.2rem; }
.blk { margin-top: 1.7rem; }
.blk:first-of-type { margin-top: 0.9rem; }
.cellid { color: var(--dim); font-size: 0.92rem; margin-bottom: 0.5rem; }
.grp { position: relative; }
.grp-bar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.ctl {
  font: inherit; font-size: 0.78rem; color: var(--accent); background: transparent;
  border: 1px solid var(--rule); border-radius: 3px; padding: 0.12rem 0.6rem; cursor: pointer;
}
.ctl:hover { background: #f3f6fb; }
.grp-hint { color: var(--dim); font-size: 0.78rem; }

/* --w is the block's total tile count. A four-tile ablation strip in the same container as a
 * nine-tile comparison would be more than twice the size and would read as the more important
 * result, which it is not; capping the tile width keeps the page's emphasis where the paper puts
 * it, while still giving the ablation the bigger tile its fabric detail needs. */
.srcs {
  display: grid; grid-template-columns: repeat(var(--g), 1fr); gap: 1.6rem;
  max-width: min(100%, calc(var(--w) * 270px)); margin-inline: auto;
}
.tiles { display: grid; grid-template-columns: repeat(var(--k), 1fr); gap: 2px; }
.srclab {
  text-align: center; font-size: 0.92rem; margin-top: 0.45rem; color: var(--ink);
  border-top: 1px solid var(--rule); padding-top: 0.35rem;
}
.srclab i { font-style: italic; }

/* ---- the additional-results carousel ------------------------------------------------------
 * One card per coefficient pair, in a horizontally scrollable, snap-aligned row (the layout of
 * the HOOD project page's Results section). Cards reuse .cell/.tiles, so a card is exactly a
 * two-tile strip with its own sync group; sync.js's IntersectionObserver lazy-loads cards as
 * they scroll into the row's viewport. */
.carnote { color: var(--dim); font-size: 0.92rem; margin: 0.2rem 0 0; }
.caro { position: relative; margin-top: 1.0rem; }
.caro-row {
  display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-behavior: smooth; padding: 0 2px 0.6rem; scrollbar-width: thin;
}
.card { flex: 0 0 auto; width: min(560px, 86vw); scroll-snap-align: start; }
.card .cellid { margin-bottom: 0.35rem; font-size: 0.88rem; }
.card-note { color: var(--dim); font-size: 0.88rem; line-height: 1.45; margin-top: 0.45rem; }
.caro-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.93); color: var(--accent);
  font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0;
}
.caro-btn:hover { background: #f3f6fb; }
.caro-btn.prev { left: -16px; }
.caro-btn.next { right: -16px; }
@media (max-width: 760px) {
  .caro-btn.prev { left: 2px; }
  .caro-btn.next { right: 2px; }
}

/* ---- composited comparison video ------------------------------------------------------------
 * One <video> per block (build_composites.py). Captions and method labels are page text laid on
 * grids whose fr columns are the composite's own pixel widths, so they sit exactly over their
 * tiles at any size. Below min-width the block scrolls sideways instead of shrinking to mush. */
.cmp { margin-inline: auto; }
.cmp-bar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.cmp-scroll { overflow-x: auto; scrollbar-width: thin; }
.cmp-caps, .cmp-labs { display: grid; }
.cmp-caps span {
  font-size: 0.84rem; color: var(--dim); text-align: center; line-height: 1.25;
  padding-bottom: 0.22rem; white-space: nowrap;
}
.cmp-labs span {
  text-align: center; font-size: 0.92rem; color: var(--ink); margin-top: 0.45rem;
  border-top: 1px solid var(--rule); padding-top: 0.35rem;
}
.cmp-labs span:empty { border-top: 0; }
.cmp-media { position: relative; width: 100%; line-height: 0; }
.cmp-media video { display: block; width: 100%; height: 100%; background: var(--tile-bg); cursor: pointer; }

/* ---- method overview ---------------------------------------------------------------------- */
.overview { margin: 1rem 0 0; }
.overview img { display: block; width: 100%; height: auto; }
.overview figcaption { color: var(--dim); font-size: 0.92rem; line-height: 1.55; margin-top: 0.7rem; }

/* ---- abstract, bibtex, footer ------------------------------------------------------------- */
.abstract-section .content p { font-size: 1rem; line-height: 1.62; }
#BibTeX pre { background: #f6f7f9; border-radius: 4px; font-size: 0.82rem; }
.footer { background: var(--page); border-top: 1px solid var(--rule); padding: 2rem 1.5rem; }
.footer .content p { color: var(--dim); font-size: 0.86rem; }

/* ---- narrower screens ---------------------------------------------------------------------
 * Nine tiles across stop being readable well before the viewport does, so the method groups
 * stack rather than shrink: within a group the coefficients stay side by side, which is the
 * comparison that matters.  */
@media (max-width: 1180px) {
  .srcs { grid-template-columns: 1fr; gap: 1.1rem; }
  .container.is-max-wide { max-width: 900px; }
}
@media (max-width: 760px) {
  .pairs { grid-template-columns: 1fr !important; }
  .publication-title { font-size: 1.6rem; }
  .section { padding: 1.4rem 0.9rem; }
}
