/* ============================================================
   LAYOUT — loader, cabecera, menú, hero, secciones, footer
   ============================================================ */

/* ---------- PANTALLA DE CARGA ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .5s ease, visibility .5s ease;
}
.loader.hidden { opacity: 0; visibility: hidden; }
.loader img {
  height: clamp(90px, 20vw, 180px);
  animation: loader-pulse 1.2s ease-in-out infinite;
}
@keyframes loader-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: .7; }
}

/* ---------- CABECERA ---------- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--pad);
  mix-blend-mode: difference; /* logo y menú siempre visibles sobre vídeo */
}
.header .logo img { height: 44px; width: auto; }

.header.is-solid {
  mix-blend-mode: normal;
  background: rgba(10, 10, 10, .84);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.menu-btn {
  background: none;
  border: none;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
}
.menu-btn .bars { display: inline-flex; flex-direction: column; gap: 5px; }
.menu-btn .bars span { width: 26px; height: 2px; background: currentColor; transition: transform .3s; }
.header.is-solid .menu-btn:hover { opacity: .7; }

/* En teléfonos la cabecera necesita una base estable: evita que cintas,
   vídeo o fotografías atraviesen visualmente el logo y el botón de menú. */
@media (max-width: 600px) {
  .header {
    mix-blend-mode: normal;
    background: rgba(10, 10, 10, .9);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }
}

/* ---------- MENÚ OVERLAY ---------- */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--black);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 28px;
  padding: 90px var(--pad) 32px;
  overflow-y: auto;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-100%);
  transition:
    transform .45s cubic-bezier(.7, 0, .2, 1),
    visibility 0s linear .45s;
}
.menu-overlay.open {
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

.menu-close {
  position: absolute;
  top: 18px; right: var(--pad);
  background: none;
  border: none;
  color: var(--white);
  font-size: 2rem;
  line-height: 1;
  padding: 8px;
}
.menu-close:hover { opacity: .7; }

.menu-links { list-style: none; }
.menu-links a {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 9.5vw, 6.6rem);
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
  line-height: 1.02;
  transition: color .2s, transform .2s;
}
.menu-links a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: .08em;
}
.menu-links a:hover { transform: translateX(12px); }

.menu-sublinks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin: 4px 0 0;
  list-style: none;
}
.menu-sublinks a {
  color: var(--gray);
  font-size: .82rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color .2s;
}
.menu-sublinks a:hover { color: var(--white); }

.menu-socials { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; }
.menu-socials a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 9px 16px;
  border-radius: 999px;
  transition: background .2s, color .2s, border-color .2s;
}
.menu-socials .icon { width: 17px; height: 17px; }
.menu-socials a:hover { background: var(--white); border-color: var(--white); color: var(--black); }

@media (max-height: 700px) {
  .menu-overlay { padding-top: 74px; gap: 20px; }
  .menu-links a { font-size: clamp(1.9rem, 7vw, 3.6rem); }
}

