/* =========================================================
   RESET BASE
========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
.viewport,
.image-wrapper,
.responsive-box {
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

body.page-ready .viewport,
body.page-ready .bottom-menu,
body.page-ready .corner-elmo {
  opacity: 1;
  transform: none;
}

.viewport,
.bottom-menu,
.corner-elmo {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

/* =========================================================
   ESTRUCTURA GENERAL
========================================================= */
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000;
  cursor: grab;
}

body.dragging {
  cursor: grabbing;
}

.viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  touch-action: none;
}

.image-wrapper {
  position: absolute;
  transition: transform 0s;
  will-change: transform;
}

.responsive-box {
  position: relative;
  width: max(100vw, calc(100vh * (2500 / 1406)));
  height: max(100vh, calc(100vw * (1406 / 2500)));
}

.main-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* =========================================================
   HOTSPOTS
========================================================= */

.media-hotspot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  transform: translate(-50%, -50%);
  display: block;
  z-index: 20;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
}

/* Glow (apagado por defecto SIEMPRE) */
.media-hotspot__glow {
  position: absolute;
  inset: -18%;
  display: block;
  z-index: 0;
  pointer-events: none;
  border-radius: 32px;

  background:
    radial-gradient(
      circle at center,
      rgba(255, 255, 255, 0.9) 0%,
      rgba(255, 255, 255, 0.42) 28%,
      rgba(255, 255, 255, 0.16) 48%,
      rgba(255, 255, 255, 0) 72%
    );

  opacity: 0;
  transform: scale(0.95);
  filter: blur(26px);

  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    filter 0.25s ease;
}

/* Animación viva */
.media-hotspot__motion {
  position: relative;
  display: block;
  z-index: 1;
  width: 100%;
  height: 100%;
  transform-origin: center center;
  will-change: transform;

  animation: hotspotFloat 2.4s cubic-bezier(0.445, 0.05, 0.55, 0.95) infinite;
  animation-delay: var(--delay, 0s);
}

/* Hover layer */
.media-hotspot__inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: center center;
  transition:
    transform 0.22s ease,
    filter 0.22s ease,
    opacity 0.22s ease;
}

/* Elementos */
.media-hotspot__img,
.media-hotspot__mask,
.media-hotspot__video {
  display: block;
  width: 100%;
  height: 100%;
}

.media-hotspot__img,
.media-hotspot__video {
  pointer-events: none;
}

/* Imagen */
.media-hotspot__img {
  object-fit: contain;
  filter:
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.20))
    drop-shadow(0 0 24px rgba(255, 255, 255, 0.16));
  transition: filter 0.22s ease;
}

/* =========================================================
   VIDEO / CUADRO
========================================================= */

.media-hotspot__mask {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;

  clip-path: polygon(
    0.092% 23.719%,
    98.059% 0.114%,
    99.322% 0.740%,
    99.322% 76.281%,
    1.510% 99.829%,
    0.092% 99.203%
  );

  filter:
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.20))
    drop-shadow(0 0 24px rgba(255, 255, 255, 0.16));
}

.media-hotspot__video {
  object-fit: cover;
}

/* Halo interno del cuadro */
.media-hotspot__mask::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  background:
    radial-gradient(
      circle at center,
      rgba(255, 255, 255, 0) 45%,
      rgba(255, 255, 255, 0.14) 72%,
      rgba(255, 255, 255, 0.32) 100%
    );

  mix-blend-mode: screen;
  opacity: 0.82;

  transition: opacity 0.22s ease, transform 0.22s ease;
}

/* Glow del cuadro más amplio */
.media-hotspot--video .media-hotspot__glow {
  inset: -22%;
  border-radius: 20px;
}

/* =========================================================
   HOVER / INTERACCIÓN
========================================================= */

.media-hotspot:hover .media-hotspot__inner,
.media-hotspot:focus-visible .media-hotspot__inner {
  transform: scale(1.06);
}

