* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000000;
}

#noiseCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  z-index: 1;
}

/* Cuadrícula procedural con p5.brush: cuadrado centrado detrás del contenido */
.grid-container {
  position: fixed;
  top: calc(50% - 24px);
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  /* Por encima de noiseCanvas (z-index: 1), por detrás de main-stage (z-index: 5) */
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0.4;
}

.grid-container canvas {
  display: block;
  pointer-events: none;
}

/* Escenario Principal: Logo a la izquierda, Video a la derecha */
.main-stage {
  position: fixed;
  top: calc(50% - 24px);
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 1240px);
  max-height: calc(100vh - 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 4vw, 56px);
  z-index: 5;
  pointer-events: none;
}

/* Columna del Logo (Izquierda) */
.logo-col {
  flex: 0 1 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  pointer-events: auto;
}

.logo {
  display: block;
  width: clamp(240px, 28vw, 420px);
  max-height: calc(85vh - 140px);
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.8));
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.015);
}

/* Columna del Video (Derecha) */
.video-col {
  flex: 1 1 480px;
  max-width: 900px;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.8));
  transition: filter 0.3s ease, transform 0.3s ease;
}

.video-col:hover {
  filter: drop-shadow(0 20px 45px rgba(0, 0, 0, 0.95));
}

.video-card {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050505;
  border-radius: clamp(24px, 3.2vw, 36px);
  overflow: hidden;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.video-card:hover {
  transform: translateY(-2px);
}

.feature-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

/* Barra Inferior (Abajo al centro) */
.bottom-bar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Envoltorio del botón que aloja el confeti para permitir que vuele libremente */
.yt-btn-wrapper {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

/* Botón de YouTube con el estilo de píldora de marca (fondo rosa, borde y texto coral) */
.yt-subscribe-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 28px;
  border-radius: 9999px;
  background-color: #f7b3cc;
  color: #ff5758;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.2px;
  border: 3.5px solid #ff5758;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75), 0 0 15px rgba(247, 179, 204, 0.3);
  cursor: pointer;
  outline: none;
  overflow: hidden;
  /* CORTA de forma absoluta el reflejo para que no se salga a los lados */
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    background-color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    color 0.25s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Reflejo / Destello estrictamente confinado al interior del botón */
.btn-sheen {
  position: absolute;
  top: 0;
  left: -130%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
  animation: btnSheen 4.5s ease-in-out infinite;
}

@keyframes btnSheen {

  0%,
  70% {
    left: -130%;
  }

  100% {
    left: 230%;
  }
}

.yt-subscribe-btn:hover {
  transform: translateY(-2px) scale(1.03);
  background-color: #fcaec7;
  border-color: #ff5758;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.85), 0 0 26px rgba(255, 87, 88, 0.45);
}

.yt-subscribe-btn:active {
  transform: scale(0.96);
}

/* Ícono de YouTube ajustado al color y contraste de la marca */
.yt-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.yt-logo-svg {
  width: 26px;
  height: 19px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(255, 87, 88, 0.35));
  transition: transform 0.25s ease;
}

.yt-subscribe-btn:hover .yt-logo-svg {
  transform: scale(1.08);
}

/* Campanita */
.bell-icon {
  display: flex;
  align-items: center;
  color: #ff5758;
  margin-left: 2px;
  transform-origin: top center;
  transition: transform 0.25s ease;
}

.yt-subscribe-btn:hover .bell-icon {
  color: #ff5758;
  animation: bellWiggle 0.6s ease-in-out;
}

@keyframes bellWiggle {

  0%,
  100% {
    transform: rotate(0);
  }

  20% {
    transform: rotate(-18deg);
  }

  40% {
    transform: rotate(18deg);
  }

  60% {
    transform: rotate(-10deg);
  }

  80% {
    transform: rotate(10deg);
  }
}

/* Animación de suscripción exitosa al dar clic */
.yt-subscribe-btn.subscribed {
  animation: subscribePop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background-color: #fde8f1;
  border-color: #ff5758;
  color: #ff5758;
}

.yt-subscribe-btn.subscribed .bell-icon {
  color: #ff5758;
  animation: bellRingActive 0.7s ease-in-out;
}

@keyframes subscribePop {
  0% {
    transform: scale(1);
  }

  35% {
    transform: scale(0.91);
  }

  65% {
    transform: scale(1.09);
  }

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

@keyframes bellRingActive {

  0%,
  100% {
    transform: rotate(0) scale(1);
  }

  25% {
    transform: rotate(-25deg) scale(1.2);
  }

  50% {
    transform: rotate(25deg) scale(1.2);
  }

  75% {
    transform: rotate(-12deg) scale(1.1);
  }
}

/* Contenedor de Confetti / Partículas flotantes (en el wrapper para que vuelen libres) */
.confetti-container {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 25;
}

.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: burstParticle 0.85s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes burstParticle {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0.3);
  }
}

/* Responsive: móviles y pantallas pequeñas */
@media (max-width: 860px) {
  .main-stage {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin: 20px auto 100px;
    flex-direction: column;
    gap: 20px;
    height: auto;
    max-height: none;
    overflow-y: auto;
    pointer-events: auto;
  }

  html,
  body {
    overflow-y: auto;
  }

  .logo {
    width: clamp(200px, 45vw, 300px);
  }

  .video-col {
    width: 100%;
    max-width: 700px;
  }
}