/* =====================================================
   DIMENSION3D — matrix.css
   ADITIVO: no sobreescribe nada de main.css
   Agrega verde #00ff41 como tercer acento (matrix)
   ===================================================== */

/* ── Nueva variable matrix (adicional a purple/cyan) ─ */
:root {
  --matrix:      #00ff41;
  --matrix-mid:  #00cc33;
  --matrix-dark: #003d12;
  --matrix-dim:  rgba(0, 255, 65, 0.07);
  --matrix-glow: rgba(0, 255, 65, 0.25);
}

/* ═══════════════════════════════════════════════════
   1. HERO — canvas matrix rain (index + page-heroes)
═══════════════════════════════════════════════════ */

/* ── Canvas fijo global — persiste en todo el scroll ─ */
#matrix-bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;  /* el negro del canvas se vuelve transparente */
}

/* Page-hero secondary canvases (servicios, quienes-somos, contact) */
.page-matrix-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: screen;
}

/* Ensure page-hero text/content sits above canvas */
.page-hero .container {
  position: relative;
  z-index: 1;
}

#matrix-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.09;
  mix-blend-mode: screen;
}

/* ═══════════════════════════════════════════════════
   2. TERMINAL WINDOW — about section overlay
═══════════════════════════════════════════════════ */
.terminal-window {
  position: absolute;
  bottom: -10px;
  right: -10px;
  width: 290px;
  background: rgba(0, 5, 0, 0.93);
  border: 1px solid rgba(0, 255, 65, 0.22);
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.6;
  box-shadow:
    0 0 0 1px rgba(0, 255, 65, 0.05),
    0 12px 50px rgba(0, 0, 0, 0.75),
    0 0 40px rgba(0, 255, 65, 0.05);
  backdrop-filter: blur(6px);
  z-index: 20;
  overflow: hidden;
}

.t-titlebar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  background: rgba(0, 255, 65, 0.04);
  border-bottom: 1px solid rgba(0, 255, 65, 0.1);
}

.t-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.t-dot.r { background: #ff5f57; }
.t-dot.y { background: #febc2e; }
.t-dot.g { background: #28c840; }

.t-name {
  color: rgba(0, 255, 65, 0.4);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  margin-left: 4px;
}

.t-body {
  padding: 10px 14px 14px;
  min-height: 148px;
}

.t-line {
  display: block;
  color: var(--matrix);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.t-line.show {
  opacity: 1;
  transform: translateY(0);
}
.t-line.muted  { color: rgba(0, 255, 65, 0.38); }
.t-line.cmd    { color: var(--cyan); }
.t-line.result { color: var(--matrix); }

.t-cursor-blink {
  display: inline-block;
  width: 6px; height: 11px;
  background: var(--matrix);
  vertical-align: middle;
  margin-left: 2px;
  animation: blink-block 1s step-end infinite;
}
@keyframes blink-block {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@media (max-width: 960px) {
  .terminal-window { display: none; }
}

/* Modo inline/flow — sin posicionamiento absoluto (para columnas de texto) */
.terminal-window-inline {
  position: relative;
  bottom: auto;
  right: auto;
  margin-top: 28px;
  width: 100%;
  max-width: 370px;
}

@media (max-width: 960px) {
  .terminal-window-inline { display: block; max-width: 100%; }
}

/* ═══════════════════════════════════════════════════
   3. HOW-WE-WORK — terminal command bar
═══════════════════════════════════════════════════ */
.steps-cmd-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--matrix);
  background: var(--matrix-dim);
  border: 1px solid rgba(0, 255, 65, 0.14);
  border-left: 3px solid var(--matrix-mid);
  border-radius: 0 4px 4px 0;
  padding: 10px 18px;
  margin-bottom: 44px;
  position: relative;
  overflow: hidden;
}

.steps-cmd-bar::before {
  content: '$';
  color: var(--matrix-mid);
  font-weight: 700;
  font-size: 13px;
  margin-right: 2px;
  flex-shrink: 0;
}

.cmd-text { flex: 1; }

.cmd-cursor {
  display: inline-block;
  width: 7px; height: 13px;
  background: var(--matrix);
  vertical-align: middle;
  animation: blink-block 1s step-end infinite;
  animation-delay: 2.8s;
}

/* Data-cmd label on each step card (top-right monospace tag) */
.step-card[data-cmd]::before {
  content: attr(data-cmd);
  position: absolute;
  top: 14px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: rgba(0, 255, 65, 0.28);
  pointer-events: none;
}

/* Green accent on step badge hover (additive — not replacing purple) */
.step-card:hover .step-badge {
  color: var(--matrix-mid);
  border-color: rgba(0, 255, 65, 0.5);
  text-shadow: 0 0 10px var(--matrix-glow);
}

/* Running dot that appears on hover */
.step-run {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--matrix-mid);
  margin-top: 14px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.step-card:hover .step-run { opacity: 1; }

.run-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--matrix);
  box-shadow: 0 0 6px var(--matrix-glow);
  animation: pulse-run 1.3s ease-in-out infinite;
}
@keyframes pulse-run {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.7); opacity: 0.4; }
}

