/* cineMINDS — NFB "Capturing Reality"-style two-axis clip browser. Dark UI, gold accents. */

:root {
  --bg:        #0a0a0c;
  --bg-2:      #15151a;
  --bg-3:      #1f1f26;
  --ink:       #f3efe6;
  --muted:     #a39e93;
  --line:      #2a2a31;
  --gold:      #e7b53c;
  --gold-deep: #c79a28;
  --gold-ink:  #1b1508;
  --rail-w:    72px;
  --flyout-w:  340px;
  --drawer-w:  360px;
  --topbar-h:  46px;
  --shadow:    0 10px 40px rgba(0,0,0,.55);
}

/* Styled scrollbars — see .claude/rules/css-scrollbars.md */
* {
  scrollbar-width: thin;
  scrollbar-color: #475569 transparent;
  box-sizing: border-box;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #475569; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #64748b; background-clip: padding-box; border: 2px solid transparent; }
*::-webkit-scrollbar-corner { background: transparent; }

html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ── Top utility bar ──────────────────────────────────────────── */
#topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); z-index: 60;
  display: flex; align-items: center; gap: 16px; padding: 0 14px;
  background: #050506; border-bottom: 1px solid var(--line);
}
.brand-mark { letter-spacing: .14em; font-size: 14px; text-transform: uppercase; color: var(--muted); }
.brand-mark b { color: var(--gold); font-weight: 800; }
.topbar-meta { flex: 1; min-width: 0; color: var(--muted); font-size: 12.5px; letter-spacing: .04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted); border-radius: 8px;
}
.icon-btn:hover { background: var(--bg-3); color: var(--ink); }
.source-toggle { display: inline-flex; gap: 2px; background: var(--bg-3); border-radius: 8px; padding: 2px; }
.src-btn {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font: inherit; font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
  padding: 4px 11px; border-radius: 6px; transition: background .15s, color .15s;
}
.src-btn:hover { color: var(--ink); }
.src-btn[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); }

/* ── App shell ────────────────────────────────────────────────── */
#app { position: fixed; inset: var(--topbar-h) 0 0 0; }

