/* Videos hero: the headline, the quick starts, a peek at one recording, and the reel.
   The reel is every recording as a real frame, a row for each year, each frame as wide as the
   recording runs. Pointing at a frame, a year or a quick start changes what the peek shows. */

.vh {
  --vh-travel: cubic-bezier(0.28, 0.11, 0.32, 1);
  --vh-settle: cubic-bezier(0.32, 0.72, 0, 1);
  --vh-row: 30px;
  --vh-gap: 2px;
}
.vh__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  grid-template-areas: "copy peek" "reel reel";
  column-gap: clamp(2rem, 5vw, 5rem);
  row-gap: clamp(2.5rem, 5vw, 3.75rem);
  align-items: end;
}
.vh__copy { grid-area: copy; }

/* Quick starts: the sentence stays, each topic carries how many recordings it opens */
.vh-starts { margin-top: 1.5rem; max-width: 48ch; font-size: 1rem; color: var(--muted); line-height: 1.85; }
.vh-starts a {
  font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 100% 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: color 0.25s, background-size 0.35s var(--vh-travel);
}
.vh-starts a:hover, .vh-starts a:focus-visible, .vh-starts a.is-on { color: var(--accent); background-size: 100% 2px; }
.vh-starts__n {
  margin-left: 0.28em; font-family: var(--label); font-weight: 600; font-size: 0.8em;
  color: var(--muted); font-variant-numeric: tabular-nums; transition: color 0.25s;
}
.vh-starts a:hover .vh-starts__n, .vh-starts a:focus-visible .vh-starts__n, .vh-starts a.is-on .vh-starts__n { color: var(--accent); }

/* The peek: one recording, the newest at rest */
.vh-peek { grid-area: peek; display: block; text-decoration: none; color: var(--ink); }
.vh-peek[hidden] { display: none; }
.vh-peek__shot {
  position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden;
  background: var(--mist-2); box-shadow: var(--shadow-2);
}
.vh-peek__shot img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; filter: blur(12px); transform: translateY(8px) scale(1.04);
}
.vh-peek__shot img.is-base { opacity: 1; filter: none; transform: none; z-index: 1; }
.vh-peek__shot img.is-front {
  opacity: 1; filter: none; transform: none; z-index: 2;
  transition: opacity 0.42s var(--vh-travel), filter 0.5s var(--vh-travel), transform 0.6s var(--vh-settle);
}
/* surgical footage stays blurred here too; the player is where it can be shown */
.vh-peek__shot img.is-graphic { filter: blur(14px) saturate(0.5); transform: scale(1.12); }
.vh-peek__veil {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center;
  font-family: var(--label); font-weight: 600; font-size: 1rem; color: #fff;
  text-shadow: 0 1px 8px rgba(10, 13, 18, 0.5); opacity: 0; transition: opacity 0.35s var(--vh-travel);
  pointer-events: none;
}
.vh-peek.is-graphic .vh-peek__veil { opacity: 1; }
.vh-peek .play {
  left: 1rem; bottom: 1rem; z-index: 4; width: 50px; height: 50px;
  transition: transform 0.45s var(--vh-settle);
}
.vh-peek:hover .play, .vh-peek:focus-visible .play { transform: scale(1.1); }
.vh-peek__txt { display: block; }
.vh-peek__t {
  display: block; margin-top: 0.95rem; font-family: var(--display); font-weight: 600;
  font-size: 1.3rem; line-height: 1.25; text-wrap: balance; transition: color 0.25s;
}
.vh-peek:hover .vh-peek__t { color: var(--accent); }
.vh-peek__m { display: block; margin-top: 0.3rem; font-family: var(--label); font-weight: 500; color: var(--muted); }
.vh-peek__m b { font-weight: 600; color: var(--ink); }

/* The reel */
.vh-reel { grid-area: reel; margin: 0; }
.vh-reel[hidden] { display: none; }
.vh-reel__rows { display: grid; gap: 7px; }
.vh-row { display: grid; grid-template-columns: 3rem minmax(0, 1fr); align-items: center; gap: 0.6rem; }
.vh-yr {
  justify-self: start; padding: 0.15rem 0; border: 0; background: none; cursor: pointer;
  font-family: var(--label); font-weight: 600; font-size: 0.86rem; color: var(--muted);
  font-variant-numeric: tabular-nums; transition: color 0.25s;
}
.vh-yr:hover, .vh-yr:focus-visible, .vh-row.is-row .vh-yr { color: var(--ink); }
.vh-yr.is-cur { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.vh-tape {
  display: flex; align-items: center; gap: var(--vh-gap); height: var(--vh-row); min-width: 0;
  clip-path: inset(-14px -10px -14px -10px);
}
.js .vh-reel:not(.is-in) .vh-tape { clip-path: inset(-14px 100% -14px -10px); }
.vh-reel.is-in .vh-tape {
  transition: clip-path 0.9s var(--vh-travel);
  transition-delay: calc(var(--r, 0) * 45ms);
}
.vh-f {
  position: relative; flex: 0 0 auto; height: 100%; padding: 0; border: 0; border-radius: 3px;
  overflow: hidden; background: var(--mist-2); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 0.45s var(--vh-settle), opacity 0.4s var(--vh-travel), box-shadow 0.3s;
}
.vh-f img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.34); filter: saturate(0.45) contrast(0.92) brightness(1.04);
  transition: filter 0.4s var(--vh-travel);
}
.vh-f.is-graphic img { filter: blur(3px) saturate(0.35); transform: scale(1.6); }
.vh-f:focus-visible { outline: none; }
.vh-n {
  flex: 0 0 auto; margin-left: 0.5rem; font-family: var(--label); font-weight: 600; font-size: 0.82rem;
  color: var(--muted); font-variant-numeric: tabular-nums; transition: color 0.3s, opacity 0.3s;
}

