/* =========================================================
   Monique & Luis — hero
   Paleta heredada del monograma: azul marino, oro, azul polvo.
   ========================================================= */

:root {
  /* marca */
  --navy-deep:  oklch(0.205 0.036 250);
  --navy:       oklch(0.360 0.033 244);
  --powder:     oklch(0.884 0.021 244);
  --gold:       oklch(0.820 0.110  84);
  --mustard:    oklch(0.906 0.056  96);
  --ivory:      oklch(0.968 0.008  85);

  /* superficies */
  --bg:         var(--navy-deep);
  --on-dark:    oklch(0.985 0.004 85);
  --on-dark-mu: oklch(0.985 0.004 85 / 0.72);

  /* tipografía */
  --display: "Antic Didone", "Times New Roman", serif;
  --sans: "Jost", ui-sans-serif, system-ui, sans-serif;

  /* ritmo */
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --stage-h: 100svh; /* altura del video; en móvil baja a ~la mitad */
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);

  /* z-scale */
  --z-stage: 0;
  --z-scrim: 1;
  --z-content: 2;
  --z-hud: 3;
  --z-nav: 4;
  --z-drawer: 5;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--on-dark);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

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

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--mustard);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---------------------------------------------------------
   Nav
   --------------------------------------------------------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-nav);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: clamp(1rem, 2.4vw, 1.9rem) var(--gutter);
  color: var(--on-dark);
  /* el degradado superior vive en el scrim del hero; aquí solo un respaldo suave */
  background: linear-gradient(to bottom, oklch(0.205 0.036 250 / 0.42), transparent);
  transition: background 500ms var(--ease-out-quint), color 600ms var(--ease-out-quint);
}

.nav.is-scrolled { background: oklch(0.205 0.036 250 / 0.92); }

/* el hero terminó en un cartón marfil: la nav se lee en azul mientras esté encima */
.nav.is-on-light:not(.is-scrolled) {
  background: none;
  color: var(--navy);
}
.nav.is-on-light:not(.is-scrolled) .nav__side a { color: oklch(0.360 0.033 244 / 0.78); }
.nav.is-on-light:not(.is-scrolled) .nav__side a:hover,
.nav.is-on-light:not(.is-scrolled) .nav__cta { color: var(--navy); }
.nav.is-on-light:not(.is-scrolled) .nav__burger span { background: var(--navy); }

.nav__side {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.75rem);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.nav__side--right { justify-content: flex-end; }

.nav__side a {
  position: relative;
  padding-block: 0.2rem;
  color: var(--on-dark-mu);
  transition: color 260ms var(--ease-out-quint);
}

.nav__side a::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 420ms var(--ease-out-quint);
}

.nav__side a:hover { color: var(--on-dark); }
.nav__side a:hover::after { transform: scaleX(1); }

.nav__cta { color: var(--mustard); }

.nav__mark {
  display: flex;
  align-items: baseline;
  gap: 0.34em;
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.8vw, 1.4rem);
  letter-spacing: 0.24em;
  padding-inline-start: 0.24em; /* compensa el tracking del último glifo */
}

.nav__amp {
  font-size: 0.72em;
  color: var(--gold);
}

.nav__burger {
  display: none;
  justify-self: end;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.nav__burger span {
  display: block;
  width: 22px;
  height: 1px;
  margin: 5px auto;
  background: var(--on-dark);
  transition: transform 380ms var(--ease-out-quint), opacity 240ms;
}

.nav__burger[aria-expanded="true"] span:first-child { transform: translateY(3px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child  { transform: translateY(-3px) rotate(-45deg); }

.drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  background: oklch(0.205 0.036 250 / 0.96);
  backdrop-filter: blur(14px);
  font-family: var(--display);
  font-size: 1.6rem;
  letter-spacing: 0.06em;
}

.drawer[hidden] { display: none; }

/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: end center;
  overflow: clip;
  isolation: isolate;
}

.hero__stage {
  position: absolute;
  inset: 0;
  z-index: var(--z-stage);
  overflow: clip;
}

.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
  transition: filter 1400ms var(--ease-out-expo),
              transform 2600ms var(--ease-out-expo),
              opacity 1200ms var(--ease-out-expo);
}

