:root {
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-card-strong: rgba(30, 41, 59, 0.84);
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(34, 211, 238, 0.42);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #cbd5e1;
  --cyan: #22d3ee;
  --blue: #2563eb;
  --amber: #fbbf24;
  --shadow: 0 24px 70px rgba(2, 6, 23, 0.45);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at 20% 0%, rgba(34, 211, 238, 0.12), transparent 32%),
    radial-gradient(circle at 85% 10%, rgba(37, 99, 235, 0.14), transparent 30%),
    linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.96));
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 10px 28px rgba(34, 211, 238, 0.32);
}

.brand-name {
  font-size: 20px;
  background: linear-gradient(135deg, #ffffff, #67e8f9 60%, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.nav-link,
.mobile-nav-link {
  color: var(--muted-2);
  font-weight: 650;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--cyan);
}

.header-search {
  position: relative;
  display: flex;
  align-items: center;
}

.header-search input,
.mobile-search input,
.search-page-form input,
.page-filter-input {
  color: var(--text);
  background: rgba(30, 41, 59, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search input {
  width: 240px;
  padding: 10px 46px 10px 18px;
}

.header-search input:focus,
.mobile-search input:focus,
.search-page-form input:focus,
.page-filter-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

.header-search button {
  position: absolute;
  right: 10px;
  border: 0;
  color: var(--muted-2);
  background: transparent;
  cursor: pointer;
  font-size: 20px;
}

.menu-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: 28px;
  cursor: pointer;
}

.mobile-panel {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 18px;
}

.mobile-nav {
  display: grid;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.mobile-search {
  display: flex;
  gap: 10px;
}

.mobile-search input {
  width: 100%;
  padding: 12px 16px;
}

.mobile-search button,
.search-page-form button,
.primary-button,
.secondary-button,
.text-link {
  border: 0;
  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-radius: 999px;
  font-weight: 750;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.mobile-search button,
.search-page-form button {
  padding: 0 20px;
}

.primary-button,
.secondary-button,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
}

.secondary-button {
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.text-link {
  padding: 9px 18px;
}

.primary-button:hover,
.secondary-button:hover,
.text-link:hover,
.mobile-search button:hover,
.search-page-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(34, 211, 238, 0.25);
  filter: brightness(1.08);
}

.hero-slider {
  position: relative;
  height: 70vh;
  min-height: 540px;
  overflow: hidden;
  background: #020617;
}

.hero-track,
.hero-slide {
  position: absolute;
  inset: 0;
}

.hero-slide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.8) 34%, rgba(2, 6, 23, 0.28) 100%),
    linear-gradient(90deg, rgba(2, 6, 23, 0.88), rgba(2, 6, 23, 0.35) 60%, rgba(2, 6, 23, 0.15));
}

.hero-content {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  padding-bottom: 72px;
  z-index: 2;
}

.hero-copy {
  max-width: 790px;
}

