/* ==========================================================================
   ESTILOS DE VANGUARDIA (STYLE ROCKSTAR / HIGH-TECH CHROMATIC SCADA)
   Despiece Isométrico 3D en Perspectiva con Ciclo de Animación Infinito
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

:root, :root[data-theme="dark"] {
  --landing-font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --landing-mono: 'JetBrains Mono', monospace;
  
  --bg-body: #060911;
  --bg-surface: #0b1120;
  --bg-card: rgba(15, 23, 42, 0.85);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  
  --neon-cyan: #00f0ff;
  --neon-magenta: #ff007f;
  --neon-indigo: #6366f1;
  --neon-amber: #f59e0b;
  --neon-emerald: #10b981;
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --hero-glow: radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.22) 0%, rgba(255, 0, 127, 0.08) 45%, transparent 75%);
  --card-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

:root[data-theme="light"] {
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  --hero-glow: radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.12) 0%, rgba(6, 182, 212, 0.08) 50%, transparent 75%);
  --card-glow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 0 0 1px #e2e8f0;
}

body {
  font-family: var(--landing-font);
  background-color: var(--bg-body);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   1. NAVBAR VIDRIO ESMERILADO (FROSTED GLASS CON SESIÓN DINÁMICA)
   ========================================================================== */
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 36px;
  background: rgba(6, 9, 17, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

:root[data-theme="light"] .landing-nav {
  background: rgba(255, 255, 255, 0.88);
}

.landing-nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.landing-nav-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff007f 0%, #6366f1 50%, #00f0ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 1.125rem;
  box-shadow: 0 4px 16px rgba(255, 0, 127, 0.35);
}

.landing-nav-title {
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.landing-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.landing-nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: color 0.15s ease;
}

.landing-nav-link:hover {
  color: var(--neon-cyan);
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
}

/* ==========================================================================
   2. HERO SECTION DE INGENIERÍA SOBRIA Y DIRECTA
   ========================================================================== */
.hero-section {
  position: relative;
  padding: 100px 24px 70px;
  max-width: 1320px;
  margin: 0 auto;
  text-align: center;
  background: var(--hero-glow);
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.4);
  font-size: 0.8125rem;
  font-weight: 700;
  color: #e0e7ff;
  margin-bottom: 28px;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.25);
}

:root[data-theme="light"] .hero-pill-badge {
  background: #ffffff;
  color: #3730a3;
  border-color: #c7d2fe;
}

