/* ============================================================
   hero.css — Dynamic Studio
   Hero cinema (exclusivo de index.html)
   ============================================================ */

/* Contenedor principal del hero */
.hero-cinema {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Canvas — recibe los frames de la secuencia */
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  will-change: transform;
  animation: handheld 11s ease-in-out infinite;
}

/* Vigneta cinematográfica — más profunda en bordes, respira en el centro */
.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse 88% 80% at 50% 50%,
    transparent 30%,
    rgba(0,0,0,0.28) 58%,
    rgba(0,0,0,0.68) 85%,
    rgba(0,0,0,0.88) 100%
  );
}

/* Grano cinematográfico */
.hero-grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.042;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 170px 170px;
  animation: grain-shift 0.55s steps(1) infinite;
}

/* UI: logo + botón */
.hero-ui {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.8rem;
  /* Fade-out más lento y profundo */
  transition: opacity 1.1s var(--ease-cinema), transform 1.1s var(--ease-cinema);
}

.hero-ui.fade-out {
  opacity: 0;
  transform: scale(0.96) translateY(-8px);
  pointer-events: none;
}

.hero-logo-img {
  filter: brightness(0) invert(1);
  width: clamp(200px, 36vw, 540px);
  opacity: 0.9;
  display: block;
}

/* Botón ENTRAR */
.hero-enter-btn {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: rgba(240,237,232,0.72);
  background: transparent;
  border: 1px solid rgba(240,237,232,0.22);
  padding: 0.9rem 3rem;
  min-height: 48px;
  cursor: pointer;
  outline: none;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  /* Sin animación de letter-spacing — es mecánico y distrae */
  transition: color 0.42s var(--ease-cinema), border-color 0.42s var(--ease-cinema);
}

.hero-enter-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.hero-enter-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(240,237,232,0.06);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.52s var(--ease-expo-out);
}

.hero-enter-btn:not(:disabled):hover::before { transform: scaleX(1); }

.hero-enter-btn:not(:disabled):hover {
  color: rgba(240,237,232,0.96);
  border-color: rgba(240,237,232,0.48);
}

/* Pista de scroll */
.hero-scroll-hint {
  position: absolute;
  bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  opacity: 0;
  transition: opacity 1.2s ease;
  cursor: pointer;
}

.hero-scroll-hint span {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  color: rgba(232,228,221,0.4);
}

.hero-scroll-hint svg {
  width: 20px;
  animation: bounce 2.4s ease-in-out infinite;
}

/* Pista de swipe izquierdo (solo mobile) */
.hero-swipe-hint {
  position: absolute;
  bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
  right: 2.5rem;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}

.hero-swipe-hint span {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  color: rgba(232,228,221,0.4);
}

.hero-swipe-hint svg {
  width: 20px;
  animation: swipe-pulse 2.4s ease-in-out infinite;
}

/* Hint teclado (desktop) */
.hero-key-hint {
  position: absolute;
  bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
  right: 2.5rem;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}

.hero-key-hint span {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  color: rgba(232,228,221,0.4);
}

.key-badge {
  font-size: 10px;
  color: rgba(232,228,221,0.4);
  border: 1px solid rgba(232,228,221,0.2);
  padding: 2px 7px;
  border-radius: 3px;
}

/* Overrides para títulos */
#hero-studio-title {
  top: 40%;
}

#hero-seq4-title {
  top: 35%;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 24px rgba(0,0,0,0.4);
}

/* Título post-animación */
.hero-studio-title {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateY(14px);
  z-index: 4;
  font-family: var(--font-display);
  font-size: clamp(1.28rem, 3.2vw, 2.56rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(240,237,232,0.92);
  text-shadow: 0 2px 32px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s var(--ease-expo-out) 0.15s, transform 1.2s var(--ease-expo-out) 0.15s;
  white-space: nowrap;
}

.hero-studio-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}

.hero-studio-title.visible {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0);
}

/* Botón volver */
.hero-back-btn {
  position: absolute;
  bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
  left: 2.5rem;
  z-index: 4;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(240,237,232,0.52);
  background: transparent;
  border: 1px solid rgba(240,237,232,0.15);
  padding: 0.75rem 1.8rem;
  min-height: 44px;
  cursor: pointer;
  outline: none;
  opacity: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: opacity 1s var(--ease-expo-out), color 0.38s var(--ease-cinema), border-color 0.38s var(--ease-cinema);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hero-back-btn.visible { opacity: 1; }

.hero-back-btn:hover {
  color: rgba(240,237,232,0.9);
  border-color: rgba(240,237,232,0.42);
}

.hero-back-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── HERO MOBILE ── */
@media (max-width: 768px) {
  @keyframes handheld {
    0%   { transform: translate(0px,    0px)   rotate(0deg)    scale(1.06); }
    10%  { transform: translate(4px,   -2px)   rotate(0.2deg)  scale(1.065); }
    22%  { transform: translate(-3px,   3px)   rotate(-0.28deg)scale(1.058); }
    35%  { transform: translate(5px,    2px)   rotate(0.15deg) scale(1.063); }
    47%  { transform: translate(-3px,  -2px)   rotate(-0.22deg)scale(1.06); }
    59%  { transform: translate(2px,    5px)   rotate(0.25deg) scale(1.065); }
    71%  { transform: translate(-5px,  -3px)   rotate(-0.15deg)scale(1.057); }
    83%  { transform: translate(3px,    2px)   rotate(0.3deg)  scale(1.064); }
    92%  { transform: translate(-2px,   4px)   rotate(-0.12deg)scale(1.059); }
    100% { transform: translate(0px,    0px)   rotate(0deg)    scale(1.06); }
  }

  .hero-enter-btn {
    font-size: 11px;
    padding: 1rem 2.2rem;
    transition: color 0.35s var(--ease-cinema), border-color 0.35s var(--ease-cinema);
  }
  .hero-enter-btn:not(:disabled):hover {
    letter-spacing: 0.38em; /* sin cambio en mobile */
  }

  .hero-back-btn {
    left: 1.2rem;
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    padding: 0.85rem 1.4rem;
    font-size: 9px;
  }

  .hero-scroll-hint {
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }

  .hero-ui {
    gap: 2rem;
  }
}
