:root {
  --emerald-950: #022c22;
  --emerald-900: #064e3b;
  --emerald-800: #065f46;
  --emerald-700: #047857;
  --emerald-600: #059669;
  --emerald-100: #d1fae5;
  --emerald-50: #ecfdf5;
  --green-600: #16a34a;
  --text-dark: #111827;
  --text-soft: #4b5563;
  --line: #d1d5db;
  --white: #ffffff;
  --shadow: 0 24px 60px rgba(6, 78, 59, .16);
}

body {
  min-height: 100vh;
  background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 35%, #f8fafc 100%);
  color: var(--text-dark);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, var(--emerald-700), var(--green-600));
  box-shadow: 0 12px 30px rgba(6, 78, 59, .22);
}

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

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  letter-spacing: .03em;
  font-size: 22px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, .14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  transition: background .25s ease, transform .25s ease;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, .14);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  color: #fff;
  font-size: 28px;
}

.hero {
  position: relative;
  height: min(720px, calc(100vh - 68px));
  min-height: 560px;
  overflow: hidden;
  background: var(--emerald-950);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .7s ease, transform .7s ease;
  transform: scale(1.015);
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.hero-bg,
.page-hero,
.detail-hero {
  background-size: cover;
  background-position: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  filter: brightness(.55) saturate(1.08);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 75% 30%, rgba(52, 211, 153, .24), transparent 34%),
    linear-gradient(90deg, rgba(2, 44, 34, .96), rgba(6, 95, 70, .72) 46%, rgba(0, 0, 0, .42));
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(260px, .62fr);
  align-items: center;
  gap: 48px;
}

.hero-copy {
  color: #fff;
  max-width: 720px;
  animation: slideUp .55s ease both;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(16, 185, 129, .18);
  color: #a7f3d0;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1,
.detail-hero h1 {
  margin: 18px 0 16px;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: -.04em;
}

.hero-desc,
.page-hero p,
.detail-hero p {
  font-size: clamp(18px, 2.3vw, 24px);
  line-height: 1.8;
  color: #d1fae5;
}

.hero-tags,
.tag-list,
.genre-list,
.meta-pills,
.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tags span,
.tag-list span,
.genre-list span,
.meta-pills span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
}

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

.primary-btn,
.ghost-btn,
.search-panel button,
.rank-table a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

.primary-btn {
  min-height: 48px;
  padding: 0 24px;
  color: var(--emerald-800);
  background: #fff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .18);
}

.primary-btn.full {
  width: 100%;
  margin-top: 16px;
}

.ghost-btn {
  min-height: 48px;
  padding: 0 24px;
  color: #fff;
  background: rgba(255, 255, 255, .13);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
}

.ghost-btn.light {
  margin-top: 22px;
  background: rgba(255, 255, 255, .18);
}

.primary-btn:hover,
.ghost-btn:hover,
.search-panel button:hover,
.rank-table a:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 48px rgba(6, 78, 59, .2);
}

.hero-poster {
  width: min(360px, 100%);
  justify-self: end;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .38);
  transform: rotate(2deg);
}

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

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

.hero-dots button {
  width: 38px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .35);
}

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

.quick-search-section,
.content-section,
.category-strip,
.detail-layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.quick-search-section {
  position: relative;
  z-index: 6;
  margin-top: -46px;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, .7fr);
  gap: 18px;
  align-items: center;
  background: rgba(255, 255, 255, .94);
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.search-panel h2 {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 6px;
}

.search-panel p {
  color: var(--text-soft);
}

.search-box {
  display: grid;
  gap: 8px;
  color: var(--emerald-800);
  font-weight: 800;
}

.search-box.wide {
  grid-column: span 2;
}

.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 18px;
  min-height: 50px;
  padding: 0 18px;
  color: var(--text-dark);
  outline: none;
}

.search-box input:focus {
  border-color: var(--emerald-600);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .12);
}

.filter-buttons {
  grid-column: 1 / -1;
}

.filter-buttons button,
.search-panel button {
  padding: 10px 16px;
  background: #f3f4f6;
  color: var(--text-soft);
}

.filter-buttons button.is-active,
.search-panel button.is-active {
  background: var(--emerald-600);
  color: #fff;
}

.category-strip,
.content-section {
  padding: 72px 0;
}

.content-section.tinted {
  width: 100%;
  max-width: none;
  padding-left: max(16px, calc((100% - 1180px) / 2));
  padding-right: max(16px, calc((100% - 1180px) / 2));
  background: linear-gradient(90deg, #ecfdf5, #eff6ff);
}

.section-heading {
  margin-bottom: 30px;
}

.section-heading p {
  color: var(--emerald-700);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin-top: 6px;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 900;
  letter-spacing: -.03em;
}

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

.section-heading.with-link a {
  color: var(--emerald-700);
  font-weight: 900;
}

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

.feature-card,
.category-card {
  position: relative;
  min-height: 140px;
  border-radius: 26px;
  overflow: hidden;
  padding: 24px;
  background: linear-gradient(135deg, var(--emerald-800), var(--green-600));
  color: #fff;
  box-shadow: var(--shadow);
}

.feature-card span,
.category-card span {
  display: block;
  font-size: 24px;
  font-weight: 900;
}

.feature-card strong {
  color: #a7f3d0;
}

.category-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(.45);
  z-index: 0;
}

