/* variables globales y reseteo de diseño de lujo */
:root {
  --color-bg: #1A1A1A;
  --color-glow: #F5E073;
  --color-text-primary: #F9F7F2;
  --font-serif: "Playfair Display", Georgia, serif;
  --font-sans: "Montserrat", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  overflow-x: hidden;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

/* Selección de texto elegante */
::selection {
  background: rgba(249, 247, 242, 0.2);
  color: var(--color-text-primary);
}

/* REJILLA DE TILES INTERACTIVA (100% Pantalla, background) */
#grid-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  background-color: #070707;
  z-index: 1;
  overflow: hidden;
  gap: 4px; /* Rendijas precisas de 4px */
  padding: 2px;
  perspective: 1400px;
  transform-style: preserve-3d;
  pointer-events: none; /* Asegura eventos interactivos en la interfaz */
}

.grid-tile {
  position: relative;
  background-color: #0E0E0E;
  border: 1px solid rgba(255, 255, 255, 0.02);
  transform-style: preserve-3d;
  transition: border-color 0.4s ease;
}

/* El led difuso dorado/ámbar instalado en la base inferior */
.tile-backlight {
  position: absolute;
  inset: 0px;
  opacity: 0;
  pointer-events: none;
  background: transparent;
  transform: translateZ(-15px);
  box-shadow: 0 0 25px 4px rgba(255, 235, 0, 0.4), inset 0 0 15px rgba(255, 235, 0, 0.6); /* Amarillo corporativo */
  border-radius: 2px;
  transition: opacity 0.3s ease-out;
}

.active-tile .tile-backlight {
  opacity: var(--backlight-opacity, 0) !important;
}

/* El gradiente radial ('glow' de tonos amarillos/dorados de lujo) */
.tile-glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(
    180px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
    rgba(255, 235, 0, 0.12), /* Amarillo #FFEB00 con opacidad baja */
    transparent 85%
  );
  transition: opacity 0.3s ease-out;
  pointer-events: none;
  z-index: 10;
}

/* Activación del brillo sutil */
.active-tile .tile-glow {
  opacity: 1 !important;
}

/* ESTRUCTURACIÓN DE CAPAS */
header, main, footer, .modal-overlay {
  position: relative;
  z-index: 10;
}

header, footer {
  pointer-events: none;
}

/* interactivos explícitos */
.p-interactive {
  pointer-events: auto;
}

/* HEADER BAR */
header {
  width: 100%;
  max-width: 80rem; 
  margin: 0 auto;
  padding: 4.5rem 1.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.location-box {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0 auto; /* Centra el bloque dentro del header */
}

.location-icon {
  color: rgba(249, 247, 242, 0.4);
}

.coord-labels {
  display: flex;
  flex-direction: column;
}

.locator-title {
  font-size: 10px;
  letter-spacing: 0.22em;
  font-weight: 500;
  color: rgba(249, 247, 242, 0.8);
  text-transform: uppercase;
}

.coord-nums {
  font-size: 9px;
  letter-spacing: 0.18em;
  color: rgba(249, 247, 242, 0.4);
  font-family: monospace;
  margin-top: 0.125rem;
}

.code-export-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  color: rgba(249, 247, 242, 0.7);
  font-size: 10px;
  letter-spacing: 0.16em;
  font-weight: 500;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.35s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.code-export-btn:hover {
  background: rgba(249, 247, 242, 0.1);
  border-color: rgba(249, 247, 242, 0.3);
  color: var(--color-text-primary);
  transform: scale(1.02);
}

/* CORE PRESENTATION ZONE */
main {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  width: 100%;
}

.main-view-container {
  text-align: center;
  max-width: 42rem; /* ~670px */
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 85px; /* Desplazado un renglón de celda exacto hacia abajo */
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--color-text-primary);
  user-select: none;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  font-variant-numeric: lining-nums;
}

@media (min-width: 768px) {
  .brand-title {
    font-size: 4.5rem;
  }
}
@media (min-width: 1024px) {
  .brand-title {
    font-size: 5rem;
  }
}

