/* InternDoor study videos: /videos and /videos/<slug> (29 Oct 2026). Loaded only by those pages.
   The list (.vl-) and the watch page (.vw-) are the pages without JavaScript; videos.js builds the
   feed (.vf-) over them. Calm system: zinc, one lime action per view (Practise), glass only on what
   floats over the video (the top bar, the quiz sheet, the toast-like badges), never on content cards.
   The feed is dark in both themes: it is a screen showing video, like a photo viewer. */

/* ---------------- the list (/videos without JavaScript, and below the desktop feed) ---------------- */
.vl-topics { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s5) 0 0; }
.vl-topics a { font-size: var(--t-small); padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--rule-2); color: var(--ink-2); text-decoration: none; }
.vl-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s4); }
.vl-card { display: block; text-decoration: none; color: var(--ink); }
.vl-card img { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: var(--r-2); background: var(--card-2); border: 1px solid var(--rule); }
.vl-meta { display: grid; gap: 2px; margin-top: var(--s2); }
.vl-meta b { font-weight: 600; font-size: var(--t-small); line-height: 1.35; letter-spacing: -.01em; }
.vl-meta span { font-size: var(--t-micro); color: var(--ink-3); }
@media (hover: hover) and (pointer: fine) {
  .vl-topics a:hover { border-color: var(--ink-3); color: var(--ink); }
  .vl-card:hover img { border-color: var(--rule-2); }
}

