:root {
  color-scheme: dark;
  --bg: #07090d;
  --surface: #10141b;
  --surface-strong: #151b24;
  --surface-hover: #19212c;
  --text: #f7f8fa;
  --muted: #9ba6b5;
  --muted-strong: #c6cbd4;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --cyan: #37c3ff;
  --violet: #7257ff;
  --green: #56c78a;
  --danger: #ff6b78;
  --max: 1280px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button,
input,
select {
  letter-spacing: 0;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

img {
  max-width: 100%;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 13, 0.94);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(100% - 32px, var(--max));
  min-height: 76px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(260px, 520px) auto;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
}

.brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.site-search {
  position: relative;
  min-width: 0;
}

.search-field {
  height: 44px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  transition: border-color 160ms ease, background 160ms ease;
}

.search-field:focus-within {
  border-color: rgba(55, 195, 255, 0.62);
  background: var(--surface-strong);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-field input::placeholder {
  color: #768293;
}

.icon-button {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  outline: 0;
}

.icon-button[hidden] {
  display: none;
}

.search-results {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #11161e;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.48);
}

.search-results[hidden] {
  display: none;
}

.search-result {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  color: var(--text);
}

.search-result + .search-result {
  border-top: 1px solid var(--line);
}

.search-result:hover,
.search-result.is-active {
  background: var(--surface-hover);
}

.search-result img {
  width: 42px;
  height: 58px;
  display: block;
  border-radius: 5px;
  object-fit: cover;
  background: var(--surface);
}

.search-result-copy {
  min-width: 0;
}

.search-result-title,
.search-result-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-title {
  font-size: 14px;
  font-weight: 750;
}

.search-result-meta,
.search-empty {
  color: var(--muted);
  font-size: 12px;
}

.search-result-rating {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.search-empty {
  padding: 18px;
  text-align: center;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 750;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav a:hover,
.nav a:focus-visible {
  border-color: rgba(55, 195, 255, 0.46);
  background: var(--surface-strong);
  color: var(--text);
  outline: 0;
  transform: translateY(-1px);
}

.page-shell {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  padding: 28px 0 54px;
}

.breadcrumbs {
  margin: 0 0 22px;
  color: #727d8b;
  font-size: 13px;
}

.breadcrumbs a {
  color: #8b96a6;
}

.page-intro {
  max-width: 880px;
  padding: 22px 0 30px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0 0 14px;
  font-size: 52px;
  line-height: 1.06;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: 0;
}

h3 {
  letter-spacing: 0;
}

.lead {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  align-items: start;
  gap: 38px;
}

.filters {
  position: sticky;
  top: 102px;
  padding-right: 26px;
  border-right: 1px solid var(--line);
}

.filters-heading {
  margin: 0 0 18px;
  font-size: 20px;
}

.filter-form {
  display: grid;
  gap: 20px;
}

.filter-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.filter-group {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.filter-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.segment {
  min-width: 0;
  position: relative;
}

.segment input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segment span {
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 5px 6px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.segment input:checked + span {
  background: var(--text);
  color: #090b0f;
}

.segment input:disabled + span {
  opacity: 0.34;
  cursor: not-allowed;
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  width: 100%;
  height: 42px;
  appearance: none;
  padding: 0 38px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.select-wrap select:focus-visible {
  border-color: rgba(55, 195, 255, 0.62);
}

.select-wrap .icon {
  position: absolute;
  top: 50%;
  right: 11px;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.filter-reset {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted-strong);
  font-weight: 700;
  cursor: pointer;
}

.filter-reset:hover,
.filter-reset:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
  outline: 0;
}

.filter-reset .icon {
  width: 17px;
  height: 17px;
}

.filter-toggle {
  display: none;
}

.catalog-results {
  min-width: 0;
}

.results-bar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.results-title {
  min-width: 0;
}

.results-count {
  margin-left: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.sort-control {
  width: 190px;
}

.catalog-list {
  display: grid;
}

.media-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 18px 14px 18px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  transition: background 160ms ease, transform 160ms ease;
}

.media-card:first-child {
  border-top: 1px solid var(--line);
}

.media-card:hover {
  background: rgba(255, 255, 255, 0.035);
}

.media-card[hidden] {
  display: none;
}

.media-card-poster {
  width: 116px;
  aspect-ratio: 2 / 3;
  display: block;
  border-radius: 7px;
  object-fit: cover;
  background: var(--surface);
}

.media-card-copy {
  min-width: 0;
}

.media-card-title {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.22;
}

.media-card-original {
  display: block;
  margin-bottom: 12px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  color: var(--muted-strong);
  font-size: 14px;
}

.media-card-meta span {
  position: relative;
}

.media-card-genres {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.media-card-side {
  min-width: 76px;
  display: grid;
  justify-items: end;
  gap: 12px;
}

.rating-badge {
  min-width: 48px;
  min-height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 4px 9px;
  border: 1px solid rgba(86, 199, 138, 0.32);
  border-radius: 7px;
  background: rgba(86, 199, 138, 0.12);
  color: var(--green);
  font-size: 16px;
  font-weight: 850;
}

.open-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.media-card:hover .open-mark {
  border-color: rgba(55, 195, 255, 0.46);
  color: var(--cyan);
}

.catalog-empty {
  padding: 44px 20px;
  color: var(--muted);
  text-align: center;
}

.catalog-empty[hidden] {
  display: none;
}

.collection-section {
  margin-top: 34px;
}

.collection-section + .collection-section {
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.collection-section h2 {
  margin-bottom: 18px;
}

.collection-grid,
.poster-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.collection-card,
.poster-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 160ms ease, transform 160ms ease;
}

.collection-card:hover,
.poster-card:hover {
  border-color: rgba(55, 195, 255, 0.45);
  transform: translateY(-2px);
}

.collection-card img,
.poster-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  display: block;
  object-fit: cover;
  background: var(--surface);
}

.card-body {
  min-width: 0;
  display: block;
  padding: 14px;
}

.card-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.card-title {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.28;
}

.card-meta {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.detail-main {
  margin-top: -28px;
}

.detail-hero {
  width: 100vw;
  min-height: 610px;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  display: grid;
  align-items: end;
  overflow: hidden;
  background-color: #0a0d12;
  background-image: var(--hero-bg);
  background-position: center 25%;
  background-size: cover;
}

.detail-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 9, 13, 0.98) 0%, rgba(7, 9, 13, 0.77) 44%, rgba(7, 9, 13, 0.12) 76%),
    linear-gradient(0deg, #07090d 0%, rgba(7, 9, 13, 0.2) 52%, rgba(7, 9, 13, 0.3) 100%);
}

.detail-hero-inner {
  width: min(100% - 32px, var(--max));
  position: relative;
  z-index: 1;
  margin: 0 auto;
  padding: 72px 0 64px;
  display: grid;
  grid-template-columns: minmax(0, 790px) 190px;
  align-items: end;
  justify-content: space-between;
  gap: 48px;
}

.detail-copy {
  min-width: 0;
}

.detail-type {
  margin-bottom: 10px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-title {
  max-width: 820px;
  margin: 0 0 16px;
  font-size: 58px;
  line-height: 1.02;
}

.detail-original {
  margin-bottom: 14px;
  color: var(--muted-strong);
  font-size: 15px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 13px;
  margin-bottom: 17px;
  color: var(--muted-strong);
  font-size: 14px;
}

.detail-meta .rating-badge {
  min-width: 42px;
  min-height: 28px;
  font-size: 14px;
}

.detail-lead {
  max-width: 720px;
  margin: 0;
  color: #d3d8e0;
  font-size: 17px;
}

.detail-credit-lines {
  display: grid;
  gap: 4px;
  margin-top: 17px;
  color: var(--muted);
  font-size: 14px;
}

.detail-credit-lines strong {
  color: var(--muted-strong);
  font-weight: 750;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 800;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.13);
  transform: translateY(-1px);
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(70, 105, 255, 0.25);
}

.button.primary:hover {
  background: linear-gradient(135deg, #65d2ff, #876fff);
}

.detail-poster {
  width: 190px;
  height: 285px;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
}

.detail-content {
  padding-top: 40px;
}

.detail-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  align-items: start;
  gap: 54px;
}

.detail-primary,
.detail-aside {
  min-width: 0;
}

.detail-aside {
  position: sticky;
  top: 104px;
}

.content-section {
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.content-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.content-section h2,
.info-panel h2 {
  margin-bottom: 18px;
}

.content-section p {
  margin: 0 0 15px;
  color: var(--muted-strong);
}

.content-section p:last-child {
  margin-bottom: 0;
}

.info-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.info-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.info-row {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.info-row:last-child {
  border-bottom: 0;
}

.info-row dt,
.info-row dd {
  margin: 0;
}

.info-row dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.info-row dd {
  color: var(--muted-strong);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.fact-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  color: var(--muted-strong);
  counter-reset: facts;
  list-style: none;
}

.fact-list li {
  position: relative;
  padding-left: 44px;
  counter-increment: facts;
}

.fact-list li::before {
  content: counter(facts);
  width: 28px;
  height: 28px;
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(55, 195, 255, 0.32);
  border-radius: 7px;
  background: rgba(55, 195, 255, 0.08);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 850;
}

.source-note {
  margin-top: 20px !important;
  color: var(--muted) !important;
  font-size: 12px;
}

.related-section {
  margin-top: 48px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

.related-section h2 {
  margin-bottom: 18px;
}

.footer {
  margin-top: 54px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.footer a {
  color: var(--muted-strong);
}

@media (max-width: 1080px) {
  .header-inner {
    grid-template-columns: auto minmax(240px, 1fr);
    gap: 18px;
    padding: 12px 0;
  }

  .nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .filters {
    top: 142px;
  }

  .detail-aside {
    top: 150px;
  }

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

@media (max-width: 820px) {
  h1 {
    font-size: 40px;
  }

  .page-intro {
    padding-bottom: 20px;
  }

  .catalog-layout {
    display: block;
  }

  .filter-toggle {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-weight: 800;
  }

  .filters {
    display: none;
    position: static;
    margin-bottom: 24px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  .filters.is-open {
    display: block;
  }

  .filters-heading {
    display: none;
  }

  .detail-hero {
    min-height: 560px;
  }

  .detail-hero-inner {
    grid-template-columns: minmax(0, 1fr) 130px;
    gap: 24px;
    padding: 68px 0 44px;
  }

  .detail-title {
    font-size: 42px;
  }

  .detail-poster {
    width: 130px;
    height: 195px;
  }

  .detail-content-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .detail-aside {
    position: static;
    grid-row: 1;
  }
}

@media (max-width: 620px) {
  .header-inner {
    width: min(100% - 24px, var(--max));
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .site-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .nav {
    grid-column: 1 / -1;
    grid-row: 3;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .page-shell,
  .detail-hero-inner {
    width: min(100% - 24px, var(--max));
  }

  .page-shell {
    padding-top: 20px;
  }

  .breadcrumbs {
    margin-bottom: 14px;
  }

  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 24px;
  }

  .lead {
    font-size: 16px;
  }

  .results-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .sort-control {
    width: 100%;
  }

  .media-card {
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: start;
    gap: 13px;
    padding: 14px 0;
  }

  .media-card-poster {
    width: 86px;
  }

  .media-card-title {
    padding-right: 52px;
    font-size: 16px;
  }

  .media-card-original {
    margin-bottom: 8px;
  }

  .media-card-meta {
    gap: 3px 9px;
    font-size: 12px;
  }

  .media-card-genres {
    font-size: 12px;
  }

  .media-card-side {
    min-width: 0;
    position: absolute;
    top: 14px;
    right: 0;
    justify-items: end;
  }

  .media-card {
    position: relative;
  }

  .open-mark {
    display: none;
  }

  .rating-badge {
    min-width: 42px;
    min-height: 28px;
    font-size: 14px;
  }

  .collection-grid,
  .poster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .card-body {
    padding: 11px;
  }

  .card-title {
    font-size: 14px;
  }

  .detail-main {
    margin-top: -20px;
  }

  .detail-hero {
    min-height: 590px;
    background-position: 64% center;
  }

  .detail-hero::before {
    background:
      linear-gradient(90deg, rgba(7, 9, 13, 0.94) 0%, rgba(7, 9, 13, 0.64) 72%, rgba(7, 9, 13, 0.28) 100%),
      linear-gradient(0deg, #07090d 0%, rgba(7, 9, 13, 0.32) 66%, rgba(7, 9, 13, 0.38) 100%);
  }

  .detail-hero-inner {
    grid-template-columns: minmax(0, 1fr) 92px;
    align-items: end;
    gap: 14px;
    padding: 54px 0 36px;
  }

  .detail-title {
    font-size: 34px;
  }

  .detail-poster {
    width: 92px;
    height: 138px;
  }

  .detail-lead {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
  }

  .detail-credit-lines {
    display: none;
  }

  .detail-actions {
    grid-column: 1 / -1;
  }

  .button {
    min-height: 46px;
    padding: 10px 15px;
  }

  .detail-content {
    padding-top: 28px;
  }

  .info-panel {
    padding: 16px;
  }

  .fact-list li {
    padding-left: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
