:root {
  --night-950: #071728;
  --night-900: #102a43;
  --night-850: #17324f;
  --night-800: #243b53;
  --night-750: #2d4a67;
  --night-700: #334e68;
  --night-600: #486581;
  --amber-500: #f59e0b;
  --amber-400: #fbbf24;
  --amber-600: #d97706;
  --text-100: #f3f4f6;
  --text-200: #e5e7eb;
  --text-300: #d1d5db;
  --text-400: #9ca3af;
  --shadow-night: 0 10px 30px -5px rgba(16, 42, 67, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--night-900);
  color: var(--text-100);
  line-height: 1.5;
}

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

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--night-700);
  background: rgba(36, 59, 83, 0.95);
  backdrop-filter: blur(16px);
}

.container {
  width: min(100% - 2rem, 80rem);
  margin-inline: auto;
}

.navbar {
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text-100);
  transition: color 0.3s ease;
}

.brand:hover {
  color: var(--amber-400);
}

.brand-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--amber-500);
  color: white;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.28);
}

.brand-text {
  font-size: 1.18rem;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  color: var(--text-300);
}

.nav-menu a {
  transition: color 0.25s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--amber-400);
}

.nav-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-box {
  width: 16rem;
  border: 0;
  outline: 0;
  border-radius: 0.65rem;
  background: var(--night-700);
  color: var(--text-100);
  padding: 0.58rem 0.85rem;
}

.search-box:focus {
  box-shadow: 0 0 0 2px var(--amber-500);
}

.search-button,
.nav-toggle {
  border: 0;
  border-radius: 0.65rem;
  background: var(--night-700);
  color: var(--text-100);
  padding: 0.58rem 0.85rem;
  transition: background 0.25s ease, color 0.25s ease;
}

.search-button:hover,
.nav-toggle:hover {
  background: var(--night-600);
  color: var(--amber-400);
}

.nav-toggle {
  display: none;
}

.mobile-menu {
  display: none;
  border-top: 1px solid var(--night-700);
  padding: 0.75rem 0 1rem;
}

.mobile-menu.open {
  display: block;
}

.mobile-menu a {
  display: block;
  padding: 0.75rem 0;
  color: var(--text-300);
}

.hero {
  position: relative;
  min-height: 70vh;
  overflow: hidden;
  background: var(--night-950);
}

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

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

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(16, 42, 67, 0.94), rgba(36, 59, 83, 0.82));
}

.hero-shade {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 45%, rgba(245, 158, 11, 0.22), transparent 38%), linear-gradient(90deg, rgba(7, 23, 40, 0.92), rgba(7, 23, 40, 0.3), rgba(7, 23, 40, 0.08));
}

.hero-inner {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
}

.hero-content {
  width: min(100%, 44rem);
  animation: fadeIn 0.6s ease-in-out;
}

.hero-kicker,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--amber-400);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.hero h1 {
  margin: 0 0 0.7rem;
  font-size: clamp(2.6rem, 8vw, 5.5rem);
  line-height: 0.98;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.65rem, 4vw, 3.2rem);
  line-height: 1.08;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
  margin: 0 0 1.35rem;
  max-width: 42rem;
  color: var(--text-200);
  font-size: clamp(1rem, 2vw, 1.22rem);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.4rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(36, 59, 83, 0.78);
  color: var(--text-200);
  padding: 0.33rem 0.75rem;
  font-size: 0.88rem;
  backdrop-filter: blur(4px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.68rem;
  padding: 0.68rem 1.45rem;
  font-weight: 700;
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.btn-primary {
  background: var(--amber-500);
  color: white;
}

.btn-primary:hover {
  background: var(--amber-600);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--night-700);
  color: var(--text-100);
}

.btn-secondary:hover {
  background: var(--night-600);
}