/* pointing: the row wakes up, the frame under the pointer lifts in full colour */
.vh-row:hover .vh-f img, .vh-row.is-row .vh-f img { filter: saturate(1); }
.vh-row:hover .vh-f.is-graphic img, .vh-row.is-row .vh-f.is-graphic img { filter: blur(3px) saturate(0.6); }
.vh-f.is-n2 { transform: scaleY(1.06); }
.vh-f.is-n1 { transform: scaleY(1.14); }
.vh-f.is-hot { transform: scaleY(1.32); z-index: 2; box-shadow: 0 6px 16px rgba(10, 13, 18, 0.28); }
.vh-f.is-hot img { filter: saturate(1.05); }
.vh-f.is-hot.is-graphic img { filter: blur(3px) saturate(0.7); }
/* the frame the peek is showing */
.vh-f.is-on { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--accent); z-index: 1; }
.vh-f.is-on.is-hot { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--accent), 0 6px 16px rgba(10, 13, 18, 0.28); }

/* a quick start or a year in focus: its frames stay lit, the rest step back */
.vh-reel.is-q .vh-f { opacity: 0.16; }
.vh-reel.is-q .vh-f.is-hit { opacity: 1; transform: scaleY(1.16); transition-delay: calc(var(--i, 0) * 22ms); }
.vh-reel.is-q .vh-f.is-hit img { filter: saturate(1); }
.vh-reel.is-q .vh-f.is-hit.is-graphic img { filter: blur(3px) saturate(0.6); }
.vh-reel.is-q .vh-f.is-hit.is-hot { transform: scaleY(1.32); }
.vh-reel.is-q .vh-n { color: var(--accent); }
.vh-reel.is-q .vh-n.is-zero { opacity: 0; }
.vh-reel.is-q .vh-yr { color: var(--line-2); }
.vh-reel.is-q .vh-row.is-lit .vh-yr { color: var(--ink); }

.vh-reel__cap {
  margin-top: 1rem; padding-left: calc(3rem + 0.6rem); font-family: var(--label); font-weight: 500;
  font-size: 0.92rem; color: var(--muted);
}

@media (max-width: 960px) {
  .vh__grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "reel" "peek"; }
  .vh-peek { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 1.1rem; align-items: center; }
  .vh-peek__t { margin-top: 0; }
}
@media (max-width: 600px) {
  .vh { --vh-row: 20px; --vh-gap: 1px; }
  .vh__grid { row-gap: 2rem; }
  .vh-reel__rows { gap: 5px; }
  .vh-row { grid-template-columns: 2.3rem minmax(0, 1fr); gap: 0.4rem; }
  .vh-yr { font-size: 0.76rem; }
  .vh-n { margin-left: 0.35rem; font-size: 0.74rem; }
  .vh-f { border-radius: 2px; }
  .vh-reel__cap { padding-left: calc(2.3rem + 0.4rem); font-size: 0.84rem; }
  .vh-peek { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 0.85rem; align-items: start; }
  .vh-peek__shot { border-radius: 12px; }
  .vh-peek .play { left: 0.5rem; bottom: 0.5rem; width: 32px; height: 32px; }
  .vh-peek .play::before { margin-left: 2px; border-left-width: 8px; border-top-width: 5px; border-bottom-width: 5px; }
  .vh-peek__t { font-size: 1.02rem; }
  .vh-peek__m { font-size: 0.84rem; }
  .vh-peek__veil { font-size: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .vh-reel .vh-tape, .js .vh-reel:not(.is-in) .vh-tape { clip-path: none; transition: none; }
  .vh-f, .vh-f img, .vh-n, .vh-peek__shot img, .vh-peek__shot img.is-front, .vh-peek .play, .vh-peek__veil { transition: none; }
  .vh-reel.is-q .vh-f.is-hit { transition-delay: 0ms; }
}