.hero-tags,
.card-tags,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags span,
.hero-tags a,
.card-tags span,
.detail-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  color: #ffffff;
  background: rgba(14, 165, 233, 0.22);
  border: 1px solid rgba(34, 211, 238, 0.26);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.hero-copy h1 {
  margin: 18px 0 4px;
  max-width: 860px;
  font-size: clamp(28px, 4.7vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero-copy h2 {
  margin: 0 0 16px;
  font-size: clamp(26px, 4vw, 52px);
  line-height: 1.12;
}

.hero-copy p {
  max-width: 680px;
  margin: 0 0 28px;
  color: var(--muted-2);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-dots {
  position: absolute;
  right: max(24px, calc((100% - 1180px) / 2));
  bottom: 48px;
  display: flex;
  gap: 10px;
  z-index: 4;
}

.hero-dot {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.68);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.active {
  width: 34px;
  background: var(--cyan);
}

.page-main {
  padding-top: 72px;
}

.page-stack {
  padding: 70px 0 80px;
  display: grid;
  gap: 80px;
}

.content-section {
  position: relative;
}

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

.glass-section {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.42);
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.section-kicker {
  display: inline-flex;
  color: var(--cyan);
  font-size: 22px;
  margin-bottom: 8px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.16;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.section-more {
  color: var(--cyan);
  font-weight: 750;
  white-space: nowrap;
}

.movie-grid {
  display: grid;
  gap: 22px;
}

.compact-grid,
.catalogue-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.featured-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.movie-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.22);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  background: var(--bg-card-strong);
  box-shadow: 0 20px 54px rgba(34, 211, 238, 0.12);
}

.card-poster,
.wide-poster,
.poster-panel {
  position: relative;
  display: block;
  overflow: hidden;
  background: #0f172a;
}

.card-poster {
  aspect-ratio: 2 / 3;
}

.card-poster img,
.wide-poster img,
.poster-panel img,
.category-thumbs img,
.category-cover-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.movie-card:hover img,
.category-tile:hover img,
.category-card-large:hover img {
  transform: scale(1.08);
}

.quality-badge,
.rank-badge {
  position: absolute;
  top: 10px;
  padding: 4px 8px;
  border-radius: 8px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.quality-badge {
  right: 10px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
}

.rank-badge {
  left: 10px;
  background: rgba(2, 6, 23, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.poster-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 28px;
  opacity: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.65), rgba(2, 6, 23, 0.08));
  transition: opacity 0.25s ease;
}

.movie-card:hover .poster-play {
  opacity: 1;
}

.card-body,
.wide-content {
  padding: 14px;
}

.card-title {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.card-title.large {
  margin: 12px 0 8px;
  white-space: normal;
  font-size: 24px;
}

.movie-card:hover .card-title {
  color: var(--cyan);
}

.card-line,
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.card-desc {
  margin: 8px 0 0;
  color: var(--muted-2);
  font-size: 14px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rating {
  color: var(--amber);
  font-weight: 800;
}

.movie-card-wide {
  min-height: 360px;
}

.wide-poster {
  height: 100%;
  min-height: 360px;
}

.wide-content {
  position: absolute;
  inset: auto 0 0 0;
  padding: 24px;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.05));
}

.movie-card-list {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 0;
}

.list-poster {
  height: 190px;
  aspect-ratio: auto;
}

.list-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.ranking-list {
  display: grid;
  gap: 14px;
}

.full-ranking {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

.category-tile,
.category-card-large {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--bg-card);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.category-tile:hover,
.category-card-large:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
  background: var(--bg-card-strong);
}

.category-thumbs,
.category-cover-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  aspect-ratio: 16 / 11;
  overflow: hidden;
}

.category-thumbs img,
.category-cover-grid img {
  min-width: 0;
}

.category-info,
.category-card-body {
  padding: 18px;
}

.category-info strong,
.category-card-body h2 {
  display: block;
  margin: 0 0 8px;
  font-size: 20px;
}

.category-info span,
.category-card-body p {
  color: var(--muted-2);
  font-size: 14px;
}

.category-list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.page-hero {
  position: relative;
  padding: 82px 0 58px;
  background: radial-gradient(circle at 20% 10%, rgba(34, 211, 238, 0.15), transparent 34%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(2, 6, 23, 0));
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  margin: 12px 0 10px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.1;
}

.page-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted-2);
  font-size: 18px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--cyan);
}

.breadcrumb span::before,
.breadcrumb a + a::before {
  content: "/";
  margin-right: 8px;
  color: var(--muted);
}

.filter-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 28px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.58);
}

