:root {
  --bg: #f9fafb;
  --surface: #ffffff;
  --surface-soft: #fff7ed;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #f97316;
  --primary-dark: #ea580c;
  --primary-soft: #ffedd5;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .12), 0 8px 10px -6px rgba(0, 0, 0, .1);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.site-header-inner {
  max-width: 80rem;
  height: 4rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

.logo-icon {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: .8rem;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 18px rgba(249, 115, 22, .25);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-left: auto;
}

.nav-link,
.mobile-link {
  color: #374151;
  font-weight: 600;
  transition: color .2s ease;
}

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

.top-search {
  display: flex;
  align-items: center;
  gap: .4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .25rem;
  background: #fff;
}

.top-search input {
  width: 12rem;
  border: 0;
  outline: 0;
  padding: .45rem .7rem;
  background: transparent;
}

.top-search button,
.search-panel-form button {
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  padding: .45rem .9rem;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.top-search button:hover,
.search-panel-form button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.menu-button {
  display: none;
  margin-left: auto;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  color: var(--text);
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--border);
  padding: .75rem 1rem 1rem;
  background: #fff;
}

.mobile-nav.is-open {
  display: grid;
  gap: .75rem;
}

.hero-carousel {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  background: #111827;
}

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

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

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(17, 24, 39, .94), rgba(17, 24, 39, .68) 45%, rgba(17, 24, 39, .28)), linear-gradient(0deg, rgba(17, 24, 39, .92), transparent 45%);
}

.hero-content {
  position: absolute;
  inset: 0;
  max-width: 80rem;
  margin: 0 auto;
  padding: 5.5rem 1rem 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22rem;
  align-items: center;
  gap: 3rem;
}

.hero-text {
  color: #fff;
  max-width: 50rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border-radius: 999px;
  padding: .35rem .75rem;
  background: rgba(249, 115, 22, .14);
  color: #fed7aa;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.hero-text h1,
.page-hero h1 {
  margin: 1rem 0 .8rem;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -.04em;
}

.hero-text p,
.page-hero p {
  max-width: 46rem;
  color: rgba(255, 255, 255, .82);
  font-size: 1.08rem;
  line-height: 1.8;
}

.hero-tags,
.movie-tags,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.hero-tags {
  margin-top: 1.5rem;
}

.hero-tags span,
.movie-tags span,
.detail-tags span {
  border-radius: 999px;
  padding: .3rem .7rem;
  background: var(--primary-soft);
  color: #9a3412;
  font-size: .82rem;
  font-weight: 700;
}

.hero-tags span {
  background: rgba(255, 237, 213, .16);
  color: #ffedd5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  border-radius: 999px;
  padding: .75rem 1.25rem;
  font-weight: 800;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 14px 30px rgba(249, 115, 22, .32);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

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

.hero-poster {
  display: block;
  border-radius: 1.4rem;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, .35);
  transform: rotate(2deg);
  transition: transform .35s ease;
}

.hero-poster:hover {
  transform: rotate(0deg) translateY(-6px);
}

.hero-poster img {
  width: 100%;
  height: 31rem;
  object-fit: cover;
}

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

.hero-dot {
  width: .7rem;
  height: .7rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .45);
  cursor: pointer;
}

.hero-dot.is-active {
  width: 2.2rem;
  background: var(--primary);
}

.search-panel {
  max-width: 80rem;
  margin: -2.1rem auto 0;
  position: relative;
  z-index: 6;
  padding: 0 1rem;
}

.search-panel-form {
  display: flex;
  gap: .7rem;
  background: #fff;
  border-radius: 1.2rem;
  padding: .75rem;
  box-shadow: var(--shadow-xl);
}

.search-panel-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: .9rem;
  padding: .85rem 1rem;
  outline: 0;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1rem;
}

.quick-links a {
  border-radius: 999px;
  padding: .45rem .85rem;
  background: #fff;
  color: #374151;
  box-shadow: var(--shadow);
  font-weight: 700;
}

