:root {
  --bg: #141416;
  --paper: #1c1f27;
  --ink: #e8eaf0;
  --muted: #8b90a0;
  --accent: #e03a3a;
  --accent-soft: #3a1414;
  --line: #2e3140;
  --radius: 18px;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: #141416;
  overflow-x: hidden;
}

.site-header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 20px 16px;
  position: relative;
}

/* ── Live viewer badge ─────────────────────────────────────────────── */
#viewer-badge {
  position: absolute;
  top: 18px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(224,58,58,.12);
  border: 1px solid rgba(224,58,58,.3);
  border-radius: 20px;
  padding: 5px 13px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  user-select: none;
  transition: color .3s;
}

#viewer-badge.live {
  color: var(--ink);
}

.vb-eye {
  font-size: 1rem;
  line-height: 1;
}

#viewer-count {
  min-width: 1.4ch;
  text-align: center;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--muted);
}

h1 {
  margin: 8px 0 8px;
  font-family: "Fraunces", serif;
  font-size: clamp(2.4rem, 5.5vw, 4.3rem);
  line-height: 1.05;
}

.subtitle {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.toolbar {
  display: flex;
  gap: 14px;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.search-wrap {
  display: grid;
  gap: 8px;
  min-width: 250px;
  flex: 1 1 320px;
}

.search-wrap span {
  font-size: 0.9rem;
  font-weight: 500;
}

.search-wrap input {
  border: 1px solid var(--line);
  background: #13161e;
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.count-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: translateY(16px);
  opacity: 0;
  animation: reveal 460ms cubic-bezier(0.26, 0.87, 0.31, 1) forwards;
}

.card-content {
  padding: 12px 14px 14px;
}

.card h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.meta,
.tags {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.meta {
  font-weight: 500;
}

.tags {
  font-size: 0.82rem;
}

.evidence-badge {
  display: inline-block;
  margin: 8px 0 0;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
}

@keyframes reveal {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ── Lightbox ───────────────────────────────────────────────────────────── */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 20px;
}

#lightbox.open {
  display: flex;
}

.lb-img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 0 60px rgba(0,0,0,0.8);
}

.lb-video {
  display: none;
  max-width: 94vw;
  max-height: 84vh;
  width: 960px;
  border-radius: 10px;
  box-shadow: 0 0 60px rgba(0,0,0,0.8);
  background: #000;
  outline: none;
}

.lb-caption {
  margin: 14px 0 0;
  color: #ccc;
  font-size: 0.95rem;
  text-align: center;
}

.lb-close {
  position: fixed;
  top: 18px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 120ms;
}

.lb-close:hover {
  opacity: 1;
}

/* ── Pagination ─────────────────────────────────────────────────────────── */
#pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 32px 0 24px;
}

.page-btn {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 22px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
}

.page-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ── Folder sections ────────────────────────────────────────────── */
.folder-section {
  margin-bottom: 2.8rem;
}

.folder-hdr {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-bottom: .85rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.folder-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.folder-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}

.folder-count {
  margin-left: auto;
  font-size: .8rem;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 2px 11px;
  border-radius: 20px;
  white-space: nowrap;
}

.no-evidence {
  text-align: center;
  color: var(--muted);
  padding: 4rem 1rem;
  font-size: .95rem;
}

/* ── Card image/video wrap ──────────────────────────────────── */
.card .img-wrap {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  border-radius: var(--radius) var(--radius) 0 0;
}

.card .img-wrap img {
  width: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 16/10;
  transition: transform 340ms ease;
}

.card:hover .img-wrap img {
  transform: scale(1.04);
}

/* Video placeholder tile */
.card .img-wrap.is-video {
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d0f15;
}

.card .img-wrap.is-video::after {
  content: "▶";
  font-size: 2.8rem;
  color: rgba(255,255,255,.55);
  pointer-events: none;
}

.page-info {
  color: var(--muted);
  font-size: 0.9rem;
}

@keyframes float1 {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(22px);
  }
}

@keyframes float2 {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-18px);
  }
}

@media (max-width: 640px) {
  .site-header {
    padding-top: 40px;
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}