.filter-search-line input {
  width: 100%;
  padding: 13px 18px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.filter-row strong {
  min-width: 46px;
  color: var(--muted-2);
}

.filter-button {
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  color: var(--muted-2);
  background: rgba(51, 65, 85, 0.86);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.filter-button.active,
.filter-button:hover {
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
}

.search-page-form {
  display: flex;
  max-width: 680px;
  gap: 12px;
  margin-top: 28px;
}

.search-page-form input {
  width: 100%;
  padding: 15px 20px;
}

.search-summary {
  margin-bottom: 22px;
  color: var(--muted-2);
}

.detail-main {
  background: radial-gradient(circle at 78% 8%, rgba(37, 99, 235, 0.13), transparent 30%);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  padding: 36px 0 26px;
}

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

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

.player-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 24px;
  background: #000000;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

.player-frame video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 14px;
  align-content: center;
  color: #ffffff;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.12));
  cursor: pointer;
  z-index: 3;
}

.player-overlay.is-hidden {
  display: none;
}

.player-button {
  width: 82px;
  height: 82px;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  font-size: 34px;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(34, 211, 238, 0.38);
}

.detail-title-block,
.detail-panel,
.info-panel,
.poster-panel,
.detail-switcher {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.62);
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.16);
}

.detail-title-block,
.detail-panel,
.info-panel,
.detail-switcher {
  padding: 24px;
}

.detail-title-block h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
}

.detail-title-block p,
.detail-panel p {
  margin: 0 0 18px;
  color: var(--muted-2);
}

.detail-panel h2,
.info-panel h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.poster-panel {
  overflow: hidden;
  margin-top: 0;
}

.poster-panel img {
  aspect-ratio: 2 / 3;
}

.info-panel dl {
  display: grid;
  gap: 14px;
  margin: 0;
}

.info-panel div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
  padding-bottom: 12px;
}

.info-panel dt {
  color: var(--muted);
}

.info-panel dd {
  margin: 0;
  color: var(--text);
}

.info-panel a {
  color: var(--cyan);
}

.detail-switcher {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.detail-switcher a {
  color: var(--cyan);
  font-weight: 750;
}

.site-footer {
  margin-top: 50px;
  padding: 46px 0 20px;
  color: var(--muted);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.2), rgba(0, 0, 0, 0.72));
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
}

.footer-brand {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 20px;
}

.footer-grid p {
  max-width: 680px;
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a:hover {
  color: var(--cyan);
}

.footer-bottom {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  font-size: 14px;
}

.is-hidden-card {
  display: none !important;
}

@media (max-width: 1120px) {
  .compact-grid,
  .catalogue-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .featured-grid,
  .category-grid,
  .full-ranking {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-aside {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 22px;
  }
}

@media (max-width: 860px) {
  .desktop-nav,
  .header-search {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .hero-slider {
    height: 78vh;
    min-height: 600px;
  }

  .hero-content {
    padding-bottom: 88px;
  }

  .hero-dots {
    left: 24px;
    right: auto;
    bottom: 44px;
  }

  .section-head,
  .footer-grid,
  .detail-switcher,
  .search-page-form {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .featured-grid,
  .category-list-grid,
  .category-grid,
  .full-ranking {
    grid-template-columns: 1fr;
  }

  .detail-aside {
    grid-template-columns: 1fr;
  }

  .poster-panel {
    max-width: 280px;
  }
}

@media (max-width: 620px) {
  .container,
  .header-inner,
  .mobile-panel,
  .footer-bottom {
    width: min(100% - 24px, 1180px);
  }

  .brand-name {
    font-size: 18px;
  }

  .hero-copy p,
  .page-hero p {
    font-size: 16px;
  }

  .compact-grid,
  .catalogue-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .movie-card-list {
    grid-template-columns: 112px 1fr;
  }

  .list-poster {
    height: 156px;
  }

  .card-title.large {
    font-size: 20px;
  }

  .glass-section,
  .filter-panel {
    padding: 18px;
    border-radius: 20px;
  }

  .detail-title-block,
  .detail-panel,
  .info-panel,
  .detail-switcher {
    padding: 18px;
  }

  .player-button {
    width: 68px;
    height: 68px;
    font-size: 28px;
  }
}