.content-section,
.page-main {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.section-heading h2,
.page-hero h1,
.detail-card h1,
.detail-card h2,
.side-box h2,
.site-footer h2 {
  color: var(--text);
}

.section-heading h2 {
  font-size: clamp(1.5rem, 2vw, 2rem);
  font-weight: 850;
  margin: 0 0 .3rem;
}

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

.section-heading.compact {
  margin-bottom: 1rem;
}

.section-more {
  color: var(--primary-dark);
  font-weight: 800;
  white-space: nowrap;
}

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

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

.movie-card {
  min-width: 0;
}

.movie-card-link {
  display: block;
  height: 100%;
  overflow: hidden;
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}

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

.movie-poster {
  position: relative;
  display: block;
  height: 13.5rem;
  overflow: hidden;
  background: #111827;
}

.movie-card-featured .movie-poster {
  height: 19rem;
}

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

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

.movie-card-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, .65), transparent 55%);
  opacity: .75;
}

.play-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  opacity: 0;
  transition: opacity .2s ease;
}

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

.rank-badge {
  position: absolute;
  left: .75rem;
  top: .75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: .7rem;
  background: rgba(249, 115, 22, .92);
  color: #fff;
  font-weight: 900;
}

.movie-card-body {
  display: grid;
  gap: .5rem;
  padding: .95rem;
}

.movie-card-body strong {
  font-size: 1rem;
  line-height: 1.35;
  color: var(--text);
}

.movie-meta-line,
.movie-desc {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
}

.category-section {
  background: linear-gradient(135deg, #fff7ed, #eff6ff);
  border-radius: 1.4rem;
  margin-top: 2rem;
}

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

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

.category-tile,
.category-card {
  display: grid;
  gap: .45rem;
  min-height: 8rem;
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}

.category-card {
  min-height: 11rem;
}

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

.category-tile span,
.category-card strong {
  font-size: 1.15rem;
  font-weight: 850;
  color: var(--text);
}

.category-tile small,
.category-card p,
.category-card small {
  color: var(--muted);
  line-height: 1.55;
}

.category-card-icon {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: .85rem;
  background: var(--primary);
  color: #fff;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22rem;
  gap: 1.5rem;
  align-items: start;
}

.split-main,
.ranking-box,
.detail-card,
.side-box {
  background: var(--surface);
  border-radius: 1.1rem;
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.ranking-box {
  position: sticky;
  top: 5rem;
}

.rank-list {
  display: grid;
  gap: .55rem;
}

.rank-row {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: .15rem .65rem;
  align-items: center;
  border-radius: .8rem;
  padding: .65rem;
  transition: background .2s ease;
}

.rank-row:hover {
  background: #fff7ed;
}

.rank-row span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: .7rem;
  background: var(--primary-soft);
  color: #9a3412;
  font-weight: 900;
}

.rank-row strong {
  color: var(--text);
}

.rank-row small {
  color: var(--muted);
}

.page-main {
  padding-top: 1.5rem;
}

.page-hero {
  margin: 0 0 1.5rem;
  border-radius: 1.4rem;
  padding: clamp(2rem, 4vw, 4rem);
  background: linear-gradient(135deg, #111827, #7c2d12 55%, #f97316);
  color: #fff;
  overflow: hidden;
}

.page-hero.soft-hero,
.page-hero.category-hero,
.page-hero.search-hero,
.page-hero.rank-hero {
  background: radial-gradient(circle at top right, rgba(249, 115, 22, .55), transparent 38%), linear-gradient(135deg, #111827, #1f2937);
}

.page-hero .eyebrow {
  color: #ffedd5;
}

.inline-filter {
  margin-top: 1.4rem;
  max-width: 32rem;
}

.inline-filter.wide {
  max-width: 44rem;
}

.inline-filter input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  padding: .9rem 1.1rem;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  outline: 0;
}

.inline-filter input::placeholder {
  color: rgba(255, 255, 255, .72);
}

.empty-state {
  display: none;
  margin-top: 2rem;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  background: #fff;
  box-shadow: var(--shadow);
}

.empty-state.is-visible {
  display: block;
}

.category-links {
  background: #fff;
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.category-links h2 {
  margin: 0 0 1rem;
  font-size: 1.4rem;
}

.category-links div {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
}

.category-links a {
  border-radius: 999px;
  padding: .5rem .85rem;
  background: var(--primary-soft);
  color: #9a3412;
  font-weight: 800;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: .95rem;
}

.breadcrumb a {
  color: var(--primary-dark);
  font-weight: 700;
}

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

.detail-content {
  min-width: 0;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 1.1rem;
  background: #000;
  box-shadow: var(--shadow-xl);
}

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

.player-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 18px 35px rgba(0, 0, 0, .35);
  transition: opacity .2s ease, transform .2s ease, background .2s ease;
}

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

.player-shell:hover .player-play {
  opacity: 1;
  pointer-events: auto;
}

.player-play:hover {
  background: var(--primary-dark);
  transform: translate(-50%, -50%) scale(1.05);
}

.player-message {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: none;
  border-radius: .8rem;
  padding: .75rem 1rem;
  background: rgba(17, 24, 39, .82);
  color: #fff;
  text-align: center;
}

.player-message.is-visible {
  display: block;
}

.detail-card {
  margin-top: 1.25rem;
}

.detail-card h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.15;
  font-weight: 900;
}

.lead-text {
  margin: 0 0 1.2rem;
  border-left: 4px solid var(--primary);
  padding-left: 1rem;
  color: #4b5563;
  font-size: 1.1rem;
  line-height: 1.8;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-bottom: 1rem;
}

.detail-meta span {
  border-radius: .75rem;
  padding: .45rem .7rem;
  background: #f3f4f6;
  color: #374151;
  font-weight: 700;
}

.prose-card h2 {
  margin: 0 0 .8rem;
  font-size: 1.35rem;
  font-weight: 850;
}

.prose-card p {
  margin: 0;
  color: #374151;
  line-height: 1.9;
  white-space: pre-line;
}

.detail-sidebar {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 5rem;
}

.detail-poster {
  overflow: hidden;
  border-radius: 1.1rem;
  box-shadow: var(--shadow-xl);
  background: #111827;
}

.detail-poster img {
  width: 100%;
  height: 30rem;
  object-fit: cover;
}

.side-box h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 850;
}

