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

body {
  font-family: 'DM Sans', sans-serif;
  background: #1a1a1f;
  color: #eaeaea;
}

/* HEADER */
header {
  position: fixed;
  width: 100%;
  top: 0;
  background: rgba(20,20,25,0.9);
  backdrop-filter: blur(8px);
  padding: 20px 0;
  z-index: 1000;
}

/* Logo blanco fijo a la izquierda del header */
#logo-header {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  height: 38px;
  width: auto;
  mix-blend-mode: screen;
}

nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
  flex-wrap: wrap;
}

nav a {
  color: #aaa;
  text-decoration: none;
  transition: color 0.2s ease;
}

nav a:hover { color: white; }

/* HERO */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
  padding-top: 80px;
}

.hero::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(26,26,31,0.7);
  z-index: 0;
}

/* Logo negro en el hero */
#logo-hero {
  width: 320px;
  max-width: 60%;
  z-index: 3;
  opacity: 1;
  transition: opacity 0.4s ease, transform 0.4s ease;
  cursor: default;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 16px 24px;
}

#logo-hero.hide {
  opacity: 0;
  transform: scale(0.85);
}

/* Gradiente radial sobre el thumb wall */
#logo-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -41%);
  width: calc(100% - 80px);
  height: 800px;
  background: radial-gradient(ellipse at center,
    rgba(255,255,255,0.92) 0%,
    rgba(255,255,255,0.75) 25%,
    rgba(255,255,255,0.4) 50%,
    rgba(255,255,255,0.2) 70%,
    rgba(255,255,255,0.0) 88%,
    transparent 100%
  );
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#logo-glow.hide {
  opacity: 0;
}

.hero p {
  font-size: 20px;
  color: #111;
  z-index: 3;
  background: rgba(255,255,255,0.9);
  padding: 5px 15px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 12px;
  transition: opacity 0.4s ease, transform 0.4s ease;
  cursor: default;
}

/* MURO DE MINIATURAS */
.thumb-wall {
  position: absolute;
  top: 145px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  /* 2 rows: 58% and 42% of available space */
  grid-template-rows: calc((100vh - 145px - 32px - 16px) * 0.58) calc((100vh - 145px - 32px - 16px) * 0.42);
  gap: 16px;
  width: calc(100% - 80px);
  max-width: calc(100% - 80px);
  z-index: 1;
  background: rgba(255,255,255,0.25);
  border-radius: 16px;
  padding: 16px;
}

/* MINIATURAS */
.thumb-wall img,
.thumb-wall video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.thumb-wall img.show,
.thumb-wall video.show {
  opacity: 1;
  transform: translateX(0);
}

.thumb-wall img.exit,
.thumb-wall video.exit {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* hero-top: contenedor */
#hero-top {
  position: fixed;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  text-align: center;
  pointer-events: none;
  width: 100%;
}

/* hero-top: texto animado */
#hero-top h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 300;
  font-size: 26px;
  letter-spacing: 0.06em;
  color: #fff;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  display: block;
  margin-bottom: 4px;
}

#hero-top p {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  background: #1a1a1f;
  color: #eaeaea;
  padding: 5px 15px;
  border-radius: 6px;
  display: inline-block;
  font-size: 16px;
}

.slide-in-up {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Sin scroll solo en el home */
body.no-scroll {
  height: 100vh;
}

html:has(body.no-scroll) {
  overflow: hidden;
}

/* Nombre al lado del logo en páginas interiores */
#header-brand {
  text-decoration: none;
  cursor: pointer;
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
}

#header-brand #logo-header {
  position: static;
  transform: none;
}

#header-name {
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 300;
  font-size: 20px;
  letter-spacing: 0.08em;
  color: #eaeaea;
  white-space: nowrap;
}

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

@media (max-width: 768px) {

  /* Header */
  header {
    padding: 12px 0;
  }

  #header-brand {
    text-decoration: none;
    cursor: pointer;
    left: 10px;
  }

  #logo-header {
    height: 28px;
  }

  #header-name {
    font-size: 15px;
  }

  nav {
    gap: 12px;
    font-size: 13px;
    padding: 0 80px 0 100px;
  }

  .icon-link svg {
    width: 15px;
    height: 15px;
  }

  /* Hero */
  .hero {
    padding-top: 60px;
  }

  /* Logo hero */
  #logo-hero {
    width: 200px;
    padding: 10px 16px;
  }

  /* Gradiente */
  #logo-glow {
    width: 100%;
    height: 400px;
  }

  /* Thumb wall */
  .thumb-wall {
    top: 120px;
    width: calc(100% - 16px);
    max-width: calc(100% - 16px);
    grid-template-columns: repeat(2, 1fr);
    /* Calcular filas para que quepan en el viewport: 100vh - top - padding - gap */
    grid-template-rows: repeat(4, calc((100vh - 120px - 16px - 24px) / 4));
    gap: 8px;
    padding: 8px;
    bottom: 0;
  }

  /* Hero-top */
  #hero-top {
    top: 60px;
  }

  #hero-top h1 {
    font-size: 20px;
  }

  /* Hero p */
  .hero p {
    font-size: 13px;
    padding: 4px 10px;
    margin-top: 8px;
  }
}

@media (max-width: 480px) {

  nav {
    gap: 8px;
    font-size: 11px;
    padding: 0 70px 0 90px;
  }

  .thumb-wall {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, calc((100vh - 110px - 16px - 24px) / 4));
    top: 110px;
  }

  #logo-hero {
    width: 160px;
  }

  .hero p {
    font-size: 11px;
    padding: 3px 8px;
  }
}

/* ================================
   MENÚ HAMBURGUESA
   ================================ */

#hamburger {
  display: none;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1100;
  flex-direction: column;
  gap: 5px;
}

#hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #aaa;
  border-radius: 2px;
  transition: all 0.3s ease;
}

#hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
#hamburger.open span:nth-child(2) {
  opacity: 0;
}
#hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 1300px) {
  #hamburger {
    display: flex;
  }

  nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(20,20,25,0.97);
    backdrop-filter: blur(12px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 28px;
    z-index: 1050;
    padding: 0;
  }

  nav.open {
    display: flex;
  }

  nav a {
    font-size: 22px;
    letter-spacing: 0.06em;
  }

  .icon-link svg {
    width: 22px;
    height: 22px;
  }

  /* Ocultar logo-header en móvil para no solapar */
  #header-brand,
  #logo-header {
    z-index: 1060;
  }
}

/* ================================
   SCROLL TO TOP
   ================================ */

#scroll-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, background 0.2s ease;
  z-index: 900;
}

#scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}

#scroll-top:hover {
  background: rgba(255,255,255,0.2);
}

/* ================================
   PROTECCIÓN DE CONTENIDO
   ================================ */

img, video {
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ================================
   OPTIMIZACIÓN DE RENDER
   ================================ */

/* Evitar reflows en imágenes sin dimensiones conocidas */
img {
  content-visibility: auto;
}
