/* Home: videos. Owned by the videos section agent (homepage 100x work, 2026-09-23).
   The page's only video player. One screen previews each talk with its real frames (YouTube's
   seek-preview storyboard, every frame looked at by eye before it went in), a timeline under it
   that you can scrub, and a queue coupled to the screen: pointing at a talk turns the screen to it. */

.videos-head { display: flex; justify-content: space-between; align-items: end; gap: 1.25rem 3rem; flex-wrap: wrap; }
.videos-lede { margin-top: 1rem; }

/* THE FILTERS: real ones (they re-pick the queue from the data), in the site's own toggle style */
.videos-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.videos-filters[hidden] { display: none; }
.videos-filter { height: 40px; padding: 0 1rem; font-size: 0.95rem; }
@media (pointer: coarse) { .videos-filter { height: 44px; } }

.videos-grid {
  margin-top: clamp(2rem, 4vw, 3rem);
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 2.75rem); align-items: start;
}

/* THE SCREEN: poster, frame canvas, scrim, and one link over all of it (click to watch) */
.videos-screen {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-card); overflow: hidden;
  background: var(--ink); isolation: isolate;
  box-shadow: 0 1px 2px rgba(10, 13, 18, 0.06), 0 10px 20px -10px rgba(10, 13, 18, 0.22), 0 34px 70px -28px rgba(10, 13, 18, 0.42);
}
.videos-screen__poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.45s var(--ease-soft);
}
.videos-screen__poster.is-on { opacity: 1; }
.videos-screen__canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  opacity: 0; transition: opacity 0.22s var(--ease-soft); pointer-events: none;
}
.videos-screen__canvas.is-on { opacity: 1; }
.videos-screen::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(to top, rgba(10, 13, 18, 0.5), rgba(10, 13, 18, 0) 42%);
}
.videos-screen__link { position: absolute; inset: 0; z-index: 3; display: block; cursor: pointer; }
.videos-screen__link:focus-visible { outline: 3px solid var(--lightbox); outline-offset: -7px; border-radius: var(--r-card); }
/* surgical demonstrations: poster and frames stay blurred until the visitor asks to see them */
.videos-screen__poster, .videos-screen__canvas { transition: opacity 0.45s var(--ease-soft), filter 0.5s var(--ease-out), transform 0.6s var(--ease-out); }
.videos-screen__canvas { transition-duration: 0.22s, 0.5s, 0.6s; }
.videos-screen.is-graphic .videos-screen__poster,
.videos-screen.is-graphic .videos-screen__canvas { filter: blur(22px) saturate(0.35); transform: scale(1.12); }
.videos-gate {
  position: absolute; inset: 0; z-index: 4; display: grid; place-content: center; justify-items: center; gap: 0.9rem;
  padding: 1rem; text-align: center; background: rgba(10, 13, 18, 0.45); pointer-events: none;
}
.videos-gate[hidden] { display: none; }
.videos-gate__t { font-family: var(--label); font-weight: 600; font-size: 1.05rem; color: var(--paper); text-shadow: 0 1px 8px rgba(10, 13, 18, 0.5); }
.videos-gate__btn { pointer-events: auto; }
.videos-gate__btn:focus-visible { outline: 3px solid var(--paper); outline-offset: 3px; }
/* "Plays here": shown only when YouTube says this video may play inside the page (live check) */
.videos-here {
  position: absolute; right: 1.15rem; bottom: 1.35rem; z-index: 3; pointer-events: none;
  font-family: var(--label); font-weight: 600; font-size: 0.95rem; color: var(--paper); text-shadow: 0 1px 6px rgba(10, 13, 18, 0.6);
  opacity: 0; translate: 0 4px; transition: opacity 0.3s, translate 0.4s var(--ease-out);
}
.videos-screen.is-here .videos-here { opacity: 1; translate: 0 0; }
/* the video itself, when it plays here */
.videos-screen__frame { position: absolute; inset: 0; z-index: 6; width: 100%; height: 100%; border: 0; background: var(--ink); }
.videos-screen.is-playing .videos-screen__link, .videos-screen.is-playing .videos-gate, .videos-screen.is-playing .videos-here { display: none; }
.videos-screen .play { left: 1.25rem; bottom: 1.25rem; width: 64px; height: 64px; }
.videos-screen .play::before { border-left-width: 18px; border-top-width: 11px; border-bottom-width: 11px; margin-left: 5px; }
.videos-screen:hover .play, .videos-screen__link:focus-visible .play { transform: scale(1.08); }

/* THE TIMELINE: the talk's length, a tick where each preview frame sits, and a playhead */
.videos-line { position: relative; margin-top: 0.85rem; height: 44px; cursor: pointer; touch-action: pan-y; outline: none; }
.videos-line[hidden] { display: none; }
.videos-line.is-off { visibility: hidden; }
.videos-line__track { position: absolute; left: 0; right: 0; top: 14px; height: 3px; border-radius: 2px; background: var(--line-2); }
.videos-line__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 2px; background: var(--accent); }
@keyframes videos-tick-in { from { opacity: 0; transform: scaleY(0); } }
.videos-line__tick {
  position: absolute; top: -3px; width: 1px; height: 9px; background: rgba(10, 13, 18, 0.2);
  transition: background 0.2s, transform 0.3s var(--ease-spring);
  animation: videos-tick-in 0.45s var(--ease-out) backwards;
}
.videos-line.is-loading { cursor: default; }
.videos-line.is-loading .videos-line__head { opacity: 0.35; }
.videos-line.is-live .videos-line__tick { background: rgba(10, 13, 18, 0.3); }
.videos-line .videos-line__tick.is-hot { background: var(--ink); transform: scaleY(1.7); }
/* the playhead is a knob on the track: at rest it waits at 0:00 as an open ring, so the line
   reads as something to drag; live, it fills in */