/* ---------- HERO (vídeo a pantalla completa) ---------- */
.hero {
  /* 1 = título y ficha a los lados; 0 = apilados. Lo lee js/main.js
     para que CSS y JavaScript nunca elijan composiciones distintas. */
  --hero-side: 1;
  position: relative;
  height: clamp(3600px, 520svh, 6000px);
  padding: 0;
  overflow: visible;
  background: var(--black);
}
.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--black);
  isolation: isolate;
}
.hero video, .hero .hero-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero .hero-fallback { z-index: 0; }
.hero video { z-index: 0; }
.hero video.unavailable { display: none; }
.hero-sticky::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,.62), transparent 35%, transparent 62%, rgba(0,0,0,.62)),
    linear-gradient(to bottom, rgba(0,0,0,.28), transparent 38%, rgba(0,0,0,.62));
  pointer-events: none;
}
.hero-dim {
  position: absolute;
  z-index: 2;
  inset: 0;
  background: var(--black);
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}
.hero-story {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
}
.hero-title,
.hero-cta {
  position: absolute;
  top: 50%;
  will-change: transform, opacity;
}
.hero-title {
  left: clamp(24px, 6vw, 112px);
  width: min(46vw, 690px);
  margin: 0;
  color: var(--white);
  font-size: clamp(4.6rem, 12.5vw, 12.5rem);
  line-height: .82;
  text-shadow: 0 5px 34px rgba(0,0,0,.5);
  transform: translate3d(0,-50%,0);
}
.hero-title span { display: block; }
.hero-title span:nth-child(2) {
  color: transparent;
  -webkit-text-stroke: 2px var(--white);
}
.hero-title span:last-child {
  font-size: .72em;
  white-space: nowrap;
}
.hero-cta {
  right: clamp(24px, 6vw, 112px);
  width: min(31vw, 430px);
  padding: clamp(20px, 3vw, 38px);
  border: 1px solid rgba(255,255,255,.34);
  border-left: 3px solid var(--white);
  background: rgba(5,5,5,.7);
  transform: translate3d(0,-50%,0);
  backdrop-filter: blur(12px);
  pointer-events: auto;
}
.hero-cta-kicker {
  display: block;
  margin-bottom: 16px;
  color: var(--gray);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.hero-cta p {
  margin-bottom: 26px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.3vw, 3.4rem);
  line-height: .98;
  text-transform: uppercase;
}
.hero.hero-animated .hero-title,
.hero.hero-animated .hero-cta { opacity: 0; }
.hero-scroll {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  font-family: var(--font-display);
  letter-spacing: .35em;
  font-size: .85rem;
  text-transform: uppercase;
  animation: bounce 1.8s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 10px); }
}

/* Ticker de próxima fecha (parte inferior del hero) */
.hero-next {
  position: absolute;
  z-index: 4;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px var(--pad);
  border-top: 1px solid var(--white-line);
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
  font-size: clamp(.74rem, 2vw, 1rem);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
}
.hero-next strong { font-family: var(--font-display); font-weight: 400; color: var(--white); }
.hero-next span:not(.arrow) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-next .arrow { margin-left: auto; font-size: 1.2rem; color: var(--white); }
.hero-next:hover { background: var(--white); color: var(--black); }
.hero-next:hover strong, .hero-next:hover .arrow { color: var(--black); }

.hero-play {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid var(--white);
  border-radius: 999px;
  background: rgba(0,0,0,.6);
  color: var(--white);
  padding: 15px 26px;
  font-family: var(--font-display);
  font-size: .9rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}
.hero-play:hover { background: var(--white); color: var(--black); }
.hero-play[hidden] { display: none; }

@media (max-width: 900px), (max-aspect-ratio: 4 / 3) {
  .hero { height: 480svh; --hero-side: 0; }
  .hero-sticky::after {
    background:
      linear-gradient(to bottom, rgba(0,0,0,.52), transparent 32%, transparent 52%, rgba(0,0,0,.86)),
      linear-gradient(90deg, rgba(0,0,0,.2), transparent 50%, rgba(0,0,0,.2));
  }
  .hero-title {
    top: 14%;
    left: 20px;
    width: calc(100% - 40px);
    font-size: clamp(3.6rem, 19vw, 7.5rem);
    line-height: .84;
    transform: none;
  }
  .hero-title span { display: block; }
  .hero-title span:last-child { font-size: .66em; }
  .hero-cta {
    top: auto;
    right: 16px;
    bottom: 15%;
    left: 16px;
    width: auto;
    max-width: 520px;
    margin: 0 auto;
    padding: 18px;
    transform: none;
  }
  .hero-cta p { margin-bottom: 18px; font-size: clamp(1.5rem, 6.4vw, 2.5rem); }
  .hero-scroll { bottom: 70px; }
}

@media (max-width: 430px) {
  .hero-title { top: 12%; font-size: clamp(3.2rem, 20vw, 5rem); }
  .hero-cta-kicker { display: none; }
  .hero-cta { bottom: 14%; padding: 16px; }
  .hero-cta p { font-size: 1.5rem; margin-bottom: 16px; }
  .hero-cta .btn-play { padding: 12px 18px; font-size: .82rem; }
  .hero-scroll { display: none; }
}

