:root {
  --ink: #050505;
  --paper: #fffef7;
  --cream: #f6f2df;
  --acid: #dfff25;
  --blue: #42b8f5;
  --muted: rgba(5, 5, 5, 0.68);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 54px;
  border-bottom: 2px solid var(--ink);
  background: rgba(255, 254, 247, 0.94);
  backdrop-filter: blur(14px);
}

.brand,
.nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  text-decoration: none;
  font-weight: 950;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--acid);
  box-shadow: 3px 3px 0 var(--ink);
}

.nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.86fr);
  gap: 56px;
  min-height: calc(100vh - 64px);
  padding: 92px 72px 58px;
  border-bottom: 2px solid var(--ink);
  background:
    linear-gradient(90deg, rgba(5, 5, 5, 0.95), rgba(5, 5, 5, 0.82)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 40px);
  color: var(--cream);
}

.hero-copy {
  align-self: center;
}

.kicker,
.eyebrow {
  width: fit-content;
  margin: 0 0 28px;
  padding: 8px 12px;
  border: 1px solid var(--acid);
  color: var(--acid);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(68px, 8vw, 150px);
  line-height: 0.82;
  letter-spacing: 0;
}

.hero h1 span,
.hero h1 strong {
  display: block;
}

.hero h1 strong {
  color: var(--acid);
  text-shadow: 7px 7px 0 var(--ink);
}

.lede {
  max-width: 680px;
  margin: 32px 0 0;
  color: rgba(246, 242, 223, 0.78);
  font-size: 24px;
  font-weight: 850;
  line-height: 1.35;
}

.stats {
  display: grid;
  max-width: 620px;
  margin-top: 38px;
  grid-template-columns: repeat(3, 1fr);
  border: 2px solid var(--acid);
}

.stats div {
  min-height: 116px;
  padding: 18px;
  border-right: 2px solid var(--acid);
  background: rgba(5, 5, 5, 0.72);
}

.stats div:last-child {
  border-right: 0;
}

.stats strong {
  display: block;
  color: var(--acid);
  font-size: 54px;
  line-height: 1;
}

.stats span {
  display: block;
  margin-top: 8px;
  color: rgba(246, 242, 223, 0.72);
  font-size: 13px;
}

.hero-stage {
  position: relative;
  min-height: 620px;
  padding: 18px 18px 72px;
  border: 2px solid var(--acid);
  background: var(--ink);
  box-shadow: 16px 16px 0 var(--acid);
}

.hero-reels {
  position: relative;
  height: 100%;
  min-height: 530px;
}

.hero-reel {
  position: absolute;
  object-fit: cover;
  background: var(--ink);
}

.hero-reel-1 {
  top: 0;
  right: 0;
  width: 96%;
  height: 62%;
}

.hero-reel-2 {
  right: 6%;
  bottom: 0;
  width: 52%;
  height: 42%;
}

.hero-reel-3 {
  bottom: 5%;
  left: 2%;
  width: 48%;
  height: 36%;
}

.hero-caption {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
  border: 2px solid var(--acid);
  color: var(--acid);
  font-size: 12px;
  font-weight: 950;
}

.library {
  padding: 58px 36px 82px;
}

.library-head,
.count-row {
  display: grid;
  max-width: 1400px;
  margin: 0 auto 22px;
  grid-template-columns: 1fr minmax(280px, 420px);
  gap: 22px;
  align-items: end;
}

.library h2 {
  margin: 0;
  font-size: clamp(34px, 4vw, 64px);
  line-height: 0.95;
}

.library .eyebrow {
  border-color: var(--ink);
  color: var(--ink);
}

.search {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 950;
}

.search input {
  min-height: 52px;
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 0 14px;
  box-shadow: 5px 5px 0 var(--ink);
  outline: none;
}

.filter-block {
  max-width: 1400px;
  margin: 0 auto 24px;
}

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