/* grano fino: le quita el aire "de stock" al degradado */
.hero__grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: var(--z-scrim);
  pointer-events: none;
  transition: background 1600ms var(--ease-out-expo);
  background:
    linear-gradient(to bottom,
      oklch(0.205 0.036 250 / 0.52) 0%,
      oklch(0.205 0.036 250 / 0.10) 22%,
      oklch(0.205 0.036 250 / 0) 40%),
    linear-gradient(to top,
      oklch(0.205 0.036 250 / 0.86) 0%,
      oklch(0.205 0.036 250 / 0.52) 26%,
      oklch(0.205 0.036 250 / 0.06) 58%,
      oklch(0.205 0.036 250 / 0) 74%);
}

.hero__inner {
  position: relative;
  z-index: var(--z-content);
  width: 100%;
  max-width: 62rem;
  padding: 0 var(--gutter) clamp(4.5rem, 11vh, 8rem);
  display: grid;
  justify-items: center;
  text-align: center;
}

.hero__title {
  display: grid;
  justify-items: center;
  gap: clamp(0.9rem, 2vh, 1.6rem);
  transition: opacity 900ms var(--ease-out-expo),
              transform 1100ms var(--ease-out-expo),
              filter 900ms var(--ease-out-expo);
}

.hero__names {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.6rem, 8.4vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: 0.02em;
  text-wrap: balance;
  text-shadow: 0 2px 40px oklch(0.205 0.036 250 / 0.45);
}

.hero__names em {
  display: block;
  font-style: italic;
  font-size: 0.42em;
  line-height: 1.6;
  color: var(--gold);
  letter-spacing: 0.06em;
}

.hero__meta {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  font-size: clamp(0.7rem, 1.5vw, 0.82rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--on-dark-mu);
}

.hero__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

/* tarjeta final: el monograma entra sobre el último fotograma */
.hero__card {
  position: absolute;
  inset: 0;
  z-index: var(--z-content);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(1.06);
  filter: blur(6px);
  pointer-events: none;
  transition: opacity 1500ms var(--ease-out-expo),
              transform 2000ms var(--ease-out-expo),
              filter 1500ms var(--ease-out-expo);
}

.hero__card img {
  position: relative;
  width: min(72vw, 24rem);
  height: auto;
}

.hero__caption {
  margin: clamp(1.4rem, 4vh, 2.6rem) 0 0;
  min-height: 2.9em;
  max-width: 36rem;
  font-weight: 400;
  font-size: clamp(1rem, 1.75vw, 1.28rem);
  line-height: 1.45;
  text-wrap: balance;
  text-shadow: 0 1px 2px oklch(0.205 0.036 250 / 0.9), 0 0 24px oklch(0.205 0.036 250 / 0.7);
  transition: opacity 260ms var(--ease-out-quint);
}

.hero__caption.is-swapping { opacity: 0; }

.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  margin-top: clamp(2rem, 5vh, 3.4rem);
}

.btn {
  display: inline-block;
  padding: 1.05rem 2.6rem;
  background: var(--ivory);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: background 320ms var(--ease-out-quint),
              color 320ms var(--ease-out-quint),
              transform 420ms var(--ease-out-quint);
}

.btn:hover {
  background: var(--mustard);
  transform: translateY(-2px);
}

.link-btn {
  border: 0;
  background: none;
  padding: 0.3rem 0.2rem;
  color: var(--on-dark-mu);
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 700ms var(--ease-out-quint), color 240ms;
}

.link-btn:hover { color: var(--on-dark); }

/* ---------------------------------------------------------
   HUD: sonido, cue de scroll, progreso
   --------------------------------------------------------- */

