/* ============================================================
   CINEMATIC VIDEO HERO — home page only (index.html)
   Loaded after style.css; everything is scoped to .hero--video
   or body.home-video so other pages are untouched.
   ============================================================ */

.hero--video {
  --hv-ink: #0B0B0D;
  --hv-white: #F7F4EE;
  --hv-muted: rgba(247, 244, 238, 0.72);
  --hv-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --hv-curtain: 1.1s;           /* when the curtain starts opening */

  height: 100vh;
  height: 100svh;
  min-height: 640px;
  background: var(--hv-ink);
  color: var(--hv-white);
  isolation: isolate;
  align-items: flex-end;
}

/* ---- Media layer -------------------------------------------------- */
.hv-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--hv-ink);
}

/* Frame: the stadium sits mid-frame; scaling from the left edge pushes
   it into the right half so the headline owns the left side. */
.hv-frame {
  position: absolute;
  inset: 0;
  transform-origin: 8% 40%;
  transform:
    translate3d(var(--hv-mx, 0px), calc(var(--hv-my, 0px) + var(--hv-py, 0px)), 0)
    scale(calc(1.25 + var(--hv-ps, 0)));
  will-change: transform;
}

.hv-video,
.hv-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hv-video { opacity: 0; transition: opacity 1.2s ease; }
.hv-video.is-playing { opacity: 1; }

/* Slow push-in on load, like a camera settling */
.hv-zoom {
  position: absolute;
  inset: 0;
  background: url('../img/hero-poster.jpg') center / cover no-repeat;
  animation: hv-push 14s var(--hv-ease) both;
}
@keyframes hv-push {
  from { transform: scale(1.12); }
  to   { transform: scale(1); }
}

/* ---- Grade, vignette, grain -------------------------------------- */
.hv-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(11,11,13,0.86) 0%, rgba(11,11,13,0.58) 34%, rgba(11,11,13,0.08) 64%, rgba(11,11,13,0) 100%),
    linear-gradient(0deg, rgba(11,11,13,0.92) 0%, rgba(11,11,13,0.35) 26%, rgba(11,11,13,0) 48%),
    linear-gradient(180deg, rgba(11,11,13,0.55) 0%, rgba(11,11,13,0) 22%),
    radial-gradient(ellipse 120% 90% at 62% 55%, transparent 55%, rgba(11,11,13,0.55) 100%);
  opacity: calc(1 + var(--hv-dark, 0));
}
/* extra darkening as the hero scrolls away */
.hv-shade::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hv-ink);
  opacity: var(--hv-dark, 0);
}

/* warm gold light leak drifting across the frame */
.hv-flare {
  position: absolute;
  z-index: 1;
  top: -20%;
  right: -10%;
  width: 70vw;
  height: 70vw;
  pointer-events: none;
  background: radial-gradient(circle, rgba(232, 200, 122, 0.22) 0%, rgba(213, 174, 101, 0.08) 35%, transparent 65%);
  mix-blend-mode: screen;
  animation: hv-flare 18s ease-in-out infinite alternate;
}
@keyframes hv-flare {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.8; }
  to   { transform: translate3d(-8vw, 6vh, 0) scale(1.15); opacity: 1; }
}

.hv-grain {
  position: absolute;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: hv-grain 0.9s steps(6) infinite;
}
@keyframes hv-grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -3%); }
  60%  { transform: translate(-2%, -1%); }
  80%  { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

/* ---- Opening curtain (pure CSS, runs even without JS) ------------- */
.hv-curtain {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.hv-curtain__panel {
  position: absolute;
  left: 0; right: 0;
  height: 50.5%;
  background: var(--hv-ink);
  animation: hv-open 1.2s var(--hv-ease) var(--hv-curtain) forwards;
}
.hv-curtain__panel--top    { top: 0;    --hv-dir: -100%; }
.hv-curtain__panel--bottom { bottom: 0; --hv-dir: 100%; }
@keyframes hv-open { to { transform: translate3d(0, var(--hv-dir), 0); } }

.hv-curtain__line {
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold-light) 50%, var(--gold) 80%, transparent);
  transform: scaleX(0);
  animation:
    hv-line-draw 0.8s var(--hv-ease) 0.2s forwards,
    hv-fade-out 0.5s ease calc(var(--hv-curtain) + 0.1s) forwards;
}
.hv-curtain__mark {
  position: absolute;
  top: 50%; left: 50%;
  width: 64px;
  transform: translate(-50%, calc(-100% - 18px));
  opacity: 0;
  animation:
    hv-fade-in 0.6s ease 0.35s forwards,
    hv-fade-out 0.4s ease calc(var(--hv-curtain) - 0.05s) forwards;
}
@keyframes hv-line-draw { to { transform: scaleX(1); } }
@keyframes hv-fade-in   { to { opacity: 1; } }
@keyframes hv-fade-out  { from { opacity: 1; } to { opacity: 0; } }

