/* TFLIX hero billboard — adapted from TomasTNunes/tflix index.html.
   The existing Vivid navigation and featured-card strip stay independently owned. */
/* The header owns its safe-area inset; the hero starts below it and never
   slides underneath the brand or relies on negative margins to meet the cards. */
body.vivid-cinema-home .vivid-topbar {
  box-sizing: border-box;
  padding-top: calc(6px + env(safe-area-inset-top, 0px));
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
/* The compact header has no inner desktop nav gutter, so restore page gutters
   explicitly on tablet and mobile without cutting into iPhone safe areas. */
@media (max-width: 900px) {
  body.vivid-cinema-home .vivid-topbar {
    padding-left: calc(14px + env(safe-area-inset-left, 0px));
    padding-right: calc(14px + env(safe-area-inset-right, 0px));
  }
}
@media (max-width: 560px) {
  body.vivid-cinema-home .vivid-topbar {
    padding-left: calc(12px + env(safe-area-inset-left, 0px));
    padding-right: calc(12px + env(safe-area-inset-right, 0px));
  }
}
body.vivid-cinema-home #hero {
  --bg: var(--vivid-site-ink, #07090d);
  --accent: #f5f7fa;
  --accent-h: #fff;
  --accent-soft: rgba(255,255,255,.12);
  --text: var(--vivid-site-text, #f4f6f8);
  --muted: var(--vivid-site-muted, #a4abb5);
  --green: var(--vivid-success, #32d583);
  --ease: cubic-bezier(.2,.7,.2,1);
  --gutter: clamp(1rem, 4vw, 3.75rem);
  position: relative;
  width: 100%;
  height: min(78vh, 720px);
  height: min(78svh, 720px);
  min-height: 500px;
  margin: 0;
  isolation: isolate;
  overflow: hidden;
  background: var(--bg);
}
body.vivid-cinema-home #hero.empty { display: none; }
body.vivid-cinema-home .hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.1s var(--ease);
}
body.vivid-cinema-home .hero-slide.active { opacity: 1; pointer-events: auto; }
body.vivid-cinema-home .hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 18%;
  transform: scale(1.02);
  animation: none;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
/* Restart the gentle push-in each time a title becomes active. The artwork
   moves independently, keeping the title and playback actions steady. */
body.vivid-cinema-home .hero-slide.active .hero-bg {
  animation: heroZoom 18s ease-out forwards;
}
@keyframes heroZoom {
  from { transform: scale(1.02); }
  to { transform: scale(1.035); }
}
body.vivid-cinema-home .hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(8,8,11,.95) 0%, rgba(8,8,11,.55) 38%, rgba(8,8,11,.08) 70%),
    linear-gradient(to top, var(--bg) 2%, rgba(8,8,11,.35) 30%, transparent 60%);
}
body.vivid-cinema-home .hero-content {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(56px, 10vh, 104px);
  max-width: min(640px, calc(100% - 2 * var(--gutter)));
  z-index: 2;
  animation: heroRise .9s var(--ease) both;
}
@keyframes heroRise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
body.vivid-cinema-home .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-h);
  margin-bottom: 1rem;
}
body.vivid-cinema-home .hero-badge .bolt { color: var(--accent-h); }
body.vivid-cinema-home .hero-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 800;
  line-height: .98;
  letter-spacing: -.03em;
  margin: 0 0 1.1rem;
  color: #fff;
  text-shadow: 0 4px 30px rgba(0,0,0,.6);
}
body.vivid-cinema-home .hero-meta {
  display: flex;
  align-items: center;
  gap: .9rem;
  flex-wrap: wrap;
  font-size: .92rem;
  font-weight: 500;
  color: rgba(255,255,255,.85);
  margin-bottom: 1.1rem;
}
body.vivid-cinema-home .hero-meta .match { color: var(--green); font-weight: 700; }
body.vivid-cinema-home .hero-meta .chip {
  padding: 1px 8px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 4px;
  font-size: .74rem;
  letter-spacing: .04em;
}
body.vivid-cinema-home .hero-overview {
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(255,255,255,.78);
  max-width: 540px;
  margin: 0 0 1.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
}
body.vivid-cinema-home .hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; }
body.vivid-cinema-home .hero-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .8rem 1.9rem;
  border-radius: 7px;
  border: none;
  font-family: inherit;
  font-size: .98rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s var(--ease), background .2s, box-shadow .2s;
}
body.vivid-cinema-home .hero-actions .btn:active { transform: scale(.97); }
body.vivid-cinema-home .hero-actions .btn-primary { background: #fff; color: #0a0a0d; }
body.vivid-cinema-home .hero-actions .btn-primary:hover { background: rgba(255,255,255,.82); transform: translateY(-2px); }
body.vivid-cinema-home .hero-actions .btn-ghost { background: rgba(70,70,80,.75); color: #fff; }
body.vivid-cinema-home .hero-actions .btn-ghost:hover { background: rgba(110,110,120,.62); transform: translateY(-2px); }
body.vivid-cinema-home .hero-dots {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(56px, 10vh, 104px);
  z-index: 2;
  display: flex;
  gap: .5rem;
}
body.vivid-cinema-home .hero-dot {
  width: 28px;
  height: 3px;
  border-radius: 99px;
  border: none;
  background: rgba(255,255,255,.3);
  cursor: pointer;
  padding: 0;
  transition: background .25s, width .25s;
}
body.vivid-cinema-home .hero-dot.active { background: var(--accent); width: 40px; }
body.vivid-cinema-home .hero-dot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 5px;
}
@media (max-width: 860px) {
  body.vivid-cinema-home #hero { height: min(74vh, 680px); height: min(74svh, 680px); min-height: 500px; }
  body.vivid-cinema-home .hero-content { bottom: clamp(72px, 10vh, 96px); max-width: calc(100% - 2 * var(--gutter)); }
  body.vivid-cinema-home .hero-dots { display: none; }
  body.vivid-cinema-home .hero-overview { -webkit-line-clamp: 2; }
}
@media (max-width: 560px) {
  body.vivid-cinema-home #hero {
    height: clamp(520px, 74svh, 680px);
    min-height: 520px;
  }
  body.vivid-cinema-home .hero-content {
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    left: max(16px, env(safe-area-inset-left, 0px));
    max-width: calc(100% - 2 * max(16px, env(safe-area-inset-left, 0px)));
  }
  body.vivid-cinema-home .hero-title {
    font-size: clamp(2.1rem, 9.5vw, 3.25rem);
    line-height: 1.02;
    overflow-wrap: anywhere;
    margin-bottom: .85rem;
  }
  body.vivid-cinema-home .hero-badge { margin-bottom: .65rem; }
  body.vivid-cinema-home .hero-meta { gap: .55rem; font-size: .82rem; margin-bottom: .7rem; }
  body.vivid-cinema-home .hero-overview { font-size: .9rem; line-height: 1.45; margin-bottom: 1rem; }
  body.vivid-cinema-home .hero-actions .btn { min-height: 44px; padding: .72rem 1.2rem; }
}
@media (max-width: 380px) {
  body.vivid-cinema-home .hero-meta { column-gap: .5rem; row-gap: .4rem; }
  body.vivid-cinema-home .hero-overview { -webkit-line-clamp: 2; }
}