/* Left icon-rail */
#rail {
  position: absolute; inset: 0 auto 0 0; width: var(--rail-w); z-index: 50;
  display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 0;
  background: #050506; border-right: 1px solid var(--line);
}
.rail-btn {
  border: 0; background: transparent; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  height: 64px; position: relative; transition: background .15s, color .15s;
}
.rail-btn .rail-label { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.rail-btn:hover { color: var(--ink); background: #101015; }
.rail-btn.primary.active   { background: var(--gold); color: var(--gold-ink); }
.rail-btn.secondary.active { background: var(--gold); color: var(--gold-ink); }
.rail-btn.active::after { content:""; position:absolute; right:0; top:8px; bottom:8px; width:3px; background: var(--gold-ink); border-radius: 2px; }

/* Flyout panels */
.flyout {
  position: absolute; inset: 0 auto 0 var(--rail-w); width: var(--flyout-w); z-index: 40;
  background: var(--gold); color: var(--gold-ink);
  transform: translateX(calc(-1 * (var(--flyout-w) + var(--rail-w))));
  transition: transform .28s cubic-bezier(.2,.7,.2,1);
  box-shadow: var(--shadow); display: flex; flex-direction: column; padding: 16px 0 0;
}
.flyout.open { transform: translateX(0); }
.flyout-close { position: absolute; top: 8px; right: 8px; color: var(--gold-ink); font-size: 16px; }
.flyout-close:hover { background: rgba(0,0,0,.12); }
.flyout-list { list-style: none; margin: 0; padding: 0 8px 24px; overflow-y: auto; flex: 1; }

/* People accordion items */
.nav-item > .nav-row { display: flex; align-items: center; }
.sidebar-item {
  flex: 1; text-align: left; border: 0; background: transparent; color: var(--gold-ink);
  padding: 9px 12px; font-size: 16px; border-radius: 6px; min-width: 0;
  transition: background .15s, color .15s;
}
.sidebar-item:hover { background: rgba(0,0,0,.10); }
.sidebar-item.active { background: var(--gold-ink); color: var(--gold); font-weight: 700; }
.sidebar-item small { display:block; font-size: 11px; opacity:.7; font-weight: 400; }
.expand-btn {
  border: 0; background: transparent; color: var(--gold-ink); width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; flex: none;
}
.expand-btn:hover { background: rgba(0,0,0,.12); }
.expand-btn svg { transition: transform .2s; }
.expand-btn[aria-expanded="true"] svg { transform: rotate(90deg); }

/* collapsible category sections */
.cat-section { display: block; }
.cat-toggle {
  width: 100%; display: flex; align-items: center; gap: 9px; text-align: left;
  border: 0; background: transparent; color: var(--gold-ink);
  padding: 11px 12px; border-radius: 6px; border-top: 1px solid rgba(0,0,0,.10);
}
.cat-toggle:hover { background: rgba(0,0,0,.10); }
.cat-toggle .cat-name { flex: 1; min-width: 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 800; opacity: .85; }
.cat-chevron { flex: none; opacity: .7; transition: transform .2s; }
.cat-toggle[aria-expanded="true"] .cat-chevron { transform: rotate(90deg); }
.cat-questions { list-style: none; margin: 0 0 4px; padding: 2px 0 6px; }
.subtopic-list { list-style: none; margin: 0 0 4px 14px; padding: 0; border-left: 2px solid rgba(0,0,0,.15); }
.subtopic-list .sidebar-item { font-size: 14px; padding: 7px 12px; }
.count-pill { font-size: 11px; background: rgba(0,0,0,.16); border-radius: 10px; padding: 1px 7px; margin-left: 6px; }

/* ── Stage ────────────────────────────────────────────────────── */
/* Reflow model: when a flyout is open on wide screens, the stage is pushed right (not overlaid). */
#stage { position: absolute; inset: 0 0 0 var(--rail-w); overflow-x: hidden; overflow-y: auto; outline: none;
  transition: left .28s cubic-bezier(.2,.7,.2,1), right .28s cubic-bezier(.2,.7,.2,1); }
#app.nav-open #stage { left: calc(var(--rail-w) + var(--flyout-w)); }
@media (max-width: 900px) {
  #app.nav-open #stage { left: var(--rail-w); }   /* narrow: flyout overlays, stage stays full-width */
}
@media (prefers-reduced-motion: reduce) {
  #stage, .flyout, .info-drawer,
  .card, .person-card,
  .home-hero, .home-gallery, .home-bg img, .home-bg .bg-layer,
  .video-frame video, .sub-cue { transition: none; }
}

/* Grid view (a person's or a question's playlist) */
.grid-wrap { padding: 28px 36px 60px; max-width: 1500px; margin: 0 auto; }
.grid-head { margin: 6px 0 22px; }
.grid-eyebrow { color: var(--gold); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.grid-title { font-size: 30px; font-weight: 800; margin: 4px 0 0; }
.grid-sub { color: var(--muted); margin-top: 6px; max-width: 70ch; }
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
}
.card {
  display: block; text-align: left; border: 1px solid var(--line); background: var(--bg-2);
  border-radius: 10px; overflow: hidden; transition: transform .14s, border-color .14s, box-shadow .14s;
}
.card:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: var(--shadow); }
.card-thumb { position: relative; aspect-ratio: 16/9; background: linear-gradient(135deg,#23232b,#121217); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block;
  transform: scale(var(--thumb-scale, 2.4)); transform-origin: 50% var(--thumb-focus, 17%); }
.card-thumb .ph { position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  color: rgba(231,181,60,.5); font-size: 40px; font-weight: 800; }
.card-thumb .len { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.72);
  color:#fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; letter-spacing: .03em; }
.card-thumb .play { position:absolute; inset:0; margin:auto; width:46px; height:46px; border-radius:50%;
  background: var(--gold); color: var(--gold-ink); display:flex; align-items:center; justify-content:center;
  opacity:0; transition: opacity .15s; }
.card:hover .play { opacity: 1; }
.card-body { padding: 11px 13px 14px; }
.card-title { font-size: 14.5px; line-height: 1.35; font-weight: 600;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }   /* answer slugs: hard 2-line budget */
.card-meta { color: var(--muted); font-size: 12.5px; margin-top: 5px; }

/* ── Player view ──────────────────────────────────────────────── */
.player-wrap { display: flex; flex-direction: column; min-height: 100%; }
.player-head { padding: 22px 36px 10px; }
.ph-person { color: var(--gold); font-size: 20px; font-weight: 700; }
.ph-title  { font-size: 27px; font-weight: 800; margin: 2px 0 8px; line-height: 1.2; }
.ph-tags { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; color: var(--muted); font-size: 13.5px; }
.ph-topic { display: inline-flex; align-items: center; gap: 7px; }
.ph-topic .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.about-btn { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line); background:var(--bg-2);
  color: var(--ink); padding: 5px 11px; border-radius: 999px; font-size: 13px; }
.about-btn:hover { border-color: var(--gold); color: var(--gold); }

.video-frame {
  position: relative; width: 100%; max-width: calc(64vh * 16 / 9); aspect-ratio: 16/9; margin: 0 auto;
  overflow: hidden; background: #000;
}
.video-frame video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #000;
  transform: translateY(var(--focus-shift, 0)) scale(var(--zoom, 1)); transform-origin: 50% var(--focus-y, 50%);
  transition: transform .35s ease, opacity .12s ease;
}
.video-frame video.seeking { opacity: .25; }      /* soft dip while seeking, instead of a hard cut */
.video-frame:fullscreen { max-height: none; height: 100vh; aspect-ratio: auto; }