@media (max-height: 650px) and (orientation: landscape) {
  .hero { height: 460svh; --hero-side: 1; }
  .hero-title {
    top: 50%;
    left: 3vw;
    width: 37vw;
    font-size: clamp(3rem, 10vw, 6rem);
    transform: translate3d(0,-50%,0);
  }
  .hero-title span { display: block; }
  .hero-title span:last-child { font-size: .68em; }
  .hero-cta {
    top: 50%;
    right: 3vw;
    bottom: auto;
    left: auto;
    width: min(35vw, 380px);
    padding: 14px;
    transform: translate3d(0,-50%,0);
  }
  .hero-cta-kicker { display: none; }
  .hero-cta p { margin-bottom: 14px; font-size: clamp(1.2rem, 3.4vw, 2rem); }
  .hero-cta .btn-play { padding: 10px 16px; }
  .hero-scroll { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero { height: 100vh; height: 100svh; }
  .hero-sticky { position: relative; }
  .hero video { transform: none !important; }
  .hero.hero-animated .hero-title,
  .hero.hero-animated .hero-cta { opacity: 1 !important; }
  .hero-dim { opacity: .08 !important; }
  .hero-scroll { display: none; }
}

/* ---------- SECCIONES ---------- */
section { padding: clamp(56px, 9vw, 120px) 0; }
/* Dos secciones seguidas sin cinta entre medias no necesitan
   el doble de aire: se recorta el borde superior de la segunda. */
section + section { padding-top: clamp(24px, 4vw, 56px); }
.marquee + section { padding-top: clamp(56px, 9vw, 120px); }
.cta-band { padding-top: clamp(46px, 7vw, 90px) !important; }

.section-title {
  font-size: clamp(2.6rem, 11vw, 9rem);
  margin-bottom: clamp(24px, 4vw, 52px);
  /* Texto hueco (outline) como título gigante */
  color: transparent;
  -webkit-text-stroke: 2px var(--white);
}
.section-title.accent { -webkit-text-stroke-color: var(--white); }
.section-title.solid { color: var(--white); -webkit-text-stroke: 0; }

.section-kicker {
  margin-bottom: 12px;
  color: var(--gray);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.section-intro {
  max-width: 680px;
  margin-bottom: clamp(26px, 4vw, 44px);
  color: var(--gray);
  font-size: clamp(.98rem, 1.6vw, 1.12rem);
}

.section-cta { margin-top: clamp(28px, 4vw, 46px); }

.sub-title {
  margin: clamp(40px, 5vw, 68px) 0 22px;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.2vw, 2.2rem);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.sub-title.is-lead { margin-top: 0; }

/* ---------- PÁGINAS INTERIORES ---------- */
.page-inner main { padding-top: var(--header-h); }
.page-hero { padding-bottom: clamp(24px, 3vw, 44px); }
.page-hero .section-title { margin-bottom: 22px; }

/* ---------- FOOTER ---------- */
.footer { border-top: 1px solid var(--line); padding: 48px 0 0; }

.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 36px;
}
.footer-legal { display: flex; gap: 20px; flex-wrap: wrap; list-style: none; }
.footer-legal a {
  font-size: .76rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gray);
}
.footer-legal a:hover { color: var(--white); }

.footer-socials { display: flex; gap: 12px; }
.footer-socials a {
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  text-decoration: none;
  transition: background .2s, color .2s, border-color .2s;
}
.footer-socials .icon { width: 19px; height: 19px; }
.footer-socials a:hover { background: var(--white); border-color: var(--white); color: var(--black); }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 20px var(--pad);
  font-size: .76rem;
  color: var(--gray);
  text-align: center;
}

@media (max-width: 560px) {
  .footer-top { flex-direction: column; align-items: flex-start; gap: 26px; }
  .footer-legal { gap: 14px 20px; }
  .hero-next { padding-right: calc(var(--pad) + 72px); }
  .footer-bottom { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}