.hud {
  position: absolute;
  z-index: var(--z-hud);
  right: var(--gutter);
  bottom: clamp(1.6rem, 4vh, 2.6rem);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lang {
  display: flex;
  padding: 3px;
  border: 1px solid oklch(0.985 0.004 85 / 0.28);
  border-radius: 999px;
  background: oklch(0.205 0.036 250 / 0.28);
  backdrop-filter: blur(8px);
}

.lang button {
  border: 0;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  background: none;
  color: var(--on-dark-mu);
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: background 260ms var(--ease-out-quint), color 260ms;
}

.lang button[aria-pressed="true"] {
  background: var(--ivory);
  color: var(--navy);
}

.sound {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 1rem 0.55rem 0.85rem;
  border: 1px solid oklch(0.985 0.004 85 / 0.28);
  border-radius: 999px;
  background: oklch(0.205 0.036 250 / 0.28);
  backdrop-filter: blur(8px);
  color: var(--on-dark);
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 300ms, background 300ms;
}

.sound:hover { border-color: oklch(0.985 0.004 85 / 0.6); }

.sound__bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 13px;
}

.sound__bars i {
  width: 2px;
  height: 4px;
  background: var(--mustard);
  transform-origin: bottom;
}

.sound[aria-pressed="true"] .sound__bars i {
  animation: eq 900ms var(--ease-out-quint) infinite alternate;
}

.sound__bars i:nth-child(2) { animation-delay: 130ms; }
.sound__bars i:nth-child(3) { animation-delay: 260ms; }
.sound__bars i:nth-child(4) { animation-delay:  60ms; }

@keyframes eq {
  from { height: 3px; }
  to   { height: 13px; }
}

.scroll-cue {
  position: absolute;
  z-index: var(--z-hud);
  left: var(--gutter);
  bottom: clamp(1.6rem, 4vh, 2.6rem);
  width: 1px;
  height: clamp(2.4rem, 7vh, 4rem);
  overflow: hidden;
  background: oklch(0.985 0.004 85 / 0.22);
  transition: opacity 600ms var(--ease-out-quint);
}

.scroll-cue__line {
  display: block;
  width: 100%;
  height: 45%;
  background: var(--mustard);
  animation: cue 2400ms var(--ease-out-quint) infinite;
}

@keyframes cue {
  0%        { transform: translateY(-100%); }
  55%, 100% { transform: translateY(240%); }
}

.hero__progress {
  position: absolute;
  z-index: var(--z-hud);
  inset: auto 0 0 0;
  height: 2px;
  background: oklch(0.985 0.004 85 / 0.12);
}

.hero__progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
  transform-origin: left;
}

/* ---------------------------------------------------------
   Estados del hero
   playing  → título y botón sobre el video
   talking  → empezaron los subtítulos: solo video + subtítulo
   ended    → la película se congela y vuelven título y botón
   --------------------------------------------------------- */

.hero__title,
.hero__actions {
  transition: opacity 900ms var(--ease-out-expo),
              transform 1100ms var(--ease-out-expo),
              filter 900ms var(--ease-out-expo);
}

.hero[data-state="talking"] .hero__title,
.hero[data-state="talking"] .hero__actions {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(3px);
  pointer-events: none;
}

.hero[data-state="ended"] .hero__video {
  filter: saturate(0.55) brightness(0.42) blur(3px);
  transform: scale(1.035);
}

/* el scrim se cierra como un telón; el título vuelve sobre el último fotograma */
.hero[data-state="ended"] .hero__scrim {
  background:
    linear-gradient(to bottom, oklch(0.205 0.036 250 / 0.55), oklch(0.205 0.036 250 / 0.25) 40%, oklch(0.205 0.036 250 / 0.7)),
    radial-gradient(ellipse 70% 60% at 50% 46%, oklch(0.205 0.036 250 / 0), oklch(0.205 0.036 250 / 0.6) 100%);
}

.hero[data-state="ended"] .hero__title,
.hero[data-state="ended"] .hero__actions {
  transition-delay: 500ms;
}

.hero[data-state="ended"] .hero__caption { opacity: 0; }