.tagline-container {
  margin-bottom: 2.5rem;
  max-width: 32rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tagline-line {
  font-size: 11px;
  letter-spacing: 0.22em;
  font-weight: 300;
  text-transform: uppercase;
  line-height: 1.6;
}

.tagline-line.first {
  color: #FFFFFF; /* Blanco Puro */
}

.tagline-line.second {
  color: #FFFFFF; /* Blanco Puro */
  font-style: normal;
}

.contact-reference {
  font-size: 11px;
  letter-spacing: 0.24em;
  font-weight: 500;
  color: rgba(249, 247, 242, 0.8);
  text-transform: uppercase;
  user-select: none;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

/* CONTENEDORES DE CONTACTO MODERADOS (Limpieza de estilos inline) */
.contact-buttons-wrapper {
  margin: 10px auto 2.5rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 3.5rem;
}

.contact-btn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: #FFFFFF;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.contact-btn-item:hover {
  transform: scale(1.05);
}

.contact-icon-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.contact-btn-item:hover .contact-icon-circle {
  color: #FFEB00;
  border-color: #FFEB00;
  background: rgba(255, 235, 0, 0.05);
}

.contact-label {
  font-size: 9px;
  letter-spacing: 0.16em;
  font-weight: 500;
  text-transform: uppercase;
  color: rgba(249, 247, 242, 0.6);
  transition: color 0.3s ease;
}

.contact-btn-item:hover .contact-label {
  color: #FFEB00;
}

.overview-trigger-box {
  margin-top: 1.5rem;
}

#logo-badge-trigger {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: #FFFFFF;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
  padding-bottom: 2px;
  transition: color 0.3s ease;
}

/* FOOTER CREDITS */
footer {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: rgba(249, 247, 242, 0.2);
  font-size: 9px;
  letter-spacing: 0.2em;
}

@media (min-width: 640px) {
  footer {
    flex-direction: row;
    gap: 0.5rem;
  }
}

.footer-left {
  text-transform: uppercase;
  text-align: center;
  font-variant-numeric: lining-nums;
}

@media (min-width: 640px) {
  .footer-left {
    text-align: left;
    flex: 1;
  }
}

.footer-center {
  opacity: 0.65;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.footer-center img {
  height: 32px !important;
  width: auto;
  display: block;
  opacity: 0.7;
  transition: opacity 0.35s ease;
}

.footer-center:hover img {
  opacity: 1;
}

.footer-right {
  text-transform: uppercase;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  letter-spacing: 0.16em;
}

@media (min-width: 640px) {
  .footer-right {
    flex: 1;
    justify-content: flex-end;
  }
}

/* OVERLAY / MODAL DE DIÁLOGOS */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: #242424;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 1rem;
  width: 100%;
  max-width: 56rem;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(0.96) translateY(30px);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.show .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.modal-headline-wrapper {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.modal-badge {
  padding: 0.5rem;
  border-radius: 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-titles-box {
  display: flex;
  flex-direction: column;
}

.modal-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-primary);
}

@media (min-width: 768px) {
  .modal-title {
    font-size: 13px;
  }
}

.modal-subtitle {
  font-size: 10px;
  color: rgba(249, 247, 242, 0.4);
  display: none;
  line-height: 1.2;
  margin-top: 0.125rem;
  font-weight: 300;
}

@media (min-width: 768px) {
  .modal-subtitle {
    display: block;
  }
}

.modal-action-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: white;
  transition: all 0.3s ease;
}

.copy-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.copy-button.copied {
  background: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
  border-color: rgba(16, 185, 129, 0.3);
}

.close-circle-btn {
  padding: 0.625rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.close-circle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* CODE DISPLAY SECTION */
.code-display-body {
  flex-grow: 1;
  overflow: auto;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.4);
  color: #A9B1D6;
  font-family: monospace;
  font-size: 11px;
  line-height: 1.5;
  min-height: 300px;
}

@media (min-width: 768px) {
  .code-display-body {
    font-size: 12px;
  }
}

.code-pre {
  white-space: pre;
  overflow-x: auto;
  user-select: all;
}

/* MODAL FOOTER */
.modal-footer {
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(249, 247, 242, 0.3);
  text-transform: uppercase;
  font-family: monospace;
}

@media (min-width: 768px) {
  .modal-footer {
    flex-direction: row;
    gap: 0.5rem;
  }
}

.footer-badge-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: rgba(253, 251, 247, 0.4);
}