.btn-ghost {
  background: rgba(245, 158, 11, 0.13);
  color: var(--amber-400);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-ghost:hover {
  background: rgba(245, 158, 11, 0.22);
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 5;
}

.hero-dot {
  width: 0.55rem;
  height: 0.55rem;
  border: 0;
  border-radius: 999px;
  background: #9ca3af;
  transition: width 0.3s ease, background 0.3s ease;
}

.hero-dot.active {
  width: 2rem;
  background: var(--amber-500);
}

main {
  flex: 1;
}

.section {
  padding: 4rem 0;
}

.section.compact {
  padding: 2.5rem 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  line-height: 1.2;
}

.title-mark {
  width: 0.28rem;
  height: 1.7rem;
  border-radius: 999px;
  background: var(--amber-500);
}

.section-subtitle {
  margin: 0.45rem 0 0;
  color: var(--text-400);
}

.link-more {
  color: var(--amber-400);
  white-space: nowrap;
}

.link-more:hover {
  color: var(--amber-500);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

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

.feature-card,
.movie-card,
.category-card,
.info-panel,
.rank-card,
.player-panel {
  background: var(--night-800);
  box-shadow: var(--shadow-night);
}

.feature-card {
  position: relative;
  min-height: 24rem;
  border-radius: 0.95rem;
  overflow: hidden;
  isolation: isolate;
}

.feature-card img,
.movie-poster img,
.rank-poster img,
.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.feature-card:hover img,
.movie-card:hover img,
.rank-card:hover img,
.category-card:hover img {
  transform: scale(1.06);
}

.feature-card::after,
.movie-poster::after,
.rank-poster::after,
.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.22), transparent);
}

.feature-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 1.5rem;
}

.feature-badge,
.rank-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--amber-500);
  color: white;
  padding: 0.28rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.feature-card h3,
.movie-card h3,
.rank-card h3 {
  margin: 0;
  color: white;
}

.feature-card p,
.movie-card p,
.rank-card p {
  color: var(--text-300);
}

.movie-card {
  display: block;
  border-radius: 0.75rem;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

.movie-poster,
.rank-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 0.75rem;
  background: var(--night-800);
}

.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  z-index: 2;
  transition: opacity 0.3s ease;
}

.movie-card:hover .card-overlay,
.feature-card:hover .card-overlay,
.rank-card:hover .card-overlay {
  opacity: 1;
}

.play-chip {
  width: 3.25rem;
  height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.92);
  color: white;
  font-size: 1.35rem;
  transform: scale(0.92);
  transition: transform 0.3s ease;
}

.movie-card:hover .play-chip,
.feature-card:hover .play-chip,
.rank-card:hover .play-chip {
  transform: scale(1);
}

.movie-body {
  padding: 0.65rem 0 0;
}

.movie-card h3 {
  color: var(--text-200);
  font-size: 0.95rem;
  line-height: 1.35;
  transition: color 0.25s ease;
}

.movie-card:hover h3 {
  color: var(--amber-400);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
  color: var(--text-400);
  font-size: 0.8rem;
}

.line-clamp-2 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

.category-card {
  position: relative;
  min-height: 13rem;
  overflow: hidden;
  border-radius: 0.95rem;
  display: flex;
  align-items: flex-end;
}

.category-card-body {
  position: relative;
  z-index: 2;
  padding: 1.25rem;
}

.category-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.25rem;
}

.category-card p {
  margin: 0;
  color: var(--text-300);
  font-size: 0.92rem;
}

.filter-panel {
  display: grid;
  grid-template-columns: 1fr 12rem 12rem;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--night-700);
  border-radius: 0.95rem;
  background: rgba(36, 59, 83, 0.72);
  margin-bottom: 1.5rem;
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  border: 0;
  outline: 0;
  border-radius: 0.65rem;
  background: var(--night-700);
  color: var(--text-100);
  padding: 0.76rem 0.9rem;
}

.filter-panel input:focus,
.filter-panel select:focus {
  box-shadow: 0 0 0 2px var(--amber-500);
}

