:root {
  --bg: #f3f4f6;
  --bg-soft: #ffffff;
  --bg-dark: #0f172a;
  --bg-darker: #020617;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e5e7eb;
  --card: #ffffff;
  --cyan: #0891b2;
  --cyan-light: #22d3ee;
  --red: #ef4444;
  --amber: #f59e0b;
  --shadow: 0 18px 55px rgba(15, 23, 42, 0.12);
  --radius: 24px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 46%, #f8fafc 100%);
  min-height: 100vh;
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan), #2563eb);
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(8, 145, 178, 0.38);
  font-size: 14px;
}

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

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

.nav-link {
  color: rgba(255, 255, 255, 0.76);
  padding: 10px 14px;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
  background: rgba(34, 211, 238, 0.14);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  padding: 10px;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: #ffffff;
  border-radius: 99px;
}

.hero-carousel {
  position: relative;
  overflow: hidden;
  min-height: 680px;
  color: #ffffff;
  background: var(--bg-darker);
}

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

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

.hero-bg,
.detail-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(12px) saturate(1.25);
  transform: scale(1.08);
  opacity: 0.48;
}

.hero-slide::before,
.detail-hero::before,
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(34, 211, 238, 0.28), transparent 30%),
    linear-gradient(90deg, rgba(2, 6, 23, 0.93) 0%, rgba(15, 23, 42, 0.78) 48%, rgba(15, 23, 42, 0.28) 100%);
}

.hero-grid {
  position: relative;
  z-index: 2;
  width: min(1200px, calc(100% - 32px));
  min-height: 680px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 420px;
  align-items: center;
  gap: 56px;
  padding: 72px 0 104px;
}

.hero-kicker,
.kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 8px;
  color: var(--cyan-light);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero-copy h1 {
  margin: 18px 0 18px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  max-width: 860px;
}

.hero-copy p {
  max-width: 720px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 19px;
  line-height: 1.9;
}

.hero-tags,
.detail-tags,
.tag-row,
.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags {
  margin: 24px 0 30px;
}

.hero-tags span,
.detail-tags span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #e0faff;
  background: rgba(8, 145, 178, 0.22);
  border: 1px solid rgba(34, 211, 238, 0.2);
}

.hero-actions,
.compact-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.primary-btn,
.ghost-btn,
.section-link,
.search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-btn {
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan), #2563eb);
  box-shadow: 0 16px 30px rgba(8, 145, 178, 0.32);
}

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

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

.hero-poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 34px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.48);
  transform: rotate(2deg);
}

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

.hero-poster::after,
.poster-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(2, 6, 23, 0.82));
}

.hero-poster span,
.poster-play {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  color: #ffffff;
  background: rgba(8, 145, 178, 0.9);
  box-shadow: 0 16px 36px rgba(8, 145, 178, 0.35);
}

.hero-poster span {
  left: 22px;
  bottom: 22px;
}

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

.hero-dot {
  width: 38px;
  height: 6px;
  border: 0;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  cursor: pointer;
}

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

.hero-quick-links {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 5;
  width: min(1200px, calc(100% - 32px));
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.hero-quick-links a,
.category-chip {
  white-space: nowrap;
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

.content-section,
.category-preview,
.detail-text {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.section-heading,
.category-preview-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-heading h2,
.category-preview-head h2,
.detail-text h2 {
  margin: 6px 0 0;
  color: var(--text);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.section-heading p,
.category-preview-head p,
.detail-text p,
.page-hero p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.8;
}

.section-link,
.search-clear {
  color: var(--cyan);
  background: #ecfeff;
}

.featured-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 24px;
}

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

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

.movie-card {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 10px 35px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #dbeafe;
}

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

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

.poster-play {
  right: 14px;
  bottom: 14px;
  width: 42px;
  height: 42px;
  font-size: 13px;
}

.rank-badge {
  position: absolute;
  z-index: 3;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 32px;
  padding: 0 10px;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--red), var(--amber));
  font-weight: 900;
}

.card-content {
  padding: 16px;
}

.card-meta {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
}

.card-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 8px;
  color: #cbd5e1;
}

.movie-card h3 {
  margin: 9px 0 8px;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.35;
}

.movie-card p {
  min-height: 3.3em;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

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

.tag-row span {
  color: #0e7490;
  background: #ecfeff;
  border-color: #cffafe;
}

.wide-card {
  display: grid;
  grid-template-columns: 42% 1fr;
  min-height: 100%;
}

.wide-card .poster-link {
  aspect-ratio: auto;
}

.wide-card .card-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 5vw, 44px);
}

.wide-card h3 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.04em;
}

.wide-card p {
  font-size: 17px;
}

.dark-section {
  width: min(1200px, calc(100% - 32px));
  margin-top: 36px;
  margin-bottom: 36px;
  padding: 42px;
  border-radius: 34px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  box-shadow: var(--shadow);
}

.dark-section .section-heading h2,
.dark-section .section-heading p {
  color: #ffffff;
}

.dark-section .section-heading p {
  opacity: 0.78;
}

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

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

.category-tile {
  min-height: 210px;
  padding: 18px;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.85);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.category-thumbs {
  display: flex;
  align-items: center;
  height: 82px;
  margin-bottom: 18px;
}

.category-thumbs img {
  width: 58px;
  height: 82px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14);
}

.category-thumbs img + img {
  margin-left: -18px;
}

