/* --- CSS VARIABLES & RESET --- */
:root {
  --bg-color: #f5f5f5;
  --text-main: #000000;
  --text-light: #888888;
  --color-lang-1: #00f0ff; /* Cian */
  --color-lang-2: #ffe600; /* Amarillo */

  /* Tipografía Fluida */
  --font-size-hero: clamp(6.4rem, 13vw, 13rem);
  --font-weight-hero: 700;
  --font-family-hero: "Inter", system-ui, -apple-system, sans-serif;

  /* Tipografía pequeña */
  --font-size-small: clamp(0.75rem, 1.5vw, 0.9rem);

  /* Espaciado */
  --spacing-header: clamp(1rem, 3vw, 2rem);
}

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

body {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  overflow: hidden; /* Evitar scroll vertical fullscreen */
  height: 100vh;
  display: flex;
  flex-direction: column;
}

button {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

/* --- HEADER --- */
header {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: var(--spacing-header);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10;
}

.btn-index {
  justify-self: start;
  background: white;
  color: black;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-index::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: black;
  border-radius: 50%;
}

.btn-sound-master {
  justify-self: center;
  background: #1a1a1a;
  color: white;
  padding: 0.5rem 2rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  transition:
    background-color 0.3s ease,
    transform 0.2s ease;
}

.btn-sound-master:hover {
  transform: scale(1.05); /* Feedback táctil sutil */
}

.sound-symbol {
  font-weight: bold;
  letter-spacing: -2px;
  color: var(--text-light); /* Un color tenue cuando está apagado */
  transition: color 0.3s ease;
}

/* Estado visual cuando el sonido esté activo (añadido vía JS) */
.btn-sound-master.is-playing .sound-symbol {
  color: var(--color-lang-1); /* Brillará cuando suene */
}

.btn-about {
  justify-self: end;
  color: black;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.8s ease; /* Transición fluida del indicador de idioma */
}
.btn-about::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: black;
  border-radius: 50%;
}

/* --- MAIN SECTION --- */
main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: var(--bg-color);
  width: 100%;
  transition: filter 0.6s ease;
  will-change: transform, filter;
}

/* Base para todas las ventanas superpuestas */
.master-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--text-main); /* Fondo negro */
  color: var(--bg-color); /* Texto blanco */
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /* GSAP controlará el clip-path, por defecto lo escondemos */
  clip-path: circle(0% at 50% 50%);
  pointer-events: none; /* Para que no intercepte clicks estando oculto */
}

/* El botón de cerrar en la parte superior central */
.btn-close {
  position: absolute;
  top: var(--spacing-header);
  background: transparent;
  color: inherit;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: color 0.3s ease;
}

.btn-close:hover {
  color: var(--color-lang-1); /* Un toque de cian al pasar el ratón */
}

/* Botón de cierre global (Oculto por defecto) */
#btn-global-close {
  position: fixed;
  top: var(--spacing-header);
  left: 50%;
  transform: translateX(-50%);
  background: transparent;
  color: var(--bg-color); /* Blanco, ya que el overlay es negro */
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 2px;
  z-index: 60; /* Debe ser mayor que el z-index 50 del master-overlay */
  opacity: 0;
  pointer-events: none;
  transition: color 0.3s ease;
}

#btn-global-close:hover {
  color: var(--color-lang-1);
}

.overlay-content {
  width: 90%;
  max-width: 800px;
  opacity: 0; /* Lo animaremos con GSAP */
}

.contact-huge a {
  font-size: clamp(2rem, 5vw, 6rem);
  font-weight: bold;
  color: inherit;
  text-decoration: none;
}

/* Contenedor del Marquee */
.marquee-container {
  width: 100%;
  overflow: hidden;
  position: relative;
  white-space: nowrap;
  cursor: default;
  z-index: 10;
  color: #ffffff;
  mix-blend-mode: difference;
}

.marquee-text {
  display: inline-block;
  font-family: var(--font-family-hero);
  font-size: var(--font-size-hero);
  font-weight: var(--font-weight-hero);
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

/* --- CONTENIDO CENTRAL SUPERPUESTO --- */
.overlay-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(400px, 90vw);
  z-index: 5;
  pointer-events: none;
}

.overlay-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  color: var(--text-light);
  font-size: var(--font-size-small);
  margin-bottom: 0.5rem;
}

.lend-ear {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.lend-ear::before {
  content: "º";
  display: inline-block;
  color: black;
}

/* Contenedor de Imagen */
.image-center-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  position: relative;
}

/* Las imágenes ahora se apilan de forma absoluta */
.image-center {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  will-change: opacity; /* Solo optimizamos el canal alfa para liberar memoria de GPU */
}

.overlay-bottom {
  margin-top: 1rem;
  color: var(--text-light);
  font-size: var(--font-size-small);
}

/* --- FOOTER (Anclaje Inferior) --- */
footer {
  display: flex;
  justify-content: space-between;
  padding: var(--spacing-header);
  position: fixed;
  bottom: 0;
  width: 100%;
  z-index: 10;
  pointer-events: none; /* Permite hacer hover/click a la marquesina a través del footer vacío */
}

footer button {
  pointer-events: auto; /* Reactiva los clicks solo en los botones */
  background: white;
  color: black;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-tour::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: transparent;
  border: 1px solid black;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

/* Estado visual cuando el sonido esté activo */
.btn-tour.is-playing::before {
  background-color: black;
}

.btn-contact::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: black;
  border-radius: 50%;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 768px) {
  .btn-index {
    /*display: none;*/
  }
  .btn-sound-master {
    justify-self: start;
    grid-column: 2;
  }
  .btn-about {
    grid-column: 3;
  }
}
