:root {
  --bg: #0a0a0a;
  --bg-2: #131313;
  --bg-3: #1c1c1c;
  --line: #2a2a2a;
  --fg: #ededed;
  --fg-dim: #a2a2a2;
  --fg-mute: #6e6e6e;
  --accent: #8a8a8a;
  --radius: 10px;
  --sidebar: 268px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 ui-sans-serif, -apple-system, "SF Pro Text", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  height: 100vh;
  padding: 22px 16px 14px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search svg {
  position: absolute;
  left: 10px;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--fg-mute);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.search input {
  width: 100%;
  padding: 9px 10px 9px 32px;
  color: var(--fg);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 13.5px;
}

.search input:focus {
  outline: none;
  border-color: var(--accent);
}

.search input::-webkit-search-cancel-button { filter: invert(0.6); }

.nav { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 2px;
  color: var(--fg-dim);
  background: none;
  border: 0;
  border-radius: 8px;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.nav-item:hover { background: var(--bg-3); color: var(--fg); }

.nav-item[aria-current="page"] {
  background: var(--bg-3);
  color: var(--fg);
}

.dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--dot, var(--accent));
}

.nav-item .name { flex: 1; font-size: 14px; }

.nav-item .count {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--fg-mute);
}

.side-foot {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--fg-mute);
}

/* ---------- Main ---------- */

.main { flex: 1; min-width: 0; }

.page { max-width: 1500px; padding: 28px 32px 64px; margin: 0 auto; }

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 24px;
  padding-bottom: 16px;
  margin-bottom: 22px;
}

.page-head h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.page-head h2 .accent { color: var(--dot, var(--accent)); }

.page-head .meta {
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--fg-mute);
}

/* ---------- Reels (one recording each) ---------- */

.reel + .reel { margin-top: 34px; }

.reel-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.reel-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 22px; }

.reel-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 13px;
  color: var(--fg-dim);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
}

.reel-chip:hover { color: var(--fg); border-color: var(--fg-mute); }

.reel-chip[aria-current="page"] {
  color: var(--fg);
  background: var(--bg-3);
  border-color: color-mix(in srgb, var(--dot, var(--accent)) 60%, transparent);
}

.tabs { display: flex; gap: 4px; margin-left: auto; padding: 3px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; }

.tab {
  padding: 7px 15px;
  color: var(--fg-dim);
  background: none;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
}

.tab:hover { color: var(--fg); }

.tab[aria-current="page"] { background: var(--bg-3); color: var(--fg); box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset; }

/* ---------- Gallery ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 0;
  color: inherit;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.12s;
}

.card:hover, .card:focus-visible {
  border-color: var(--dot, var(--accent));
  transform: translateY(-2px);
  outline: none;
}

.shot {
  position: relative;
  aspect-ratio: 1736 / 1080;
  background: #000;
}

.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }

.shot .stamp {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(4px);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.card-body { padding: 11px 13px 12px; }

.card-title { font-size: 14px; font-weight: 600; }

.card mark, .lb-stage mark { background: rgba(255, 255, 255, 0.2); color: #fff; border-radius: 2px; }

/* ---------- Video page ---------- */

.player-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }

video {
  width: 100%;
  aspect-ratio: 1736 / 1080;
  background: #000;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: block;
}

.player-note { margin: 10px 0 0; font-size: 12.5px; color: var(--fg-mute); }

.chapters {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.chapters h3 {
  position: sticky;
  top: 0;
  margin: 0;
  padding: 12px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-mute);
}

.chapter {
  display: flex;
  gap: 11px;
  width: 100%;
  padding: 10px 14px;
  color: var(--fg-dim);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.chapter:last-child { border-bottom: 0; }
.chapter:hover { background: var(--bg-3); color: var(--fg); }

.chapter[aria-current="true"] {
  background: var(--bg-3);
  color: var(--fg);
  box-shadow: inset 2px 0 0 var(--dot, var(--accent));
}

.chapter .ch-time {
  flex: 0 0 42px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--fg-mute);
  padding-top: 1px;
}

.chapter[aria-current="true"] .ch-time { color: var(--dot, var(--accent)); }

.chapter .ch-title { font-size: 13.5px; }

.chapter img { width: 74px; aspect-ratio: 1736/1080; object-fit: cover; border-radius: 4px; flex: 0 0 74px; }

/* ---------- Bits ---------- */

.chip {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--bg-3);
  color: var(--fg-dim);
}

.chip-service { background: color-mix(in srgb, var(--dot, var(--accent)) 22%, transparent); color: var(--dot, var(--accent)); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  color: var(--fg);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { border-color: var(--fg-mute); }

.btn-accent {
  background: color-mix(in srgb, var(--dot, var(--accent)) 20%, var(--bg-3));
  border-color: color-mix(in srgb, var(--dot, var(--accent)) 55%, transparent);
}

.btn-icon { padding: 7px 10px; }

.muted { color: var(--fg-mute); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.empty { padding: 60px 0; text-align: center; color: var(--fg-mute); }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: center;
  background: rgba(5, 7, 10, 0.94);
  backdrop-filter: blur(10px);
}

.lightbox[hidden] { display: none; }

.lb-bar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.lb-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lb-heading strong { font-size: 15px; }
.lb-tools { display: flex; gap: 8px; margin-left: auto; }

.lb-stage {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 20px 0 26px;
  min-height: 0;
  height: 100%;
}

.lb-stage img {
  max-width: 100%;
  max-height: calc(100vh - 230px);
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #000;
}

.lb-stage figcaption {
  max-width: 90ch;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--fg-dim);
  text-align: center;
}

.lb-arrow {
  grid-row: 2;
  height: 88px;
  color: var(--fg-dim);
  background: none;
  border: 0;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.lb-prev { grid-column: 1; }
.lb-next { grid-column: 3; }
.lb-arrow:hover { color: var(--fg); }
.lb-arrow:disabled { opacity: 0.2; cursor: default; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .player-wrap { grid-template-columns: minmax(0, 1fr); }
  .chapters { max-height: 420px; }
}

@media (max-width: 820px) {
  .app { flex-direction: column; }
  .sidebar {
    position: static;
    width: auto;
    flex: none;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav { display: flex; flex-wrap: wrap; gap: 6px; overflow: visible; }
  .nav-item { width: auto; margin: 0; }
  .page { padding: 20px 16px 48px; }
  .lightbox { grid-template-columns: 34px minmax(0, 1fr) 34px; }
}