/* ---- Content ------------------------------------------------------ */
.hero--video .hero__content {
  display: block;
  z-index: 3;
  padding-bottom: clamp(7rem, 15vh, 10rem);
  transform: translate3d(0, var(--hv-cy, 0px), 0);
  opacity: var(--hv-co, 1);
  will-change: transform, opacity;
}
.hero--video .hero__copy { max-width: 880px; }

.hv-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-light);
  opacity: 0;
  animation: hv-fade-in 0.8s ease calc(var(--hv-curtain) + 0.5s) forwards;
}
.hv-eyebrow__line {
  width: 48px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  animation: hv-line-draw 0.9s var(--hv-ease) calc(var(--hv-curtain) + 0.55s) forwards;
}

.hero--video .hero__title {
  font-size: clamp(2.4rem, 4.4vw, 4.75rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: 0.01em;
  max-width: none;
  margin-bottom: 1.75rem;
  color: var(--hv-white);
  opacity: 1;
  animation: none;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.35);
}
/* masked line reveal */
.hv-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.hv-line__inner {
  display: block;
  transform: translate3d(0, 105%, 0);
  animation: hv-rise 1.1s var(--hv-ease) forwards;
}
.hv-line:nth-child(1) .hv-line__inner { animation-delay: calc(var(--hv-curtain) + 0.35s); }
.hv-line:nth-child(2) .hv-line__inner { animation-delay: calc(var(--hv-curtain) + 0.5s); }
.hv-line__inner.gold { color: var(--gold-light); }
@keyframes hv-rise  { to { transform: translate3d(0, 0, 0); } }

.hero--video .hero__subtitle {
  max-width: 520px;
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  color: var(--hv-muted);
  margin-bottom: 2.5rem;
  animation: fadeUp 0.9s ease forwards calc(var(--hv-curtain) + 0.8s);
}
.hero--video .hero__cta { animation: fadeUp 0.9s ease forwards calc(var(--hv-curtain) + 0.95s); }

.hero--video .btn--primary {
  position: relative;
  overflow: hidden;
  color: var(--hv-ink);
}
.hero--video .btn--primary::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-20deg);
  animation: hv-btn-shine 5s ease-in-out calc(var(--hv-curtain) + 2s) infinite;
}
@keyframes hv-btn-shine {
  0%, 70% { left: -60%; }
  100%    { left: 130%; }
}
.hero--video .btn--outline {
  color: var(--hv-white);
  border-color: rgba(247, 244, 238, 0.35);
  background: rgba(247, 244, 238, 0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hero--video .btn--outline:hover { border-color: var(--gold); color: var(--gold-light); }

/* ---- Bottom bar: route · scroll · controls ----------------------- */
.hv-bar {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  z-index: 4;
  opacity: 0;
  animation: hv-fade-in 1s ease calc(var(--hv-curtain) + 1.3s) forwards;
}
.hv-bar__inner {
  max-width: calc(var(--container-max) + var(--container-padding) * 2);
  margin: 0 auto;
  padding: 0 var(--container-padding) 1.75rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 2rem;
}

.hv-route {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--hv-muted);
}
.hv-route svg { width: 150px; height: 34px; overflow: visible; }
.hv-route__path { stroke: rgba(213, 174, 101, 0.45); stroke-width: 1; stroke-dasharray: 3 4; fill: none; }
.hv-route__dot  { fill: var(--gold); }
.hv-route__ball { fill: var(--gold-light); filter: drop-shadow(0 0 6px rgba(232, 200, 122, 0.9)); }

.hero--video .hero__scroll {
  position: static;
  transform: none;
  animation: none;
  opacity: 1;
}
.hero--video .hero__scroll-label { color: var(--hv-muted); }

.hv-controls {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--hv-muted);
}
/* keep clear of the floating WhatsApp button on narrower desktops */
@media (min-width: 769px) {
  .hv-controls { margin-right: clamp(0px, calc(110px - (100vw - var(--container-max)) / 2), 90px); }
}
.hv-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(247, 244, 238, 0.3);
  display: grid;
  place-items: center;
  color: var(--hv-white);
  transition: border-color var(--transition), background var(--transition);
}
.hv-toggle:hover { border-color: var(--gold); background: rgba(213, 174, 101, 0.12); }
.hv-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.hv-toggle svg { width: 14px; height: 14px; fill: currentColor; }
.hv-toggle .hv-icon-play { display: none; }
.hv-toggle[aria-pressed="true"] .hv-icon-play  { display: block; }
.hv-toggle[aria-pressed="true"] .hv-icon-pause { display: none; }

/* video progress hairline */
.hv-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  z-index: 4;
  background: rgba(247, 244, 238, 0.08);
}
.hv-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transform: scaleX(0);
  transform-origin: left;
}