.side-box dl {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: .6rem .8rem;
  margin: 0;
}

.side-box dt {
  color: var(--muted);
}

.side-box dd {
  margin: 0;
  color: var(--text);
  font-weight: 700;
}

.side-box dd a {
  color: var(--primary-dark);
}

.side-related {
  display: grid;
  gap: .9rem;
}

.side-related .movie-card-link {
  display: grid;
  grid-template-columns: 7rem 1fr;
}

.side-related .movie-poster {
  height: 6rem;
}

.side-related .movie-card-body {
  padding: .65rem;
}

.side-related .movie-desc,
.side-related .movie-tags {
  display: none;
}

.site-footer {
  margin-top: 3rem;
  background: #111827;
  color: #d1d5db;
}

.footer-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 3rem 1rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 2rem;
}

.site-footer h2 {
  margin: 0 0 1rem;
  color: #fff;
  font-size: 1.15rem;
}

.site-footer p {
  margin: 0;
  line-height: 1.8;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.footer-links a {
  color: #d1d5db;
}

.footer-links a:hover {
  color: #fb923c;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding: 1rem;
  text-align: center;
  color: #9ca3af;
}

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

  .hero-content,
  .split-section,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .hero-poster,
  .detail-sidebar,
  .ranking-box {
    position: static;
  }

  .hero-poster {
    display: none;
  }
}

@media (max-width: 820px) {
  .site-nav,
  .top-search {
    display: none;
  }

  .menu-button {
    display: block;
  }

  .hero-carousel {
    min-height: 560px;
  }

  .hero-content {
    padding-top: 4.5rem;
  }

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

  .footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-logo span:last-child {
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hero-carousel {
    min-height: 520px;
  }

  .hero-text p,
  .page-hero p {
    font-size: .98rem;
  }

  .search-panel-form {
    display: grid;
  }

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

  .movie-poster,
  .movie-card-featured .movie-poster {
    height: 16rem;
  }

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

  .side-related .movie-card-link {
    grid-template-columns: 6.5rem 1fr;
  }

  .detail-poster img {
    height: 22rem;
  }
}
