/* ==========================================================================
   MoSk project page: brand tokens and page components.
   The shared components (layout, nav, hero, section heads, figures, tabs,
   tables, disclosures, key points, lightbox, BibTeX, footer) are in
   family.css, which this file follows. Two sets of colours:
   - the logo's: orange #E8641B ("Mo", the motion half of the figure) and
     blue #3A6FD0 ("Sk", the skeleton half), for the wordmark and the title;
   - the page accent: the pink in which the paper's figures draw MoSk
     (#FF428E outlines on #FFD9E8 fills), for everything else.
   ========================================================================== */

/* ---------- 1. Brand tokens ---------------------------------------------- */
:root {
  --accent: #FF428E;           /* the paper's pink: rules, borders, bars, focus rings; too light for small text (3.3:1) */
  --accent-text: #CF2077;      /* pink for small text and white-on-colour fills (5.1:1 on white, 4.6:1 on the tint) */
  --accent-strong: #A3175D;    /* hover */
  --accent-soft: #FFF1F6;      /* tinted fills */
  --accent-line: #FFC9DD;      /* tinted borders (the paper's fill pink #FFD9E8, a little stronger) */
  --brand-mo: #E8641B;         /* logo orange ("Mo"): large text only (3.4:1 on white) */
  --brand-sk: #3A6FD0;         /* logo blue ("Sk"), 4.8:1 on white */
  --logo-k: 1.466;             /* hero logo height factor: the wordmark's capitals as tall as GeoSET's (54 px at 1440) */
}

/* wordmark (nav, footer) and title in the logo's two colours: orange "Mo" / "Motion", blue "Sk" / "Skeleton" */
.wordmark { color: var(--brand-mo); }
.wordmark > span { color: var(--brand-sk); }
.hero-mo { color: var(--brand-mo); }
.hero-sk { color: var(--brand-sk); }
/* the mark is a tall, narrow figure: a little taller than the family default (28 / 22 px) so that it stays legible */
.topnav-brand img { height: 32px; }
.footer-brand img { height: 25px; }

/* hero: the logo keeps its aspect ratio if the column is ever narrower than the lockup */
.hero-logo { object-fit: contain; }
/* phones: the three names fit on one line from 375 px up (the family's 22 px gap would drop the last name) */
@media (max-width: 420px) { .hero-authors { column-gap: 10px; } }
/* the title breaks where the paper's title does, once both lines fit */
@media (min-width: 900px) {
  .hero-title { max-width: none; }
  .hero-title .t-line { display: block; }
}

/* ---------- 2. Headline: paper Fig. 1 next to Table 1 --------------------- */
.overview {
  display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  gap: clamp(24px, 3.4vw, 44px); align-items: center;
}
.overview .table-figure > figcaption { font-size: .875rem; }
.overview-fig figcaption { max-width: 64ch; }
@media (max-width: 1179px) {
  .overview { grid-template-columns: minmax(0, 1fr); }
  .overview-fig { width: 100%; max-width: 680px; margin-inline: auto; }
  .overview .table-figure { width: 100%; max-width: 680px; margin-inline: auto; }
}