.media-hotspot:hover .media-hotspot__img,
.media-hotspot:focus-visible .media-hotspot__img {
  filter:
    drop-shadow(0 0 14px rgba(255, 255, 255, 0.38))
    drop-shadow(0 0 34px rgba(255, 255, 255, 0.24));
}

.media-hotspot:hover .media-hotspot__mask,
.media-hotspot:focus-visible .media-hotspot__mask {
  filter:
    drop-shadow(0 0 14px rgba(255, 255, 255, 0.38))
    drop-shadow(0 0 34px rgba(255, 255, 255, 0.24));
}

/* Glow SOLO en interacción */
.media-hotspot:hover .media-hotspot__glow,
.media-hotspot:focus-visible .media-hotspot__glow,
.media-hotspot:active .media-hotspot__glow {
  opacity: 1;
  transform: scale(1.08);
  filter: blur(32px);
}

/* Video highlight */
.media-hotspot:hover .media-hotspot__mask::after,
.media-hotspot:focus-visible .media-hotspot__mask::after {
  opacity: 1;
  transform: scale(1.03);
}

/* =========================================================
   TOOLTIPS
========================================================= */

.media-hotspot::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: 108%;
  transform: translateX(-50%) translateY(8px);
  z-index: 40;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-family: "Bebas Neue", sans-serif;
  font-size: 18px;
}

.media-hotspot::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(108% - 6px);
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(0, 0, 0, 0.82);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.media-hotspot:hover::after,
.media-hotspot:hover::before,
.media-hotspot:focus-visible::after,
.media-hotspot:focus-visible::before {
  opacity: 1;
}

.media-hotspot:hover::after {
  transform: translateX(-50%) translateY(0);
}

/* Tooltip cuadro */
.media-hotspot--video::after {
  bottom: 16%;
}

.media-hotspot--video::before {
  bottom: calc(16% - 6px);
  border-top: none;
  border-bottom: 6px solid rgba(0, 0, 0, 0.82);
}

/* =========================================================
   ANIMACIÓN
========================================================= */

@keyframes hotspotFloat {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-4px) scale(1.038);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}


/* =========================================================
   ELMO FIJO SUPERIOR IZQUIERDO
========================================================= */

.corner-elmo {
  position: fixed;
  top: 28px;
  left: 28px;
  z-index: 9998;
  display: block;
  width: clamp(90px, 10vw, 150px);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.corner-elmo__motion {
  display: block;
  width: 8vw;
  max-width: 100px;
  height: auto;
  transform-origin: center center;
  will-change: transform;
  animation-name: hotspotFloat;
  animation-duration: var(--float-duration, 3.2s);
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-delay: var(--delay, 0s);
  transition: transform 0.22s ease, filter 0.22s ease;
}

.corner-elmo__img {
  display: block;
  width: 100%;
  height: auto;
  filter:
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.12))
    drop-shadow(0 0 20px rgba(255, 255, 255, 0.08));
  transition: filter 0.22s ease;
}

.corner-elmo:hover .corner-elmo__motion,
.corner-elmo:focus-visible .corner-elmo__motion {
  transform: scale(1.04);
}

.corner-elmo:hover .corner-elmo__img,
.corner-elmo:focus-visible .corner-elmo__img {
  filter:
    drop-shadow(0 0 14px rgba(255, 255, 255, 0.22))
    drop-shadow(0 0 28px rgba(255, 255, 255, 0.14));
}

@media (max-width: 768px) {
  .corner-elmo {
    top: 26px;
    left: 20px;
  }

  .corner-elmo__motion {
width: 20vw;

  }
}



/* =========================================================
   MENÚ DESPLEGABLE
========================================================= */

.bottom-menu {
  position: fixed;
  left: 25px;
  bottom: 20px;
  z-index: 9999;
  font-family: "Bebas Neue", sans-serif;
}

