/* ═══════════════════════════════════════════════════════════════════════
   A LOS PIES DEL ÁRBOL — ESTILOS
   Proyecto: Sitio web teatral con animación Canvas generativa
   ═══════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────
   1. FUENTES Y VARIABLES GLOBALES
   ───────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Lunema";
  src: url("../fonts/Lunema-Regular.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --green: #c7ff02;
  --black: #000000;
  --white: #e8e8e8;
  --dark: #050505;
  --transition-speed: 0.25s;
}

/* ─────────────────────────────────────────────────────────────────────
   2. RESET Y ESTILOS BASE
   ───────────────────────────────────────────────────────────────────── */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: var(--black);
  color: var(--green);
  font-family: "Lunema", Arial, sans-serif;
  letter-spacing: 0.03em;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ─────────────────────────────────────────────────────────────────────
   3. BARRA DE NAVEGACIÓN (TOPBAR)
   ───────────────────────────────────────────────────────────────────── */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  width: 100%;
  height: 56px;
  background: var(--green);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  letter-spacing: 0.55em;
  text-transform: uppercase;
  gap: 64px;
}

.topbar-title {
  flex: 1;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.08em;
}

/* ─────────────────────────────────────────────────────────────────────
   4. BOTÓN HAMBURGUESA (SOLO MOBILE)
   ───────────────────────────────────────────────────────────────────── */

.hamburger {
  display: none;
  position: absolute;
  left: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
  z-index: 1001;
}

.hamburger span {
  width: 24px;
  height: 3px;
  background: #000;
  border-radius: 2px;
  transition: all var(--transition-speed) ease;
}

/* Animación hamburguesa cuando está activo */
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translateY(11px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translateY(-11px);
}

.hamburger:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────────────────────
   5. MENÚ CONTAINER (DESKTOP)
   ───────────────────────────────────────────────────────────────────── */

.menu-container {
  position: relative;
  display: block;
}

.menu-toggle {
  background: none;
  border: none;
  color: #000;
  font-family: "Lunema", Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 8px 12px;
  transition: all var(--transition-speed) ease;
}

.menu-toggle:hover {
  opacity: 0.8;
}

.menu-toggle:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────────────────────
   6. MENÚ DESPLEGABLE (DESKTOP)
   ───────────────────────────────────────────────────────────────────── */

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  border: 1px solid #000;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-10px);
  transition: all var(--transition-speed) ease;
  z-index: 1000;
}

.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu li {
  margin: 0;
}

.dropdown-menu a {
  display: block;
  padding: 12px 20px;
  color: #000;
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all var(--transition-speed) ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.dropdown-menu li:last-child a {
  border-bottom: none;
}

.dropdown-menu a:hover {
  background: rgba(0, 0, 0, 0.1);
}

.dropdown-menu a:focus {
  outline: 2px solid #000;
  outline-offset: -2px;
}

/* ─────────────────────────────────────────────────────────────────────
   7. MENÚ MÓVIL (HAMBURGUESA)
   ───────────────────────────────────────────────────────────────────── */

.mobile-menu {
  position: fixed;
  top: 56px;
  left: 0;
  width: 100%;
  background: var(--green);
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-speed) ease;
  z-index: 1000;
  display: none;
}

.mobile-menu.active {
  max-height: 500px;
}

.mobile-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-menu li {
  margin: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-menu a {
  display: block;
  padding: 14px 20px;
  color: #000;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all var(--transition-speed) ease;
}

.mobile-menu a:active {
  background: rgba(0, 0, 0, 0.1);
}

.mobile-menu a:focus {
  outline: 2px solid #000;
  outline-offset: -2px;
}

/* ─────────────────────────────────────────────────────────────────────
   8. CANVAS ANIMADO
   ───────────────────────────────────────────────────────────────────── */

#tree-lines {
  position: fixed;
  top: 56px;
  left: 0;
  width: 100vw;
  height: calc(100vh - 56px);
  z-index: 1500;
  pointer-events: none;
  opacity: 0.75;
}

