/* Кино1ТВ — Demo landing in brandbook palette (Tokyo Midnight + #188bf5 + Montserrat) — v3 */

:root {
  --surface-deep: #07091A;
  --surface-base: #0B0E1A;
  --surface-card: #141828;
  --surface-elevated: #1B2036;
  --text-primary: #F2F2F5;
  --text-muted: #7A8699;
  --accent: #188bf5;
  --accent-hover: #3aa1f7;
  --danger: #FF4D7E;
  --success: #3DDC97;
  --rule: rgba(122, 134, 153, 0.16);

  --font-display: "Montserrat", system-ui, -apple-system, sans-serif;
  --font-body: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-sm: 8px;
  --r-md: 22px;
  --r-lg: 36px;

  --container: 1650px;          /* +10% */
  --pad-x: 40px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--surface-base);
  color: var(--text-primary);
  font-weight: 400;
  font-size: 19px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* --- HEADER --- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 9, 26, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--rule);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: 48px;
  height: 88px;
}
.header__logo img { height: 40px; }
.header__nav {
  display: flex;
  gap: 34px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
}
.header__nav a {
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s;
}
.header__nav a:hover { color: var(--text-primary); }
.header__nav a.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}
.header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.header__search {
  width: 360px;             /* placeholder «Поиск по фильмам и сериалам» влезает целиком */
  height: 48px;
  background: var(--surface-card);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 0 20px 0 48px;
  color: var(--text-primary);
  font-size: 16px;
  font-family: inherit;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A8699' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
  background-repeat: no-repeat;
  background-position: 17px center;
  background-size: 19px;
}
.header__search:focus { outline: none; border-color: var(--accent); }

.btn {
  height: 48px;
  padding: 0 22px;
  border-radius: var(--r-lg);
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.15s;
}
.btn:hover { background: var(--surface-card); border-color: var(--accent); }
.btn--primary { background: var(--accent); border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--lg { height: 64px; padding: 0 34px; font-size: 18px; }

/* --- HERO CAROUSEL: center 21:9 full-container, sides peek beyond container with safe gap --- */
.hero {
  padding: 40px 0 76px;
  overflow: hidden;              /* clip side cards до viewport edge */
}

.hero-carousel { position: relative; }
.hero-track { position: relative; }

.hero-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 21 / 9;          /* строго 21:9 */
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface-card);
  cursor: pointer;
  transition: transform 0.45s cubic-bezier(0.5, 0, 0.2, 1), opacity 0.4s ease;
}
.hero-card--center {
  position: relative;            /* задаёт высоту трека */
  z-index: 5;
  opacity: 1;
  transform: none;
}
.hero-card--side {
  z-index: 1;
  opacity: 0.55;
  filter: brightness(0.55);
}
.hero-card--side:hover { opacity: 0.78; filter: brightness(0.7); }

/* боковые сдвинуты за края container с гарантированным gap = 24px;
   видны только в зоне между container.edge и viewport.edge */
.hero-card--left  { transform: translateX(calc(-100% - 24px)); }
.hero-card--right { transform: translateX(calc(100%  + 24px)); }

/* стрелки вправо-влево скрыты по запросу — листаем кликом по side-карточке */
.hero-nav { display: none; }
.hero-card .bg-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: opacity 0.4s ease;
}
.hero-card .bg-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 35%, rgba(7,9,26,0.45) 65%, rgba(7,9,26,0.95) 100%);
}
.hero-card .video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
  z-index: 1;
}
.hero-card .video-bg.is-playing { opacity: 1; }
.hero-card .video-bg + .bg-img {
  /* keep poster-ish even with video over (fallback gradient on top) */
}
.hero-card .video-grad {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  /* затемнение трейлера: alpha уменьшена вдвое относительно прежней */
  background:
    linear-gradient(180deg, transparent 30%, rgba(7,9,26,0.275) 65%, rgba(7,9,26,0.475) 100%);
}
.hero-card.is-active .video-grad { opacity: 1; }

.hero-card.is-active {
  box-shadow: 0 24px 60px rgba(7,9,26,0.5),
              0 0 0 1px rgba(24,139,245,0.18);
}

/* Content overlay: bottom-left (text) + bottom-right (actions) */
.hero__content {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0 44px 44px;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}
.hero__content-left {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.hero__content-right {
  flex: 0 0 auto;
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  align-self: flex-start;
}
.hero__badge::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent);
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 64px;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0;
}
.hero__meta {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 14px;
  color: var(--text-primary);
  opacity: 0.85;
  font-weight: 500;
  flex-wrap: wrap;
}
.hero__meta .age {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 7px;
  border: 1px solid var(--text-muted);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
}
.hero__lead {
  font-size: 16px;
  color: var(--text-primary);
  opacity: 0.92;
  max-width: 60ch;
  line-height: 1.55;
  margin: 0;
}