.category-tile strong {
  display: block;
  font-size: 19px;
  margin-bottom: 8px;
}

.category-tile p {
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.category-chip {
  display: inline-flex;
  justify-content: center;
  color: #0f172a;
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.chip-grid {
  margin-bottom: 24px;
}

.search-panel {
  margin: 0 0 28px;
  padding: 18px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.search-label {
  display: block;
  color: var(--cyan);
  font-weight: 900;
  margin-bottom: 10px;
}

.search-row {
  display: flex;
  gap: 12px;
}

.search-input {
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid #cbd5e1;
  color: var(--text);
  background: #f8fafc;
  outline: none;
}

.search-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.12);
}

.page-hero,
.detail-hero {
  position: relative;
  overflow: hidden;
  color: #ffffff;
  background: #0f172a;
}

.small-hero {
  width: min(1200px, calc(100% - 32px));
  margin: 34px auto 0;
  padding: clamp(36px, 7vw, 72px);
  border-radius: 34px;
  box-shadow: var(--shadow);
}

.page-hero > * {
  position: relative;
  z-index: 2;
}

.page-hero h1 {
  margin: 12px 0 0;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.page-hero p {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.78);
}

.category-preview {
  padding-top: 24px;
}

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

.breadcrumb {
  width: min(1200px, calc(100% - 32px));
  margin: 24px auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

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

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

.detail-layout {
  position: relative;
  z-index: 2;
  width: min(1200px, calc(100% - 32px));
  min-height: 520px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 42px;
  align-items: center;
  padding: 64px 0;
}

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

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

.detail-copy h1 {
  margin: 12px 0 18px;
  font-size: clamp(38px, 7vw, 76px);
  line-height: 1;
  letter-spacing: -0.055em;
}

.detail-one-line {
  max-width: 780px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 19px;
  line-height: 1.9;
}

.detail-tags {
  margin: 24px 0 30px;
}

.player-section {
  width: min(1100px, calc(100% - 32px));
  margin: -70px auto 0;
  position: relative;
  z-index: 5;
}

.video-shell {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  background: #020617;
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.28);
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #ffffff;
  border: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.72));
  cursor: pointer;
}

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

.play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  padding-left: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), #2563eb);
  box-shadow: 0 22px 46px rgba(8, 145, 178, 0.38);
  font-size: 30px;
}

.detail-text {
  padding-top: 48px;
}

.detail-text h2 + p {
  margin-bottom: 30px;
  font-size: 17px;
  color: #334155;
}

.rank-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.rank-row {
  display: grid;
  grid-template-columns: 60px 96px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.86);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--red), var(--amber));
  font-weight: 900;
  font-size: 20px;
}

.rank-cover {
  display: block;
  width: 96px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 16px;
}

.rank-main h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

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

.site-footer {
  margin-top: 40px;
  color: #cbd5e1;
  background: #0f172a;
}

.footer-inner {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 46px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
  gap: 32px;
}

.footer-brand {
  color: #ffffff;
  font-size: 24px;
  margin-bottom: 12px;
}

.footer-inner p {
  max-width: 620px;
  color: #94a3b8;
  line-height: 1.8;
}

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

.footer-links a {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}

.footer-copy {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  text-align: center;
}

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

@media (max-width: 1024px) {
  .hero-grid,
  .detail-layout,
  .featured-layout,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    gap: 28px;
    padding-top: 44px;
  }

  .hero-poster {
    max-width: 360px;
    transform: none;
  }

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

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

  .detail-layout {
    padding-top: 44px;
  }

  .detail-poster {
    max-width: 260px;
  }
}

@media (max-width: 760px) {
  .header-inner {
    min-height: 64px;
  }

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

  .menu-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 72px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.98);
    box-shadow: var(--shadow);
  }

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

  .nav-link {
    border-radius: 14px;
  }

  .hero-carousel,
  .hero-grid {
    min-height: 760px;
  }

  .hero-grid {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-bottom: 132px;
  }

  .hero-copy h1,
  .detail-copy h1 {
    font-size: clamp(36px, 12vw, 54px);
  }

  .hero-copy p,
  .detail-one-line {
    font-size: 16px;
  }

  .hero-poster {
    width: 220px;
  }

  .hero-controls {
    bottom: 92px;
  }

  .hero-quick-links {
    bottom: 26px;
  }

  .content-section,
  .category-preview,
  .detail-text {
    padding: 38px 0;
  }

  .section-heading,
  .category-preview-head {
    align-items: start;
    flex-direction: column;
  }

  .movie-grid,
  .compact-grid,
  .preview-grid,
  .ranking-grid,
  .catalog-grid,
  .category-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

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

  .wide-card {
    grid-template-columns: 1fr;
  }

  .dark-section {
    padding: 24px;
  }

  .small-hero {
    border-radius: 26px;
  }

  .detail-layout {
    gap: 24px;
  }

  .player-section {
    margin-top: -34px;
  }

  .video-shell {
    border-radius: 20px;
  }

  .search-row {
    flex-direction: column;
  }

  .rank-row {
    grid-template-columns: 44px 74px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .rank-num {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 16px;
  }

  .rank-cover {
    width: 74px;
  }

  .rank-main h2 {
    font-size: 18px;
  }

  .rank-main p {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .movie-grid,
  .compact-grid,
  .preview-grid,
  .ranking-grid,
  .catalog-grid,
  .category-list,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .category-thumbs img {
    width: 52px;
    height: 74px;
  }
}