/* ═══════════════════════════════════════════════════
   4. CTA — glitch title effect (pure CSS)
═══════════════════════════════════════════════════ */
.glitch-title {
  position: relative;
  display: inline-block;
}
.glitch-title::before,
.glitch-title::after {
  content: attr(data-glitch);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  white-space: normal;
  width: 100%;
}
.glitch-title::before {
  color: var(--cyan);
  animation: glitch-a 7s infinite 1.5s;
}
.glitch-title::after {
  color: var(--matrix);
  animation: glitch-b 7s infinite 1.9s;
}
@keyframes glitch-a {
  0%, 90%, 100% { opacity: 0; transform: translateX(0); clip-path: none; }
  91%  { opacity: 0.75; transform: translateX(-3px); clip-path: inset(20% 0 55% 0); }
  92%  { opacity: 0.6;  transform: translateX(3px);  clip-path: inset(70% 0 8%  0); }
  93%  { opacity: 0.8;  transform: translateX(-2px); clip-path: inset(40% 0 30% 0); }
  94%  { opacity: 0;    transform: translateX(0); }
}
@keyframes glitch-b {
  0%, 90%, 100% { opacity: 0; transform: translateX(0); clip-path: none; }
  91.5% { opacity: 0.7; transform: translateX(3px);  clip-path: inset(55% 0 18% 0); }
  92.5% { opacity: 0.5; transform: translateX(-3px); clip-path: inset(8%  0 65% 0); }
  93.5% { opacity: 0.7; transform: translateX(2px);  clip-path: inset(30% 0 45% 0); }
  94%   { opacity: 0;   transform: translateX(0); }
}

/* Scrolling binary strip at top of CTA */
#home-cta {
  position: relative;
  overflow: hidden;
}
#home-cta::before {
  content: '01 // SECURE · 10 // DEPLOY · 11 // MONITOR · 01 // BACKUP · 10 // PROTECT · 11 // SCALE · 01 // ENCRYPT · 10 // SCAN · 11 // AUDIT · 01 // SECURE · 10 // DEPLOY';
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 0 32px;
  height: 26px;
  line-height: 26px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  color: var(--matrix);
  opacity: 0.15;
  white-space: nowrap;
  pointer-events: none;
  animation: scroll-strip 22s linear infinite;
}
@keyframes scroll-strip {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* eyebrow matrix accent for specific sections */
#how-we-work .section-eyebrow { color: var(--matrix-mid); }
#how-we-work .section-eyebrow::before { content: '>_'; color: var(--matrix); }

#home-cta .section-eyebrow { color: var(--matrix-mid); }
#home-cta .section-eyebrow::before { content: '>_'; color: var(--matrix); }

/* ═══════════════════════════════════════════════════
   5. GLOBAL DETAILS
═══════════════════════════════════════════════════ */
/* Scrollbar matrix themed */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, var(--purple), var(--matrix-dark));
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--matrix-mid); }

/* Service cards: subtle matrix border on hover (additive) */
.service-card:hover {
  border-color: rgba(0, 255, 65, 0.18);
}
.service-card:hover .service-card-num {
  color: var(--matrix-mid);
  text-shadow: 0 0 10px var(--matrix-glow);
}

/* Footer: matrix tint on brand name */
.footer-copy strong { color: var(--matrix-mid); }

/* ═══════════════════════════════════════════════════
   6. LEGIBILIDAD — contraste y visibilidad del contenido
   Corrige bajo contraste causado por la superposición
   del canvas matrix. Aditivo: no rompe main.css.
═══════════════════════════════════════════════════ */

/* ── Textos secundarios: --gray-500 (#6a6a78) falla WCAG AA ──
   Subimos a ~#9e9eb8 para alcanzar ≥ 4.5:1 sobre fondos oscuros */
.t-small,
.service-feature,
.stat-label,
.contact-item-label,
.form-group label,
.footer-nav-group ul li a,
.footer-nav-group ul li a:visited {
  color: #9e9eb8;
}
.footer-nav-group ul li a:hover {
  color: var(--matrix-mid);
}

/* ── Sombra de texto en headings — pop sobre el overlay matrix ── */
.h-section,
.h-card,
.stat-value {
  text-shadow: 0 1px 14px rgba(2, 2, 6, 0.9), 0 0 30px rgba(2, 2, 6, 0.6);
}