@media (prefers-reduced-motion: reduce) {
  body.vivid-cinema-home .hero-slide,
  body.vivid-cinema-home .hero-bg,
  body.vivid-cinema-home .hero-content { animation: none !important; transition: none !important; }
}


/* Compact home header: the glass layer's generic auth rule must not squeeze
   the text action into a 40px icon box. Keep each control independently sized. */
@media (max-width: 900px) {
  body.vivid-cinema-home .vivid-topbar .vivid-nav {
    min-width: 0 !important;
    gap: 8px !important;
  }
  body.vivid-cinema-home .vivid-topbar .vivid-nav-action {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 40px !important;
    margin: 0 !important;
    padding: 0 10px !important;
    white-space: nowrap !important;
    font-size: .76rem !important;
  }
  body.vivid-cinema-home .vivid-topbar .vivid-notification-button {
    display: inline-grid !important;
    place-items: center !important;
    flex: 0 0 38px !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}
@media (max-width: 380px) {
  body.vivid-cinema-home .vivid-topbar .vivid-nav {
    gap: 6px !important;
  }
  body.vivid-cinema-home .vivid-topbar .vivid-nav-action {
    padding-inline: 7px !important;
    font-size: .72rem !important;
  }
}


/* Hero framing and autoplay polish: avoid the aggressive push-in that crops faces
   and keep the billboard content inside the visible mobile viewport. */
body.vivid-cinema-home .hero-bg {
  background-position: center center;
  transform: scale(1);
}
body.vivid-cinema-home .hero-slide.active .hero-bg {
  animation: heroZoom 24s ease-out forwards;
}
@keyframes heroZoom {
  from { transform: scale(1); }
  to { transform: scale(1.035); }
}
@media (max-width: 560px) {
  body.vivid-cinema-home #hero {
    height: clamp(490px, 70svh, 620px);
    min-height: 490px;
    max-height: 620px;
  }
  body.vivid-cinema-home .hero-bg {
    background-position: center center;
    transform: none;
  }
  body.vivid-cinema-home .hero-slide.active .hero-bg {
    animation: none;
  }
  body.vivid-cinema-home .hero-content {
    bottom: calc(66px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100% - 100px - env(safe-area-inset-bottom, 0px));
  }
  body.vivid-cinema-home .hero-overview {
    -webkit-line-clamp: 2;
    margin-bottom: .8rem;
  }
  body.vivid-cinema-home .hero-title {
    margin-bottom: .7rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.vivid-cinema-home .hero-slide { transition-duration: .2s; }
  body.vivid-cinema-home .hero-bg { animation: none !important; }
}


/* Full-bleed trailer background. The YouTube player itself must be larger
   than the hero viewport, then center-cropped by the clipped layer. This avoids
   the small, letterboxed mobile-player look while preserving the 16:9 ratio. */
body.vivid-cinema-home #hero {
  container-type: size;
}
body.vivid-cinema-home .hero-bg {
  z-index: 0;
}
body.vivid-cinema-home .hero-trailer-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  background: #000;
  transition: opacity .55s ease;
}
body.vivid-cinema-home .hero-trailer-layer.is-ready {
  opacity: 1;
}
body.vivid-cinema-home .hero-trailer-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  /* 16:9 cover fallback: size to the viewport, not the phone's player box. */
  width: max(100vw, 177.78vh);
  height: max(100vh, 56.25vw);
  min-width: 100%;
  min-height: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  transform: translate(-50%, -50%) scale(1.08);
  transform-origin: center;
  pointer-events: none;
}
body.vivid-cinema-home .hero-trailer-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(8,8,11,.76) 0%, rgba(8,8,11,.32) 38%, rgba(8,8,11,.06) 72%),
    linear-gradient(to top, var(--bg, #07090d) 2%, rgba(8,8,11,.3) 30%, transparent 60%);
}
body.vivid-cinema-home .hero-content {
  z-index: 3;
}
@media (prefers-reduced-motion: reduce) {
  body.vivid-cinema-home .hero-trailer-layer {
    transition: none;
  }
}
@supports (width: 1cqh) and (height: 1cqw) {
  body.vivid-cinema-home .hero-trailer-frame {
    width: max(100cqw, 177.78cqh);
    height: max(100cqh, 56.25cqw);
  }
}
