:root {
  color-scheme: dark;
  --background: #141414;
  --surface: #0b0b0b;
  --accent: #e50914;
  --text: #fff;
  --muted: #aaa;
  --border: #454545;
  --gutter: 4%;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--background);
  letter-spacing: 0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
body.dialog-open { overflow: hidden; }
button, input, select { font: inherit; letter-spacing: 0; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
button { color: inherit; border: 0; }
button:disabled { opacity: .5; cursor: default; }
button, a { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, video:focus-visible { outline: 3px solid var(--text); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
img { display: block; max-width: 100%; }
.lucide { width: 22px; height: 22px; flex-shrink: 0; pointer-events: none; }
.button-primary .lucide-play { fill: currentColor; }
.visually-hidden, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; left: 20px; top: 12px; z-index: 50; padding: 12px; background: var(--text); color: var(--surface); }
.site-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 30px; min-height: 72px; padding: 12px var(--gutter); background: rgb(11 11 11 / 96%); }
.brand { flex-shrink: 0; color: var(--accent); font-family: Impact, "Arial Narrow", sans-serif; font-weight: 900; font-size: 35px; line-height: 1.1; }
.category-nav { display: flex; flex: 1; align-items: center; gap: 22px; min-width: 0; overflow-x: auto; padding: 2px 22px 4px 0; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.category-nav.is-overflowing { mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent); }
.category-nav .nav-link, .category-nav button, .category-nav a { flex-shrink: 0; background: transparent; padding: 10px 0; color: var(--muted); font-size: 14px; white-space: nowrap; }
.category-nav button:hover, .category-nav a:hover, .category-nav .active, .category-nav [aria-current]:not([aria-current="false"]), .category-nav [aria-selected="true"] { color: var(--text); }
.category-nav .active, .category-nav [aria-current="page"], .category-nav [aria-selected="true"] { font-weight: 700; }
.search-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.icon-button { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0; border-radius: 50%; background: transparent; line-height: 1; }
.icon-button:hover { background: rgb(255 255 255 / 12%); }
#search-form { width: 240px; max-width: 100%; }
input[type="search"] { width: 100%; min-height: 42px; border: 1px solid var(--border); border-radius: 3px; color: var(--text); background: var(--surface); padding: 10px 12px; }
input::placeholder { color: var(--muted); }
.featured { position: relative; display: flex; align-items: center; min-height: 580px; height: min(76vh, 820px); overflow: hidden; isolation: isolate; }
.hero-backdrop { position: absolute; z-index: -2; inset: 0; background: var(--surface); }
.hero-backdrop img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.featured::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, rgb(11 11 11 / 93%) 0%, rgb(11 11 11 / 65%) 35%, rgb(11 11 11 / 8%) 80%), linear-gradient(0deg, var(--background) 0%, transparent 42%); }
.hero-content { width: min(650px, 60%); padding: 48px 0 86px; margin: 0 var(--gutter); }
#hero-title { font-family: Impact, "Arial Narrow", "Helvetica Neue", sans-serif; font-size: 64px; font-weight: 800; line-height: 1.05; text-wrap: balance; }
.metadata { color: var(--muted); font-size: 14px; line-height: 1.6; }
#hero-meta { margin-top: 22px; color: #ddd; }
.hero-description { font-size: 18px; line-height: 1.55; margin-top: 16px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 12px 24px; border-radius: 4px; font-size: 16px; font-weight: 700; text-align: center; }
.button-primary { color: var(--surface); background: var(--text); }
.button-primary:hover { background: #ddd; }
.button-secondary { color: var(--text); background: #363636; }
.button-secondary:hover { background: #4a4a4a; }
.catalogue-feedback { margin: 0 var(--gutter); }
.catalogue-feedback:has(#catalogue-status:empty):has(#catalogue-retry[hidden]) { display: none; }
#catalogue-status { color: var(--muted); padding: 28px 0 16px; font-size: 15px; line-height: 1.5; }
#catalogue-status:empty { display: none; }
.home-rows { padding: 0 0 64px; position: relative; }
.shelf { margin: 0 0 38px; }
.shelf-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 var(--gutter) 10px; }
.shelf-title, .home-rows h2 { font-size: 22px; line-height: 1.3; }
.shelf-title button, .shelf-title a { font: inherit; background: transparent; padding: 0; text-align: left; }
.shelf-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.shelf-controls button { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #252525; }
.shelf-controls button:hover { background: #454545; }
.shelf-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 15.5%); gap: 14px; padding: 6px var(--gutter) 14px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.poster-card { display: block; width: 100%; min-width: 0; text-align: left; padding: 0; border-radius: 4px; background: transparent; scroll-snap-align: start; }
.poster-frame { position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; aspect-ratio: 2 / 3; border-radius: 4px; background: #252525; }
.poster-frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 180ms ease; }
.poster-card:hover .poster-frame img { transform: scale(1.045); }
.poster-rating { position: absolute; top: 10px; right: 10px; background: rgb(11 11 11 / 88%); color: var(--text); padding: 4px 6px; border-radius: 3px; font-size: 12px; font-weight: 700; line-height: 1.2; }
.poster-affordance { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / 30%); opacity: 0; transition: opacity 180ms ease; }
.poster-affordance .lucide { width: 48px; height: 48px; filter: drop-shadow(0 2px 6px #000); }
.poster-card:hover .poster-affordance, .poster-card:focus-visible .poster-affordance { opacity: 1; }
.poster-fallback { padding: 18px; color: var(--muted); font-size: 19px; text-align: center; }
.card-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; font-weight: 600; line-height: 1.4; margin-top: 10px; overflow-wrap: anywhere; }
.card-meta { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 4px; }
.browse-section { padding: 32px var(--gutter) 72px; }
.browse-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 24px; margin-bottom: 22px; }
.browse-header h1 { font-size: 30px; line-height: 1.2; }
#catalogue-count { font-size: 13px; color: var(--muted); }
.collections-region { min-width: 0; margin-bottom: 24px; }
.catalogue-collections { position: relative; display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--border) transparent; padding: 3px 2px 12px; }
.collection-chip { flex: none; min-height: 44px; padding: 10px 18px; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.collection-chip:hover { color: var(--text); border-color: var(--muted); }
.collection-chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--surface); }
.collections-status { color: var(--muted); font-size: 13px; line-height: 1.5; }
.collections-status:empty { display: none; }
#collections-retry { margin-top: 8px; min-height: 44px; }
.catalogue-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 28px; }
.catalogue-filters:empty { display: none; }
.catalogue-filters label { display: grid; gap: 8px; font-size: 13px; color: var(--muted); }
select { min-height: 42px; max-width: 100%; border: 1px solid var(--border); border-radius: 3px; padding: 9px 32px 9px 12px; background: var(--surface); color: var(--text); }
.catalogue-filters select { min-width: 140px; }
.catalogue-filters button { min-height: 42px; padding: 9px 14px; background: #363636; border-radius: 4px; }
.catalogue-filters button[aria-pressed="true"] { background: var(--text); color: var(--surface); }
.catalogue-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 28px 16px; }
.catalogue-grid[aria-busy="true"]:empty::before { content: ""; display: block; grid-column: 1 / -1; min-height: 200px; border-top: 2px solid var(--border); }
#catalogue-more { display: flex; margin: 36px auto 0; }
dialog { color: var(--text); background: var(--background); border: 0; padding: 0; max-height: calc(100dvh - 48px); border-radius: 8px; box-shadow: 0 20px 80px #0009; overscroll-behavior: contain; }
dialog::backdrop { background: rgb(0 0 0 / 80%); }
.title-dialog { width: min(820px, calc(100% - 32px)); }
.dialog-close { position: absolute; z-index: 2; top: 14px; right: 14px; background: rgb(11 11 11 / 90%); }
.detail-artwork { position: relative; width: 100%; aspect-ratio: 16 / 7; overflow: hidden; background: var(--surface); }
.detail-artwork::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--background), transparent 65%); }
.detail-artwork img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.detail-artwork img:not([src]), .detail-artwork img[src=""] { visibility: hidden; }
.detail-content { padding: 0 36px 36px; position: relative; }
#detail-title { font-size: 36px; line-height: 1.15; text-wrap: balance; }
.original-title { color: var(--muted); margin-top: 8px; font-size: 15px; }
#detail-meta { margin-top: 16px; }
.detail-description { margin-top: 20px; font-size: 16px; line-height: 1.6; }
.detail-status { color: var(--muted); font-size: 14px; line-height: 1.5; margin-top: 20px; }
.detail-description:empty, .detail-status:empty, .original-title:empty, .metadata:empty, .hero-description:empty { display: none; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.detail-actions select { flex: 1; min-width: 0; }
.player-dialog { position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: 100dvh; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: #000; overflow: hidden; }
.player-header { min-height: 66px; padding: 10px 16px 10px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#playing-title { font-size: 18px; line-height: 1.4; min-width: 0; }
.video-stage { width: 100%; aspect-ratio: 16 / 9; background: #000; display: grid; place-items: center; }
video { display: block; width: 100%; height: 100%; max-height: 70dvh; background: #000; }
video::cue { background: rgb(11 11 11 / 85%); color: var(--text); }
.player-toolbar { padding: 18px 24px 24px; }
.playback-feedback { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
#status { font-size: 14px; line-height: 1.5; color: var(--muted); flex: 1 1 180px; }
.player-dialog[aria-busy="true"] .video-stage::after { content: ""; width: 34px; height: 34px; border: 3px solid #454545; border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
.subtitle-tools { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-top: 16px; }
.subtitle-tools label { font-size: 14px; }
.subtitle-tools select { max-width: min(100%, 280px); }
#subtitle-status { font-size: 13px; color: var(--muted); }
.text-button { min-height: 44px; padding: 8px 0; background: transparent; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 1600px) { .catalogue-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .site-header { gap: 20px; flex-wrap: wrap; }
  .category-nav { order: 3; width: 100%; flex-basis: 100%; }
  .search-tools { margin-left: auto; }
  .featured { min-height: 520px; }
  .hero-content { width: min(600px, 70%); }
  #hero-title { font-size: 52px; }
  .catalogue-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .site-header { gap: 8px 16px; padding-top: 12px; padding-bottom: 6px; }
  .brand { font-size: 30px; }
  .category-nav { gap: 22px; }
  #search-form { width: 200px; }
  .featured { height: 70svh; min-height: 480px; max-height: 650px; align-items: end; }
  .featured::before { background: linear-gradient(0deg, var(--background) 0%, rgb(11 11 11 / 85%) 30%, rgb(11 11 11 / 5%) 100%); }
  .hero-content { width: 100%; padding: 44px 0 48px; }
  #hero-title { font-size: 42px; max-width: 540px; }
  #hero-meta { margin-top: 16px; }
  .hero-description { font-size: 16px; -webkit-line-clamp: 3; max-width: 500px; }
  .hero-actions { margin-top: 20px; }
  .shelf-title, .home-rows h2 { font-size: 20px; }
  .catalogue-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 12px; }
  .browse-header h1 { font-size: 26px; }
  .detail-content { padding: 0 24px 28px; }
  #detail-title { font-size: 28px; }
  .player-header { padding-left: 16px; }
  .player-toolbar { padding: 16px; }
}
@media (max-width: 440px) {
  #search-form { width: 100%; min-width: 0; }
  .search-tools:has(#search-form:not([hidden])) { flex: 1; min-width: 0; gap: 6px; }
  .catalogue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .button { padding: 12px 18px; }
  .catalogue-filters label { width: 100%; }
  .catalogue-filters select { width: 100%; }
  #hero-title { font-size: 36px; }
  .subtitle-tools select { width: 100%; max-width: 100%; }
  dialog { max-height: calc(100dvh - 16px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