/* ── Hero principal: sombra más intensa (canvas más activo) ── */
.hero-title,
.page-hero .h-section {
  text-shadow:
    0 2px 20px rgba(0, 0, 0, 0.95),
    0 0 60px rgba(0, 0, 0, 0.7);
}
.page-hero .t-body,
.page-hero .section-eyebrow {
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.95);
}

/* ── Cards: backgrounds más sólidos para amortiguar el overlay ── */
.service-card,
.feature-card,
.mvv-card,
.step-card {
  background: rgba(10, 10, 14, 0.97);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* ── Stat blocks: fondo y separación visual ── */
.stat-block {
  background: rgba(10, 10, 14, 0.97);
}

/* ── Contact panels: más opacos ── */
.contact-info-panel,
.contact-form-panel {
  background: rgba(10, 10, 16, 0.98);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ── Form inputs: fondo sólido y labels visibles ── */
.form-group input,
.form-group textarea,
.form-group select {
  background: rgba(6, 6, 10, 0.98);
}

/* ── Footer: siempre por encima del canvas ── */
#site-footer {
  z-index: 2;
  isolation: isolate;
}

/* ── Header: siempre por encima del canvas ── */
#site-header {
  z-index: 100;
  isolation: isolate;
}

/* ── Secciones con fondo sólido: bloquean el canvas visual ──
   Dado que el canvas es fixed z-index:1, secciones con
   z-index:2 y fondo oscuro opaco oscurecen el overlay. ── */
#about,
#how-we-work,
#home-cta,
.services-section,
.about-section,
.team-section,
.values-section,
.contact-section,
.page-section {
  position: relative;
  z-index: 2;
  isolation: isolate;
}

/* ── Sección stats/hud — texto HUD existente más visible ── */
.hero-hud-item .hud-label { color: #9e9eb8; }

/* ── Eyebrows en secciones interiores ── */
.section-eyebrow {
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.8);
}

/* ── Page-hero overlay oscuro detrás del texto ──
   Gradiente vertical que oscurece el bottom del hero
   donde aparece el texto, sin tapar la imagen completa */
.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(6, 6, 8, 0.2) 0%,
    rgba(6, 6, 8, 0.55) 60%,
    rgba(6, 6, 8, 0.75) 100%
  );
  pointer-events: none;
  z-index: 0;
}
.page-hero .container { z-index: 2; } /* texto por encima del overlay */

/* ── MVV section (quienes-somos) ── */
.mvv-card {
  background: rgba(10, 10, 14, 0.97);
}

/* ── Team members ── */
.team-member-name { text-shadow: 0 1px 8px rgba(0,0,0,0.9); }
.team-member-role { color: #9e9eb8; }

/* ═══════════════════════════════════════════════════
   7. CISO CALLOUT — quienes-somos
═══════════════════════════════════════════════════ */
.ciso-callout-section {
  padding: 80px 0;
  position: relative;
  z-index: 2;
  isolation: isolate;
}

.ciso-callout-block {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 40px;
  align-items: start;
  background: rgba(10, 10, 18, 0.97);
  border: 1px solid rgba(0, 255, 65, 0.14);
  border-left: 4px solid var(--matrix-mid);
  border-radius: 8px;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

/* Matrix glow background layer */
.ciso-callout-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top left, rgba(0,255,65,0.04) 0%, transparent 60%);
  pointer-events: none;
}

.ciso-callout-icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: rgba(0, 255, 65, 0.06);
  border: 1px solid rgba(0, 255, 65, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--matrix);
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.08);
}

.ciso-callout-content .section-eyebrow {
  color: var(--matrix-mid);
  display: block;
  margin-bottom: 10px;
}

.ciso-callout-content .h-card {
  margin-bottom: 20px;
  color: var(--white);
}

@media (max-width: 768px) {
  .ciso-callout-block {
    grid-template-columns: 1fr;
    padding: 32px 24px;
  }
  .ciso-callout-icon { width: 52px; height: 52px; font-size: 22px; }
}

/* ═══════════════════════════════════════════════════
   8. LAB STRIP — metodología antes de producción
═══════════════════════════════════════════════════ */
.lab-strip {
  display: flex;
  align-items: center;
  gap: 24px;
  background: rgba(0, 255, 65, 0.04);
  border: 1px solid rgba(0, 255, 65, 0.18);
  border-left: 4px solid var(--matrix-mid);
  border-radius: 6px;
  padding: 20px 28px;
  margin-bottom: 72px;
}

.lab-strip-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 255, 65, 0.1);
  border: 1px solid rgba(0, 255, 65, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--matrix-mid);
  font-size: 18px;
}

.lab-strip-text {
  flex: 1;
}

.lab-strip-text strong {
  display: block;
  color: var(--matrix-mid);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.lab-strip-text p {
  color: var(--gray-400, #9e9eb8);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 640px) {
  .lab-strip { flex-direction: column; align-items: flex-start; gap: 14px; }
}