.hero-title {
  font-size: clamp(2.75rem, 5.8vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.06;
  margin: 0 auto 24px;
  max-width: 1100px;
  color: var(--text-main);
}

.hero-title-gradient {
  background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 35%, #00f0ff 70%, #ff007f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

:root[data-theme="light"] .hero-title-gradient {
  background: linear-gradient(135deg, #0f172a 0%, #4338ca 40%, #0284c7 75%, #be185d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: clamp(1.0625rem, 1.8vw, 1.25rem);
  color: var(--text-muted);
  max-width: 820px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

.hero-cta-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.btn-hero-primary {
  height: 50px;
  padding: 0 30px;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 700;
  background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  box-shadow: 0 4px 25px rgba(236, 72, 153, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 35px rgba(236, 72, 153, 0.6);
}

.btn-hero-secondary {
  height: 50px;
  padding: 0 26px;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text-main) !important;
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.btn-hero-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--neon-cyan);
  transform: translateY(-2px);
}

/* ==========================================================================
   3. DESPIECE ISOMÉTRICO 3D EN PERSPECTIVA CON CARRUSEL DE ANIMACIÓN INFINITO
   ========================================================================== */
.exploded-section {
  padding: 80px 24px 110px;
  max-width: 1440px;
  margin: 0 auto;
}

.section-header-center {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 40px;
}

.section-tag {
  font-size: 0.8125rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--neon-cyan);
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(2rem, 3.8vw, 2.875rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin: 0 0 14px;
  line-height: 1.15;
}

.section-desc {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Barra de Control de Despiece */
.exploded-controller-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px 24px;
  border-radius: 9999px;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: var(--card-glow);
  flex-wrap: wrap;
}

.exploded-slider {
  flex: 1;
  accent-color: var(--neon-cyan);
  cursor: pointer;
  height: 6px;
}

/* Escenario 3D */
.stage-3d-wrapper {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 48px;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 28px;
  padding: 48px;
  box-shadow: var(--card-glow);
  position: relative;
  overflow: visible; /* Evita que el resplandor o la capa superior se recorten */
}

@media (max-width: 1080px) {
  .stage-3d-wrapper {
    grid-template-columns: 1fr;
    padding: 32px;
  }
}

.stage-viewport {
  height: 620px;
  perspective: 1400px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  user-select: none;
  overflow: visible;
  padding-top: 50px; /* Offset para centrar la pila proyectada */
}

.isometric-stack {
  position: relative;
  width: 300px;
  height: 300px;
  transform-style: preserve-3d;
  transform: rotateX(54deg) rotateZ(-30deg) translateY(40px); /* Desplazamiento hacia abajo para centrar en el viewport */
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base de cada placa del despiece en perspectiva */
.layer-plate {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease, border-color 0.5s ease, opacity 0.5s ease, filter 0.5s ease;
  cursor: pointer;
  overflow: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  will-change: transform, opacity;
}

.layer-plate:hover, .layer-plate.active-plate {
  border-color: var(--neon-cyan) !important;
  box-shadow: 0 0 45px rgba(0, 240, 255, 0.7), 0 35px 70px rgba(0, 0, 0, 0.95) !important;
  filter: brightness(1.2) drop-shadow(0 0 20px rgba(0, 240, 255, 0.4));
  z-index: 30 !important;
}

/* ==========================================================================
   COMPONENTES INTERNOS REALISTAS DE CADA CAPA
   ========================================================================== */

/* CAPA 1: CHASIS RUGERIZADO IP67 CON DISIPADORES */
.layer-chassis-pro {
  background: #0f172a !important;
  border: 2px solid #475569;
}
.chassis-vent-fins {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
}
.vent-fin {
  width: 8px;
  height: 48px;
  background: #020617;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}
.corner-bolt {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #94a3b8 30%, #334155 80%);
  border: 1px solid #1e293b;
  box-shadow: inset 0 1px 2px #ffffff;
}

/* CAPA 2: BLINDAJE RF CON GRABADO LÁSER Y ANTENA EN ORO */
.layer-rf-pro {
  background: #1e293b !important;
  border: 2px solid #94a3b8;
  color: #f8fafc;
}
.rf-shield-can {
  background: linear-gradient(145deg, #334155 0%, #0f172a 100%);
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.gold-antenna-trace {
  height: 24px;
  background: repeating-linear-gradient(90deg, #f59e0b, #f59e0b 8px, transparent 8px, transparent 14px);
  border-bottom: 2px solid #f59e0b;
  margin-top: 6px;
}

/* CAPA 3: MICROCONTROLADOR ESP32 SILICON DIE & WIRE BONDS */
.layer-silicon-pro {
  background: #090d16 !important;
  border: 2px solid #38bdf8;
}

/* CAPA 4: PCB ENIG GOLD */
.layer-pcb-pro {
  background: #020617 !important;
  border: 2px solid #f59e0b;
}

/* CAPA 5: RUST HOT-PATH ENGINE */
.layer-rust-pro {
  background: #180808 !important;
  border: 2px solid #ef4444;
}

/* CAPA 6: TIMESCALEDB SCADA CLOUD */
.layer-cloud-pro {
  background: #021a12 !important;
  border: 2px solid #10b981;
}
.silicon-qfn-chip {
  width: 140px;
  height: 140px;
  margin: auto;
  background: #020617;
  border: 2px solid #00f0ff;
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}
.silicon-core-glow {
  width: 50px;
  height: 50px;
  background: radial-gradient(circle, #00f0ff 0%, #6366f1 70%);
  border-radius: 8px;
  animation: pulseSilicon 2s infinite ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 1.25rem;
}
@keyframes pulseSilicon {
  0% { transform: scale(0.95); box-shadow: 0 0 10px #00f0ff; }
  50% { transform: scale(1.08); box-shadow: 0 0 25px #ff007f; }
  100% { transform: scale(0.95); box-shadow: 0 0 10px #00f0ff; }
}

/* CAPA 4: PCB MULTICAPA MATTE BLACK CON PISTAS Y HEADER GPIO */
.layer-pcb-pro {
  background: #0b1120;
  border: 2px solid #f59e0b;
  background-image: 
    radial-gradient(#f59e0b 1px, transparent 1px),
    radial-gradient(rgba(245, 158, 11, 0.15) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}
.pcb-gpio-header {
  display: flex;
  justify-content: space-between;
  padding: 4px 10px;
  background: #020617;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  font-family: var(--landing-mono);
  font-size: 0.625rem;
  color: #f59e0b;
  font-weight: 700;
}

/* CAPA 5: KERNEL FREERTOS & RUST HOT PATH */
.layer-rust-pro {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 2px solid #ef4444;
}
.rust-threads-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: auto;
  width: 90%;
}
.rust-thread-box {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  border-radius: 8px;
  padding: 8px;
  font-family: var(--landing-mono);
  font-size: 0.6875rem;
  color: #fca5a5;
  text-align: center;
}

/* CAPA 6: TIMESCALEDB RLS & SCADA CLOUD MATRIX */
.layer-cloud-pro {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 2px solid #10b981;
}
.cloud-matrix-box {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10b981;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  font-family: var(--landing-mono);
}

/* PANEL LATERAL DE INFORMACIÓN */
.layer-info-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.layer-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.layer-info-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.layer-info-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.layer-spec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 6px;
}

.layer-spec-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 14px 18px;
  border-radius: 12px;
}

.layer-spec-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.layer-spec-val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--landing-mono);
}

/* Controles de Navegación del Carrusel */
.carousel-nav-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.carousel-indicators {
  display: flex;
  gap: 8px;
  align-items: center;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.carousel-dot.active {
  width: 28px;
  border-radius: 6px;
  background: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
}

/* ==========================================================================
   4. SHOWCASE DE ACTIVOS SCADA Y BENTO GRIDS
   ========================================================================== */
.scada-showcase-section, .bento-section {
  padding: 90px 24px;
  max-width: 1440px;
  margin: 0 auto;
}

.scada-demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 1024px) {
  .bento-grid { grid-template-columns: 1fr; }
}

.bento-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 36px;
  box-shadow: var(--card-glow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.bento-card:hover {
  border-color: var(--neon-cyan);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 240, 255, 0.2);
}

.bento-card.span-2 {
  grid-column: span 2;
}

@media (max-width: 1024px) {
  .bento-card.span-2 { grid-column: span 1; }
}

.bento-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 24px;
}

.bento-title {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.bento-text {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   5. SITEMAP FOOTER
   ========================================================================== */
.landing-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 70px 36px 36px;
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}

@media (max-width: 1080px) {
  .footer-container {
    grid-template-columns: 1fr repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .footer-container {
    grid-template-columns: 1fr;
  }
}

.footer-col h4 {
  font-size: 0.8125rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-main);
  margin: 0 0 18px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.footer-col a:hover {
  color: var(--neon-cyan);
}

.footer-bottom {
  max-width: 1440px;
  margin: 0 auto;
  padding-top: 28px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 16px;
}
