/* The time-lapse (js/timelapse.js): an ordinary section that loops the weeks of thumbnail testing for good, tweening
   back to day 0 each time round. The board races a channel's videos on click-through,
   flipping the lowest one's thumbnail over into its test's winner; beside it an activity feed, the app's Activity list,
   writes each step at the bottom and slides the older ones up and out. */
/* the automation's head over its feed: the mark, its name, and TRY (opens the desktop app, js/download.js) */
.tl-top { display: flex; align-items: center; gap: var(--sp-12); margin-bottom: var(--sp-24); }
.tl-top sb-mark { display: block; width: var(--ic-l); height: var(--ic-l); flex: none; }
.tl-top sb-mark > * { width: 100%; height: 100%; }
.tl-top h2 { min-width: 0; font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: var(--tr-h3); font-weight: 700; text-wrap: balance; }
/* TRY: a compact pill, shorter than the page's buttons */
.tl-try { flex: none; margin-left: auto; min-height: var(--sp-32); padding: 0 var(--sp-16); font-size: var(--fs-small); font-weight: 600; }
.tl-stage { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: var(--sp-48); align-items: center; }
/* the feed: its newest lines, a 3D icon and a line each, anchored to the bottom; the oldest fades out at the top. A
   line too long for its column wraps rather than lose its figures to an ellipsis (js measures what each one adds).
   It is the whole column beside the board, about as tall as the board */
.tl-feed { --feed-lines: 16; --line: var(--sp-32); position: relative; height: calc(var(--feed-lines) * var(--line)); overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, transparent, var(--ink) var(--line)); mask-image: linear-gradient(to bottom, transparent, var(--ink) var(--line)); }
.tl-feed-in { position: absolute; inset: auto 0 0; display: grid; transition: transform var(--d-slow) var(--ease-std); }
.tl-line { display: flex; align-items: center; gap: var(--sp-12); min-height: var(--line); padding-block: var(--sp-4); font-size: var(--fs-small); line-height: var(--lh-small); }
.tl-line span { min-width: 0; text-wrap: pretty; }
.tl-line .fx { flex: none; width: var(--ic-m); height: var(--ic-m); }
.tl-line.is-win { font-weight: 600; }
.tl-board-wrap { perspective: 1600px; }
/* the feeds and boards move their rows while you read: never the browser's scroll anchor, or each line that leaves
   the top of a feed (or a mail that leaves the inbox) scrolls the whole page up with it */
.tl-feed, .tl-board-wrap { overflow-anchor: none; }
.tl-board { padding: var(--sp-20); box-shadow: var(--lift); will-change: transform; }
.tl-head { display: flex; align-items: center; gap: var(--sp-8); margin-bottom: var(--sp-16); }
.tl-head img { width: var(--ic-m); height: var(--ic-m); }
.tl-head b { font-weight: 600; }
.tl-head span { margin-left: auto; font-size: var(--fs-meta); color: var(--muted); }
/* a row's thumbnail is exactly as tall as the face holds inside its padding and hairline, 16:9 wide */
.tl-rows { --row-h: 70px; --thumb-h: calc(var(--row-h) - var(--sp-8) - 2 * var(--sp-6) - 2 * var(--hair)); position: relative; height: calc(var(--rows, 5) * var(--row-h)); }
.tl-row { position: absolute; inset: 0 0 auto; height: var(--row-h); perspective: 900px; transform: translateY(calc(var(--rank, 0) * var(--row-h))); transition: transform var(--d-slow) var(--spring); }
.tl-card { position: relative; height: calc(var(--row-h) - var(--sp-8)); transform-style: preserve-3d; }
.tl-face { position: absolute; inset: 0; display: grid; grid-template-columns: calc(var(--thumb-h) * 16 / 9) minmax(0, 1.2fr) minmax(0, 0.8fr) var(--sp-64); align-items: center; gap: var(--sp-12); padding: var(--sp-6) var(--sp-12) var(--sp-6) var(--sp-6); background: var(--ground); border: var(--hair) solid transparent; border-radius: var(--r-ctl); backface-visibility: hidden; transition: background-color var(--d-slow) var(--ease-std), border-color var(--d-slow) var(--ease-std); }
.tl-back { transform: rotateX(180deg); }
/* the way back round to day 0: a slot whose thumbnail changes crossfades, the back face laid flat over the front */
.tl-card.is-xfade .tl-back { transform: none; }
.tl-face img { width: 100%; height: var(--thumb-h); object-fit: cover; border-radius: var(--r-ctl); }
/* the name gives way (an ellipsis) before its pills do: New, or Lowest in its place on the row being replaced */
.tl-name { display: flex; align-items: center; gap: var(--sp-6); min-width: 0; font-size: var(--fs-small); font-weight: 600; white-space: nowrap; }
.tl-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tl-new, .tl-row.is-low .tl-name::after { flex: none; }
.tl-new { padding: 1px var(--sp-6); border-radius: var(--r-pill); background: color-mix(in srgb, var(--win) 12%, var(--surface)); color: var(--win); font-size: var(--fs-tiny); font-style: normal; }
.tl-row.is-low .tl-new { display: none; }
.tl-bar { height: 10px; border-radius: var(--r-pill); background: var(--sel); overflow: hidden; }
.tl-bar i { display: block; height: 100%; background: var(--ink); transform-origin: left; transform: scaleX(0); transition: background-color var(--d-slow) var(--ease-std); }
.tl-rate { font-size: 17px; text-align: right; font-variant-numeric: tabular-nums; }
.tl-row.is-best .tl-face { background: var(--surface); border-color: color-mix(in srgb, var(--win) 45%, var(--sel)); }
.tl-row.is-best .tl-bar i { background: var(--win); }
.tl-row.is-low .tl-face { border-color: var(--ink); }
.tl-row.is-low .tl-name::after { content: "Lowest"; padding: 1px var(--sp-6); border-radius: var(--r-pill); background: var(--ink); color: var(--surface); font-size: var(--fs-tiny); }
.tl-row.is-testing .tl-rate { font-size: var(--fs-small); color: var(--muted); }

@media (max-width: 960px) {
  .tl-stage { grid-template-columns: minmax(0, 1fr); gap: var(--sp-16); }
  .tl-feed { --feed-lines: 4; }
}
@media (max-width: 640px) {
  .tl-top { gap: var(--sp-8); }
  .tl-top sb-mark { width: var(--sp-32); height: var(--sp-32); }
  .tl-top h2 { font-size: var(--fs-body); line-height: var(--lh-body); }
  .tl-head { flex-wrap: wrap; row-gap: var(--sp-2); }
  .tl-head span { flex-basis: 100%; margin-left: calc(var(--ic-m) + var(--sp-8)); }
  .tl-rows { --row-h: 60px; }
  .tl-line { gap: var(--sp-8); }
  .tl-line .fx { width: var(--ic-s); height: var(--ic-s); }
  .tl-board { padding: var(--sp-12); }
  .tl-face { grid-template-columns: calc(var(--thumb-h) * 16 / 9) minmax(0, 1fr) var(--sp-48); gap: var(--sp-8); }
  .tl-bar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tl-row, .tl-face, .tl-bar i, .tl-feed-in { transition: none; }
}