/* zoom segmented control (top-right) */
.zoom-seg {
  position: absolute; top: 12px; right: 12px; z-index: 3; display: flex; gap: 2px;
  background: rgba(10,10,12,.6); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 3px;
  backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s;
}
.video-frame:hover .zoom-seg, .video-frame:focus-within .zoom-seg, .video-frame.paused .zoom-seg { opacity: 1; }
.zoom-btn { border: 0; background: transparent; color: #d8d4c9; font-size: 12px; padding: 4px 11px; border-radius: 999px; line-height: 1; }
.zoom-btn:hover { color: #fff; }
.zoom-btn[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); font-weight: 700; }

/* caption overlay — sibling of the scaled <video>, so the zoom transform doesn't move it. The control is in
   the topbar (no in-frame control); size scales with --sub-scale (default 2 = 200%). */
.sub-layer { position: absolute; left: 0; right: 0; bottom: 64px; z-index: 2; display: flex; justify-content: center; pointer-events: none; padding: 0 6%; }
.sub-cue { max-width: 90%; background: rgba(0,0,0,.66); color: #fff; font-family: var(--sub-font, inherit); font-size: calc(clamp(15.4px, 1.9vw, 21px) * var(--sub-scale, 1.6)); line-height: 1.3; text-align: center; padding: 4px 12px; border-radius: 6px; text-shadow: 0 1px 2px rgba(0,0,0,.6); opacity: 0; transition: opacity .12s; }
.sub-cue.show { opacity: 1; }
.video-frame:fullscreen .sub-layer { bottom: 9vh; }

/* transport bar */
.video-controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; align-items: center; gap: 12px;
  padding: 28px 14px 12px; color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,0));
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.video-frame:hover .video-controls, .video-frame:focus-within .video-controls, .video-frame.paused .video-controls { opacity: 1; pointer-events: auto; }
.vc-btn { border: 0; background: transparent; color: #fff; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 7px; flex: none; }
.vc-btn:hover { background: rgba(255,255,255,.16); }
.vc-btn[aria-pressed="true"] { color: var(--gold); }   /* enabled speaker = gold (player + chat bar) */
.vc-time { font-size: 12px; font-variant-numeric: tabular-nums; color: #ececec; flex: none; min-width: 40px; text-align: center; }
.vc-seek { flex: 1; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 3px; background: rgba(255,255,255,.28); outline: none; cursor: pointer; }
.vc-seek::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); border: 0; cursor: pointer; }
.vc-seek::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--gold); cursor: pointer; }