.empty-result {
  display: none;
  text-align: center;
  color: var(--text-400);
  padding: 2rem 0;
}

.empty-result.show {
  display: block;
}

.rank-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.rank-card {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1rem;
  border-radius: 0.95rem;
  overflow: hidden;
  background: rgba(36, 59, 83, 0.88);
  padding: 0.75rem;
}

.rank-poster {
  border-radius: 0.75rem;
}

.rank-body {
  min-width: 0;
  align-self: center;
}

.rank-body h3 {
  font-size: 1rem;
  line-height: 1.35;
  margin-bottom: 0.4rem;
}

.page-hero {
  background: linear-gradient(135deg, #29203d, #40365c, #5a4d7e);
  padding: 4.5rem 0;
  text-align: center;
}

.page-hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.2rem, 6vw, 4rem);
}

.page-hero p {
  width: min(100%, 46rem);
  margin: 0 auto;
  color: var(--text-200);
  font-size: 1.1rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-400);
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
}

.breadcrumb a:hover {
  color: var(--amber-400);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr);
  gap: 2rem;
  align-items: start;
}

.player-panel {
  position: relative;
  overflow: hidden;
  border-radius: 0.95rem;
  background: black;
  margin-bottom: 1.5rem;
}

.player-panel video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: black;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.22);
  z-index: 3;
  cursor: pointer;
}

.player-cover.hidden {
  display: none;
}

.player-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.58;
}

.player-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.22));
}

.play-button {
  position: relative;
  z-index: 2;
  width: 5rem;
  height: 5rem;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.94);
  color: white;
  font-size: 2rem;
  box-shadow: 0 0 34px rgba(245, 158, 11, 0.36);
}

.info-panel {
  border-radius: 0.95rem;
  padding: 1.5rem;
}

.info-panel h1,
.info-panel h2,
.sidebar-card h2 {
  margin: 0 0 1rem;
}

.info-panel h1 {
  font-size: clamp(1.8rem, 4vw, 2.25rem);
}

.info-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--text-400);
  margin-bottom: 1.25rem;
}

.highlight-line {
  color: var(--amber-400);
  font-size: 1.12rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
}

.tag {
  border-radius: 0.58rem;
  background: var(--night-700);
  color: var(--text-300);
  padding: 0.34rem 0.72rem;
  font-size: 0.88rem;
}

.detail-section {
  border-top: 1px solid var(--night-700);
  padding-top: 1.4rem;
  margin-top: 1.4rem;
}

.detail-section p {
  white-space: pre-line;
  color: var(--text-300);
  line-height: 1.75;
}

.sidebar-card {
  position: sticky;
  top: 5.5rem;
  border-radius: 0.95rem;
  padding: 1.5rem;
  background: var(--night-800);
  box-shadow: var(--shadow-night);
}

.sidebar-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(51, 78, 104, 0.75);
  padding: 0.75rem 0;
  color: var(--text-300);
}

.sidebar-row span:first-child {
  color: var(--text-400);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
}

.site-footer {
  margin-top: 5rem;
  border-top: 1px solid var(--night-700);
  background: var(--night-800);
  color: var(--text-400);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  padding: 3rem 0 2rem;
}

.footer-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-100);
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.footer-links {
  display: grid;
  gap: 0.65rem;
}

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

.copyright {
  border-top: 1px solid var(--night-700);
  padding: 1.25rem 0;
  text-align: center;
  font-size: 0.92rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(0.35rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

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

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

  .sidebar-card {
    position: static;
  }
}

@media (max-width: 768px) {
  .nav-menu,
  .nav-search {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .hero,
  .hero-inner {
    min-height: 76vh;
  }

  .section {
    padding: 3rem 0;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .feature-grid,
  .rank-list,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

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

  .filter-panel {
    grid-template-columns: 1fr;
  }

  .search-box {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .container {
    width: min(100% - 1.25rem, 80rem);
  }

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

  .rank-card {
    grid-template-columns: 5rem 1fr;
  }

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

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