.hero__actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
/* icon-only heart button */
.btn--icon {
  width: 64px;
  padding: 0;
}
.btn--icon svg { width: 24px; height: 24px; }

/* Carousel navigation buttons — стрелки не отображаются;
   сами button-элементы остаются в DOM как программные триггеры для click() из JS,
   а листание выполняется кликом по выглядывающей side-карточке */

/* --- SECTION --- */
.section { padding: 80px 0 10px; }   /* перед каруселями ×2, под ними ×0.5 */
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}
.section__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.02em;
  margin: 0;
}
.section__more {
  font-size: 16px;
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.section__more::after { content: "→"; transition: transform 0.15s; }
.section__more:hover::after { transform: translateX(4px); }

/* --- ROW (carousels with posters 2:3) --- */
.row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 22px;
}
.row--7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.row--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.row--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.row--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row--8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }

/* --- CARD: poster 2:3 --- */
.card {
  position: relative;
  display: block;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-5px); }
.card__cover {
  aspect-ratio: 2 / 3;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-card);
  border: 1px solid var(--rule);
  position: relative;
}
.card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.card:hover .card__cover img { transform: scale(1.04); }
.card__age {
  position: absolute;
  top: 12px;
  left: 12px;
  height: 26px;
  padding: 0 8px;
  background: rgba(7,9,26,0.85);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.04em;
}
.card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  background: linear-gradient(180deg, transparent, rgba(7,9,26,0.5));
}
.card:hover .card__play { opacity: 1; }
.card__play span {
  width: 70px; height: 70px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.card__play span::before {
  content: "";
  width: 0; height: 0;
  border-left: 18px solid #fff;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  margin-left: 5px;
}
.card__title {
  margin-top: 14px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- CHANNEL CARD --- */
.channel {
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-card);
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.channel:hover { transform: translateY(-5px); border-color: var(--accent); }
.channel img { width: 100%; height: 100%; object-fit: cover; }

/* --- COLLECTION --- */
.collection {
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-card);
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
}
.collection:hover { transform: translateY(-5px); }
.collection img { width: 100%; height: 100%; object-fit: cover; }
.collection::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(7,9,26,0.55) 100%);
  pointer-events: none;
}

/* --- CTA --- */
.cta {
  margin: 76px 0 40px;
  padding: 68px 60px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(ellipse at top right, rgba(24,139,245,0.18), transparent 60%),
    var(--surface-card);
  border: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 60px;
  align-items: center;
}
.cta h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 49px;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
}
.cta p {
  font-size: 19px;
  color: var(--text-muted);
  margin: 0 0 30px;
  max-width: 50ch;
  line-height: 1.55;
}
.cta__price { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; text-align: right; }
.cta__price .big {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 70px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.cta__price .small { font-size: 16px; color: var(--text-muted); }

/* --- FOOTER --- */
.footer {
  margin-top: 76px;
  padding: 60px 0 48px;
  border-top: 1px solid var(--rule);
}
.footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 60px;
}
.footer h3 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 20px;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.footer ul a {
  font-size: 16px;
  color: var(--text-primary);
  opacity: 0.85;
}
.footer ul a:hover { color: var(--accent); opacity: 1; }
.footer__brand img { height: 36px; margin-bottom: 20px; }
.footer__brand p {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 24px;
  max-width: 36ch;
}
.footer__bottom {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-muted);
}

/* --- RESPONSIVE --- */
@media (max-width: 1400px) {
  .row--7 { grid-template-columns: repeat(5, 1fr); }
  .row--6 { grid-template-columns: repeat(4, 1fr); }
  .row--5 { grid-template-columns: repeat(4, 1fr); }
  .row--8 { grid-template-columns: repeat(4, 1fr); }
  .row--4 { grid-template-columns: repeat(2, 1fr); }
  .hero-card--side { display: none; }
  .hero__title { font-size: 48px; }
  .cta { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .row--7, .row--6, .row--5, .row--8, .row--4 { grid-template-columns: repeat(2, 1fr); }
  .hero__title { font-size: 36px; }
  .header__nav, .header__search { display: none; }
  .hero__content { padding: 0 28px 28px; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
}
