:root {
  --bg: #081018;
  --bg-2: #0e1824;
  --paper: rgba(16, 28, 42, 0.78);
  --paper-solid: #122033;
  --line: rgba(196, 224, 255, 0.12);
  --line-strong: rgba(228, 177, 90, 0.45);
  --text: #e8f1f8;
  --muted: #8aa0b5;
  --gold: #e4b15a;
  --gold-2: #f3d59a;
  --ice: #8ecfff;
  --mint: #7ddec0;
  --rose: #f0a3a0;
  --violet: #b7a6ff;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
  min-height: 100%;
}

body {
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(142, 207, 255, 0.12), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(228, 177, 90, 0.1), transparent 50%),
    radial-gradient(700px 400px at 50% 100%, rgba(125, 222, 192, 0.06), transparent 50%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,.35), transparent),
    radial-gradient(1px 1px at 80px 120px, rgba(255,255,255,.25), transparent),
    radial-gradient(1px 1px at 160px 70px, rgba(255,255,255,.18), transparent);
  background-size: 220px 180px;
  opacity: .35;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr .8fr;
  gap: 28px;
  align-items: end;
  margin-bottom: 28px;
}

.kicker {
  color: var(--gold);
  letter-spacing: .18em;
  font-size: 12px;
  text-transform: uppercase;
  margin: 0 0 10px;
}

h1 {
  font-family: "Fraunces", "Noto Serif SC", serif;
  font-weight: 500;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.08;
  margin: 0 0 14px;
  letter-spacing: -.03em;
}

h1 em {
  font-style: italic;
  color: var(--gold-2);
}

.lede {
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 62ch;
  margin: 0;
}

.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  backdrop-filter: blur(12px);
}

.stat b {
  display: block;
  font-family: "Fraunces", serif;
  font-size: 28px;
  color: var(--ice);
  line-height: 1.15;
  white-space: nowrap;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 8px 0 18px;
}

.search {
  flex: 1 1 280px;
  position: relative;
  min-height: 44px;
}

.search input {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 12px 16px 12px 40px;
  font: inherit;
  outline: none;
}

.search input:focus { border-color: var(--gold); }

.search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: .6;
}

.selects {
  display: flex;
  gap: 8px;
}

select, .ghost-btn {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
}

.ghost-btn:hover, select:hover { border-color: var(--ice); }

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 8px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.group {
  margin-bottom: 10px;
}

.group-label {
  font-size: 12px;
  color: var(--gold-2);
  margin-bottom: 6px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: .15s ease;
}

.tag small {
  color: var(--muted);
  font-size: 11px;
}

.tag:hover { border-color: var(--ice); transform: translateY(-1px); }

.tag.active {
  background: linear-gradient(180deg, rgba(228,177,90,.2), rgba(228,177,90,.08));
  border-color: var(--gold);
  color: var(--gold-2);
}

.tag.related {
  border-color: rgba(142, 207, 255, .45);
  background: rgba(142, 207, 255, .08);
}

.tag.dim { opacity: .28; }

.tag.dim:hover { opacity: .7; }

.related-box {
  display: none;
  margin: 4px 0 12px;
  padding: 10px 12px 12px;
  border: 1px dashed rgba(142, 207, 255, .28);
  border-radius: 12px;
  background: rgba(142, 207, 255, .05);
}

.related-box.show { display: block; }

.related-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.related-head p {
  margin: 0;
  color: var(--ice);
  font-size: 13px;
}

.selected-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 32px;
  margin-bottom: 10px;
}

.chip-empty { color: var(--muted); font-size: 13px; }

.results-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 8px 2px 14px;
  color: var(--muted);
  font-size: 13px;
}

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

.card {
  background: #173044;
  border: 1px solid rgba(196, 224, 255, 0.16);
  border-radius: 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  text-decoration: none;
  color: inherit;
  transition: .18s ease;
  position: relative;
  overflow: hidden;
}

.card-body {
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-media {
  position: relative;
  display: block;
  width: 100%;
  height: 200px;
  flex: 0 0 200px;
  padding: 0;
  border: 0;
  background: #0b1622;
  cursor: zoom-in;
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.card-media:hover img {
  transform: scale(1.03);
  transition: transform .25s ease;
}

.play-btn,
.media-count {
  position: absolute;
  z-index: 1;
  color: #fff;
  font-size: 12px;
  letter-spacing: .02em;
}

.play-btn {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 64px;
  height: 36px;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  pointer-events: none;
}

.play-btn::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent #fff;
}

.media-count {
  right: 10px;
  bottom: 10px;
  background: rgba(0,0,0,.6);
  border-radius: 999px;
  padding: 3px 8px;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gold);
}

.card:hover {
  border-color: rgba(142, 207, 255, .35);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.card h3 {
  font-family: "Fraunces", "Noto Serif SC", serif;
  font-size: 20px;
  line-height: 1.3;
  margin: 0 0 10px;
  font-weight: 500;
}

.summary {
  color: #c5d5e4;
  font-size: 14px;
  line-height: 1.65;
  margin: 0 0 10px;
  flex: 1;
}

.takeaway {
  font-size: 13px;
  color: var(--gold-2);
  background: rgba(228, 177, 90, .08);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 0 0 12px;
  line-height: 1.55;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.mini-tag {
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  cursor: pointer;
}

.mini-tag:hover, .mini-tag.on {
  color: var(--gold-2);
  border-color: var(--gold);
}

.card-foot {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.card-foot a {
  color: var(--ice);
  text-decoration: none;
}

.card-foot a:hover { text-decoration: underline; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(4, 8, 14, .88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 24px;
}

.lightbox[hidden] { display: none; }

.lb-stage {
  max-width: min(1100px, 92vw);
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-stage img,
.lb-stage video {
  max-width: 92vw;
  max-height: 78vh;
  border-radius: 12px;
  background: #000;
}

.lb-stage iframe {
  width: min(92vw, 960px);
  height: min(78vh, 540px);
  border: 0;
  border-radius: 12px;
}

.lb-caption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  max-width: 80ch;
}

.lb-close,
.lb-nav {
  position: absolute;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--line);
  color: #fff;
  cursor: pointer;
}

.lb-close {
  top: 14px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 22px;
}

.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 64px;
  border-radius: 12px;
  font-size: 32px;
}

.lb-prev { left: 12px; }
.lb-next { right: 12px; }

.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,.16); }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
}

footer {
  margin-top: 36px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .stat b { font-size: 20px; }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search {
    flex: 0 0 auto;
    width: 100%;
  }
  .selects { justify-content: flex-start; }
}