/* Botón hamburguesa */
.menu-toggle {
  position: relative;
  width: 58px;
  height: 58px;
  border: 0;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding: 0;
  transition:
    transform 0.25s ease,
    background 0.25s ease,
    opacity 0.25s ease;
}

.menu-toggle:hover {
  background: rgba(18, 18, 18, 0.52);
}

.menu-toggle:active {
  transform: scale(0.86);
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  transform-origin: center;
  transition:
    transform 0.28s ease,
    opacity 0.2s ease,
    width 0.2s ease;
}

/* Estado abierto del botón */
.bottom-menu.is-open .menu-toggle span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.bottom-menu.is-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

.bottom-menu.is-open .menu-toggle span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Panel */
.menu-panel {
  position: absolute;
  left: 0;
  bottom: 72px;
  min-width: 220px;
  padding: 18px 18px 16px;
  background: rgba(8, 8, 8, 0.52);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.96);
  transform-origin: bottom left;
  pointer-events: none;
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    visibility 0.28s ease;
}

.bottom-menu.is-open .menu-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.menu-panel a {
  color: #fff;
  text-decoration: none;
  font-size: 28px;
  line-height: 0.95;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  font-weight: 300;
  transition:
    opacity 0.28s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.2s ease;
    
}

.bottom-menu.is-open .menu-panel a {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.bottom-menu.is-open .menu-panel a:nth-child(1) { transition-delay: 0.03s; }
.bottom-menu.is-open .menu-panel a:nth-child(2) { transition-delay: 0.06s; }
.bottom-menu.is-open .menu-panel a:nth-child(3) { transition-delay: 0.09s; }
.bottom-menu.is-open .menu-panel a:nth-child(4) { transition-delay: 0.12s; }
.bottom-menu.is-open .menu-panel a:nth-child(5) { transition-delay: 0.15s; }

.menu-panel a:hover {
  opacity: 0.7;
  transform: translate3d(6px, 0, 0);
}

.bottom-menu.is-open .menu-panel a:hover {
  transform: translate3d(6px, 0, 0);
  opacity: 0.7;
}

/* Mobile */
@media (hover: none) and (pointer: coarse) {
  .menu-toggle {
    width: 54px;
    height: 54px;
  }

  .menu-panel {
    min-width: 190px;
    bottom: 68px;
    padding: 16px 16px 14px;
    gap: 12px;
  }

  .menu-panel a {
    font-size: 24px;
  }
}



/* =========================================================
   LOADER
========================================================= */

.loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0000;
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.7s ease,
    visibility 0.7s ease;
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center;
}

.loader__logo {
  display: block;
  width: clamp(140px, 18vw, 240px);
  height: auto;
  transform-origin: center center;
  will-change: transform, opacity;
  animation: loaderCinematic 2.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* animación más premium */
@keyframes loaderCinematic {
  0% {
    opacity: 0;
    transform: scale(0.88);
  }

  18% {
    opacity: 1;
    transform: scale(1);
  }

  55% {
    opacity: 1;
    transform: scale(1);
  }

  78% {
    opacity: 1;
    transform: scale(1.045);
  }

  100% {
    opacity: 1;
    transform: scale(1.02);
  }
}

/* animación pro */
@keyframes loaderIntro {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  20% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  80% {
    transform: scale(0.98);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}




/* =========================================================
   MOBILE
========================================================= */

@media (hover: none) and (pointer: coarse) {

  /* SIN glow automático */
  .media-hotspot__glow {
    opacity: 0;
  }

  /* Glow solo cuando se toca */
  .media-hotspot:active .media-hotspot__glow {
    opacity: 1;
    transform: scale(1.06);
    filter: blur(28px);
  }

  .media-hotspot:active .media-hotspot__inner {
    transform: scale(1.04);
  }

  .media-hotspot::after,
  .media-hotspot::before {
    display: none;
  }

}