/* ─────────────────────────────────────────────────────────────────────
   9. SECCIONES GENERALES
   ───────────────────────────────────────────────────────────────────── */

section {
  min-height: 100vh;
  padding: 110px 12vw 80px;
  position: relative;
  overflow: hidden;
  z-index: 2;
}

/* ─────────────────────────────────────────────────────────────────────
   10. SECCIÓN HERO
   ───────────────────────────────────────────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  align-items: start;
  text-align: center;
  background: #000;
  position: relative;
  z-index: 2;
}

/* Imagen de fondo para hero con gradiente oscuro */
.hero::before {
  content: "";
  position: absolute;
  inset: 56px 0 0;
  background:
    linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.95)),
    url("../img/hero.jpg") center top / cover no-repeat;
  opacity: 0.45;
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 2;
}

.hero-name {
  margin-top: 90px;
  font-size: clamp(18px, 1.6vw, 28px);
  line-height: 1.05;
  text-transform: uppercase;
}

.hero-title {
  margin-top: 90px;
}

h1 {
  margin: 0;
  font-size: clamp(52px, 6.5vw, 105px);
  font-weight: 400;
  line-height: 0.95;
  text-transform: uppercase;
}

.director {
  margin-top: 20px;
  font-size: clamp(15px, 1.1vw, 22px);
  text-transform: uppercase;
  white-space: nowrap;
  text-align: center;
}

/* Sección de descarga dossier */
.dossier {
  grid-column: 2;
  margin-top: 70px;
  color: var(--white);
  font-family: Arial, sans-serif;
  letter-spacing: 0.03em;
  font-size: 15px;
}

/* Botones de descarga */
.buttons {
  grid-column: 2;
  display: flex;
  justify-content: center;
  gap: 80px;
  margin-top: 36px;
}

.btn {
  min-width: 190px;
  padding: 9px 18px;
  border: 1px solid var(--green);
  color: var(--green);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.08em;
  transition: all var(--transition-speed) ease;
  cursor: pointer;
}

.btn:hover {
  background: var(--green);
  color: #000;
}

.btn:focus {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────────────────────
   11. SECCIONES CON IMÁGENES DE FONDO
   ───────────────────────────────────────────────────────────────────── */

.image-section {
  background-size: cover;
  background-position: center;
  background-attachment: fixed; /* Efecto parallax sutil */
  display: flex;
  align-items: center;
  z-index: 2;
}

.resena {
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.2)),
    url("../img/resena.jpg");
}

.descripcion {
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.72)),
    url("../img/description.jpg");
  background-position: left center;
}

.content {
  max-width: 590px;
}

.descripcion .content {
  margin-left: 38%;
  max-width: 700px;
}

h2 {
  margin: 0 0 38px;
  font-size: clamp(34px, 3vw, 60px);
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green);
}

p {
  margin: 0 0 20px;
  font-size: clamp(14px, 1vw, 18px);
  line-height: 1.55;
  color: var(--green);
}

/* ─────────────────────────────────────────────────────────────────────
   12. SECCIÓN CRÉDITOS
   ───────────────────────────────────────────────────────────────────── */

.credits-section {
  min-height: 78vh;
  padding-top: 130px;
  background: linear-gradient(#050505, #0a0a0a);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  z-index: 2;
}

.credits {
  width: min(600px, 90vw);
  color: var(--white);
  font-family: Arial, sans-serif;
  letter-spacing: 0.04em;
  font-size: 15px;
  line-height: 1.7;
}

.credits p {
  color: var(--white);
  font-size: 15px;
  margin-bottom: 4px;
}

.credits strong {
  font-weight: 700;
}

.credits a {
  color: var(--green);
  text-decoration: none;
  transition: opacity var(--transition-speed) ease;
}

.credits a:hover {
  opacity: 0.8;
}

/* ─────────────────────────────────────────────────────────────────────
   13. SECCIÓN DE TEXTOS
   ───────────────────────────────────────────────────────────────────── */

.text-section {
  min-height: 100vh;
  padding: 110px 12vw 80px;
  position: relative;
  overflow: hidden;
  z-index: 2;
  background: #000;
}

.text-content {
  max-width: 800px;
  margin: 0 auto;
}

.back-button-container {
  margin-bottom: 40px;
}

.back-btn {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--green);
  color: var(--green);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all var(--transition-speed) ease;
  margin-bottom: 40px;
}

