:root {
  --primary-900: #333d4f;
  --primary-800: #39475d;
  --primary-700: #42536f;
  --primary-600: #506688;
  --primary-100: #ebeef3;
  --accent-600: #ca8a04;
  --accent-500: #eab308;
  --accent-400: #facc15;
  --neutral-950: #0f172a;
  --neutral-900: #171717;
  --neutral-800: #262626;
  --neutral-700: #404040;
  --neutral-600: #525252;
  --neutral-500: #737373;
  --neutral-300: #d4d4d4;
  --neutral-200: #e5e5e5;
  --neutral-100: #f5f5f5;
  --neutral-50: #fafafa;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  color: var(--neutral-800);
  background: var(--neutral-50);
  line-height: 1.6;
}

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: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(229, 229, 229, 0.9);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}

.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 22px;
  color: var(--primary-900);
}

.logo-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-500);
  background: var(--primary-100);
  border-radius: 10px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav > a {
  color: var(--neutral-700);
  font-weight: 600;
  transition: color 0.2s ease;
}

.site-nav > a:hover,
.site-nav > a.active {
  color: var(--primary-600);
}

.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-search input,
.big-search input,
.inline-filter input,
.search-page-form input {
  border: 1px solid var(--neutral-300);
  border-radius: 12px;
  background: var(--white);
  outline: none;
  color: var(--neutral-800);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-search input {
  width: 210px;
  padding: 9px 12px;
}

.nav-search input:focus,
.big-search input:focus,
.inline-filter input:focus,
.search-page-form input:focus {
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(80, 102, 136, 0.18);
}

.nav-search button,
.big-search button,
.search-page-form button {
  border: 0;
  border-radius: 12px;
  padding: 9px 16px;
  color: var(--white);
  background: var(--primary-600);
  cursor: pointer;
  transition: background 0.2s ease;
}

.nav-search button:hover,
.big-search button:hover,
.search-page-form button:hover {
  background: var(--primary-700);
}

.menu-button {
  display: none;
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--neutral-100);
  color: var(--neutral-800);
  cursor: pointer;
}

.hero {
  position: relative;
  height: 560px;
  overflow: hidden;
  background: var(--neutral-900);
}

.hero-slide {
  position: absolute;
  inset: 0;
  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.02);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.12));
}

.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
}

.hero-copy {
  max-width: 680px;
  color: var(--white);
}

.hero-label {
  display: inline-flex;
  margin-bottom: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-500);
  color: var(--white);
  font-weight: 700;
  font-size: 14px;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero p {
  margin: 0 0 20px;
  max-width: 620px;
  color: var(--neutral-200);
  font-size: 20px;
}

.hero-meta,
.detail-meta,
.movie-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-meta span,
.detail-meta span,
.movie-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(235, 238, 243, 0.18);
  color: inherit;
  font-size: 13px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border-radius: 12px;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-button {
  color: var(--white);
  background: var(--primary-600);
}

.primary-button:hover {
  background: var(--primary-700);
  transform: translateY(-1px);
}

.ghost-button {
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.46);
  background: rgba(255, 255, 255, 0.12);
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.45);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(0, 0, 0, 0.72);
}

.hero-prev {
  left: 18px;
}

.hero-next {
  right: 18px;
}

.hero-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.is-active {
  width: 32px;
  background: var(--white);
}

.home-search {
  margin-top: -46px;
  position: relative;
  z-index: 2;
}

.search-panel {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 520px);
  gap: 22px;
  align-items: center;
  padding: 26px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.search-panel h2,
.section-heading h2,
.page-hero h1,
.detail-head h1 {
  margin: 0;
  color: var(--neutral-900);
}

.search-panel p,
.page-hero p {
  margin: 6px 0 0;
  color: var(--neutral-600);
}

.big-search,
.search-page-form {
  display: flex;
  gap: 10px;
}

.big-search input,
.search-page-form input {
  flex: 1;
  min-width: 0;
  padding: 13px 14px;
}

.section-block {
  padding: 54px 0 0;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.section-heading h2 {
  font-size: 30px;
  letter-spacing: -0.02em;
}

.section-heading a {
  color: var(--primary-600);
  font-weight: 700;
}

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

.movie-card {
  overflow: hidden;
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.movie-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--neutral-200);
}

.movie-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.movie-card:hover .movie-thumb img,
.compact-item:hover img,
.rank-row:hover img {
  transform: scale(1.08);
}

.movie-year,
.movie-rank {
  position: absolute;
  top: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.68);
}

.movie-year {
  right: 10px;
}

.movie-rank {
  left: 10px;
  background: var(--primary-600);
}

.movie-card-body {
  padding: 16px;
}

.movie-title {
  display: -webkit-box;
  min-height: 52px;
  overflow: hidden;
  color: var(--neutral-900);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color 0.2s ease;
}

.movie-title:hover {
  color: var(--primary-600);
}

.movie-line {
  display: -webkit-box;
  min-height: 44px;
  margin: 8px 0 12px;
  overflow: hidden;
  color: var(--neutral-600);
  font-size: 14px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-meta span {
  background: var(--primary-100);
  color: var(--primary-700);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 36px;
}

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

.compact-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.compact-item:hover {
  transform: translateX(3px);
  box-shadow: var(--shadow-lg);
}

.compact-item img {
  width: 120px;
  height: 74px;
  object-fit: cover;
  border-radius: 10px;
  transition: transform 0.25s ease;
}

.compact-body strong,
.compact-body em {
  display: block;
}

.compact-body strong {
  color: var(--neutral-900);
  font-style: normal;
  font-weight: 800;
}

.compact-body em {
  margin-top: 4px;
  color: var(--neutral-500);
  font-size: 13px;
  font-style: normal;
}

.compact-rank {
  display: inline-flex;
  width: 30px;
  margin-right: 6px;
  color: var(--accent-600);
}

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

.category-tile,
.category-card {
  display: block;
  padding: 18px;
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.category-tile:hover,
.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.category-tile strong,
.category-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--primary-900);
  font-size: 18px;
}