.category-card span,
.category-card p {
  position: relative;
  z-index: 1;
}

.category-card p {
  margin-top: 12px;
  color: #d1fae5;
}

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

.movie-card {
  overflow: hidden;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, .08);
  transition: transform .28s ease, box-shadow .28s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 60px rgba(6, 78, 59, .18);
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--emerald-900);
}

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

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

.play-chip,
.rank-badge {
  position: absolute;
  border-radius: 999px;
  font-weight: 900;
  color: #fff;
}

.play-chip {
  right: 14px;
  bottom: 14px;
  padding: 8px 12px;
  background: rgba(5, 150, 105, .92);
}

.rank-badge {
  left: 14px;
  top: 14px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: rgba(234, 179, 8, .95);
}

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

.movie-meta-row,
.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #6b7280;
  font-size: 13px;
}

.movie-meta-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  color: var(--emerald-700);
  font-weight: 800;
}

.movie-card h3 {
  margin: 10px 0 8px;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 900;
}

.movie-card p {
  color: var(--text-soft);
  line-height: 1.65;
  min-height: 78px;
}

.tag-list {
  margin-top: 14px;
}

.tag-list span,
.genre-list span,
.meta-pills span {
  background: #ecfdf5;
  color: var(--emerald-700);
}

.score-row {
  margin-top: 16px;
  font-weight: 800;
}

.score-row a {
  color: var(--emerald-700);
}

.page-hero,
.detail-hero {
  min-height: 360px;
  display: flex;
  align-items: center;
  background-color: var(--emerald-900);
  color: #fff;
}

.compact-hero {
  background: radial-gradient(circle at top right, rgba(52, 211, 153, .26), transparent 36%), linear-gradient(110deg, var(--emerald-900), var(--emerald-700));
}

.page-hero > div,
.detail-hero-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.category-hero {
  min-height: 430px;
}

.detail-hero {
  min-height: 470px;
}

.detail-hero-inner {
  padding-top: 40px;
}

.breadcrumb,
.breadcrumb-sep {
  color: #d1fae5;
  font-weight: 800;
}

.breadcrumb-sep {
  margin: 0 8px;
}

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

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  padding: 56px 0 24px;
}

.detail-main,
.detail-aside {
  display: grid;
  gap: 24px;
  align-content: start;
}

.player-card,
.detail-card,
.aside-card,
.table-wrap {
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.player-shell {
  position: relative;
  background: #000;
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  background: linear-gradient(180deg, rgba(0, 0, 0, .15), rgba(0, 0, 0, .62));
  z-index: 2;
}

.player-overlay.is-hidden {
  display: none;
}

.play-circle {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(16, 185, 129, .94);
  box-shadow: 0 20px 60px rgba(5, 150, 105, .45);
}

.detail-card,
.aside-card {
  padding: 26px;
}

.detail-card h2,
.aside-card h2 {
  margin: 22px 0 12px;
  font-size: 24px;
  font-weight: 900;
}

.detail-card p {
  color: var(--text-soft);
  line-height: 1.95;
  font-size: 17px;
}

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

.table-wrap {
  overflow-x: auto;
}

.rank-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.rank-table th,
.rank-table td {
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.rank-table th {
  color: var(--emerald-800);
  background: #ecfdf5;
  font-weight: 900;
}

.rank-table a {
  color: var(--emerald-700);
  justify-content: flex-start;
}

.site-footer {
  margin-top: 40px;
  background: linear-gradient(180deg, var(--emerald-900), var(--emerald-950));
  color: #fff;
}

.footer-grid {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 28px;
}

.site-footer p,
.site-footer a {
  color: #d1fae5;
  line-height: 1.8;
}

.site-footer a {
  display: block;
  margin: 8px 0;
}

.site-footer h3 {
  margin-bottom: 12px;
  color: #86efac;
  font-weight: 900;
}

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

.is-filtered-out {
  display: none;
}

@media (max-width: 980px) {
  .hero-content,
  .detail-layout,
  .footer-grid,
  .search-panel {
    grid-template-columns: 1fr;
  }

  .hero-poster {
    display: none;
  }

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

  .search-box.wide {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 18px;
    background: var(--emerald-800);
  }

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

  .hero {
    min-height: 620px;
  }

  .hero-content {
    padding-top: 36px;
  }

  .hero-copy h1,
  .page-hero h1,
  .detail-hero h1 {
    font-size: 40px;
  }

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

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