.player-grid { display: grid; grid-template-columns: 1fr 320px; gap: 28px; padding: 22px 36px 60px; align-items: start; }
@media (max-width: 1100px) { .player-grid { grid-template-columns: 1fr; } }
.panel-h { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin: 0 0 12px; }
.playlist-strip { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.related-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.related-list a { display: block; padding: 9px 12px; border-radius: 7px; color: var(--ink); font-size: 14px; border:1px solid transparent; }
.related-list a:hover { background: var(--bg-2); border-color: var(--line); }
.related-list a small { display:block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.related-empty { color: var(--muted); font-size: 13px; }

/* karaoke transcript word/sentence highlight (rendered in the right drawer's Transkript tab) */
.tx-w { transition: color .12s; cursor: pointer; }
.tx-w.spoken { color: var(--ink); }
.tx-w.current { color: var(--gold); font-weight: 600; }
.tx-w.tx-low { opacity: .5; }
.tx-missing { color: var(--muted); font-style: italic; font-size: 13px; }

/* translation mode: coarse sentence sync (no word timing) */
.tx-note { font-size: 12px; color: var(--muted); font-style: italic; line-height: 1.5; margin: 0 0 14px; padding-left: 10px; border-left: 2px solid var(--line); }
.tx-seg { cursor: pointer; transition: color .12s, border-color .12s; border-bottom: 2px solid transparent; }
.tx-seg.spoken { color: var(--ink); }
.tx-seg.current { color: var(--gold); border-bottom-color: var(--gold); }

/* ── Home ─────────────────────────────────────────────────────── */
.home { position: relative; min-height: 100%; display: flex; flex-direction: column; }
.home-hero { padding: 8vh 7vw 4vh; max-width: 900px; max-height: 1200px; overflow: hidden;
  transition: opacity .4s ease, max-height .45s ease, padding .4s ease; }
.home-hero.gone { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; }
.home-hero h1 { font-size: clamp(34px, 5vw, 64px); margin: 0; line-height: 1.04; }
.home-hero h1 .gold { color: var(--gold); }
.home-hero p { color: var(--ink); opacity: .85; font-size: clamp(15px, 1.5vw, 18px); max-width: 60ch; margin-top: 18px; }
.enter-btn { margin-top: 26px; background: var(--gold); color: var(--gold-ink); border: 0; font-weight: 800;
  padding: 13px 30px; border-radius: 999px; font-size: 16px; letter-spacing: .03em; }
.enter-btn:hover { background: #fff; }
.home-gallery { padding: 10px 36px 60px; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); transition: opacity .5s, max-height .5s; }
.home-gallery.collapsed { max-height: 0; overflow: hidden; opacity: 0; padding-top: 0; padding-bottom: 0; }
/* Identical geometry to .card so people-gallery → clip-grid click-through is seamless (radius/min-width/gradient/lift matched). */
.person-card { text-align: left; border: 1px solid var(--line); background: var(--bg-2); border-radius: 10px; overflow: hidden; transition: transform .14s, border-color .14s, box-shadow .14s; }
.person-card:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: var(--shadow); }
.person-card .pc-thumb { aspect-ratio: 16/9; background: linear-gradient(135deg,#23232b,#121217); position: relative; overflow: hidden; }
.person-card .pc-thumb img { width:100%; height:100%; object-fit: cover;
  transform: scale(var(--thumb-scale, 2.4)); transform-origin: 50% var(--thumb-focus, 17%); }
.person-card .pc-thumb .ph { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color: rgba(231,181,60,.5); font-size: 40px; font-weight: 800; }
/* Name + position below the portrait — same lettering as the grid answer cards (.card-title / .card-meta). */
.person-card .pc-body { padding: 11px 13px 14px; }
.person-card .pc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.person-card .pc-meta { color: var(--muted); font-size: 12.5px; margin-top: 5px; }

/* ── Key-value + link lists (used by the info drawer) ─────────────── */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
/* values flow over multiple lines — UA dd margin + long tokens (BRAW filenames, venues) must not clip */
.kv dd { margin: 0; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a { border:1px solid var(--line); background: var(--bg-3); padding: 6px 12px; border-radius: 999px; font-size: 13px; }
.links a:hover { border-color: var(--gold); color: var(--gold); }

.loading, .errbox { padding: 60px 36px; color: var(--muted); }
.errbox { color: #ff8d7a; }

/* ════════════════════════════════════════════════════════════════
   New components: info drawer, timecode readout, people filter
   Appended — reuses the :root scale above; existing rules untouched.
   ════════════════════════════════════════════════════════════════ */

/* ── Right-side info drawer (replaces the modal: meta + person tabs) ─ */
.info-drawer {
  position: fixed; inset: var(--topbar-h) 0 0 auto; width: var(--drawer-w); max-width: 100vw; z-index: 70;
  display: flex; flex-direction: column;
  background: var(--bg-2); border-left: 1px solid var(--line); box-shadow: var(--shadow);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.7,.2,1);
}
.info-drawer.open { transform: translateX(0); }
.info-drawer[aria-hidden="true"] { pointer-events: none; }
.info-drawer.open[aria-hidden="false"] { pointer-events: auto; }

.drawer-head {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); flex: none;
}
.drawer-tabs { display: inline-flex; gap: 2px; background: var(--bg-3); border-radius: 8px; padding: 2px; flex: 1; }
.drawer-tabs [data-tab] {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
  padding: 6px 11px; border-radius: 6px;
}
.drawer-tabs [data-tab]:hover { color: var(--ink); }
.drawer-tabs [data-tab][aria-selected="true"] { background: var(--gold); color: var(--gold-ink); }
.drawer-close { flex: none; }

.drawer-body { flex: 1; overflow-y: auto; padding: 22px 24px 30px; }
.drawer-body h2 { margin: 0 0 4px; font-size: 24px; line-height: 1.15; }
.drawer-body .sub { color: var(--muted); margin-bottom: 18px; }
.drawer-body h3 { color: var(--gold); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; margin: 22px 0 8px; }
.drawer-body .kv { grid-template-columns: 110px 1fr; }
/* Filmography (TMDB credits): a contained scrollable list, title left · year/role right, links out in a new tab. */
.drawer-body .filmography { max-height: 320px; overflow-y: auto; margin-top: 4px; padding-right: 4px; }
/* Two lines per row: title on top, "year · role" below — same font sizes, stacked vertically. */
.drawer-body .film-item { display: flex; flex-direction: column; align-items: stretch; gap: 1px; padding: 6px 2px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.drawer-body .film-item:hover { color: var(--gold); }
.drawer-body .film-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body .film-meta { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* "See all NN clips" — a full-width action button replacing the old ANSWERS heading + link. */
.drawer-body .see-all-clips { display: block; margin-top: 22px; text-align: center; border: 1px solid var(--line);
  background: var(--bg-3); color: var(--ink); padding: 10px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.drawer-body .see-all-clips:hover { border-color: var(--gold); color: var(--gold); }

/* ── SMPTE timecode readout in the transport bar (beside .vc-time) ── */
.vc-tc {
  font-size: 12px; font-family: "SF Mono", ui-monospace, "Menlo", monospace;
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
  color: #ececec; flex: none; min-width: 96px; text-align: center;
}

/* ── People-nav filter control (sits at top of #people-nav, gold panel) ── */
/* Function (DoP/Actor) switch — gold-panel segmented control (mirrors the topbar .source-toggle) */
.func-seg { display: flex; gap: 2px; margin: 0 44px 12px 20px; background: rgba(0,0,0,.10); border-radius: 8px; padding: 2px; }   /* right room clears the ✕ close button */
.func-btn { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--gold-ink); cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .03em; padding: 5px 8px; border-radius: 6px;
  opacity: .72; transition: opacity .12s, background .12s, color .12s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.func-btn:hover { opacity: 1; }
.func-btn[aria-pressed="true"] { background: var(--gold-ink); color: var(--gold); opacity: 1; }

/* ── Person pill (the pinned person atop the Questions nav) + clickable nav affordances ── */
.person-pill { display: flex; align-items: center; gap: 8px; margin: 0 44px 12px 20px;
  background: var(--gold-ink); color: var(--gold); border-radius: 999px; padding: 6px 6px 6px 14px; }
.person-pill .pp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 14px; }
.person-pill .pp-clear { flex: none; border: 0; background: rgba(231,181,60,.16); color: var(--gold);
  width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; }
.person-pill .pp-clear:hover { background: rgba(231,181,60,.34); }
.ph-person-btn { cursor: pointer; }
.ph-person-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.grid-eyebrow-btn { border: 0; background: none; padding: 0; cursor: pointer; font-family: inherit; }
.grid-eyebrow-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Narrow screens: drawer becomes a full-width overlay ─────────── */
@media (max-width: 720px) {
  .info-drawer { width: 100vw; border-left: 0; }
}

/* ════════════════════════════════════════════════════════════════
   Phase E — one-line people rows, fullscreen, GSAP slide layer
   ════════════════════════════════════════════════════════════════ */

/* People rows: name left · function right on one line (overrides the global `small { display:block }`) */
#people-list .sidebar-item { display: flex; align-items: baseline; gap: 8px; }
#people-list .si-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#people-list .sidebar-item small {
  display: inline; flex: none; opacity: .6; font-weight: 700;
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
}
#people-list .si-count { margin-left: auto; flex: none; opacity: .5; font-size: 11px; font-variant-numeric: tabular-nums; }

/* Outgoing view snapshot during a GSAP slide */
.view-out { will-change: transform, opacity; }

/* ════════════════════════════════════════════════════════════════
   Phase H — topbar subtitle controls + unmute, right-drawer reflow
   ════════════════════════════════════════════════════════════════ */
.subs-ctl { display: inline-flex; align-items: center; gap: 6px; }
.subs-size { width: 72px; accent-color: var(--gold); cursor: pointer; }
/* Icon-style toggle button (subtitle CC glyph) — sized to sit flush in the .src-btn toggle group. */
.src-btn.icon { display: inline-flex; align-items: center; justify-content: center; padding: 4px 8px; }
.src-btn.icon svg { display: block; }
/* Topbar audio controls: music note + speaker, always visible (not landing-gated). Gold when active. */
#music-btn[aria-pressed="true"], #sound-btn[aria-pressed="true"] { color: var(--gold); }

/* Right info-drawer reflows the stage instead of overlaying it (wide); overlays on narrow. */
#app.drawer-open #stage { right: var(--drawer-w); }
@media (max-width: 900px) { #app.drawer-open #stage { right: 0; } }

/* ════════════════════════════════════════════════════════════════
   Phase F — landing rotating backdrop + subtitle-switch fade
   ════════════════════════════════════════════════════════════════ */

/* Rotating clip MOVIES (or a still under reduced motion) behind the landing hero, crossfading. */
.home-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: #000; }
.home-bg img, .home-bg .bg-layer { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity var(--crossfade, .2s) linear; }   /* long crossfade between in-motion layers (duration from settings.landing.crossfade_sec) */
.home-bg .bg-layer video { width: 100%; height: 100%; object-fit: cover; display: block;
  transform: translateY(var(--landing-y, 10%)) scale(var(--landing-scale, 1.28)); transform-origin: 50% 30%; }   /* landing crop + y-shift (settings.yaml landing.*) */
.home-bg img { object-fit: cover; }
.home-bg .show { opacity: 1; }
/* Loading spinner over the backdrop until the first clip is buffered full-res (prevents the low-bitrate blur). */
.home-bg .home-spinner { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; background: #000; }
@keyframes cm-spin { to { transform: rotate(360deg); } }
/* App-wide three-dot pulse — the boot overlay and the landing backdrop cover share it. */
.cm-dots { display: flex; gap: 21px; }
.cm-dots i { width: 15px; height: 15px; border-radius: 50%; background: var(--gold);
  animation: cm-dotpulse 1.05s ease-in-out infinite; }
.cm-dots i:nth-child(2) { animation-delay: .15s; }
.cm-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes cm-dotpulse { 0%, 70%, 100% { opacity: .18; transform: scale(.8); }
  30% { opacity: 1; transform: scale(1.15); } }
/* Pre-corpus loading spinner (no i18n needed yet). */
.loading-spin { width: 28px; height: 28px; margin: 80px auto; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.08); border-top-color: var(--gold); animation: cm-spin .7s linear infinite; }
/* Boot overlay (static in index.html): covers EVERYTHING — no chrome, no lettering — until app.js
   reveals the first route. On the landing it stays up until the first backdrop clip can play, so
   chrome + hero + movie arrive together (app.js waits for ui.js's cm-landing-ready event). */
body.booting #topbar, body.booting #rail { visibility: hidden; }
/* Staggered chrome entrance when revealApp() drops .booting: visibility flips instantly, the
   opacity/transform transitions do the visible work (topbar first, rail .12s behind). */
@media (prefers-reduced-motion: no-preference) {
  #topbar { transition: opacity .45s ease, transform .45s ease; }
  #rail { transition: opacity .45s ease .12s, transform .45s ease .12s; }
  body.booting #topbar { opacity: 0; transform: translateY(-6px); }
  body.booting #rail { opacity: 0; transform: translateX(-6px); }
  body.booting .home-hero > * { opacity: 0; animation: none; }
  .home-hero > * { animation: cm-rise .5s ease backwards; }
  .home-hero > :nth-child(1) { animation-delay: .05s; }
  .home-hero > :nth-child(2) { animation-delay: .18s; }
  .home-hero > :nth-child(3) { animation-delay: .3s; }
}
/* no `to` frame: each element settles at its own computed opacity (the tagline rests at .85) */
@keyframes cm-rise { from { opacity: 0; transform: translateY(8px); } }

/* ── Micro-transitions: content swaps fade in instead of hard-cutting ── */
@keyframes cm-fadein { from { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .flyout-list > li { animation: cm-fadein .18s ease backwards; }   /* replays per rebuild, no stagger */
  .drawer-body > * { animation: cm-fadein .18s ease backwards; }
  .mode-view:not([hidden]) { animation: cm-fadein .22s ease; }      /* RAG/KG overlay open; hide stays instant */
  .card { animation: cm-fadein .18s ease backwards; }
}
#boot-loader { position: fixed; inset: 0; z-index: 200; background: var(--bg);
  display: flex; align-items: center; justify-content: center; transition: opacity .25s; }
#boot-loader.done { opacity: 0; pointer-events: none; }
/* Landing preload gate: the dots swap for wordmark + progress bar; the bar swaps for Enter once
   the first backdrop clips are buffered. Plain black chrome — nothing else shows until Enter. */
#boot-loader.preload .cm-dots { display: none; }
#boot-loader .boot-inner { display: grid; justify-items: center; gap: 34px;
  grid-template-areas: "brand" "gate"; }
#boot-loader .boot-brand { grid-area: brand; font-size: clamp(30px, 4.4vw, 52px); line-height: 1; color: var(--ink); }
#boot-loader .boot-brand b { color: var(--gold); font-weight: 800; }
/* Bar and Enter share one grid cell so the swap causes no layout jump. */
#boot-loader .boot-bar { grid-area: gate; align-self: center; width: min(320px, 60vw); height: 2px;
  border-radius: 999px; background: rgba(255, 255, 255, .14); overflow: hidden; transition: opacity .3s ease; }
#boot-loader .boot-bar i { display: block; height: 100%; width: 0; border-radius: 999px;
  background: var(--gold); transition: width .35s ease; }
#boot-loader.ready .boot-bar { opacity: 0; }
#boot-loader .enter-btn { grid-area: gate; margin-top: 0; }
@media (prefers-reduced-motion: no-preference) {
  #boot-loader.ready .enter-btn { animation: cm-rise .4s ease backwards; }
}
/* Player initial-load spinner over an opaque cover — replaces the .seeking dip so no blurry frame shows
   before the first full-res frame is buffered. Shares the cm-spin ring; hidden once .loading is dropped. */
.video-frame .video-spinner { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; background: #000; }
.video-frame .video-spinner::after { content: ""; width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.08); border-top-color: var(--gold); animation: cm-spin .7s linear infinite; }
.video-frame:not(.loading) .video-spinner { display: none; }
/* Light, localized scrim so the interviewee stays clearly visible while the hero text stays readable. */
.home-bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(10,10,12,.72) 0%, rgba(10,10,12,.34) 38%, rgba(10,10,12,.12) 100%); }
.home-bg.gone { opacity: 0; transition: opacity .4s ease; }
.home-hero, .home-gallery { position: relative; z-index: 1; }   /* keep hero/gallery above the backdrop */
.home-hero h1, .home-hero p { text-shadow: 0 2px 14px rgba(0,0,0,.7); }

