:root {
  color-scheme: dark;
  --bg: #050507;
  --panel: rgba(20, 20, 26, 0.72);
  --text: #f8f8fb;
  --muted: #b9bac8;
  --dim: #777989;
  --red: #e50914;
  --red2: #ff3540;
  --card: #171720;
  --ring: rgba(229, 9, 20, 0.55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 20% 0%, rgba(229, 9, 20, 0.38), transparent 34rem),
    radial-gradient(circle at 90% 15%, rgba(83, 32, 255, 0.22), transparent 28rem),
    linear-gradient(180deg, #09090d 0%, #050507 44%, #000 100%);
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 18px clamp(18px, 4vw, 56px);
  background: linear-gradient(180deg, rgba(0,0,0,0.92), rgba(0,0,0,0.62) 74%, transparent);
  backdrop-filter: blur(12px);
}
.brand {
  color: var(--red);
  font-weight: 950;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1;
  text-decoration: none;
  letter-spacing: -0.08em;
  text-shadow: 0 0 22px rgba(229, 9, 20, 0.35);
}
.brand span { color: #fff; letter-spacing: -0.05em; }
.nav { display: flex; gap: 18px; align-items: center; flex: 1; }
.nav a { color: #dedee8; text-decoration: none; font-size: 0.96rem; }
.nav a:hover { color: #fff; }
.search {
  width: min(310px, 35vw);
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,0.17);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(0,0,0,0.38);
}
.search span { color: var(--dim); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; }
.search input {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: white;
  outline: 0;
  font-size: 0.95rem;
}

.hero {
  position: relative;
  min-height: clamp(520px, 72vh, 790px);
  display: grid;
  align-items: end;
  padding: 78px clamp(18px, 5vw, 72px) 84px;
  isolation: isolate;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  opacity: 0.62;
  filter: saturate(1.1) contrast(1.08);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(0,0,0,0.94) 0%, rgba(0,0,0,0.72) 38%, rgba(0,0,0,0.15) 70%), linear-gradient(180deg, rgba(0,0,0,0.18), #050507 96%);
}
.hero-fade {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 160px;
  background: linear-gradient(transparent, #050507 70%);
  pointer-events: none;
}
.hero-copy { max-width: 760px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--red2);
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
h1, h2 { margin: 0; letter-spacing: -0.055em; }
h1 { font-size: clamp(3rem, 9vw, 7.2rem); line-height: 0.88; max-width: 9ch; text-shadow: 0 6px 28px rgba(0,0,0,0.75); }
h2 { font-size: clamp(1.7rem, 3vw, 2.6rem); }
.meta { color: #f2f2f7; font-weight: 750; margin: 20px 0 0; }
.description { color: var(--muted); font-size: clamp(1rem, 2vw, 1.25rem); max-width: 650px; line-height: 1.55; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
button, .link-button {
  border: 0;
  border-radius: 10px;
  padding: 12px 22px;
  font-weight: 850;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
}
.primary { background: white; color: #09090d; }
.primary::before { content: "▶"; margin-right: 9px; font-size: 0.84em; }
.secondary { background: rgba(110,110,120,0.44); color: white; border: 1px solid rgba(255,255,255,0.11); }
button:hover, .link-button:hover { transform: translateY(-1px); filter: brightness(1.08); }

.rail-section { padding: 0 clamp(18px, 5vw, 72px) 80px; }
.section-title-row { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.count-label { color: var(--dim); margin: 0; }
.movie-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
}
.card {
  position: relative;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 18px 46px rgba(0,0,0,0.35);
  cursor: pointer;
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}
.card:hover, .card:focus-visible {
  transform: translateY(-8px) scale(1.025);
  border-color: var(--ring);
  box-shadow: 0 26px 70px rgba(0,0,0,0.55), 0 0 0 3px rgba(229,9,20,0.16);
  outline: none;
}
.poster-wrap { aspect-ratio: 16/9; background: #101016; overflow: hidden; }
.poster { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 220ms ease; }
.card:hover .poster { transform: scale(1.08); }
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(229, 9, 20, 0.88);
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.card-body { padding: 14px 14px 16px; }
.card h3 { margin: 0 0 7px; font-size: 1.05rem; letter-spacing: -0.025em; }
.card p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.card .small { margin-top: 8px; color: var(--dim); font-size: 0.78rem; }

.player-dialog {
  width: min(1120px, 94vw);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  background: #07070a;
  color: white;
  box-shadow: 0 32px 110px rgba(0,0,0,0.78);
}
.player-dialog::backdrop { background: rgba(0,0,0,0.82); backdrop-filter: blur(8px); }
.player-dialog video { width: 100%; max-height: 74vh; background: black; display: block; }
.close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 42px;
  height: 42px;
  min-height: 0;
  padding: 0;
  border-radius: 999px;
  background: rgba(0,0,0,0.65);
  color: white;
  font-size: 1.9rem;
  line-height: 1;
}
.player-info { padding: 18px 22px 22px; }
.player-info p { color: var(--muted); margin: 8px 0 0; }

@media (max-width: 760px) {
  .topbar { gap: 12px; flex-wrap: wrap; padding: 14px 16px; }
  .brand { flex: 1; }
  .nav { order: 3; width: 100%; gap: 16px; overflow-x: auto; }
  .search { width: 100%; order: 2; }
  .hero { min-height: 580px; padding: 52px 18px 70px; }
  h1 { font-size: clamp(3rem, 19vw, 5rem); }
  .movie-rail { grid-template-columns: minmax(0, 1fr); }
  .actions > * { flex: 1 1 100%; }
}
