:root {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #151519;
  --surface-soft: #1d1d22;
  --text: #f5f5f4;
  --muted: #a1a1aa;
  --accent: #e11d48;
  --accent-light: #fb7185;
  --line: rgba(255, 255, 255, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  z-index: 100;
  top: 1rem;
  left: 1rem;
  padding: .75rem 1rem;
  border-radius: .5rem;
  background: white;
  color: black;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(260px, 620px) auto;
  align-items: center;
  gap: 2rem;
  padding: 1rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid var(--line);
  background: rgba(9, 9, 11, .88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo { display: block; width: clamp(170px, 17vw, 230px); height: auto; }
.brand-icon { display: none; width: 2.75rem; height: 2.75rem; object-fit: contain; }

.search { display: flex; gap: .6rem; }
.search input {
  width: 100%;
  min-width: 0;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  outline: none;
  background: var(--surface);
  color: var(--text);
}
.search input:focus { border-color: var(--accent-light); box-shadow: 0 0 0 3px rgba(251, 113, 133, .13); }
.search button, .primary-action {
  border: 0;
  border-radius: .8rem;
  background: var(--accent);
  color: white;
  font-weight: 750;
  cursor: pointer;
}
.search button { padding: .8rem 1.1rem; }
.search button:hover, .primary-action:hover { background: #be123c; }
.api-link { color: var(--muted); font-weight: 700; text-decoration: none; }
.api-link:hover { color: white; }

main { min-height: 80vh; }

.hero {
  position: relative;
  display: flex;
  min-height: min(68vh, 680px);
  align-items: end;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 78% 15%, rgba(225, 29, 72, .24), transparent 32%),
    linear-gradient(115deg, #18181b, #09090b 62%);
}

.hero-poster {
  position: absolute;
  z-index: -2;
  inset: -12% 0 auto auto;
  width: min(58vw, 760px);
  height: 125%;
  object-fit: cover;
  object-position: center 20%;
  opacity: .58;
  filter: saturate(.85);
}

.hero-shade {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, #09090b 4%, rgba(9, 9, 11, .83) 43%, rgba(9, 9, 11, .14) 76%), linear-gradient(0deg, #09090b, transparent 40%);
}

.hero-content {
  width: min(680px, 100%);
  padding: clamp(3rem, 7vw, 7rem) clamp(1rem, 7vw, 7rem);
}

.eyebrow {
  margin: 0 0 .8rem;
  color: var(--accent-light);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 1rem; font-size: clamp(2.8rem, 7vw, 6.4rem); line-height: .94; letter-spacing: -.07em; }
.hero-content > p:not(.eyebrow) { max-width: 560px; color: #d4d4d8; font-size: clamp(1rem, 2vw, 1.25rem); line-height: 1.65; }
.primary-action { display: inline-flex; align-items: center; gap: .65rem; margin-top: .6rem; padding: .95rem 1.25rem; }
.primary-action:disabled { cursor: wait; opacity: .45; }

.catalog { padding: 2rem clamp(1rem, 4vw, 4rem) 5rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; }
h2 { margin-bottom: 0; font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.045em; }
.result-count { margin-bottom: .35rem; color: var(--muted); }
.status { padding: 2rem; border: 1px dashed var(--line); border-radius: 1rem; color: var(--muted); text-align: center; }
.status.error { color: #fda4af; }

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

.movie-card { min-width: 0; }
.movie-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 1rem;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  box-shadow: 0 16px 35px rgba(0, 0, 0, .22);
}
.movie-button:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 4px; }
.poster {
  position: relative;
  display: grid;
  aspect-ratio: 2 / 3;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, #27272a, #111113);
}
.poster img { position: absolute; z-index: 1; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease, filter .35s ease; }
.poster-fallback { color: #3f3f46; font-size: 4rem; font-weight: 900; }
.play-badge {
  position: absolute;
  z-index: 3;
  right: .7rem;
  bottom: .7rem;
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  place-items: center;
  border-radius: 50%;
  background: rgba(225, 29, 72, .94);
  opacity: 0;
  transform: translateY(.5rem);
  transition: .25s ease;
}
.movie-button:hover .poster img { transform: scale(1.055); filter: brightness(.72); }
.movie-button:hover .play-badge, .movie-button:focus-visible .play-badge { opacity: 1; transform: none; }
.movie-details { padding: .8rem .15rem 0; }
.movie-details h3 { overflow: hidden; margin-bottom: .35rem; font-size: .98rem; text-overflow: ellipsis; white-space: nowrap; }
.movie-details p { color: var(--muted); font-size: .82rem; }

.title-page { min-height: calc(100vh - 73px); padding: clamp(1rem, 3vw, 3rem); }
.page-back { display: inline-flex; margin-bottom: 1.2rem; color: #d4d4d8; font-weight: 750; text-decoration: none; }
.page-back:hover { color: white; }
.detail-view { position: relative; min-height: min(760px, calc(100vh - 150px)); overflow: hidden; border: 1px solid var(--line); border-radius: 1.3rem; isolation: isolate; background: #0f0f12; box-shadow: 0 24px 70px rgba(0, 0, 0, .42); }
.detail-backdrop { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .38; filter: blur(1px); }
.detail-shade { position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, rgba(15, 15, 18, .98) 12%, rgba(15, 15, 18, .83) 56%, rgba(15, 15, 18, .58)), linear-gradient(0deg, #0f0f12, transparent 55%); }
.detail-content { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: end; min-height: min(760px, calc(100vh - 150px)); padding: clamp(3rem, 7vw, 6rem); }
.detail-view.no-artwork .detail-content { grid-template-columns: 1fr; }
.detail-view.no-artwork .detail-copy { max-width: 800px; }
.detail-poster { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 1rem; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.detail-copy { max-width: 620px; }
.detail-copy h2 { margin-bottom: .8rem; font-size: clamp(2rem, 5vw, 4.2rem); }
.detail-meta { color: #d4d4d8; font-weight: 700; }
.detail-description { max-width: 60ch; color: #d4d4d8; line-height: 1.65; }
.watch-page { min-height: calc(100vh - 73px); padding: clamp(1rem, 2.5vw, 2.5rem); }
.watch-page-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1rem; }
.watch-page-heading .page-back { margin-bottom: .45rem; }
.watch-page-heading h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 3.2rem); }
.watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: min(74vh, 760px); overflow: hidden; border: 1px solid var(--line); border-radius: 1.1rem; background: #09090b; box-shadow: 0 24px 70px rgba(0, 0, 0, .42); }
.watch-main { min-width: 0; align-self: center; }
.video-frame { position: relative; display: grid; aspect-ratio: 16 / 9; place-items: center; background: #000; }
video { width: 100%; height: 100%; }
.player-status { position: absolute; max-width: 32rem; padding: 1rem; color: #d4d4d8; text-align: center; }
.player-info { padding: 1.5rem 2rem 2rem; }
.player-info h2 { margin-bottom: .6rem; }
.player-info p:last-child { color: var(--muted); }
.resource-panel { padding: 1.5rem; border-left: 1px solid var(--line); background: #202126; }
.format-summary { display: grid; gap: .45rem; margin: -1.5rem -1.5rem 1.4rem; padding: 1.5rem; border-bottom: 1px solid var(--line); }
.format-summary span { font-size: 1.15rem; font-weight: 850; }
.format-summary strong { color: var(--muted); font-size: .78rem; font-weight: 600; }
.resource-heading { padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.resource-heading h3 { margin: 0; font-size: 1.35rem; }
.resource-panel > label, .series-controls > label:not(.sr-only) { display: block; margin: 1rem 0 .45rem; color: var(--muted); font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.resource-panel select { width: 100%; padding: .72rem .8rem; border: 1px solid rgba(255, 255, 255, .16); border-radius: .55rem; background: #303136; color: var(--text); }
.series-controls { margin-top: .5rem; }
.series-controls[hidden] { display: none; }
.episode-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .55rem; margin-top: 1rem; }
.episode-button { position: relative; min-height: 3.4rem; border: 1px solid transparent; border-radius: .45rem; background: #38393f; color: #e4e4e7; font-weight: 800; cursor: pointer; }
.episode-button:hover, .episode-button:focus-visible { border-color: var(--accent-light); outline: none; }
.episode-button.active { background: #075f3b; color: #86efac; }
.episode-button.locked::after { content: "VIP"; position: absolute; top: .2rem; right: .25rem; color: #fde68a; font-size: .48rem; letter-spacing: .04em; }
.secondary-action { padding: .7rem .9rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface-soft); color: var(--text); cursor: pointer; }

footer { padding: 2rem clamp(1rem, 4vw, 4rem); border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }

@media (max-width: 700px) {
  .site-header { grid-template-columns: 1fr auto; gap: .8rem; padding: .8rem 1rem; }
  .search { grid-column: 1 / -1; grid-row: 2; }
  .api-link { justify-self: end; }
  .brand-logo { display: none; }
  .brand-icon { display: block; }
  .hero { min-height: 560px; }
  .hero-poster { inset: 0 0 auto auto; width: 100%; height: 70%; opacity: .42; }
  .hero-shade { background: linear-gradient(0deg, #09090b 18%, rgba(9, 9, 11, .35) 70%, rgba(9, 9, 11, .1)); }
  .hero-content { padding: 5rem 1rem 3rem; }
  h1 { font-size: clamp(2.8rem, 15vw, 4.8rem); }
  .section-heading { align-items: start; flex-direction: column; gap: .5rem; }
  .movie-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .play-badge { opacity: 1; transform: none; }
  .player-info { padding: 1.2rem; }
  .series-controls { align-items: stretch; flex-direction: column; }
  .detail-view, .detail-content { min-height: 620px; }
  .detail-content { grid-template-columns: 110px 1fr; align-items: end; padding: 4rem 1.2rem 2rem; }
  .detail-copy h2 { font-size: clamp(1.8rem, 8vw, 3rem); }
  .watch-layout { grid-template-columns: 1fr; }
  .watch-page-heading { align-items: start; flex-direction: column; gap: .6rem; }
  .resource-panel { border-top: 1px solid var(--line); border-left: 0; }
}

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