/* ---- Header over the dark hero ----------------------------------- */
.header__logo-img--light { display: none; }
.home-video .header { animation: hv-fade-in 0.8s ease calc(1.1s + 0.9s) both; }
.home-video .header:not(.scrolled) .header__logo-img--dark  { display: none; }
.home-video .header:not(.scrolled) .header__logo-img--light { display: block; }
.home-video .header:not(.scrolled) .header__nav-link { color: rgba(247, 244, 238, 0.78); }
.home-video .header:not(.scrolled) .header__nav-link:hover { color: #FFFFFF; }
.home-video .header:not(.scrolled) .lang-btn { color: rgba(247, 244, 238, 0.7); }
.home-video .header:not(.scrolled) .lang-btn.active { color: var(--gold-light); }
.home-video .header:not(.scrolled) .btn-header { color: var(--gold-light); }
.home-video .header:not(.scrolled) .btn-header:hover { color: #0B0B0D; }
.home-video .header:not(.scrolled) .hamburger span { background: #FFFFFF; }
.home-video .header:not(.scrolled) {
  background: linear-gradient(180deg, rgba(11, 11, 13, 0.45), transparent);
}
/* mobile menu open: panel is white, so fall back to the dark header */
.home-video:has(.mobile-nav.open) .header .header__logo-img--dark  { display: block; }
.home-video:has(.mobile-nav.open) .header .header__logo-img--light { display: none; }
.home-video:has(.mobile-nav.open) .header .hamburger span { background: var(--cream); }
.home-video:has(.mobile-nav.open) .header .lang-btn { color: var(--grey); }
.home-video:has(.mobile-nav.open) .header { background: transparent; }

/* ---- Responsive --------------------------------------------------- */
@media (max-width: 1024px) {
  .hv-frame { transform-origin: 20% 40%; }
}

@media (max-width: 768px) {
  .hero--video {
    height: calc(100svh - 76px - env(safe-area-inset-bottom, 0px));
    min-height: 560px;
  }
  /* portrait: stadium lifted into the top half, above the copy */
  .hv-frame {
    transform-origin: 50% 126%;
    transform: translate3d(0, var(--hv-py, 0px), 0) scale(calc(1.35 + var(--hv-ps, 0)));
  }
  .hv-shade {
    background:
      linear-gradient(0deg, rgba(11,11,13,0.95) 0%, rgba(11,11,13,0.75) 38%, rgba(11,11,13,0.1) 62%, rgba(11,11,13,0) 100%),
      linear-gradient(180deg, rgba(11,11,13,0.6) 0%, rgba(11,11,13,0) 20%);
  }
  .hero--video .hero__content {
    text-align: left;
    padding-bottom: 4.25rem;
  }
  .hero--video .hero__copy { margin-inline: 0; }
  .hero--video .hero__title,
  .hero--video .hero__subtitle { margin-inline: 0; }
  .hero--video .hero__title { font-size: clamp(1.7rem, 7.4vw, 2.5rem); margin-bottom: 1.1rem; }
  .hero--video .hero__subtitle { font-size: 0.95rem; margin-bottom: 1.75rem; }
  .hero--video .hero__cta { flex-direction: row; align-items: stretch; }
  .hero--video .hero__cta .btn { flex: 1; justify-content: center; padding: 0.95rem 0.75rem; letter-spacing: 0.12em; font-size: 0.68rem; }
  .hv-eyebrow { font-size: 0.6rem; letter-spacing: 0.22em; margin-bottom: 1.1rem; }
  .hv-eyebrow__line { width: 28px; }
  .hv-bar__inner { grid-template-columns: 1fr auto; padding-bottom: 1rem; }
  .hv-route, .hero--video .hero__scroll { display: none; }
  .hv-controls { grid-column: 1; justify-self: start; }
  .hv-controls__label { display: none; }
  .hv-toggle { width: 32px; height: 32px; }
  .hv-flare { width: 120vw; height: 120vw; }
}

@media (max-width: 350px) {
  .hero--video .hero__cta { flex-direction: column; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .hero--video { height: 100vh; min-height: 320px; }
  .hero--video .hero__content { padding-bottom: 3rem; }
  .hero--video .hero__title { font-size: clamp(1.6rem, 4.6vw, 2.6rem); }
  .hv-eyebrow, .hv-route, .hero--video .hero__scroll { display: none; }
}

/* ---- Reduced motion: no curtain, no drift, poster only ----------- */
@media (prefers-reduced-motion: reduce) {
  .hv-curtain, .hv-grain, .hv-flare { display: none; }
  .hv-zoom, .hv-line__inner, .hv-eyebrow, .hv-eyebrow__line, .hv-bar,
  .hero--video .hero__subtitle, .hero--video .hero__cta,
  .home-video .header, .hero--video .btn--primary::after {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
