:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f1f5ff;
  --text: #111827;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.1);
  --brand: #2563eb;
  --brand-deep: #1e3a8a;
  --brand-soft: #dbeafe;
  --accent: #f59e0b;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

img,
video {
  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: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.nav-shell {
  width: min(1180px, calc(100% - 32px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #0f172a);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.3);
}

.brand-text {
  font-size: 19px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link,
.mobile-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: #334155;
  font-weight: 700;
  transition: 0.2s ease;
}

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

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: var(--panel-soft);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.menu-button span {
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
}

.mobile-nav {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 14px;
  padding: 10px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.mobile-nav.open {
  display: grid;
  gap: 6px;
}

.hero {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a, #1e3a8a 45%, #2563eb);
}

.hero-track {
  position: relative;
  min-height: 640px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: center;
  gap: 56px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease;
  padding: 76px 0 90px;
}

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

.hero-bg {
  position: absolute;
  inset: 0 calc(50% - 50vw);
  z-index: 0;
  opacity: 0.22;
  filter: blur(2px) saturate(1.2);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.95), rgba(30, 58, 138, 0.65), rgba(37, 99, 235, 0.7));
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-content,
.hero-poster {
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  color: #bfdbfe;
  background: rgba(255, 255, 255, 0.08);
  font-size: 14px;
  font-weight: 800;
}

.hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.hero p {
  width: min(700px, 100%);
  margin: 24px 0 0;
  color: #dbeafe;
  font-size: 18px;
  line-height: 1.85;
}

.hero-tags,
.tag-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags {
  margin-top: 24px;
}

.hero-tags span,
.tag-row span,
.chip-row span {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  color: #1e3a8a;
  background: #dbeafe;
  font-size: 13px;
  font-weight: 800;
}

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

.primary-btn,
.ghost-btn,
.section-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 900;
  transition: 0.2s ease;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  box-shadow: 0 14px 30px rgba(239, 68, 68, 0.28);
}

.ghost-btn {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
}

.primary-btn:hover,
.ghost-btn:hover,
.section-link:hover {
  transform: translateY(-2px);
}

.hero-poster {
  overflow: hidden;
  border-radius: 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.38);
  transform: rotate(2deg);
}

.hero-poster img {
  width: 100%;
  aspect-ratio: 3 / 4.1;
  object-fit: cover;
}

.hero-dots {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.hero-dots button {
  width: 42px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
}

.hero-dots button.active {
  background: #fff;
}

.feature-search,
.toolbar-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 34px;
}

.search-panel,
.toolbar-section {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.search-panel h2 {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.search-panel p {
  margin: 0 0 16px;
  color: var(--muted);
}

input[type="search"] {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: 0;
  background: #f8fafc;
  transition: 0.2s ease;
}

input[type="search"]:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.quick-links,
.pill-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-links a,
.pill-links a {
  padding: 12px 16px;
  border-radius: 999px;
  color: var(--brand-deep);
  background: var(--brand-soft);
  font-weight: 900;
}

section.container {
  margin-top: 48px;
}

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

.section-heading h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.06em;
}

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

.section-link {
  color: var(--brand);
  background: var(--brand-soft);
}

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

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  transition: 0.22s ease;
}

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

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
}

.poster-link img {
  width: 100%;
  aspect-ratio: 3 / 4.05;
  object-fit: cover;
  transition: 0.3s ease;
}

.movie-card:hover .poster-link img {
  transform: scale(1.04);
}

.poster-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 9px;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.card-body {
  padding: 16px;
}

