:root {
  --bg: #fafafa;
  --paper: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --soft: #f3f4f6;
  --line: #e5e7eb;
  --amber: #d97706;
  --amber-dark: #b45309;
  --amber-soft: #fff7ed;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
  --radius: 1.25rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.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.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

.nav-shell {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #f59e0b, #b45309);
  box-shadow: 0 10px 22px rgba(180, 83, 9, 0.26);
  font-size: 14px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 20px;
  color: #111827;
}

.brand-text small {
  font-size: 12px;
  color: #6b7280;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.desktop-nav a {
  font-weight: 700;
  color: #374151;
  transition: color 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.is-active {
  color: var(--amber-dark);
}

.top-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-search input,
.mobile-search input,
.home-search input,
.catalog-filter input {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  border-radius: 999px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.top-search input {
  width: 210px;
  padding: 10px 14px;
}

.top-search input:focus,
.mobile-search input:focus,
.home-search input:focus,
.catalog-filter input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.top-search button,
.mobile-search button,
.home-search button,
.catalog-filter button {
  border: 0;
  border-radius: 999px;
  background: var(--amber);
  color: #ffffff;
  font-weight: 800;
  padding: 10px 18px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.top-search button:hover,
.mobile-search button:hover,
.home-search button:hover,
.catalog-filter button:hover,
.primary-button:hover {
  background: var(--amber-dark);
  transform: translateY(-1px);
}

.mobile-toggle {
  display: none;
  border: 0;
  border-radius: 12px;
  padding: 9px 12px;
  background: #f3f4f6;
  color: #374151;
  font-weight: 800;
}

.mobile-nav {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 18px;
  border-top: 1px solid #e5e7eb;
}

.mobile-nav a {
  display: block;
  padding: 10px 0;
  font-weight: 700;
  color: #374151;
}

.mobile-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding-top: 10px;
}

.mobile-search input {
  padding: 10px 14px;
}

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

.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  transform: scale(1.015);
  transition: opacity 0.55s ease, transform 0.75s ease;
}

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.84), rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.18));
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 620px;
}

.hero-copy {
  width: min(680px, 100%);
  color: #ffffff;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  background: rgba(217, 119, 6, 0.94);
  box-shadow: 0 10px 20px rgba(180, 83, 9, 0.28);
}

.hero-copy h1,
.page-hero h1 {
  margin: 18px 0 18px;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero-copy p {
  margin: 0 0 22px;
  color: #e5e7eb;
  font-size: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.hero-meta span {
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.14);
  color: #f9fafb;
  font-size: 14px;
}

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

.primary-button,
.ghost-button,
.panel-link,
.section-heading.with-link > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 12px;
  font-weight: 900;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.primary-button {
  background: var(--amber);
  color: #ffffff;
}

.ghost-button {
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

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

.hero-dot {
  width: 38px;
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  padding: 0;
}

.hero-dot.is-active {
  background: #f59e0b;
}

.quick-panel {
  position: relative;
  z-index: 3;
  margin-top: -36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.home-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.home-search input,
.catalog-filter input {
  padding: 13px 18px;
}

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

.quick-links a {
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--amber-soft);
  color: var(--amber-dark);
  font-weight: 800;
}

.section-block {
  padding: 58px 0;
}

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

.section-heading span {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--amber-dark);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

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

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

.section-heading.with-link > a,
.panel-link {
  color: var(--amber-dark);
  border: 1px solid rgba(217, 119, 6, 0.28);
  background: #ffffff;
}

.section-heading.with-link > a:hover,
.panel-link:hover {
  background: var(--amber);
  color: #ffffff;
  border-color: var(--amber);
}

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

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

.category-card {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 24px;
  color: #ffffff;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: end;
  box-shadow: var(--shadow);
  isolation: isolate;
}

.category-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.18), rgba(17, 24, 39, 0.88));
}

.category-card span {
  font-size: 24px;
  font-weight: 950;
}

.category-card strong {
  margin-top: 8px;
  color: #f3f4f6;
  font-size: 14px;
  line-height: 1.5;
}

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

.library-grid {
  align-items: stretch;
}

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

.movie-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 42px rgba(15, 23, 42, 0.14);
}

.movie-poster {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #111827;
}

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

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

.poster-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  border-radius: 999px;
  padding: 5px 10px;
  color: #ffffff;
  background: rgba(217, 119, 6, 0.94);
  font-weight: 900;
  font-size: 12px;
}

.movie-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px;
}

.movie-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
}

.movie-card h2,
.movie-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.3;
}

.movie-card h2 a:hover,
.movie-card h3 a:hover {
  color: var(--amber-dark);
}