/* ---------- 3. Paper figures: prev, thumbnail strip, next ----------------- */
/* carousel slides: large, but never taller than the viewport, so the whole figure can be seen at once */
.fig-carousel .slide[style*="--ar"] .figure-media {
  max-width: min(100%, max(var(--min-w, 760px), calc((100vh - 150px) * var(--ar))));
  margin-inline: auto;
}
@supports (height: 100svh) {
  .fig-carousel .slide[style*="--ar"] .figure-media {
    max-width: min(100%, max(var(--min-w, 760px), calc((100svh - 150px) * var(--ar))));
  }
}
/* horizontal scroller with edge fades (fade classes set by main.js) */
.hscroll {
  position: relative;
  overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.hscroll::-webkit-scrollbar { display: none; }
.carousel-nav { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 18px; }
.carousel-nav .thumbs { flex: 0 1 auto; min-width: 0; }
.thumbs { display: flex; gap: 10px; padding: 3px; scroll-padding-inline: 3px; }
.thumb {
  flex: 0 0 132px;
  display: flex; flex-direction: column; gap: 6px;
  padding: 5px 5px 7px; border-radius: var(--radius); text-align: left;
  background: var(--bg); border: 1px solid var(--border);
  transition: border-color .15s, box-shadow .15s;
  scroll-snap-align: start;
}
.thumb:hover { border-color: var(--border-strong); }
.thumb img {
  width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: contain;
  border-radius: var(--radius-s); background: #fff; border: 1px solid var(--border);
}
.thumb span {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  padding: 0 3px; font-size: .78rem; line-height: 1.35; color: var(--muted); font-weight: 500;
}
.thumb span b { color: var(--ink); font-weight: 700; margin-right: 2px; }
.thumb[aria-selected="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
@media (max-width: 640px) {
  .carousel-nav .carousel-btn { display: none; }
  .thumb { flex-basis: 128px; }
}

/* ---------- 4. Tables ------------------------------------------------------ */
.results-note { margin-top: 14px; }
.table-figure .table-note { margin-top: 10px; }
/* the paper's "Motion-skeleton unified" category row carries the MoSk tint */
.results tr.group--ours td { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
/* Tables 5 and 12: the dataset names are group rows (upright, as labels rather than categories) */
.results tr.group--data td { font-style: normal; font-weight: 600; color: var(--text); }
/* mean ± std: the deviation is secondary */
.results .pm { margin-left: 1px; font-size: .8em; font-weight: 500; color: var(--muted); }
/* check / cross marks (Table 7) */
.results .mark-x { color: var(--faint); }
.results .mark-ok { color: var(--text); font-weight: 700; }
.results--checks tr.ours td:first-child { box-shadow: inset 3px 0 0 var(--ours-bar); }
.results td.col-text { text-align: left; font-variant-numeric: normal; color: var(--text); font-weight: 500; }
/* reference rows without MoSk alignment (Tables 6, 10 and 11): a label across the first columns */
.results tr.ref td { background: var(--bg-band); color: var(--muted); }
.results tr.ref td.col-span { position: static; font-style: italic; font-weight: 500; color: var(--muted); background: var(--bg-band); }
/* Table 11: both frame counts are numbers, so the first column is centred like the second */
.results--frames td.col-method, .results--frames thead .col-method { text-align: center; }
.results--frames tr.ref td.col-span { text-align: left; }
/* Table 1: three right-aligned columns, as in the paper; the total row closes the table */
.results--corpus td:not(.col-method), .results--corpus thead th:not(.col-method) { text-align: right; }
.results--corpus td.col-text { color: var(--text-2); font-weight: 400; }
/* phones: Table 1 fits without scrolling (tighter cells, dataset names may wrap) */
@media (max-width: 480px) {
  .results--corpus th, .results--corpus td { padding-inline: 6px; }
  .results--corpus .col-method { white-space: normal; padding-left: 10px; }
  .results--corpus tr.group td { white-space: normal; }
}
/* tables with few columns keep their numbers close enough to read across
   (width: 100% so that grid items with auto margins do not grow to the table's nowrap width) */
.table-figure--narrow, .table-figure--mid { width: 100%; margin-inline: auto; }
.table-figure--narrow { max-width: 780px; }
.table-figure--mid { max-width: 940px; }
/* disclosure titles: no single-word second line; sub-labels ("Tables 6 and 7") never break inside */
.disclosure > summary { text-wrap: balance; }
.summary-sub { white-space: nowrap; }
/* no single-word last lines in key points, captions and notes (family.css applies this to p only) */
.keypoints li, .figure > figcaption, .table-figure > figcaption, .table-note { text-wrap: pretty; }
/* synthetic-italic variables (J, p, x) lean into the next glyph: give them a hair of room */
figcaption i, .table-note i, .results i { margin-right: .04em; }

/* ---------- 5. BibTeX: the prior-work entry (SOfA) under the paper's own entry */
.bibtex + .bibtex { margin-top: 16px; }
.bibtex-label { margin-right: auto; font: 600 .8125rem/1.35 var(--font-sans); color: var(--muted); }
.bibtex-label a { color: var(--accent-text); text-decoration: none; }
.bibtex-label a:hover { text-decoration: underline; }
.bibtex pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- 6. Print ------------------------------------------------------ */
@media print {
  .topnav, .copy-btn, .carousel-nav .carousel-btn, .skip-link { display: none !important; }
  .section { padding-block: 24px; }
}