.category-tile span,
.category-card span {
  color: var(--neutral-600);
  font-size: 14px;
}

.category-card {
  padding: 14px;
}

.category-covers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.category-covers img {
  height: 82px;
  width: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.page-hero {
  padding: 58px 0;
  color: var(--white);
  background: linear-gradient(135deg, var(--primary-900), var(--primary-600));
}

.page-hero h1 {
  color: var(--white);
  font-size: 42px;
}

.page-hero p {
  max-width: 760px;
  color: var(--neutral-200);
  font-size: 18px;
}

.crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

.crumb a:hover {
  color: var(--white);
}

.filter-panel {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 360px);
  gap: 18px;
  align-items: start;
  margin-bottom: 26px;
  padding: 18px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-nav a {
  padding: 9px 13px;
  border-radius: 999px;
  background: var(--neutral-100);
  color: var(--neutral-700);
  font-weight: 700;
  font-size: 14px;
}

.category-nav a.active,
.category-nav a:hover {
  color: var(--white);
  background: var(--primary-600);
}

.inline-filter input {
  width: 100%;
  padding: 11px 13px;
}

.rank-list {
  display: grid;
  gap: 16px;
}

.rank-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  padding: 18px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rank-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.rank-cover {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
}

.rank-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.rank-title {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--neutral-900);
  font-size: 22px;
  font-weight: 900;
}

.rank-title span {
  color: var(--accent-600);
}

.rank-info p {
  margin: 10px 0 14px;
  color: var(--neutral-600);
}

.detail-hero {
  position: relative;
  overflow: hidden;
  color: var(--white);
  background: var(--neutral-900);
}

.detail-backdrop {
  position: absolute;
  inset: 0;
}

.detail-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(10px);
  transform: scale(1.08);
  opacity: 0.38;
}

.detail-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.45));
}

.detail-head {
  position: relative;
  padding: 46px 0 54px;
}

.detail-head-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 30px;
  align-items: center;
}

.detail-cover {
  width: 240px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

.detail-head h1 {
  color: var(--white);
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.1;
}

.detail-line {
  max-width: 760px;
  margin: 16px 0;
  color: var(--neutral-200);
  font-size: 20px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.detail-tags span {
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--white);
  background: rgba(234, 179, 8, 0.82);
  font-size: 13px;
  font-weight: 700;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 30px;
  padding-top: 42px;
}

.player {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  background: #000;
  box-shadow: var(--shadow-lg);
}

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

.player-play {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: var(--white);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.52));
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.player-play span {
  width: 82px;
  height: 82px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(80, 102, 136, 0.9);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.14);
  font-size: 34px;
}

.player.is-playing .player-play {
  opacity: 0;
  pointer-events: none;
}

.player-state {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 4;
  color: var(--white);
  font-size: 14px;
}

.content-card,
.side-card {
  margin-top: 24px;
  padding: 24px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.content-card h2,
.side-card h2 {
  margin: 0 0 14px;
  color: var(--neutral-900);
  font-size: 24px;
}

.content-card p {
  margin: 0 0 24px;
  color: var(--neutral-700);
}

.content-card p:last-child {
  margin-bottom: 0;
}

.detail-side {
  align-self: start;
  position: sticky;
  top: 88px;
}

.detail-more {
  padding-top: 28px;
}

.search-page-form {
  margin-bottom: 28px;
  padding: 18px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.empty-state {
  padding: 50px 20px;
  border-radius: 18px;
  color: var(--neutral-500);
  text-align: center;
  background: var(--white);
}

.site-footer {
  margin-top: 64px;
  padding: 42px 0 22px;
  color: var(--white);
  background: var(--primary-900);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: 32px;
}

.footer-logo {
  color: var(--white);
}

.site-footer p {
  max-width: 520px;
  color: var(--neutral-300);
}

.site-footer h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.footer-links {
  display: grid;
  gap: 8px;
  color: var(--neutral-300);
}

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

.footer-bottom {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--neutral-300);
  font-size: 14px;
}

@media (max-width: 1024px) {
  .movie-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .two-column,
  .detail-layout,
  .filter-panel {
    grid-template-columns: 1fr;
  }

  .detail-side {
    position: static;
  }
}

@media (max-width: 820px) {
  .menu-button {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 72px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 18px;
    border-radius: 16px;
    background: var(--white);
    box-shadow: var(--shadow-lg);
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-search {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .nav-search input {
    width: 100%;
  }

  .hero {
    height: 520px;
  }

  .hero p {
    font-size: 17px;
  }

  .hero-arrow {
    display: none;
  }

  .search-panel,
  .footer-grid,
  .detail-head-grid {
    grid-template-columns: 1fr;
  }

  .detail-cover {
    width: min(260px, 70vw);
  }

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

  .rank-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .container {
    width: min(100% - 24px, 1180px);
  }

  .hero {
    height: 500px;
  }

  .hero h1,
  .page-hero h1 {
    font-size: 34px;
  }

  .movie-grid,
  .category-grid,
  .category-overview {
    grid-template-columns: 1fr;
  }

  .big-search,
  .search-page-form {
    flex-direction: column;
  }

  .compact-item {
    grid-template-columns: 96px 1fr;
  }

  .compact-item img {
    width: 96px;
    height: 66px;
  }
}