.videos-line__head {
  position: absolute; left: 0; top: 15.5px; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%;
  background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink), 0 1px 4px rgba(10, 13, 18, 0.18);
  transition: left 0.12s linear, transform 0.35s var(--ease-spring), background 0.2s;
}
.videos-line.is-live .videos-line__head { background: var(--ink); transform: scale(1.1); }
.videos-line:hover .videos-line__head { transform: scale(1.25); }
.videos-line__fill { transition: width 0.12s linear; }
/* the trailer moves the playhead in long, eased strides; a scrub follows the hand closely */
.videos-line.is-trailer .videos-line__head { transition: left 0.5s var(--ease-out), transform 0.35s var(--ease-spring), background 0.2s; }
.videos-line.is-trailer .videos-line__fill { transition: width 0.5s var(--ease-out); }
.videos-line.is-live .videos-line__ends span:first-child { color: var(--ink); font-weight: 600; }
.videos-line__ends {
  position: absolute; left: 0; right: 0; top: 24px; display: flex; justify-content: space-between;
  font-family: var(--label); font-weight: 500; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums;
}
/* a keyboard ring the eye can find on mist: the site's accent outline, not a soft glow */
.videos-line:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

/* THE CAPTION: what is on the screen */
.videos-cap { margin-top: 0.35rem; }
/* without JavaScript there is no timeline: give the caption its own air under the screen */
.videos-screen + .videos-cap { margin-top: 1rem; }
.videos-cap__t { font-size: clamp(1.25rem, 1.6vw, 1.5rem); text-wrap: balance; }
.videos-cap__m { margin-top: 0.3rem; font-family: var(--label); font-weight: 500; color: var(--muted); }

/* THE QUEUE: every row can turn the screen; the one on screen is lifted off the page */
.videos-queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.videos-row {
  position: relative; display: grid; grid-template-columns: 8.75rem minmax(0, 1fr); gap: 1rem; align-items: center;
  padding: 0.55rem; border-radius: var(--r-card); text-decoration: none; color: var(--ink);
  transition: background 0.25s, box-shadow 0.35s var(--ease-out);
}
.videos-row[aria-current="true"] { background: var(--paper); box-shadow: var(--shadow-1); }
.videos-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.videos-row__thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--r-photo); overflow: hidden; background: var(--mist-2); }
.videos-row__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease-out); }
/* the talk on the screen carries the play mark, like the screen itself: this one, now */
.videos-row__thumb .play {
  left: 0.4rem; bottom: 0.4rem; width: 26px; height: 26px; box-shadow: 0 2px 8px rgba(10, 13, 18, 0.3);
  opacity: 0; transform: scale(0.6); transition: opacity 0.25s, transform 0.45s var(--ease-spring);
}
.videos-row__thumb .play::before { border-left-width: 8px; border-top-width: 5px; border-bottom-width: 5px; margin-left: 2px; }
.videos-row[aria-current="true"] .videos-row__thumb .play, .videos-row:focus-visible .videos-row__thumb .play { opacity: 1; transform: scale(1); }
.videos-row__body { display: block; min-width: 0; }
.videos-row__t { display: block; font-family: var(--display); font-weight: 600; font-size: 1.02rem; line-height: 1.28; text-wrap: pretty; transition: color 0.2s; }
.videos-row__m { display: block; margin-top: 0.3rem; font-family: var(--label); font-weight: 500; font-size: 0.85rem; color: var(--muted); }
/* the talk's length, every talk on one scale (70 minutes is a full bar); while the screen runs
   this talk, the bar fills in step with it */
.videos-row__len {
  position: relative; display: block; margin-top: 0.5rem; height: 2px; border-radius: 1px; overflow: hidden;
  width: calc(var(--videos-len, 0.5) * 100%); background: var(--line-2);
}
.videos-row__len i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); transition: width 0.5s var(--ease-out); }
.videos-row[aria-current="true"] .videos-row__len { background: rgba(10, 13, 18, 0.24); }
.videos-row.is-graphic .videos-row__thumb img { filter: blur(7px) saturate(0.35); transform: scale(1.18); }
/* hover styles only where there is a real hover, so a tapped row does not stay lit */
@media (hover: hover) {
  .videos-row:hover { background: rgba(255, 255, 255, 0.55); }
  .videos-row[aria-current="true"]:hover { background: var(--paper); }
  .videos-row:hover .videos-row__thumb img { transform: scale(1.05); }
  .videos-row.is-graphic:hover .videos-row__thumb img { transform: scale(1.18); }
  .videos-row:hover .videos-row__t { color: var(--accent); }
}
/* a new pick of talks arrives row by row */
@keyframes videos-row-in { from { opacity: 0; translate: 0 10px; } }
.videos-row.is-in { animation: videos-row-in 0.5s var(--ease-out) backwards; }
.videos-more { margin-top: 1.25rem; padding-left: 0.55rem; }

@media (max-width: 960px) {
  .videos-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .videos-row { grid-template-columns: 7rem minmax(0, 1fr); gap: 0.85rem; }
  .videos-screen .play { left: 0.9rem; bottom: 0.9rem; width: 52px; height: 52px; }
}