/* Transcript in the right drawer (Transkript tab) — karaoke (DE) / sentence (EN). */
#info-drawer .tx-body { font-size: 15px; line-height: 1.85; color: var(--muted); }
#info-drawer .tx-note { margin-top: 0; }

/* ═══════════════ Mode A (RAG chat) + Mode B (knowledge graph) ═══════════════ */
/* Both overlay the stage, starting after the rail so the rail (z 50) stays clickable. z 45 sits above
   stage content but below the rail and the right drawer (z 70). */
.mode-view {
  position: absolute; inset: 0 0 0 var(--rail-w); z-index: 45;
  background: var(--bg); overflow-y: auto; overflow-x: hidden;
}
.mode-view[hidden] { display: none; }
.rail-btn[hidden] { display: none; }   /* .rail-btn{display:flex} otherwise overrides the UA [hidden] rule */
.rail-btn.active { color: var(--gold-ink); background: var(--gold); }

/* ── Mode A: RAG ── */
/* width:100% — as a flex item of #rag-view, a bare margin:0 auto would shrink-to-fit and float
   the head toward the center; full width keeps it flush-left with .rag-result. */
.rag-head { padding: 26px 36px 12px; width: 100%; max-width: 1500px; margin: 0 auto; }
.rag-title { font-size: 26px; font-weight: 800; margin: 0; }
.rag-intro { color: var(--muted); margin: 6px 0 16px; max-width: 70ch; }
.rag-form { display: flex; gap: 8px; max-width: 760px; }
.rag-input {
  flex: 1; background: var(--bg-2); border: 1px solid var(--line); color: var(--ink);
  border-radius: 8px; padding: 11px 14px; font: inherit;
}
.rag-input:focus { outline: none; border-color: var(--gold); }
.rag-send {
  border: 0; background: var(--gold); color: var(--gold-ink); font-weight: 700;
  border-radius: 8px; padding: 0 20px; letter-spacing: .03em;
}
.rag-send:hover { background: var(--gold-deep); }