.filter-row button {
  min-height: 38px;
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 0 14px;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.filter-row button.active {
  background: var(--ink);
  color: var(--cream);
}

.count-row {
  align-items: center;
  margin-bottom: 18px;
}

.count-row p {
  margin: 0;
  font-size: 18px;
  font-weight: 950;
}

.count-row span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.grid {
  display: grid;
  max-width: 1400px;
  margin: 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card {
  display: flex;
  height: 560px;
  overflow: hidden;
  flex-direction: column;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 7px 7px 0 var(--ink);
}

.card-preview {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 2px solid var(--ink);
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.preview {
  position: relative;
  height: 260px;
  overflow: hidden;
  background: var(--ink);
  color: var(--cream);
}

.preview video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0) 45%, rgba(5, 5, 5, 0.78)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 18px);
}

.play-dot {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1;
  width: 48px;
  height: 48px;
  border: 2px solid var(--cream);
  border-radius: 999px;
  background: var(--ink);
}

.play-dot::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 18px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid var(--acid);
}

.preview-caption,
.preview-tags {
  position: absolute;
  z-index: 1;
  right: 18px;
  left: 18px;
}

.preview-caption {
  top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 11px;
  font-weight: 950;
}

.preview-caption em {
  max-width: 54%;
  overflow: hidden;
  color: rgba(246, 242, 223, 0.78);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-tags {
  bottom: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.preview-tags span {
  min-width: 0;
  overflow: hidden;
  padding: 6px 8px;
  background: var(--acid);
  color: var(--ink);
  font-size: 10px;
  font-weight: 950;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview.cyan .preview-tags span {
  background: var(--blue);
}

.preview.coral .preview-tags span {
  background: #ff7043;
}

.card-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  padding: 18px;
}

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

.card h3 {
  display: -webkit-box;
  min-height: 50px;
  margin: 14px 0 8px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 24px;
  line-height: 1.02;
}

.card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.card-actions {
  display: grid;
  margin-top: auto;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.card-actions button,
.prompt-box button,
.dialog-close,
#loadMore {
  min-height: 44px;
  border: 2px solid var(--ink);
  background: var(--acid);
  color: var(--ink);
  font-weight: 950;
  cursor: pointer;
}

.card-actions button:last-child,
.prompt-box button {
  background: var(--ink);
  color: var(--cream);
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 34px;
}

#loadMore {
  min-width: 220px;
}

.dialog {
  position: fixed;
  z-index: 30;
  inset: 0;
  overflow: auto;
  background: rgba(5, 5, 5, 0.76);
  padding: 28px;
}

.dialog[hidden] {
  display: none;
}

.dialog-panel {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 10px 10px 0 var(--acid);
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 44px;
  min-height: 44px;
}

.dialog-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.92fr) 1fr;
  gap: 28px;
  padding: 28px;
}

.dialog-grid .preview {
  height: 520px;
}

.dialog-info h2 {
  margin: 10px 0;
  font-size: 42px;
  line-height: 1;
}

.dialog-info > p {
  color: var(--muted);
  line-height: 1.55;
}

.dialog-kicker {
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.detail-meta div {
  min-width: 0;
  border: 2px solid var(--ink);
  padding: 10px;
}

.detail-meta span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
}

.detail-meta strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompt-box {
  border: 2px solid var(--ink);
}

.prompt-box > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid var(--ink);
  padding: 12px;
}

.prompt-box pre {
  max-height: 360px;
  margin: 0;
  overflow: auto;
  padding: 16px;
  white-space: pre-wrap;
  font-family: "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
}

.modal-open {
  overflow: hidden;
}

@media (max-width: 1080px) {
  .hero,
  .library-head,
  .count-row,
  .dialog-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 52px 24px;
  }

  .hero-stage {
    min-height: 520px;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .count-row span {
    text-align: left;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 0 16px;
  }

  .nav {
    display: none;
  }

  .hero h1 {
    font-size: clamp(54px, 18vw, 90px);
  }

  .stats,
  .grid,
  .card-actions,
  .detail-meta {
    grid-template-columns: 1fr;
  }

  .stats div {
    border-right: 0;
    border-bottom: 2px solid var(--acid);
  }

  .stats div:last-child {
    border-bottom: 0;
  }

  .library {
    padding: 42px 14px 68px;
  }

  .card {
    height: auto;
    min-height: 540px;
  }

  .dialog {
    padding: 8px;
  }

  .dialog-panel {
    box-shadow: none;
  }

  .dialog-grid {
    padding: 12px;
  }

  .dialog-grid .preview {
    height: 320px;
  }
}