.hero[data-state="ended"] .link-btn {
  opacity: 1;
  visibility: visible;
  transition-delay: 1200ms;
}

.hero[data-state="ended"] .scroll-cue,
.hero[data-state="ended"] .hero__progress { opacity: 0; }

/* el monograma solo cierra el video en móvil, donde el título vive fuera del video */
.hero__card { display: none; }

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 860px) {
  :root { --stage-h: 54svh; }

  .nav { grid-template-columns: 1fr auto; }
  .nav__side { display: none; }
  .nav__burger { display: block; }
  .nav__mark { justify-self: start; }

  /* el video ocupa media pantalla; título y botón viven debajo, sobre el azul */
  .hero { display: block; min-height: 0; }

  .hero__stage {
    position: relative;
    height: var(--stage-h);
  }

  .hero__video { object-position: 50% 30%; }

  .hero__inner {
    position: static; /* el subtítulo absoluto se ancla al .hero, no a este bloque */
    max-width: none;
    padding: clamp(2.2rem, 6vh, 3.4rem) var(--gutter) clamp(3rem, 8vh, 4.5rem);
  }

  .hero__names { font-size: clamp(2.4rem, 12vw, 3.4rem); text-shadow: none; }

  /* subtítulos dentro del video, apoyados en su borde inferior */
  .hero__caption {
    position: absolute;
    z-index: var(--z-content);
    left: var(--gutter);
    right: var(--gutter);
    top: calc(var(--stage-h) - 3.6rem);
    transform: translateY(-100%);
    margin: 0;
    max-width: none;
    min-height: 0;
    font-size: clamp(0.95rem, 4vw, 1.1rem);
    text-align: center;
  }

  .hud {
    top: calc(var(--stage-h) - 0.8rem);
    bottom: auto;
    right: var(--gutter);
    transform: translateY(-100%);
  }

  .hero__progress {
    top: calc(var(--stage-h) - 2px);
    bottom: auto;
  }

  .hero__actions { margin-top: clamp(1.6rem, 4vh, 2.4rem); }
  .btn { width: 100%; text-align: center; }

  .sound__label { display: none; }
  .sound { padding: 0.6rem; }
  .scroll-cue { display: none; }

  /* el título vive debajo del video: no se esconde mientras hablan */
  .hero[data-state="talking"] .hero__title,
  .hero[data-state="talking"] .hero__actions {
    opacity: 1;
    transform: none;
    filter: none;
    pointer-events: auto;
  }

  /* al terminar, la banda del video se vuelve marfil y entra el monograma */
  .hero__card { display: grid; }

  .hero[data-state="ended"] .hero__card {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }

  .hero[data-state="ended"] .hero__video {
    filter: saturate(0.4) brightness(1.15) blur(8px);
  }

  .hero[data-state="ended"] .hero__scrim {
    background: radial-gradient(ellipse 80% 70% at 50% 45%, oklch(0.968 0.008 85 / 0.97), oklch(0.968 0.008 85 / 0.9) 100%);
  }

  .hero[data-state="ended"] .hero__grain { opacity: 0.09; }

  .hero[data-state="ended"] .lang,
  .hero[data-state="ended"] .sound {
    border-color: oklch(0.360 0.033 244 / 0.28);
    background: oklch(0.968 0.008 85 / 0.6);
    color: var(--navy);
  }
  .hero[data-state="ended"] .lang button { color: oklch(0.360 0.033 244 / 0.7); }
  .hero[data-state="ended"] .lang button[aria-pressed="true"] { background: var(--navy); color: var(--ivory); }
  .hero[data-state="ended"] .sound__bars i { background: var(--navy); }
}

@media (max-width: 560px) {
  /* en una columna el punto dorado queda huérfano al final de la línea */
  .hero__meta { flex-direction: column; gap: 0.45rem; }
  .hero__dot { display: none; }
}

/* ---------------------------------------------------------
   Movimiento reducido
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .hero__card { filter: none; transform: none; }
  .scroll-cue__line { height: 100%; }
}