/* Mode A is a no-scroll view: #rag-view is a flex column; the only scrollers are the answer panel,
   the karaoke body and the playlist. :not([hidden]) keeps the ID selector from out-specifying
   .mode-view[hidden]{display:none} — a bare #rag-view{display:flex} would pin the opaque z-45
   overlay over the stage on every route. */
#rag-view:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; }
#rag-view .rag-head { flex: none; }
.rag-result { flex: 1; min-height: 0; display: flex; flex-direction: column;
  width: 100%; max-width: 1500px; margin: 0 auto; padding: 0 36px 24px; }
.rag-result[hidden] { display: none; }   /* author display:flex would defeat the UA [hidden] rule */

.rag-main-tabs { max-width: 320px; flex: none; }
.rag-tabs { display: flex; gap: 2px; background: var(--bg-3); border-radius: 8px; padding: 2px; margin-bottom: 10px; }
.rag-tab { flex: 1; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 12.5px;
  padding: 7px 14px; border-radius: 6px; }
.rag-tab[aria-selected="true"] { background: var(--gold); color: var(--gold-ink); }
.rag-tab[disabled] { opacity: .35; cursor: default; }
.rag-panel[hidden] { display: none; }
.rag-panel-main { flex: 1; min-height: 0; }
/* Answer tab: the markdown column + a live playlist that fills as citations stream in. The side
   column only exists once the first [n] appears (.has-rows). Each column scrolls on its own. */