/* ---------------- the watch page without JavaScript ---------------- */
.vw { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: var(--s6); align-items: start; margin-top: var(--s5); }
.vw-stage { position: sticky; top: calc(var(--bar-h) + var(--s4)); }
.vw-video { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; border-radius: var(--r-2); background: #000; }
.vw-kick { font: var(--t-micro) / 1.4 var(--mono); color: var(--ink-3); margin: 0; }
.vw-side h1 { font-size: var(--t-display); line-height: var(--t-display-lh); letter-spacing: var(--t-display-tr); margin: var(--s2) 0 var(--s3); font-weight: 600; }
.vw-lede { color: var(--ink-2); margin: 0 0 var(--s4); }
.vw-acts { display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0 0 var(--s6); }
.vw-go, .vw-more { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: var(--r-pill); font-weight: 500; text-decoration: none; }
.vw-go { background: var(--cta); color: var(--cta-ink); }
.vw-more { border: 1px solid var(--rule-2); color: var(--ink); }
.vw-quiz, .vw-script { border-top: 1px solid var(--rule); padding-top: var(--s4); margin-top: var(--s5); }
.vw-quiz h2, .vw-script h2 { font-size: var(--t-title); margin: 0 0 var(--s3); font-weight: 600; }
.vw-opts { margin: var(--s3) 0; padding-left: 1.4em; color: var(--ink-2); }
.vw-opts li::marker { font-family: var(--mono); }
.vw-quiz summary { cursor: pointer; color: var(--ink-2); }
.vw-script p { color: var(--ink-2); margin: 0 0 var(--s2); max-width: 64ch; }
@media (max-width: 900px) {
  .vw { grid-template-columns: minmax(0, 1fr); }
  .vw-stage { position: static; max-width: 420px; }
}
@media (hover: hover) and (pointer: fine) {
  .vw-go:hover { filter: brightness(1.06); }
  .vw-more:hover { border-color: var(--ink-3); background: var(--card); }
}
.vw-go:active, .vw-more:active { transform: scale(.98); }

/* ---------------- the feed (videos.js) ---------------- */
.vf {
  --vf-ink: #fafafa; --vf-ink-2: #b4b4bc; --vf-ink-3: #92929b; --vf-rule: rgba(255, 255, 255, .14);
  --vf-glass: rgba(26, 26, 30, .42); --vf-pad: 16px;
  color: var(--vf-ink); -webkit-tap-highlight-color: transparent;
}
.vf[hidden] { display: none; }
.vf button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.vf-scroll { overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.vf-scroll::-webkit-scrollbar { display: none; }
/* the video frame is dark in both themes, so everything drawn over it keeps the dark-surface ink */
.vf-item { position: relative; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; background: #000; color: var(--vf-ink); }
.vf-poster, .vf-item video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.vf-item video { z-index: 1; }
.vf-hit { position: absolute; inset: 0; z-index: 2; touch-action: pan-y; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* what floats over the video: the rail (Instagram's format: drawn icons down the right edge, a word
   under each), the sound pill and the badges */
.vf-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.vf-rail { position: absolute; z-index: 4; right: 2px; bottom: calc(var(--vf-under, 0px) + 30px); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.vf-act { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 60px; padding: 2px 0; color: var(--vf-ink); text-decoration: none;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.vf-ic { display: block; transition: transform .14s cubic-bezier(.2, .9, .25, 1); }
.vf-ic svg { display: block; width: 30px; height: 30px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .55)); }
.vf-lbl { font-size: 11.5px; font-weight: 500; line-height: 1.2; text-shadow: 0 1px 2px rgba(0, 0, 0, .75); white-space: nowrap; }
.vf-act:active .vf-ic { transform: scale(.88); }
.vf-act[aria-pressed="true"] .vf-lbl { color: #f2c443; }
.vf-wide { display: none; } /* the transcript is a wide-screen panel */
.vf-pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 500;
  background: var(--vf-glass); border: 1px solid var(--vf-rule); color: var(--vf-ink);
  -webkit-backdrop-filter: blur(16px) saturate(1.7); backdrop-filter: blur(16px) saturate(1.7); }
.vf-pill svg { width: 18px; height: 18px; flex: none; }
.vf-pill:active { transform: scale(.96); }

.vf-bar { position: absolute; left: var(--vf-pad); right: 72px; bottom: calc(6px + var(--vf-under, 0px)); z-index: 4; height: 22px; display: flex; align-items: center; touch-action: none; cursor: pointer; }
.vf-bar i { display: block; width: 100%; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .22); overflow: hidden; transition: height .14s cubic-bezier(.2, .9, .25, 1); }
.vf-bar b { display: block; height: 100%; width: 100%; background: var(--vf-ink); transform-origin: 0 50%; transform: scaleX(0); }
.vf-bar.is-dragging i { height: 6px; }

.vf-badge { position: absolute; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 10px 16px; border-radius: 999px; font-size: 15px; font-weight: 500;
  background: var(--vf-glass); border: 1px solid var(--vf-rule); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  opacity: 0; pointer-events: none; transition: opacity .2s cubic-bezier(.16, 1, .3, 1); }
.vf-badge.is-on { opacity: 1; }
.vf-badge svg { width: 30px; height: 30px; display: block; }
.vf-sound { position: absolute; z-index: 4; right: var(--vf-pad); top: calc(var(--vf-top, 0px) + 12px); }
.vf-sound[hidden] { display: none; }

/* the quiz: the video stops on the question and the options become buttons */
.vf-quiz { position: absolute; left: 10px; right: 10px; bottom: calc(10px + var(--vf-under, 0px)); z-index: 5; padding: 16px; border-radius: 22px;
  background: rgba(26, 26, 30, .62); border: 1px solid var(--vf-rule); -webkit-backdrop-filter: blur(22px) saturate(1.7); backdrop-filter: blur(22px) saturate(1.7);
  transform: translateY(16px); opacity: 0; transition: opacity .3s cubic-bezier(.16, 1, .3, 1), transform .3s cubic-bezier(.16, 1, .3, 1); }
.vf-quiz.is-on { transform: none; opacity: 1; }
.vf-quiz[hidden] { display: none; }
/* the rail steps aside under the sheet */
.vf-item.is-quiz .vf-rail, .vf-item.is-quiz .vf-bar { visibility: hidden; }
.vf-quiz p { margin: 0 0 12px; font-size: 15px; line-height: 1.4; font-weight: 500; }
.vf-quiz p small { display: block; font: 12px / 1.4 var(--mono); color: var(--vf-ink-3); margin-bottom: 4px; font-weight: 400; }
.vf-opts { display: grid; gap: 8px; }
.vf-opt { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: center; width: 100%; text-align: left; padding: 10px 12px; border-radius: 14px;
  border: 1px solid var(--vf-rule) !important; background: rgba(255, 255, 255, .04) !important; font-size: 14px; line-height: 1.35; }
.vf-opt i { font: 600 13px / 28px var(--mono); font-style: normal; text-align: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--vf-rule); }
.vf-opt.is-right { border-color: rgba(200, 255, 0, .7) !important; }
.vf-opt.is-right i { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.vf-opt.is-wrong { border-color: rgba(255, 106, 61, .7) !important; }
.vf-opt.is-wrong i { background: #ff6a3d; color: #1a0a04; border-color: #ff6a3d; }
.vf-skip { margin-top: 10px; font-size: 13px; color: var(--vf-ink-3); }

/* the top bar: subjects and saved, glass over the video's empty top */
.vf-top { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 10px var(--vf-pad); }
.vf-top::-webkit-scrollbar { display: none; }
.vf-chip { flex: none; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--vf-ink-2);
  background: var(--vf-glass); border: 1px solid var(--vf-rule) !important; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.vf-chip[aria-pressed="true"] { background: var(--vf-ink) !important; color: #070708; border-color: var(--vf-ink) !important; }
.vf-empty { display: grid; place-items: center; text-align: center; padding: 32px; color: var(--vf-ink-2); }

/* PHONES: the feed takes the screen (the tab bar stays above it, the masthead steps aside) */
@media (max-width: 900px) {
  html.vf-open, html.vf-open body { overflow: hidden; overscroll-behavior: none; }
  html.vf-open .bar { visibility: hidden; }
  .vf { position: fixed; inset: 0; z-index: 59; background: #000; --vf-under: env(safe-area-inset-bottom); }
  html.has-tabbar .vf { --vf-under: calc(var(--tb-h) + 18px + env(safe-area-inset-bottom)); }
  .vf-top { position: absolute; left: 0; right: 0; top: 0; z-index: 6; padding-top: calc(10px + env(safe-area-inset-top)); --vf-top: env(safe-area-inset-top); }
  .vf-scroll { height: 100dvh; }
  .vf-item { height: 100dvh; }
  .vf-side { display: none; }
  /* the video hangs from under the chips; the rail sits on its right edge above the tab bar */
  .vf-poster, .vf-item video { top: calc(52px + env(safe-area-inset-top)); object-position: 50% 0; }
  .vf-sound { top: calc(60px + env(safe-area-inset-top)); }
}
/* the site's own promo pill and the tab bar's accessory would sit on the video's actions */
html.vf-on .tb-float { display: none !important; }
html.vf-on .tb-acc { visibility: hidden !important; pointer-events: none !important; }

/* WIDE SCREENS: the video is the spotlight, centred; subjects on the left; the transcript opens on
   the right only when asked (the rail's Transcript), so the page is the video until then */
@media (min-width: 901px) {
  /* the gap clears the up/down arrows that hang 60px off the video's right edge */
  .vf { display: grid; grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr); column-gap: 120px; align-items: start; margin: var(--s5) 0 var(--s7); color: var(--ink); }
  .vf-top { flex-direction: column; overflow: visible; padding: 0; gap: 6px; position: sticky; top: calc(var(--bar-h) + var(--s4)); justify-self: start; width: 180px; }
  .vf-chip { justify-content: flex-start; text-align: left; height: 34px; color: var(--ink-2); background: transparent; border-color: var(--rule-2) !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .vf-chip[aria-pressed="true"] { background: var(--ink) !important; color: var(--bg); border-color: var(--ink) !important; }
  /* the rail sits BESIDE the video here (YouTube's desktop Shorts), in a gutter inside each item: the scroll box
     clips anything outside it. --vf-g is that gutter; everything drawn over the video stays clear of it. */
  .vf { --vf-h: min(84vh, 880px); --vf-g: 84px; }
  .vf-stagewrap { position: relative; }
  .vf-scroll { height: var(--vf-h); width: calc(var(--vf-h) * 9 / 16 + var(--vf-g)); }
  .vf-item { height: var(--vf-h); background: transparent; color: var(--ink); }
  .vf-poster, .vf-item video, .vf-hit { right: var(--vf-g); width: auto; border-radius: var(--r-2); }
  .vf-item video, .vf-poster { background: #000; }
  .vf-rail { right: 0; width: var(--vf-g); bottom: 4px; gap: 14px; }
  .vf-act { color: var(--ink); }
  .vf-lbl { text-shadow: none; color: var(--ink-2); font-size: 12px; }
  /* beside the video the icons sit on the page, so each gets a dark disc (YouTube's desktop Shorts): the paper-white
     save and share would vanish on the light theme's page */
  .vf-ic { width: 48px; height: 48px; border-radius: 999px; display: grid; place-items: center; background: #1c1c20; }
  .vf-ic svg { width: 26px; height: 26px; filter: none; }
  .vf-act[aria-pressed="true"] .vf-lbl { color: var(--ink); }
  .vf-bar { right: calc(var(--vf-g) + var(--vf-pad)); }
  .vf-sound { right: calc(var(--vf-g) + var(--vf-pad)); color: var(--vf-ink); }
  .vf-quiz { right: calc(var(--vf-g) + 10px); color: var(--vf-ink); }
  .vf-badge { left: calc((100% - var(--vf-g)) / 2); color: var(--vf-ink); }
  .vf-empty { color: var(--ink-2); }
  .vf-wide { display: flex; }
  .vf-nav { position: absolute; right: -52px; top: 50%; transform: translateY(-50%); display: grid; gap: 8px; }
  .vf-nav button { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--rule-2) !important; display: grid; place-items: center; color: var(--ink); }
  .vf-nav svg { width: 18px; height: 18px; }
  .vf-side { display: none; padding-top: 4px; max-width: 46ch; }
  .vf.is-reading .vf-side { display: block; }
  .vf-side .vw-kick { margin-bottom: var(--s2); }
  .vf-side h2 { font-size: 1.5rem; line-height: 1.15; letter-spacing: -.02em; font-weight: 600; margin: 0 0 var(--s3); }
  .vf-side p { color: var(--ink-2); }
  .vf-side .vf-lines p { margin: 0 0 var(--s2); }
  .vf-side .vf-lines p.is-now { color: var(--ink); }
  .vf-side h3 { font-size: var(--t-title); font-weight: 600; margin: var(--s5) 0 var(--s3); border-top: 1px solid var(--rule); padding-top: var(--s4); }
  .vf-keys { font: var(--t-micro) / 1.5 var(--mono); color: var(--ink-3); margin-top: var(--s5); }
  .vl-page.vf-ready .dir-hero { display: none; }
  .vw-page.vf-ready .vw { display: none; }
}
@media (hover: hover) and (pointer: fine) {
  .vf-pill:hover { border-color: rgba(255, 255, 255, .3); }
  .vf-act:hover .vf-lbl { color: var(--ink); }
  .vf-chip:hover { color: var(--ink); }
  .vf-nav button:hover { border-color: var(--ink-3) !important; background: var(--card); }
  .vf-opt:hover { border-color: rgba(255, 255, 255, .3) !important; }
}
