:root,
[data-theme="modern"] {
  --bg: #101012;
  --panel: #19191c;
  --ink: #f7f5ef;
  --muted: #a19fa7;
  --line: #303035;
  --accent: #f6cb59;
  --on-accent: #181308;
  --heading: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --body: "DM Sans Variable", system-ui, sans-serif;
  --hero: #131315;
  --radius: 10px;
  --shadow: none;
  --art-filter: saturate(0.75);
}
[data-theme="ny"] {
  --bg: #141111;
  --panel: #221719;
  --ink: #fff1df;
  --muted: #c0a49d;
  --line: #54303a;
  --accent: #ff506a;
  --hero: #190d12;
  --radius: 3px;
  --shadow: 0 0 15px #e619383b;
  --art-filter: grayscale(1) sepia(0.35);
  --body: "Courier New", monospace;
}
[data-theme="uk"] {
  --bg: #f2efe9;
  --panel: #fffdf6;
  --ink: #141414;
  --muted: #59534d;
  --line: #222;
  --accent: #ffd100;
  --hero: #252320;
  --radius: 0px;
  --shadow: 3px 3px #1a1a1a;
  --body: Georgia, serif;
}
[data-theme="sitcom"] {
  --bg: #f5e5ce;
  --panel: #fff4e5;
  --ink: #242d2c;
  --muted: #62574f;
  --line: #c2a896;
  --accent: #96dbcf;
  --hero: #283d3a;
  --radius: 18px;
  --shadow: 0 7px 17px #7f422322;
  --heading: "Trebuchet MS", system-ui, sans-serif;
  --art-filter: sepia(0.4);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--body);
}
a {
  color: inherit;
  text-decoration: none;
}
button,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.wrap,
.top-inner,
.hero-inner {
  width: min(1200px, calc(100% - 104px));
  margin: auto;
}
.top {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}
.top-inner {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 56px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 800 22px/1 var(--heading);
  letter-spacing: 0.035em;
  white-space: nowrap;
}
.brand strong {
  color: var(--accent);
  margin-left: 4px;
}
.mark {
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  font: 22px/1 system-ui;
}
.top nav {
  display: flex;
  gap: 28px;
  height: 100%;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
}
.top nav a {
  height: 100%;
  display: grid;
  place-items: center;
}
.top nav .current {
  color: var(--ink);
  box-shadow: inset 0 -2px var(--accent);
}
.theme-label {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}
.theme-label > span {
  color: var(--accent);
  font-size: 17px;
}
select {
  appearance: none;
  cursor: pointer;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 29px 8px 12px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 52%,
    calc(100% - 10px) 52%;
  background-size: 4px 4px;
  background-repeat: no-repeat;
}
.hero {
  background-color: var(--hero);
  background-image:
    linear-gradient(
      90deg,
      rgba(13, 13, 16, 0.96) 0%,
      rgba(13, 13, 16, 0.66) 37%,
      transparent 73%
    ),
    url("/stage.webp");
  background-size: cover;
  background-position: center 55%;
  color: #f7f5ef;
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  padding: 48px 0 53px;
}
.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin: 0 0 13px;
}
.eyebrow span {
  display: inline-block;
  width: 19px;
  border-top: 1px solid;
  vertical-align: middle;
  margin-right: 8px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  font-family: var(--heading);
}
h1 {
  font-size: clamp(64px, 8.2vw, 116px);
  font-weight: 900;
  line-height: 0.83;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0 0 24px;
}
h1 em {
  color: var(--accent);
  font-style: normal;
}
.intro {
  max-width: 395px;
  color: #ccc9c8;
  margin-bottom: 25px;
}
.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.primary,
.secondary {
  padding: 11px 17px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.primary {
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--accent);
}
.secondary {
  background: #1b1a1dcc;
  color: #f7f5ef;
  border: 1px solid #57545b;
}
.secondary span {
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
}
.primary:hover,
.secondary:hover {
  filter: brightness(1.15);
}
.catalog {
  padding: 39px 0 52px;
}
.catalog-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
}
.catalog-title .eyebrow,
.lineage .eyebrow {
  margin-bottom: 3px;
}
h2 {
  font-size: clamp(31px, 4vw, 47px);
  line-height: 1;
  text-transform: uppercase;
  margin: 0 0 15px;
  letter-spacing: 0.015em;
}
#count,
.muted {
  color: var(--muted);
}
#count {
  font-size: 14px;
  margin-bottom: 15px;
}
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 5px 0 22px;
}
.filters label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.filters label span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
#clear {
  background: none;
  border: 0;
  text-decoration: underline;
  font-size: 14px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.card {
  width: 100%;
  padding: 0;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition:
    transform 0.18s,
    border-color 0.18s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}
