/**
 * FULL-SCREEN HERO BACKGROUND SIMULATION (6-9s LOOP)
 * Toda la primera sección como fondo dinámico:
 * - Media pantalla izquierda: Código escribiéndose
 * - Media pantalla derecha: Página web editándose en tiempo real
 * - Carlos Hernández al frente con tipografía nítida y contraste perfecto
 */

/* ========================================================
   FONDO COMPLETO DE LA SECCIÓN HERO
   ======================================================== */
.hero-fullscreen-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

/* Lienzo dividido (Split Canvas: 50% / 50%) */
.hero-split-canvas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  height: 100%;
  opacity: 1;
}

/* --------------------------------------------------------
   MEDIA PANTALLA IZQUIERDA: CÓDIGO ESCRIBIÉNDOSE
   -------------------------------------------------------- */
.bg-code-panel {
  background: #08101E;
  border-right: 1px solid rgba(34, 211, 238, 0.25);
  display: flex;
  flex-direction: column;
  padding: calc(var(--nav-height) + 2rem) 2.5rem 2rem 3rem;
  overflow: hidden;
  position: relative;
}

.bg-code-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.2);
  padding: 0.25rem 0.85rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  align-self: flex-start;
}

.bg-code-body {
  display: flex;
  font-family: var(--font-mono);
  font-size: clamp(0.92rem, 1.25vw, 1.15rem);
  line-height: 1.85;
  color: #FFFFFF;
  overflow: hidden;
}

.bg-code-gutter {
  padding-right: 1.25rem;
  color: #64748B;
  user-select: none;
  text-align: right;
  border-right: 1px solid rgba(34, 211, 238, 0.2);
}

.bg-code-gutter span {
  display: block;
}

.bg-code-text {
  padding-left: 1.25rem;
  flex: 1;
  white-space: pre;
}

/* Resaltado de sintaxis */
.tok-kw  { color: #F472B6; font-weight: 600; }
.tok-fn  { color: #38BDF8; }
.tok-str { color: #A7F3D0; }
.tok-num { color: #FBBF24; }
.tok-var { color: #F4F7FB; }
.tok-cm  { color: #64748B; font-style: italic; }

.bg-cursor {
  display: inline-block;
  width: 2.5px;
  height: 1.2em;
  background: var(--accent-cyan);
  vertical-align: middle;
  margin-left: 2px;
  animation: blink-cursor 0.65s infinite;
  box-shadow: 0 0 10px var(--accent-cyan), 0 0 4px #FFFFFF;
}

/* --------------------------------------------------------
   MEDIA PANTALLA DERECHA: PÁGINA WEB EDITÁNDOSE EN VIVO
   -------------------------------------------------------- */
.bg-web-panel {
  background: #091220;
  display: flex;
  flex-direction: column;
  padding: calc(var(--nav-height) + 2rem) 3rem 2rem 2.5rem;
  overflow: hidden;
  position: relative;
}

.bg-web-body {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 580px;
}

/* Componentes visuales que se construyen con el código */
.bg-mock-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.15rem;
  background: rgba(20, 38, 61, 0.85);
  border-radius: 8px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.bg-mock-nav.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.bg-mock-logo {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.bg-mock-chip {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  font-weight: 600;
}

/* Tarjeta KPI en la página de fondo */
.bg-mock-kpi {
  background: rgba(20, 38, 61, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1.15rem;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.bg-mock-kpi.is-visible {
  opacity: 1;
  transform: scale(1);
}

.bg-mock-kpi.is-highlight {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 25px -5px rgba(34, 211, 238, 0.4);
}

.bg-kpi-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.bg-kpi-val {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.bg-kpi-progress {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.bg-kpi-progress-bar {
  width: 0%;
  height: 100%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  transition: width 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Botón interactivo y notificación */
.bg-mock-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.bg-mock-actions.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.bg-mock-action-btn {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  background: var(--accent-cyan);
  color: #0B1220;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.3);
  transition: transform 0.2s ease, background 0.2s ease;
}

.bg-mock-action-btn.is-clicked {
  transform: scale(0.92);
  background: #38BDF8;
}

.bg-mock-toast {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: #34D399;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.bg-mock-toast.is-visible {
  opacity: 1;
}

/* ========================================================
   CAPA DE DEGRADADO (OVERLAY) CON 60% DE TRANSPARENCIA
   ======================================================== */
.hero-cinema-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: rgba(11, 18, 32, 0.40); /* 60% de transparencia real */
}

/* Barra de línea de tiempo inferior del bucle de 8s */
.hero-loop-timeline {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  z-index: 4;
}

.hero-loop-fill {
  width: 0%;
  height: 100%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

/* ========================================================
   CONTENIDO PRINCIPAL DEL HERO (AL FRENTE CON 60% TRANSPARENCIA)
   ======================================================== */
.hero-foreground-content {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 920px;
  padding: 2rem 0;
}

.hero-glass-card {
  background: rgba(11, 18, 32, 0.40); /* 60% de transparencia real */
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 4vw, 3.25rem);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.6),
    0 0 35px -5px rgba(34, 211, 238, 0.25);
}

.hero-loop-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
}

.hero-title-name {
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}

.hero-specialty {
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  font-weight: 600;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  margin-bottom: 1.5rem;
}

.hero-lead-box {
  margin-bottom: 2rem;
}

.hero-lead-main {
  font-size: clamp(1.2rem, 2.1vw, 1.65rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.hero-lead-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 780px;
}