/* EXPOSICIÓN DE FICHA TÉCNICA */
.factsheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  /* Opacidad reducida del 0.9 al 0.2 para revelar el grid inferior */
  background-color: rgba(10, 10, 10, 0.2);
  /* Desenfoque reducido de 12px a 2px para permitir ver el efecto luminoso */
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.factsheet-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.factsheet-card {
  width: 100%;
  max-width: 56rem;
  
  /* FONDO SÓLIDO Y OPACO */
  background-color: #1A1A1A; 
  
  /* HUD DEFINITIVO (GRID DE TILES) */
  background-image: 
    linear-gradient(to bottom, 
      rgba(255, 255, 255, 0.05) 0px, rgba(255, 255, 255, 0.05) 1px, 
      transparent 1px, transparent 84px, 
      rgba(255, 255, 255, 0.05) 84px, rgba(255, 255, 255, 0.05) 85px, 
      transparent 85px, transparent 89px
    ),
    linear-gradient(to right, 
      rgba(255, 255, 255, 0.05) 0px, rgba(255, 255, 255, 0.05) 1px, 
      transparent 1px, transparent 84px, 
      rgba(255, 255, 255, 0.05) 84px, rgba(255, 255, 255, 0.05) 85px, 
      transparent 85px, transparent 89px
    );
  background-size: 89px 89px; 
  background-position: center top;
  
  /* ESTRUCTURA Y SOMBRA DE PROFUNDIDAD */
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  
  /* COMPORTAMIENTO Y ANIMACIÓN */
  position: relative;
  cursor: default;
  transform: scale(0.98) translateY(40px);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  max-height: 90vh;
}
  
  /* RESTO DE PROPIEDADES INTACTAS */
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  position: relative;
  cursor: default;
  transform: scale(0.98) translateY(40px);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  max-height: 90vh;
}

@media (min-width: 768px) {
  .factsheet-card {
    padding: 1.5rem;
  }
}

.factsheet-overlay.show .factsheet-card {
  transform: scale(1) translateY(0);
}

.fs-glow-1 {
  position: absolute;
  top: 0;
  right: 0;
  width: 20rem;
  height: 20rem;
  background: rgba(249, 247, 242, 0.02);
  border-radius: 9999px;
  filter: blur(100px);
  pointer-events: none;
}

.fs-glow-2 {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 20rem;
  height: 20rem;
  background: rgba(249, 247, 242, 0.01);
  border-radius: 9999px;
  filter: blur(100px);
  pointer-events: none;
}

.factsheet-header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .factsheet-header {
    flex-direction: row;
    align-items: center;
  }
}

.fs-pre-sale {
  font-size: 10px;
  letter-spacing: 0.24em;
  font-weight: 600;
  color: rgba(253, 230, 138, 0.7);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
}

.fs-main-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  letter-spacing: 0.15em;
  color: var(--color-text-primary);
  text-transform: uppercase;
  font-weight: 300;
}

@media (min-width: 768px) {
  .fs-main-title {
    font-size: 2.25rem;
  }
}

.fs-subtitle {
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: rgba(249, 247, 242, 0.5);
  margin-top: 0.375rem;
  font-weight: 300;
}

.fs-back-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  color: var(--color-text-primary);
  font-size: 11px;
  letter-spacing: 0.1em;
  font-weight: 500;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s ease;
}

.fs-back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* BENTO FACT GRID */
.fact-grid {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 2rem;
  row-gap: 1rem;
  margin: 0.5rem 0;
}

@media (min-width: 768px) {
  .fact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-row-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 1rem;
  transition: border-color 0.3s ease;
}

.grid-row-item:hover {
  border-color: rgba(249, 247, 242, 0.15);
}

@media (min-width: 768px) {
  .grid-row-item:last-child {
    grid-column: 1 / -1;
  }
}

.fs-row-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: rgba(249, 247, 242, 0.3);
  text-transform: uppercase;
  font-weight: 500;
}

.fs-row-value {
  font-size: 12px;
  color: rgba(249, 247, 242, 0.85);
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.03em;
}

@media (min-width: 768px) {
  .fs-row-value {
    font-size: 14px;
  }
}

/* FACTS FOOTER */
.fact-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.50rem;
  margin-top: 0.50rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 10px;
  text-align: center;
}

@media (min-width: 640px) {
  .fact-footer {
    flex-direction: row;
    text-align: left;
  }
}

.fact-footer-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(249, 247, 242, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.fact-footer-right {
  letter-spacing: 0.2em;
  font-weight: 600;
  color: rgba(253, 230, 138, 0.6);
  font-family: monospace;
}

/* Capa intermedia fija para el logo de fondo en el hueco superior */
.matrix-logo-overlay {
  position: fixed;
  top: 21.5%; /* Centrado en el espacio vacío vertical */
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2; /* Por encima de los tiles (1), por debajo del texto (10) */
  pointer-events: none;
  user-select: none;
}

.matrix-logo-overlay img {
  width: 21vmin;  
  height: 21vmin; 
  object-fit: contain;
  opacity: 0.25; /* Transparencia exacta al 2.5% */
}