:root {
  color-scheme: dark;
  --bg: #14110e;
  --bg-2: #1c1814;
  --line: #3a322a;
  --text: #f4efe6;
  --muted: #b3a79a;
  --accent: #ff5c24;
  --accent-ink: #2a1008;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  font-family: Outfit, "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(255, 92, 36, 0.16), transparent 60%),
    var(--bg);
  color: var(--text);
}
button, input { font: inherit; color: inherit; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px 9.5rem;
  gap: 20px 28px;
  align-items: center;
  padding: 22px 28px 16px;
  background: rgba(20, 17, 14, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}
.kicker {
  margin: 0 0 4px;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 650;
}
h1 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-weight: 560;
  font-size: clamp(32px, 4vw, 52px);
  letter-spacing: -0.03em;
  line-height: 0.95;
}
.search input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 999px;
  padding: 12px 18px;
  outline: none;
}
.search input:focus { border-color: var(--accent); }
.count {
  margin: 0;
  width: 9.5rem;
  justify-self: end;
  text-align: right;
  color: var(--muted);
  white-space: nowrap;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.stage {
  display: grid;
  grid-template-columns: minmax(280px, 1.3fr) minmax(260px, 0.9fr);
  gap: 28px;
  padding: 22px 28px 8px;
}
.stage video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.stage h2 {
  margin: 0 0 8px;
  font-family: Fraunces, Georgia, serif;
  font-weight: 560;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.meta { margin: 0 0 14px; color: var(--muted); }
.meta a { color: var(--text); }
.theses {
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 15.5px;
}

.grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 8px 28px 48px;
}
.group h2 {
  margin: 10px 0 14px;
  font-family: Fraunces, Georgia, serif;
  font-weight: 560;
  font-size: 28px;
  letter-spacing: -0.03em;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.card {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  background: #2a241e;
}
.card.selected img { outline: 2px solid var(--accent); outline-offset: 3px; }
.card h3 {
  margin: 10px 0 4px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.badge {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.snippet {
  margin-top: 8px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.35;
}
.snippet mark {
  background: #ffd7c4;
  color: #2a1008;
  border-radius: 3px;
  padding: 0 2px;
}
.empty {
  color: var(--muted);
  padding: 24px 0;
}

@media (max-width: 860px) {
  .top, .stage { grid-template-columns: 1fr; }
  .top { position: static; }
  .count { width: auto; text-align: left; }
}
