:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.86);
  --panel-strong: #0f172a;
  --line: rgba(148, 163, 184, 0.22);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --cyan: #22d3ee;
  --blue: #2563eb;
  --yellow: #facc15;
  --radius: 24px;
  --shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 5%, rgba(34, 211, 238, 0.18), transparent 32rem),
    radial-gradient(circle at 85% 0%, rgba(37, 99, 235, 0.18), transparent 34rem),
    linear-gradient(180deg, #020617 0%, #0f172a 52%, #020617 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 74%);
}

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;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.74);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  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: 12px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: white;
  box-shadow: 0 16px 38px rgba(34, 211, 238, 0.25);
}

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

.brand.mini .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--soft);
}

.main-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  transition: color 0.25s ease, background 0.25s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--cyan);
  background: rgba(15, 23, 42, 0.86);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: white;
  background: rgba(15, 23, 42, 0.9);
}

.hero {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.7s ease, transform 1.4s ease;
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
}

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) brightness(0.62);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.72) 42%, rgba(2, 6, 23, 0.18) 100%),
    linear-gradient(0deg, #020617 0%, transparent 46%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  min-height: 620px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(280px, 0.72fr);
  align-items: center;
  gap: 48px;
  padding: 84px 0 64px;
}

.hero-kicker,
.section-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px 14px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(8, 145, 178, 0.12);
}

.hero h1,
.page-hero h1,
.detail-title {
  margin: 0;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.hero h1 span,
.gradient-text {
  color: transparent;
  background: linear-gradient(135deg, var(--cyan), #60a5fa, #f8fafc);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero p {
  max-width: 720px;
  margin: 20px 0 0;
  color: #dbeafe;
  font-size: 18px;
  line-height: 1.75;
}

.hero-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(15, 23, 42, 0.84);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.24);
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.42);
}

.hero-card {
  border: 1px solid var(--line);
  border-radius: 32px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.74);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

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

.hero-card-body {
  padding: 22px;
}

.hero-card h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.hero-card p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

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

.hero-dot {
  width: 34px;
  height: 5px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.32);
}

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

.section {
  padding: 72px 0;
}

.section.compact-top {
  padding-top: 36px;
}

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

.section-title {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
}

.section-desc,
.page-desc {
  margin: 12px 0 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.75;
}

.search-panel {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.76);
  box-shadow: var(--shadow);
}

.search-input {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  outline: none;
  color: var(--text);
  background: rgba(2, 6, 23, 0.72);
}

.search-input:focus {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.1);
}

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

.movie-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.72);
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 211, 238, 0.38);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.poster {
  position: relative;
  display: block;
  overflow: hidden;
  background: #0f172a;
}

.poster img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 0.5s ease, opacity 0.3s ease;
}

.movie-card:hover .poster img {
  transform: scale(1.06);
  opacity: 0.82;
}

.poster-glow {
  position: absolute;
  inset: auto 0 0;
  height: 46%;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.9), transparent);
}

.poster-play {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.28);
}

.movie-info {
  padding: 16px;
}

.movie-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  font-size: 17px;
  font-weight: 800;
  transition: color 0.25s ease;
}

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

.movie-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.movie-info p {
  display: -webkit-box;
  overflow: hidden;
  min-height: 42px;
  margin: 10px 0 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.58;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag-row span,
.meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  color: #a5f3fc;
  background: rgba(8, 145, 178, 0.16);
  font-size: 12px;
}

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

.category-card {
  min-height: 168px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(37, 99, 235, 0.06)),
    rgba(15, 23, 42, 0.76);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.42);
}

.category-card h2,
.category-card h3 {
  margin: 0;
  font-size: 22px;
}

.category-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.page-hero {
  padding: 72px 0 44px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.09), rgba(37, 99, 235, 0.03));
}

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

.rank-item {
  display: grid;
  grid-template-columns: 64px 92px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.72);
}

.rank-no {
  color: var(--yellow);
  font-size: 24px;
  font-weight: 900;
  text-align: center;
}

.rank-item img {
  width: 92px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
}

.rank-info h2,
.rank-info h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.rank-info p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}

.player-box {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #020617;
  box-shadow: var(--shadow);
}

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

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.16), rgba(2, 6, 23, 0.72));
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-cover.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.player-start {
  width: 92px;
  height: 92px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.38);
  font-size: 18px;
  font-weight: 800;
}

.detail-panel,
.sidebar-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(15, 23, 42, 0.76);
}

.detail-title {
  margin-top: 28px;
  font-size: clamp(34px, 5vw, 58px);
}

.detail-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.content-block {
  margin-top: 28px;
}

.content-block h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.content-block p {
  margin: 0;
  color: var(--soft);
  line-height: 1.9;
}

.sidebar-card {
  position: sticky;
  top: 92px;
}

.sidebar-card img {
  width: 100%;
  border-radius: 20px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

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

.footer {
  border-top: 1px solid var(--line);
  padding: 36px 0;
  color: var(--muted);
  background: rgba(2, 6, 23, 0.55);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

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

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

.empty-note {
  display: none;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.72);
}

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

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

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

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

  .sidebar-card {
    position: static;
  }
}

@media (max-width: 820px) {
  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .main-nav {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 78px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(2, 6, 23, 0.96);
  }

  .main-nav.open {
    display: flex;
  }

  .hero,
  .hero-content {
    min-height: auto;
  }

  .hero-content {
    grid-template-columns: 1fr;
    padding-top: 56px;
  }

  .hero-card {
    max-width: 360px;
  }

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

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

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

  .rank-item .btn {
    grid-column: 2 / -1;
  }
}

@media (max-width: 520px) {
  .topbar-inner {
    height: 64px;
  }

  .brand {
    font-size: 17px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .movie-grid,
  .related-grid,
  .category-grid {
    gap: 14px;
  }

  .movie-info {
    padding: 13px;
  }

  .movie-info p,
  .tag-row {
    display: none;
  }

  .section {
    padding: 50px 0;
  }
}