.thumb {
  aspect-ratio: 16/9;
  display: grid;
  place-items: center;
  position: relative;
  background: var(--tile);
  isolation: isolate;
  overflow: hidden;
}
.thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    124deg,
    transparent 0 15px,
    #ffffff17 16px 17px,
    transparent 18px 30px
  );
  z-index: -1;
}
.thumb img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: var(--art-filter);
  z-index: -1;
}
.play {
  position: absolute;
  left: 12px;
  bottom: 11px;
  border-radius: 50%;
  background: #111c;
  color: white;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 12px;
  border: 1px solid #ffffff50;
}
.thumb-letter {
  font: 900 68px/1 var(--heading);
  color: #ffffff47;
  letter-spacing: -0.06em;
}
.length {
  position: absolute;
  right: 9px;
  bottom: 9px;
  background: #111e;
  color: #fff;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}
.card-info {
  padding: 12px 13px 15px;
}
.card-info h3 {
  font-size: 23px;
  line-height: 1.04;
  margin: 0 0 5px;
}
.card-info p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}
.tag {
  display: inline-block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 5px;
}
[data-theme="uk"] .tag,
[data-theme="sitcom"] .tag,
[data-theme="uk"] .catalog .eyebrow,
[data-theme="sitcom"] .catalog .eyebrow,
[data-theme="uk"] .lineage .eyebrow,
[data-theme="sitcom"] .lineage .eyebrow {
  color: var(--ink);
}
.lineage {
  padding: 32px 0 64px;
  border-top: 1px solid var(--line);
}
#connections {
  display: grid;
  gap: 8px;
  max-width: 670px;
}
.connection {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--panel);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.connection button,
.credit-link {
  background: none;
  border: 0;
  text-decoration: underline;
  padding: 0;
  text-align: left;
}
.connection span {
  font-size: 14px;
  color: var(--muted);
}
footer {
  border-top: 1px solid var(--line);
  padding: 25px 0;
  color: var(--muted);
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
footer p {
  margin: 0;
  font-size: 14px;
}
dialog {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  width: min(820px, calc(100% - 28px));
  max-height: 90dvh;
}
dialog::backdrop {
  background: #000c;
}
.detail-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}
.detail-head h2 {
  margin: 0;
  font-size: 32px;
}
.close {
  background: none;
  border: 0;
  font-size: 27px;
}
.detail-body {
  padding: 20px;
}
.detail-body section {
  margin-top: 25px;
}
.detail-body h3 {
  font-size: 26px;
  margin: 0 0 8px;
}
.detail-body .grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.video {
  width: 100%;
  aspect-ratio: 16/9;
  background: #080808;
  border: 0;
}
.sources {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.sources a {
  text-decoration: underline;
}
.detail-body ul {
  padding-left: 22px;
}
@media (max-width: 850px) {
  .wrap,
  .top-inner,
  .hero-inner {
    width: calc(100% - 48px);
  }
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .top-inner {
    gap: 26px;
  }
}
@media (max-width: 590px) {
  .wrap,
  .top-inner,
  .hero-inner {
    width: calc(100% - 32px);
  }
  .top-inner {
    height: auto;
    min-height: 60px;
    gap: 10px;
    flex-wrap: wrap;
    padding: 9px 0;
  }
  .top nav {
    order: 3;
    width: 100%;
    gap: 20px;
  }
  .theme-label > span {
    display: none;
  }
  .theme-label select {
    max-width: 143px;
  }
  .hero-inner {
    padding: 55px 0;
  }
  .hero {
    background-position: 62% center;
  }
  h1 {
    font-size: clamp(55px, 13vw, 78px);
  }
  .grid,
  .detail-body .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .filters select {
    width: 100%;
  }
  .catalog-title {
    align-items: flex-start;
  }
  .catalog-title h2 {
    font-size: 32px;
  }
  #count {
    white-space: nowrap;
  }
  footer .wrap {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.more-row {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}
.more-row button {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}
.connection p {
  width: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
[data-theme="ny"] .hero {
  background-blend-mode: normal, luminosity;
}
[data-theme="uk"] .theme-label > span,
[data-theme="sitcom"] .theme-label > span,
[data-theme="uk"] .brand strong,
[data-theme="sitcom"] .brand strong {
  color: var(--ink);
}
[data-theme="uk"] .primary {
  box-shadow: 3px 3px #000;
  border-radius: 1px;
}
[data-theme="sitcom"] .card:hover .thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(transparent 0 3px, #ffffff20 4px 5px);
  pointer-events: none;
}
