:root {
  color-scheme: dark;
  --bg: #090909;
  --panel: #181818;
  --ink: #f5f5f1;
  --muted: #b3b3ad;
  --red: #e50914;
  --red-hover: #ff1b26;
  --line: #353535;
  --sans: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 82px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, .movie-card:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.topbar {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 42px;
  width: 100%;
  height: 76px;
  padding: 0 clamp(24px, 5vw, 76px);
  background: linear-gradient(180deg, #080808 0%, #080808d9 54%, transparent 100%);
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--red); font-weight: 900; letter-spacing: .06em; }
.brand-mark { font-size: 39px; line-height: .8; transform: scaleX(.82); }
.brand-name { font-size: 21px; letter-spacing: .04em; white-space: nowrap; }
.main-nav { display: flex; align-items: center; gap: 25px; color: #e5e5e5; font-size: 13px; }
.main-nav a { transition: color .18s ease; }
.main-nav a:hover, .main-nav .active { color: #fff; font-weight: 700; }
.nav-search { display: grid; place-items: center; width: 38px; height: 38px; margin-left: auto; color: #fff; background: transparent; border: 0; cursor: pointer; }
.nav-search span { font-size: 30px; line-height: 1; }

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 650px;
  height: min(78vw, 790px);
  max-height: 810px;
  overflow: hidden;
  padding: 112px clamp(26px, 7vw, 108px) 160px;
  isolation: isolate;
  background: radial-gradient(ellipse at 82% 37%, #5b1015 0, #211013 27%, #0b0909 55%, #090909 75%);
}
.hero::before, .hero::after { position: absolute; z-index: 1; inset: 0; content: ""; pointer-events: none; }
.hero::before { background: linear-gradient(90deg, #090909 0%, #090909ed 25%, #090909a3 48%, #09090912 83%), linear-gradient(0deg, var(--bg) 0%, transparent 41%); }
.hero::after { background: radial-gradient(ellipse at 78% 42%, transparent 8%, #0909092e 65%, #090909a8 100%); }
.hero-glow { position: absolute; z-index: 0; top: 8%; right: 8%; width: 48vw; height: 48vw; max-width: 700px; max-height: 700px; border-radius: 50%; background: radial-gradient(circle, #ab101b50, #690c1530 33%, transparent 70%); filter: blur(14px); }
.hero-poster { position: absolute; z-index: 0; top: 0; right: 0; width: min(73%, 1060px); height: 100%; object-fit: cover; object-position: center 28%; opacity: .66; }
.hero-copy { position: relative; z-index: 2; width: min(650px, 62vw); padding-top: 18px; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 17px; color: #eee; font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 14px #e5091480; }
.hero h1 { max-width: 680px; margin: 0 0 18px; font-size: clamp(48px, 6.4vw, 86px); font-weight: 800; line-height: .99; letter-spacing: -.055em; text-wrap: balance; text-shadow: 0 2px 24px #0007; }
.hero h1 span { color: #f3f3f0; }
.hero.is-featured h1 { max-width: 720px; font-size: clamp(44px, 6vw, 78px); }
.hero-description { max-width: 510px; margin: 0 0 17px; color: #e0e0dc; font-size: 16px; line-height: 1.55; text-shadow: 0 1px 10px #000; }
.hero-meta { margin: 0 0 17px; color: #d5d5d0; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 23px; }
.button-primary, .button-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 19px; border: 0; border-radius: 4px; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .18s ease, transform .18s ease; }
.button-primary { color: #fff; background: var(--red); }
.button-primary:hover { background: var(--red-hover); transform: translateY(-1px); }
.button-primary span { font-size: 12px; }
.button-secondary { color: #fff; background: #555c; backdrop-filter: blur(10px); }
.button-secondary:hover { background: #777c; }
.button-secondary span { font-size: 22px; line-height: .8; }
.search-form { display: flex; align-items: center; width: min(100%, 560px); height: 58px; padding: 0 8px 0 20px; border: 1px solid #dfe1e5; border-radius: 999px; background: #fff; box-shadow: 0 2px 8px #0004; transition: box-shadow .2s ease; }
.search-form:focus-within { box-shadow: 0 3px 12px #0007; }
.search-icon { margin-right: 11px; color: #70757a; font-size: 23px; line-height: 1; }
.search-form input { flex: 1; min-width: 0; height: 100%; color: #202124; background: transparent; border: 0; outline: 0; font-size: 15px; }
.search-form input::placeholder { color: #70757a; }
.search-form button { display: grid; place-items: center; width: 42px; height: 42px; color: #fff; background: var(--red); border: 0; border-radius: 50%; font-size: 23px; cursor: pointer; }
.search-form button:hover { background: var(--red-hover); }
.hero-highlights { display: flex; flex-wrap: wrap; gap: 18px 27px; margin-top: 19px; }
.hero-highlights > div { display: grid; gap: 2px; }
.hero-highlights strong { color: #fff; font-size: 11px; letter-spacing: .08em; }
.hero-highlights span { color: #aaa; font-size: 9px; letter-spacing: .08em; }
.hero-vignette { position: absolute; z-index: 1; right: 0; bottom: 0; left: 0; height: 200px; background: linear-gradient(0deg, var(--bg), transparent); pointer-events: none; }

.catalog { position: relative; z-index: 2; min-height: 290px; margin-top: -115px; padding: 0 clamp(22px, 4.5vw, 70px) 78px; }
.catalog-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.catalog-heading .eyebrow { margin-bottom: 6px; color: #c9c9c4; font-size: 10px; }
.catalog-heading h2 { margin: 0; font-size: clamp(23px, 2.6vw, 32px); font-weight: 700; letter-spacing: -.025em; }
.result-count { color: var(--muted); font-size: 11px; }
.catalog-tabs { display: flex; gap: 8px; margin: 15px 0 13px; overflow-x: auto; scrollbar-width: thin; }
.catalog-tab { flex: none; min-height: 39px; padding: 0 15px; color: #d0d0d0; background: #171717; border: 1px solid #414141; border-radius: 999px; font-size: 12px; font-weight: 700; cursor: pointer; }
.catalog-tab:hover { border-color: #777; color: #fff; }
.catalog-tab[aria-pressed="true"] { color: #fff; background: #3a1114; border-color: var(--red); }
.status { min-height: 38px; padding: 8px 0 12px; color: var(--muted); font-size: 13px; }
.status.error { color: #ff8b8b; }
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 23px 15px; }
.movie-card { min-width: 0; cursor: pointer; }
.poster-wrap { position: relative; overflow: hidden; aspect-ratio: 2 / 3; border-radius: 4px; background: linear-gradient(145deg, #312427, #111); box-shadow: 0 4px 12px #0008; transition: transform .2s ease, box-shadow .2s ease; }
.poster-wrap::after { position: absolute; inset: 40% 0 0; content: ""; background: linear-gradient(transparent, #000c); pointer-events: none; }
.poster { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: cover; transition: filter .2s ease; }
.poster-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: #eee; font-size: 42px; font-weight: 800; }
.movie-card:hover .poster-wrap, .movie-card:focus-visible .poster-wrap { z-index: 2; transform: scale(1.045); box-shadow: 0 12px 34px #000d; }
.movie-card:hover .poster, .movie-card:focus-visible .poster { filter: brightness(1.12); }
.poster-meta { position: absolute; z-index: 2; right: 10px; bottom: 9px; left: 10px; display: flex; justify-content: space-between; gap: 8px; color: #fff; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-shadow: 0 1px 5px #000; }
.poster-meta span:last-child { color: #e7e7e2; }
.card-title { overflow: hidden; margin: 9px 1px 2px; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.card-sub { margin: 0 1px; color: #aaa; font-size: 11px; }
.load-more { display: block; min-height: 42px; margin: 23px auto 0; padding: 0 20px; color: #fff; background: #333; border: 0; border-radius: 4px; font-size: 13px; font-weight: 700; cursor: pointer; }
.load-more:hover { background: #4a4a4a; }

.footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 70px; padding: 18px clamp(22px, 5vw, 76px); color: #92928c; border-top: 1px solid #222; font-size: 11px; }
.footer-brand { color: var(--red); font-size: 16px; font-weight: 900; letter-spacing: .13em; }

.dialog { position: relative; max-height: 92vh; padding: 0; overflow: auto; color: var(--ink); background: #181818; border: 1px solid #414141; border-radius: 8px; box-shadow: 0 20px 90px #000e; }
.dialog::backdrop { background: #000c; backdrop-filter: blur(5px); }
.dialog-close { position: absolute; z-index: 5; top: 14px; right: 14px; display: grid; place-items: center; width: 38px; height: 38px; color: #fff; background: #111c; border: 0; border-radius: 50%; font-size: 25px; line-height: 1; cursor: pointer; }
.dialog-close:hover { background: #333; }
.details-dialog { width: min(880px, calc(100% - 28px)); }
.detail-layout { display: grid; grid-template-columns: minmax(200px, .8fr) 1.2fr; min-height: 420px; }
.detail-poster { width: 100%; height: 100%; min-height: 420px; object-fit: cover; background: #222; }
.detail-copy { align-self: center; padding: 48px; }
.detail-copy h2, .player-head h2 { margin: 0 0 12px; font-size: 36px; line-height: 1.08; letter-spacing: -.03em; }
.detail-meta { margin: 0 0 17px; color: #b5b5ae; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.detail-description { max-width: 500px; color: #d0d0cb; font-size: 14px; line-height: 1.7; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 17px 0; }
.detail-tags span { padding: 5px 9px; color: #deded8; border: 1px solid #555; border-radius: 3px; font-size: 10px; }
.episode-picker { display: flex; flex-wrap: wrap; gap: 9px; margin: 20px 0; }
.episode-picker select, .player-controls select { min-height: 40px; padding: 8px 11px; color: #fff; background: #252525; border: 1px solid #555; border-radius: 4px; }
.primary-button { min-height: 44px; margin-top: 6px; padding: 0 20px; color: #fff; background: var(--red); border: 0; border-radius: 4px; font-size: 14px; font-weight: 700; cursor: pointer; }
.primary-button:hover { background: var(--red-hover); }
.primary-button:disabled { opacity: .55; cursor: not-allowed; }
.detail-error { margin: 12px 0 0; color: #ff9292; font-size: 12px; }

@media (max-width: 760px) {
  .topbar { height: 66px; gap: 24px; padding: 0 20px; }
  .brand-mark { font-size: 33px; }
  .brand-name { font-size: 16px; letter-spacing: .02em; }
  .main-nav { gap: 16px; font-size: 12px; }
  .hero { min-height: 650px; height: 76vh; padding: 105px 23px 150px; }
  .hero-poster { width: 100%; opacity: .42; object-position: 58% 25%; }
  .hero::before { background: linear-gradient(90deg, #090909ed, #09090986 60%, #0909094a), linear-gradient(0deg, var(--bg), transparent 58%); }
  .hero-copy { width: min(100%, 580px); padding-top: 30px; }
  .hero h1, .hero.is-featured h1 { max-width: 540px; font-size: clamp(44px, 10vw, 70px); }
  .hero-description { max-width: 430px; font-size: 14px; }
  .hero-highlights { gap: 13px 19px; }
  .hero-highlights span { font-size: 8px; }
  .catalog { margin-top: -105px; padding: 0 19px 58px; }
  .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-poster { height: 245px; min-height: 0; object-position: center 32%; }
  .detail-copy { padding: 28px 23px 30px; }
  .detail-copy h2 { font-size: 30px; }
}
@media (max-width: 420px) {
  .topbar { gap: 12px; padding: 0 12px; }
  .brand { gap: 5px; }
  .brand-mark { font-size: 24px; }
  .brand-name { font-size: 14px; letter-spacing: 0; }
  .main-nav { gap: 9px; font-size: 10px; }
  .nav-search { width: 28px; }
  .hero { min-height: 610px; }
  .hero-actions { gap: 8px; }
  .button-primary, .button-secondary { min-height: 41px; padding: 0 13px; font-size: 13px; }
  .footer { flex-wrap: wrap; }
  .footer > span:nth-child(2) { display: none; }
}
@media (max-width: 360px) {
  .topbar { gap: 7px; padding: 0 10px; }
  .brand-mark { display: none; }
  .brand-name { font-size: 13px; }
  .main-nav { gap: 6px; font-size: 9px; }
  .nav-search { width: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