.movie-card p {
  margin: 0 0 14px;
  color: #4b5563;
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.tag-row span {
  border-radius: 999px;
  padding: 5px 9px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 12px;
  font-weight: 800;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 26px;
  align-items: start;
}

.ranking-panel,
.content-panel {
  border-radius: var(--radius);
  background: #ffffff;
  padding: 24px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.ranking-list,
.ranking-page-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ranking-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}

.ranking-list li > span,
.rank-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber-dark);
  font-weight: 950;
}

.compact-item {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.compact-item img {
  width: 68px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
  background: #111827;
}

.compact-item strong {
  display: block;
  line-height: 1.3;
}

.compact-item small {
  color: var(--muted);
}

.panel-link {
  width: 100%;
  margin-top: 18px;
}

.page-hero {
  padding: 78px 0;
}

.soft-hero {
  background: linear-gradient(135deg, #fff7ed, #ffffff 55%, #f3f4f6);
}

.dark-hero {
  color: #ffffff;
  background: radial-gradient(circle at top left, rgba(245, 158, 11, 0.42), transparent 35%), linear-gradient(135deg, #111827, #1f2937);
}

.page-hero p {
  max-width: 760px;
  margin: 0;
  color: #6b7280;
  font-size: 18px;
}

.dark-hero p {
  color: #d1d5db;
}

.catalog-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  max-width: 700px;
  margin-top: 26px;
}

.filter-empty {
  display: none;
  margin-bottom: 20px;
  border-radius: 16px;
  padding: 18px;
  background: #ffffff;
  color: var(--muted);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

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

.ranking-page-list {
  display: grid;
  gap: 18px;
}

.ranking-page-list li {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.ranking-page-list .movie-card {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.ranking-page-list .movie-poster {
  height: 100%;
  aspect-ratio: auto;
}

.detail-hero {
  padding: 34px 0 58px;
  color: #ffffff;
  background: radial-gradient(circle at top left, rgba(245, 158, 11, 0.28), transparent 34%), linear-gradient(135deg, #0f172a, #111827 55%, #292524);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: #d1d5db;
  font-size: 14px;
}

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

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

.player-card,
.movie-side {
  overflow: hidden;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.28);
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.video-frame video {
  width: 100%;
  height: 100%;
  background: #000000;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 0;
  color: #ffffff;
  background-color: rgba(0, 0, 0, 0.48);
  background-size: cover;
  background-position: center;
  isolation: isolate;
}

.player-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0.72));
}

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

.play-symbol {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--amber);
  box-shadow: 0 16px 36px rgba(217, 119, 6, 0.36);
  font-size: 28px;
}

.player-cover span:last-child {
  font-size: 20px;
  font-weight: 950;
}

.movie-side img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #111827;
}

.side-body {
  padding: 22px;
}

.side-body h1 {
  margin: 16px 0 12px;
  font-size: 28px;
  line-height: 1.2;
}

.side-body p {
  margin: 0 0 18px;
  color: #e5e7eb;
}

.detail-meta {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.detail-meta div {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
}

.detail-meta dt {
  color: #fbbf24;
  font-weight: 900;
}

.detail-meta dd {
  margin: 0;
  color: #f3f4f6;
}

.detail-content {
  display: grid;
  gap: 24px;
  padding: 42px 0 64px;
}

.content-panel h2 {
  margin: 0 0 14px;
  font-size: 26px;
  line-height: 1.25;
}

.content-panel p {
  margin: 0;
  color: #374151;
  font-size: 17px;
}

.inner-heading {
  margin-bottom: 20px;
}

.site-footer {
  color: #d1d5db;
  background: linear-gradient(135deg, #111827, #1f2937);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 34px;
  padding: 44px 0;
}

.site-footer h2 {
  margin: 0 0 14px;
  color: #ffffff;
  font-size: 20px;
}

.site-footer p {
  margin: 0;
  color: #d1d5db;
}

.footer-links {
  display: grid;
  gap: 8px;
}

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

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

.footer-bottom p {
  margin: 0;
}

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

  .mobile-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .mobile-nav.is-open {
    display: block;
  }

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

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

  .ranking-panel {
    order: 2;
  }
}

@media (max-width: 760px) {
  .nav-shell {
    min-height: 68px;
  }

  .brand-text small {
    display: none;
  }

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

  .hero-copy p {
    font-size: 16px;
    -webkit-line-clamp: 5;
  }

  .quick-panel,
  .home-search,
  .catalog-filter {
    grid-template-columns: 1fr;
  }

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

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

  .ranking-page-list li {
    grid-template-columns: 1fr;
  }

  .ranking-page-list .movie-card {
    grid-template-columns: 1fr;
  }

  .rank-number {
    width: 42px;
    height: 42px;
  }

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

@media (max-width: 520px) {
  .container,
  .mobile-nav {
    width: min(100% - 22px, 1180px);
  }

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

  .hero-actions {
    flex-direction: column;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .side-body h1 {
    font-size: 24px;
  }
}