.card-title {
  display: -webkit-box;
  overflow: hidden;
  min-height: 48px;
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 900;
  letter-spacing: -0.03em;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

.card-meta {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.card-body p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 14px;
  color: #475569;
  font-size: 14px;
  line-height: 1.65;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.compact .card-body {
  padding: 14px;
}

.compact .card-title {
  font-size: 16px;
}

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

.category-card,
.category-overview-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.category-card {
  padding: 20px;
}

.category-card > a {
  display: grid;
  gap: 10px;
}

.category-card span {
  color: var(--brand);
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -0.05em;
}

.category-card strong {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.category-card div {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.category-card div a {
  overflow: hidden;
  color: #334155;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-main {
  padding-bottom: 60px;
}

.page-hero {
  position: relative;
  overflow: hidden;
  padding: 78px 0;
  color: #fff;
  background: radial-gradient(circle at 20% 10%, rgba(96, 165, 250, 0.45), transparent 32%), linear-gradient(135deg, #0f172a, #1e3a8a 55%, #2563eb);
}

.slim-hero h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1;
  letter-spacing: -0.07em;
}

.slim-hero p {
  width: min(720px, 100%);
  margin: 18px 0 0;
  color: #dbeafe;
  font-size: 18px;
  line-height: 1.8;
}

.toolbar-section {
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
}

.sticky-toolbar {
  position: sticky;
  top: 88px;
  z-index: 20;
}

.categories-wrap {
  display: grid;
  gap: 28px;
}

.category-overview-card {
  padding: 22px;
}

.category-overview-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.category-overview-head h2 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -0.05em;
}

.category-overview-head p {
  margin: 0;
  color: var(--muted);
}

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

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

.rank-item {
  display: grid;
  grid-template-columns: 52px 86px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.rank-num {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #0f172a);
  font-weight: 950;
}

.rank-cover {
  overflow: hidden;
  border-radius: 14px;
}

.rank-cover img {
  width: 86px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.rank-info a {
  display: block;
  overflow: hidden;
  margin-bottom: 6px;
  font-size: 17px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-info p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 8px;
  color: #475569;
  font-size: 14px;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rank-info div {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  padding: 74px 0;
  color: #fff;
  background: #0f172a;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  opacity: 0.26;
  filter: blur(3px) saturate(1.2);
}

.detail-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #0f172a, rgba(15, 23, 42, 0.8), rgba(30, 58, 138, 0.8));
}

.detail-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 42px;
  align-items: center;
}

.detail-poster {
  overflow: hidden;
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 3 / 4.05;
  object-fit: cover;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: #bfdbfe;
  font-weight: 800;
}

.breadcrumb a:hover {
  color: #fff;
}

.detail-info h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1;
  letter-spacing: -0.07em;
}

.detail-one-line {
  width: min(760px, 100%);
  margin: 22px 0;
  color: #dbeafe;
  font-size: 18px;
  line-height: 1.8;
}

.detail-tags {
  margin-top: 16px;
}

.player-section {
  margin-top: -70px !important;
  position: relative;
  z-index: 3;
}

.player-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  background: #020617;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.34);
}

.movie-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #020617;
}

.play-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 0;
  color: #fff;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.2), rgba(2, 6, 23, 0.58));
  cursor: pointer;
}

.play-layer.hidden {
  opacity: 0;
  pointer-events: none;
}

.play-icon {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  padding-left: 4px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  box-shadow: 0 18px 48px rgba(239, 68, 68, 0.38);
  font-size: 30px;
}

.play-layer strong {
  font-size: 20px;
}

.detail-text {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.detail-text h2 {
  margin: 0 0 18px;
  font-size: 30px;
  letter-spacing: -0.05em;
}

.detail-text p {
  margin: 0 0 16px;
  color: #334155;
  font-size: 17px;
  line-height: 1.95;
}

.site-footer {
  margin-top: 72px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
}

.footer-logo {
  color: var(--text);
  font-weight: 950;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-weight: 800;
}

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

.back-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 45;
  width: 46px;
  height: 46px;
  display: none;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  box-shadow: var(--shadow);
  font-weight: 950;
}

.back-top.visible {
  display: grid;
  place-items: center;
}

[data-card].is-hidden {
  display: none;
}

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

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

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

@media (max-width: 820px) {
  .desktop-nav {
    display: none;
  }

  .menu-button {
    display: inline-flex;
  }

  .hero-slide {
    grid-template-columns: 1fr;
    gap: 28px;
    align-content: center;
    padding-top: 42px;
  }

  .hero-poster {
    display: none;
  }

  .feature-search,
  .toolbar-section,
  .detail-layout,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .detail-layout {
    gap: 24px;
  }

  .detail-poster {
    width: min(260px, 80%);
  }

  .footer-inner {
    display: grid;
  }
}

@media (max-width: 640px) {
  .nav-shell {
    height: 64px;
  }

  .brand-text {
    font-size: 16px;
  }

  .hero,
  .hero-track {
    min-height: 580px;
  }

  .hero h1,
  .detail-info h1,
  .slim-hero h1 {
    font-size: 38px;
  }

  .movie-grid,
  .large-grid,
  .mini-grid,
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .card-body {
    padding: 12px;
  }

  .card-body p,
  .tag-row {
    display: none;
  }

  .rank-item {
    grid-template-columns: 40px 62px minmax(0, 1fr);
  }

  .rank-num {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 13px;
  }

  .rank-cover img {
    width: 62px;
  }

  .page-hero,
  .detail-hero {
    padding: 48px 0;
  }

  .player-section {
    margin-top: -30px !important;
  }

  .detail-text {
    padding: 22px;
  }
}