#rag-panel-answer:not([hidden]) { overflow: hidden; display: grid; grid-template-columns: minmax(0,1fr); gap: 24px; }   /* :not([hidden]) — a bare id display rule would defeat .rag-panel[hidden] */
#rag-panel-answer.has-rows:not([hidden]) { grid-template-columns: minmax(0,1fr) 360px; }
.rag-answer-scroll { overflow-y: auto; min-height: 0; }
#rag-panel-answer .rag-answer-playlist { display: none; }   /* id-level: outranks .rag-playlist{display:flex} */
#rag-panel-answer.has-rows .rag-answer-playlist { display: flex; border-left: 1px solid var(--line); padding-left: 20px; }
.rag-pl-item { animation: rag-row-in .25s ease; }
@keyframes rag-row-in { from { opacity: 0; transform: translateY(5px); } }
#rag-panel-video { overflow: hidden; }

.rag-status { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 14px 2px; flex: none; }
.rag-status[hidden] { display: none; }
.rag-status.rag-error { color: #e88; }
.rag-spin { width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid rgba(255,255,255,.08); border-top-color: var(--gold); animation: cm-spin .7s linear infinite; }

/* Antwort tab: markdown typography */
.rag-answer { font-size: 16px; line-height: 1.7; color: var(--ink); max-width: 75ch; padding: 6px 2px 24px; }
.rag-answer.rag-ungrounded { color: var(--muted); font-style: italic; }
.rag-answer h1, .rag-answer h2, .rag-answer h3, .rag-answer h4 { color: var(--ink); line-height: 1.3; margin: 1.1em 0 .45em; }
.rag-answer h1 { font-size: 20px; } .rag-answer h2 { font-size: 18px; }
.rag-answer h3 { font-size: 16.5px; } .rag-answer h4 { font-size: 15px; }
.rag-answer > :first-child { margin-top: 0; }
.rag-answer p { margin: 0 0 .85em; }
.rag-answer ul, .rag-answer ol { margin: 0 0 .85em; padding-left: 1.4em; }
.rag-answer li { margin: .25em 0; }
.rag-answer blockquote { margin: .85em 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--gold-deep); color: var(--muted); }
.rag-answer code { background: var(--bg-3); border-radius: 4px; padding: 1px 5px; font-size: .9em; }
.rag-answer pre { background: var(--bg-3); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.rag-answer pre code { background: transparent; padding: 0; }
.rag-answer a { color: var(--gold); }
.rag-fn {
  color: var(--gold); cursor: pointer; font-weight: 700; font-size: .72em;
  padding: 0 2px; vertical-align: super; line-height: 0;
}
.rag-fn:hover { text-decoration: underline; }
.rag-fn-sep { color: var(--gold); font-size: .72em; vertical-align: super; line-height: 0; }

/* Video tab: player + in-clip scrubber | sidebar (Wortlaut / Playlist) */
.rag-video-grid { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 20px; height: 100%; min-height: 0; }
.rag-video-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.rag-player { flex: 1; min-height: 0; display: flex; }
/* The frame inherits .video-frame's video rules (cover + the --zoom/--focus transform), so the
   framing zoom segment works exactly like on the main player. */
.rag-player .video-frame { position: relative; flex: 1; min-height: 0; background: #000; border-radius: 10px; overflow: hidden; }
.edl-frame .sub-layer { bottom: 24px; }   /* no in-frame control bar to clear (scrubber sits below) */
.rag-scrub-wrap { flex: none; }
.rag-scrub { display: flex; align-items: center; gap: 12px; padding: 2px 4px; }
.rag-scrub .vc-btn { color: var(--ink); }
.rag-scrub-vol { width: 72px; flex: none; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 3px; background: var(--bg-3); outline: none; cursor: pointer; }
.rag-scrub-vol::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 0; cursor: pointer; }
.rag-scrub-vol::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--gold); cursor: pointer; }
.rag-scrub-range { flex: 1; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 3px; background: var(--bg-3); outline: none; cursor: pointer; }
.rag-scrub-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); border: 0; cursor: pointer; }
.rag-scrub-range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--gold); cursor: pointer; }
.rag-scrub-time { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; flex: none; }
.rag-video-hint { flex: none; margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
.rag-video-hint[hidden] { display: none; }

.rag-video-side { display: flex; flex-direction: column; min-width: 0; min-height: 0;
  border-left: 1px solid var(--line); padding-left: 20px; }
.rag-side-tabs { flex: none; }
.rag-words { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.rag-words-head { flex: none; display: flex; flex-direction: column; gap: 2px; padding: 2px 2px 8px;
  border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.rag-words-name { color: var(--gold); font-size: 13.5px; font-weight: 700; }
.rag-words-note { color: var(--muted); font-size: 11.5px; }
.rag-words-body { flex: 1; min-height: 0; overflow-y: auto; font-size: 14px; line-height: 1.8; color: var(--muted); padding: 2px 2px 12px; }

.rag-playlist { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.rag-pl-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
  border: 0; background: transparent; color: var(--ink); padding: 8px 9px; border-radius: 8px; flex: none; }
.rag-pl-item:hover { background: var(--bg-3); }
.rag-pl-item.active { background: var(--bg-3); box-shadow: 0 0 0 1px var(--gold) inset; }
.rag-pl-thumb { position: relative; width: 56px; aspect-ratio: 16/9; border-radius: 5px; overflow: hidden;
  background: linear-gradient(135deg,#23232b,#121217); flex: none; margin-top: 2px; }
.rag-pl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block;
  transform: scale(var(--thumb-scale, 2.4)); transform-origin: 50% var(--thumb-focus, 17%); }
.rag-pl-thumb .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-weight: 700; font-size: 12px; }
.rag-pl-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.rag-pl-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.rag-pl-ref { color: var(--gold); font-size: 11.5px; font-weight: 700; flex: none; }
.rag-pl-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rag-pl-tc { margin-left: auto; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; flex: none; }
.rag-pl-text { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* Narrow viewports: sidebar drops below the video; the answer keeps a single column. */
@media (max-width: 1000px) {
  .rag-video-grid { grid-template-columns: 1fr; grid-template-rows: minmax(0,1.2fr) minmax(0,1fr); }
  .rag-video-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; }
  #rag-panel-answer.has-rows { grid-template-columns: minmax(0,1fr); }
  #rag-panel-answer.has-rows .rag-answer-playlist { display: none; }
}

/* ── Mode B: knowledge graph ── */
.kg-head { padding: 26px 36px 8px; }
.kg-title { font-size: 26px; font-weight: 800; margin: 0; }
.kg-intro { color: var(--muted); margin: 6px 0 0; max-width: 70ch; }
.kg-body { position: absolute; inset: 96px 0 0 0; display: flex; }
.kg-stage { flex: 1; min-width: 0; background: radial-gradient(circle at 50% 40%, #101016, var(--bg)); }
.kg-legend { width: 190px; flex: none; border-left: 1px solid var(--line); padding: 16px 14px; }
.kg-legend-h { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.kg-legend-row { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 0;
  background: transparent; color: var(--ink); padding: 7px 6px; border-radius: 7px; font-size: 13.5px; }
.kg-legend-row:hover { background: var(--bg-3); }
.kg-legend-row.off { opacity: .4; }
.kg-swatch { width: 13px; height: 13px; border-radius: 3px; flex: none; }