.back-btn:hover {
  background: var(--green);
  color: #000;
}

.back-btn:focus {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.text-section h2 {
  margin: 0 0 38px;
  font-size: clamp(34px, 3vw, 60px);
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green);
}

.text-section p {
  margin: 0 0 20px;
  font-size: clamp(14px, 1vw, 18px);
  line-height: 1.7;
  color: var(--green);
  text-align: justify;
}

/* ─────────────────────────────────────────────────────────────────────
   14. PIE DE PÁGINA
   ───────────────────────────────────────────────────────────────────── */

footer {
  background: #181818;
  color: #777;
  text-align: center;
  padding: 14px 20px;
  font-family: Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 0.02em;
  z-index: 3000;
  position: relative;
}

/* ─────────────────────────────────────────────────────────────────────
   14. MEDIA QUERIES - RESPONSIVE DESIGN (MOBILE FIRST)
   ───────────────────────────────────────────────────────────────────── */

/* MOBILE - Breakpoint 900px y menores */
@media (max-width: 900px) {
  /* Mostrar hamburguesa en mobile */
  .hamburger {
    display: flex;
  }

  /* Ocultar menú desktop */
  .menu-container {
    display: none;
  }

  /* Mostrar menú móvil */
  .mobile-menu {
    display: block;
  }

  /* Topbar en mobile */
  .topbar {
    gap: 0;
    justify-content: flex-start;
  }

  .topbar-title {
    flex: 1;
    padding-left: 20px;
  }

  /* Secciones en mobile */
  section {
    padding: 95px 28px 60px;
  }

  /* Hero layout en mobile */
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-name,
  .hero-title,
  .director,
  .dossier,
  .buttons {
    grid-column: 1;
    margin-top: 36px;
  }

  .director {
    white-space: normal;
  }

  /* Botones apilados verticalmente */
  .buttons {
    flex-direction: column;
    gap: 16px;
    align-items: center;
  }

  .btn {
    width: min(280px, 100%);
  }

  /* Contenido de secciones */
  .image-section {
    align-items: flex-start;
  }

  .descripcion .content {
    margin-left: 0;
  }

  .content {
    max-width: 100%;
  }

  /* Parallax desactivado en mobile por performance */
  .image-section {
    background-attachment: scroll;
  }

  /* Sección de textos en mobile */
  .text-section {
    padding: 95px 28px 60px;
  }

  .text-section h2 {
    margin: 0 0 28px;
  }

  .back-btn {
    font-size: 12px;
    padding: 8px 16px;
  }
}

/* DESKTOP - Breakpoint 901px y mayores */
@media (min-width: 901px) {
  /* Ocultar hamburguesa en desktop */
  .hamburger {
    display: none;
  }

  /* Mostrar menú desktop */
  .menu-container {
    display: block;
  }

  /* Ocultar menú móvil */
  .mobile-menu {
    display: none;
  }

  /* Topbar en desktop */
  .topbar {
    gap: 64px;
  }
}

/* ─────────────────────────────────────────────────────────────────────
   15. ACCESIBILIDAD Y PREFERENCIAS DEL USUARIO
   ───────────────────────────────────────────────────────────────────── */

/* Respeta preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Alto contraste */
@media (prefers-contrast: more) {
  .btn {
    border-width: 2px;
  }

  .hamburger span {
    height: 4px;
  }

  .menu-toggle {
    border: 2px solid #000;
  }
}
