:root {
  --bg-deep: #060a12;
  --bg-mid: #0c1220;
  --bg-card: #111827;
  --ink: #f1f5f9;
  --ink-soft: #cbd5e1;
  --muted: #64748b;
  --accent: #3b82f6;
  --accent-glow: #60a5fa;
  --signal: #38bdf8;
  --neon-orange: #f97316;
  --neon-green: #10b981;
  --neon-violet: #8b5cf6;
  --neon-cyan: #06b6d4;
  --alert: #f87171;
  --ok: #34d399;
  --font: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --max: 1080px;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
}

#como-funciona,
#expedientes,
#reconstruccion,
#contacto {
  scroll-margin-top: 5rem;
}

a {
  color: inherit;
  text-decoration: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-radius: 6px;
}

.skip-link:focus {
  top: 1rem;
}

/* ——— Header ——— */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1.25rem, 4vw, 2.5rem);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(6, 10, 18, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.brand-word {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.04em;
}

.nav {
  display: none;
  gap: 1.75rem;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--muted);
}

.nav a:hover {
  color: var(--ink);
}

.header-cta {
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: var(--ink);
  transition: border-color 0.2s, background 0.2s;
}

.header-cta:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

@media (min-width: 800px) {
  .nav {
    display: flex;
  }
}

/* ——— Hero ——— */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem clamp(1.5rem, 5vw, 3rem) 4rem;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(59, 130, 246, 0.18), transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 60%, rgba(56, 189, 248, 0.08), transparent 50%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 52rem;
  text-align: center;
}

.hero-eyebrow {
  margin: 0 0 1.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-glow);
}

.hero-title {
  margin: 0;
  font-size: clamp(2.4rem, 6.5vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.hero-title em {
  font-style: normal;
  background: linear-gradient(135deg, #93c5fd 0%, #3b82f6 50%, #38bdf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 1.75rem auto 0;
  max-width: 32rem;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--muted);
  line-height: 1.65;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2.5rem;
  min-height: 3rem;
  padding: 0 1.75rem;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-primary:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(59, 130, 246, 0.35);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
}

.hero-scroll-hint span {
  display: block;
  width: 1px;
  height: 48px;
  background: linear-gradient(180deg, transparent, rgba(148, 163, 184, 0.5));
  animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ——— Section typography ——— */
.section-label {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-glow);
}

.section-title {
  margin: 0;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  max-width: 18ch;
}

.section-title.light {
  color: var(--ink);
}

.section-lede {
  margin: 1.25rem 0 0;
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.section-lede.light {
  color: var(--ink-soft);
}

/* ——— Engine / flow ——— */
.engine {
  background: var(--bg-mid);
  padding: clamp(5rem, 12vw, 8rem) clamp(1.5rem, 5vw, 3rem);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.engine-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.flow-canvas {
  position: relative;
  margin-top: 3.5rem;
  padding-bottom: 2rem;
}

.flow-sources {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  max-width: 280px;
  margin: 0 auto;
}

.source-line {
  width: 100%;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.source-line.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.source-line span {
  display: block;
  padding: 0.55rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.flow-lines {
  display: block;
  width: 100%;
  max-width: 400px;
  height: 120px;
  margin: 0.5rem auto;
  opacity: 0;
  transition: opacity 1s ease 0.3s;
}

.flow-canvas.is-active .flow-lines {
  opacity: 1;
}

.flow-path {
  fill: none;
  stroke: url(#lineGrad);
  stroke-width: 1;
  opacity: 0.5;
}

.nucleus {
  position: relative;
  width: min(280px, 80vw);
  height: min(280px, 80vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nucleus-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.nucleus-ring-1 {
  animation: nucleus-pulse 4s ease-in-out infinite;
}

.nucleus-ring-2 {
  inset: -12px;
  border-color: rgba(56, 189, 248, 0.12);
  animation: nucleus-pulse 4s ease-in-out infinite reverse;
}

@keyframes nucleus-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.04); opacity: 1; }
}

.nucleus-core {
  position: relative;
  z-index: 1;
  width: 72%;
  height: 72%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(59, 130, 246, 0.35), transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(56, 189, 248, 0.15), transparent 50%),
    linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(96, 165, 250, 0.35);
  box-shadow:
    0 0 60px rgba(59, 130, 246, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nucleus-label {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-glow);
}

.nucleus-name {
  margin: 0.35rem 0 0;
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #fff;
}

.process-stages {
  position: relative;
  height: 2rem;
  margin-top: 2rem;
  text-align: center;
}

.process-stage {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.process-stage.active {
  opacity: 1;
  transform: translateY(0);
  color: var(--accent-glow);
}

.verb-pipeline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 0;
  margin: 3.5rem 0 0;
  padding: 0;
  list-style: none;
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-soft);
}

.verb-pipeline li {
  display: flex;
  align-items: center;
}

.verb-pipeline li:not(:last-child)::after {
  content: "↓";
  margin: 0 0.65rem;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.75rem;
}

@media (min-width: 720px) {
  .verb-pipeline li:not(:last-child)::after {
    content: "→";
  }
}

/* ——— Brain ——— */
.brain {
  padding: clamp(4rem, 10vw, 6rem) clamp(1.5rem, 5vw, 3rem);
  background: var(--bg-deep);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.brain-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.brain-layout {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 900px) {
  .brain-layout {
    grid-template-columns: 1fr auto 1fr;
    gap: 2.5rem;
  }
}

.brain-sources,
.brain-outputs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.brain-sources span,
.brain-outputs span {
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  text-align: center;
}

.brain-outputs span {
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.2);
  background: rgba(52, 211, 153, 0.05);
}

.brain-hub {
  padding: 2rem 1.75rem;
  border-radius: 50%;
  aspect-ratio: 1;
  max-width: 280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(59, 130, 246, 0.2), transparent 60%),
    var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.25);
  box-shadow: 0 0 80px rgba(59, 130, 246, 0.12);
}

.brain-hub-title {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.brain-capabilities {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.8;
  color: var(--muted);
}

/* ——— Dossiers ——— */
.dossiers {
  padding: clamp(5rem, 12vw, 8rem) clamp(1.5rem, 5vw, 3rem);
  background: linear-gradient(180deg, var(--bg-mid) 0%, var(--bg-deep) 100%);
}

.dossiers-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.dossier-list {
  display: grid;
  gap: 1.25rem;
  margin-top: 3rem;
}

@media (min-width: 800px) {
  .dossier-list {
    grid-template-columns: 1.2fr 1fr;
    grid-template-rows: auto auto;
  }

  .dossier-featured {
    grid-row: span 2;
  }
}

.dossier {
  padding: 1.5rem 1.35rem;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  transition: border-color 0.25s, transform 0.25s;
}

.dossier:hover {
  border-color: rgba(59, 130, 246, 0.35);
  transform: translateY(-2px);
}

.dossier-featured {
  border-color: rgba(59, 130, 246, 0.2);
  background:
    linear-gradient(145deg, rgba(59, 130, 246, 0.08) 0%, var(--bg-card) 40%);
}

.dossier-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.dossier-id {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-glow);
}

.dossier-provider {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.dossier-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.dossier-chain li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dossier-chain em {
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.dossier-chain strong {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.chain-arrow {
  width: 1rem;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  position: relative;
  align-self: center;
}

.chain-arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 4px;
  height: 4px;
  border-right: 1px solid rgba(255, 255, 255, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  transform: translateY(-50%) rotate(45deg);
}

.dossier-result-label {
  margin: 0 0 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.dossier-result-type {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dossier-result-amount {
  margin: 0.35rem 0 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #fff;
}

.dossier-result-alert .dossier-result-amount {
  color: var(--alert);
}

.dossier-result-meta {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.conf-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ok);
  background: rgba(52, 211, 153, 0.12);
  border-radius: 4px;
}

/* ——— Reconstruction tower ——— */
.reconstruction {
  padding: clamp(5rem, 12vw, 8rem) clamp(1.5rem, 5vw, 3rem);
  background: var(--bg-deep);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.reconstruction-inner {
  max-width: 32rem;
  margin: 0 auto;
  text-align: center;
}

.reconstruction .section-title,
.reconstruction .section-lede {
  margin-left: auto;
  margin-right: auto;
}

.recon-tower {
  margin-top: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.recon-step {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.recon-step.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.recon-step span {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}

.recon-step-detail span {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-soft);
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.08);
}

.recon-connector {
  width: 1px;
  height: 28px;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.5), rgba(59, 130, 246, 0.1));
}

.recon-connector-wide {
  height: 40px;
}

.recon-outcome {
  margin-top: 0.5rem;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.recon-outcome p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-glow);
}

/* ——— Close ——— */
.close {
  padding: clamp(5rem, 14vw, 9rem) clamp(1.5rem, 5vw, 3rem);
  text-align: center;
  background:
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(59, 130, 246, 0.12), transparent 60%),
    var(--bg-mid);
}

.close-inner {
  max-width: 36rem;
  margin: 0 auto;
}

.close h2 {
  margin: 0;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.close p {
  margin: 1rem 0 0;
  color: var(--muted);
}

.close-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  margin-top: 2rem;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  transition: border-color 0.2s, color 0.2s;
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--ink);
}

.close-email {
  margin-top: 1.5rem !important;
  font-size: 0.9rem;
}

.close-email a:hover {
  color: var(--accent-glow);
}

/* ——— Footer ——— */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  padding: 2rem clamp(1.5rem, 5vw, 3rem) 2.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.site-footer strong {
  color: var(--ink-soft);
  font-weight: 700;
}

/* ——— Scroll reveal ——— */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }

  .recon-step,
  .source-line,
  .process-stage {
    opacity: 1;
    transform: none;
  }

  .flow-particle {
    display: none;
  }
}

/* ——— ADN Comercial · motor vivo ——— */
.dna-engine {
  position: relative;
  overflow: hidden;
  padding: clamp(5rem, 12vw, 8rem) clamp(1.25rem, 5vw, 3rem);
  background:
    radial-gradient(ellipse 70% 45% at 50% 40%, rgba(37, 99, 235, 0.1), transparent 65%),
    linear-gradient(180deg, #0c1220 0%, #060a12 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dna-engine-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.dna-title {
  margin: 0;
  max-width: 20ch;
  font-size: clamp(2.1rem, 5.2vw, 3.7rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.dna-title em,
.truth-statement em {
  font-style: normal;
  background: linear-gradient(120deg, #93c5fd, #3b82f6 55%, #38bdf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dna-intro {
  max-width: 40rem;
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.dna-stage {
  position: relative;
  margin-top: 3.5rem;
  min-height: 760px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.07), transparent 45%),
    rgba(5, 9, 17, 0.72);
  overflow: hidden;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.03);
}

.dna-phase-copy {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 5;
  max-width: 20rem;
}

.dna-phase-number {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent-glow);
}

.dna-phase-title {
  margin: 0.35rem 0 0;
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.dna-phase-detail {
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.dna-visual {
  position: relative;
  width: 100%;
  min-height: 700px;
}

.dna-network {
  display: block;
  width: 100%;
  height: 700px;
}

.dna-orbits ellipse {
  fill: none;
  stroke: rgba(96, 165, 250, 0.07);
  stroke-width: 1;
  stroke-dasharray: 3 10;
}

.dna-edge {
  stroke: rgba(96, 165, 250, 0.18);
  stroke-width: 0.85;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.dna-node {
  fill: #60a5fa;
  opacity: 0;
  transition: opacity 0.65s ease, r 0.4s ease, fill 0.4s ease;
}

.dna-stage.is-running .dna-edge,
.dna-stage.is-running .dna-node {
  opacity: 1;
}

.dna-node.node-product { fill: #38bdf8; }
.dna-node.node-document { fill: #818cf8; }
.dna-node.node-provider { fill: #34d399; }

.dna-stage[data-phase="0"] .dna-edge { opacity: 0.08; }
.dna-stage[data-phase="0"] .dna-node { opacity: 0.3; }
.dna-stage[data-phase="1"] .dna-edge { opacity: 0.26; }
.dna-stage[data-phase="1"] .dna-node { opacity: 0.65; }
.dna-stage[data-phase="2"] .dna-edge { opacity: 0.46; }
.dna-stage[data-phase="2"] .dna-node { opacity: 0.9; }
.dna-stage[data-phase="3"] .dna-edge { opacity: 0.33; }
.dna-stage[data-phase="3"] .dna-node { opacity: 0.82; }

.dna-stage[data-phase="3"] .dna-node.node-alert {
  fill: #f87171;
  opacity: 1;
  filter: url(#alertGlow);
  animation: alert-node-pulse 1.8s ease-in-out infinite;
}

@keyframes alert-node-pulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

.dna-core-ring {
  fill: none;
  stroke: rgba(96, 165, 250, 0.26);
  stroke-width: 1;
  transform-origin: 450px 350px;
}

.ring-a { animation: dna-breathe 5s ease-in-out infinite; }
.ring-b {
  stroke: rgba(56, 189, 248, 0.13);
  stroke-dasharray: 3 8;
  animation: dna-spin 24s linear infinite;
}

@keyframes dna-breathe {
  0%, 100% { transform: scale(0.96); opacity: 0.55; }
  50% { transform: scale(1.06); opacity: 1; }
}

@keyframes dna-spin {
  to { transform: rotate(360deg); }
}

.dna-core-kicker {
  fill: #93c5fd;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 4px;
}

.dna-core-name {
  fill: #fff;
  font-family: var(--font);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.dna-core-status {
  fill: #64748b;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 500;
}

.dna-source-labels text {
  fill: #475569;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
}

.dna-ingest {
  position: absolute;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 4;
  display: grid;
  gap: 0.25rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.dna-stage.is-running .dna-ingest {
  opacity: 1;
  transform: none;
}

.dna-ingest span {
  font-size: 0.72rem;
  color: #475569;
}

.dna-ingest strong {
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.dna-alerts {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dna-alert {
  position: absolute;
  padding: 0.35rem 0.55rem;
  font-size: 0.64rem;
  font-weight: 600;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.45);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 5px;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.dna-stage[data-phase="3"] .dna-alert {
  opacity: 1;
  transform: scale(1);
}

.alert-a { top: 23%; left: 22%; transition-delay: 0.1s; }
.alert-b { top: 31%; right: 16%; transition-delay: 0.35s; }
.alert-c { bottom: 30%; left: 18%; transition-delay: 0.6s; }
.alert-d { bottom: 20%; right: 23%; transition-delay: 0.85s; }
.alert-e { top: 55%; right: 9%; transition-delay: 1.1s; }

.dna-phase-dots {
  position: absolute;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 6;
  display: flex;
  gap: 0.6rem;
}

.dna-dot {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border: 0;
  color: #475569;
  background: none;
  font: inherit;
  font-size: 0.66rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.dna-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #334155;
  transition: background 0.2s, box-shadow 0.2s;
}

.dna-dot.active { color: #93c5fd; }
.dna-dot.active::before {
  background: #60a5fa;
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.8);
}

.footprint-stats {
  margin-top: 2rem;
}

.footprint-note,
.demo-disclaimer {
  margin: 0 0 1rem;
  font-size: 0.7rem;
  color: #475569;
}

.footprint-stats dl {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
}

.footprint-stats dl > div {
  padding: 1.1rem;
  background: #0a0f1a;
}

.footprint-stats dt {
  font-size: 0.68rem;
  color: #475569;
}

.footprint-stats dd {
  margin: 0.25rem 0 0;
  font-size: clamp(1.1rem, 2.8vw, 1.45rem);
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: -0.04em;
}

@media (min-width: 760px) {
  .footprint-stats dl {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 680px) {
  .dna-stage { min-height: 640px; }
  .dna-visual { min-height: 590px; }
  .dna-network { height: 590px; transform: scale(1.12); }
  .dna-source-labels { display: none; }
  .dna-ingest span:nth-child(n + 4) { display: none; }
  .dna-phase-dots {
    left: 1.25rem;
    right: 1.25rem;
    justify-content: space-between;
  }
  .dna-dot span { display: none; }
  .dna-dot::before { width: 8px; height: 8px; }
  .dna-alert { font-size: 0.56rem; }
  .alert-a { left: 8%; }
  .alert-b { right: 5%; }
  .alert-e { display: none; }
}

/* ——— Mensaje central ——— */
.truth-statement {
  padding: clamp(5rem, 14vw, 9rem) clamp(1.25rem, 5vw, 3rem);
  background: #050810;
  text-align: center;
}

.truth-inner {
  max-width: 940px;
  margin: 0 auto;
}

.truth-statement h2 {
  margin: 0;
  font-size: clamp(2rem, 5.2vw, 3.8rem);
  font-weight: 700;
  line-height: 1.07;
  letter-spacing: -0.045em;
}

.truth-statement p {
  max-width: 44rem;
  margin: 1.6rem auto 0;
  color: var(--muted);
  font-size: 1.1rem;
}

/* ——— Conciliación a nivel de línea ——— */
.line-reconciliation {
  padding: clamp(5rem, 12vw, 8rem) clamp(1.25rem, 5vw, 3rem);
  background: linear-gradient(180deg, #0c1220, #060a12);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.line-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.line-case {
  margin-top: 3rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: #0d1422;
}

.line-case-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.line-case-head div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.line-case-head div span {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  color: #60a5fa;
}

.line-case-head div strong {
  font-size: 1rem;
  color: #e2e8f0;
}

.line-case-badge {
  font-size: 0.65rem;
  color: #475569;
}

.line-trace {
  display: grid;
  gap: 0;
  padding: 1rem;
}

@media (min-width: 760px) {
  .line-trace {
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
    align-items: stretch;
  }
}

.line-event {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 110px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}

.line-event-warning {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.22);
}

.line-event-danger {
  background: rgba(248, 113, 113, 0.06);
  border-color: rgba(248, 113, 113, 0.24);
}

.line-event-type {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
}

.line-event strong {
  margin-top: 0.45rem;
  font-size: 0.95rem;
  color: #e2e8f0;
}

.line-event em {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  font-style: normal;
  color: #475569;
}

.line-event-warning em { color: #fbbf24; }
.line-event-danger em { color: #f87171; }

.line-arrow {
  display: block;
  width: 1px;
  height: 22px;
  margin: 0 auto;
  background: #334155;
}

@media (min-width: 760px) {
  .line-arrow {
    width: 28px;
    height: 1px;
    align-self: center;
  }
}

.line-result {
  display: grid;
  gap: 1px;
  background: rgba(255, 255, 255, 0.06);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (min-width: 680px) {
  .line-result { grid-template-columns: 1fr auto; }
}

.line-result > div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.2rem 1.35rem;
  background: #0a0f1a;
}

.line-result > div:last-child {
  min-width: 200px;
}

.line-result span {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
}

.line-result strong {
  font-size: 1.05rem;
  color: #fca5a5;
}

/* ADN por fases: vacío → cadenas → grafo → anomalías */
.dna-stage[data-phase="0"] .dna-edge { opacity: 0; }
.dna-stage[data-phase="0"] .dna-node { opacity: 0; }
.dna-stage[data-phase="0"] .dna-node.node-ring-2 {
  opacity: 0.32;
  animation: source-arrival 2.4s ease-in-out infinite alternate;
}

.dna-stage[data-phase="1"] .dna-edge { opacity: 0.03; }
.dna-stage[data-phase="1"] .dna-edge.edge-ring-0 { opacity: 0.34; }
.dna-stage[data-phase="1"] .dna-node { opacity: 0.1; }
.dna-stage[data-phase="1"] .dna-node.node-ring-0 { opacity: 0.78; }
.dna-stage[data-phase="1"] .dna-node.node-ring-1 { opacity: 0.28; }

.dna-stage[data-phase="2"] .dna-edge { opacity: 0.46; }
.dna-stage[data-phase="2"] .dna-node { opacity: 0.9; }

@keyframes source-arrival {
  from { opacity: 0.12; transform: scale(0.75); }
  to { opacity: 0.55; transform: scale(1.1); }
}

.dna-core-name {
  transition: opacity 0.25s ease;
}

.dna-stage[data-phase="0"] .dna-core-ring {
  opacity: 0.2;
  animation-duration: 8s;
}

.dna-document-chains {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.dna-stage[data-phase="1"] .dna-document-chains {
  opacity: 1;
}

.dna-doc-chain {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  background: rgba(10, 15, 26, 0.88);
  border: 1px solid rgba(96, 165, 250, 0.16);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  transform: translateY(8px);
  animation: chain-assemble 0.8s ease forwards;
}

.dna-doc-chain span {
  font-size: 0.5rem;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}

.dna-doc-chain i {
  display: block;
  width: 12px;
  height: 1px;
  background: #3b82f6;
  position: relative;
}

.dna-doc-chain i::after {
  content: "";
  position: absolute;
  right: 0;
  top: -2px;
  width: 4px;
  height: 4px;
  border-right: 1px solid #60a5fa;
  border-top: 1px solid #60a5fa;
  transform: rotate(45deg);
}

.chain-one { top: 25%; left: 15%; animation-delay: 0.1s; }
.chain-two { top: 57%; right: 9%; animation-delay: 0.35s; }
.chain-three { bottom: 16%; left: 25%; animation-delay: 0.6s; }

@keyframes chain-assemble {
  to { transform: translateY(0); }
}

@media (max-width: 680px) {
  .dna-doc-chain { transform: scale(0.8); transform-origin: left center; }
  .chain-one { left: 2%; top: 23%; }
  .chain-two { right: -8%; top: 60%; }
  .chain-three { left: 10%; bottom: 20%; }
}

/* Prueba visual de conciliación de 100 unidades */
.quantity-proof {
  padding: 1.15rem 1.35rem 1.35rem;
  background: #080d16;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.quantity-proof-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.8rem;
  font-size: 0.68rem;
  color: #64748b;
}

.quantity-proof-head i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 0.25rem;
  border-radius: 2px;
  background: #3b82f6;
}

.quantity-proof-head i.missing {
  background: #f87171;
}

.quantity-grid {
  display: grid;
  grid-template-columns: repeat(25, minmax(2px, 1fr));
  gap: 3px;
}

.quantity-grid span {
  display: block;
  height: 7px;
  border-radius: 2px;
  background: rgba(59, 130, 246, 0.66);
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.12);
}

.quantity-grid span.missing {
  background: #f87171;
  box-shadow: 0 0 9px rgba(248, 113, 113, 0.6);
  animation: missing-unit-pulse 1.7s ease-in-out infinite;
}

@keyframes missing-unit-pulse {
  50% { opacity: 0.45; }
}

/* Expediente como carpeta de investigación */
.case-folder {
  position: relative;
  margin-top: 3rem;
  perspective: 1400px;
}

.folder-cover {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0;
  overflow: visible;
  text-align: left;
  color: var(--ink);
  font: inherit;
  background: linear-gradient(145deg, #162238, #101a2b);
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-radius: 5px 14px 14px 14px;
  cursor: pointer;
  transform-origin: bottom center;
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.3);
}

.folder-tab {
  position: absolute;
  left: -1px;
  bottom: calc(100% - 1px);
  padding: 0.55rem 1.1rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #93c5fd;
  background: #162238;
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.folder-cover-grid {
  display: grid;
  gap: 1px;
  padding: 1.75rem 1.35rem 1.1rem;
}

@media (min-width: 700px) {
  .folder-cover-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.folder-cover-grid > span {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.folder-cover em,
.folder-body em {
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
}

.folder-cover strong {
  font-size: 0.95rem;
  color: #e2e8f0;
}

.folder-cover .folder-status {
  color: #34d399;
}

.folder-open-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem;
  font-size: 0.72rem;
  color: #64748b;
}

.folder-open-label i {
  font-style: normal;
  transition: transform 0.4s ease;
}

.folder-body {
  position: relative;
  z-index: 1;
  max-height: 0;
  margin: -0.5rem 0 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-25px);
  background: linear-gradient(180deg, #f8fafc, #e8eef7);
  color: #0f172a;
  border-radius: 0 0 14px 14px;
  transition:
    max-height 1s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.5s ease,
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.case-folder.is-open .folder-cover {
  transform: rotateX(-9deg) translateY(-4px);
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.4);
}

.case-folder.is-open .folder-open-label i {
  transform: rotate(180deg);
}

.case-folder.is-open .folder-body {
  max-height: 1100px;
  opacity: 1;
  transform: translateY(0);
}

.folder-timeline {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 2rem 1.35rem 1.25rem;
  list-style: none;
}

.folder-timeline li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0.9rem;
  padding: 0 0 1.1rem;
}

.folder-timeline li > span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #2563eb;
  font-size: 0.64rem;
  font-weight: 700;
  background: #dbeafe;
  border-radius: 50%;
}

.folder-timeline li > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.09);
}

.folder-timeline strong {
  font-size: 0.9rem;
}

.folder-evidence li,
.folder-evidence strong {
  color: #047857;
}

.folder-spine {
  position: absolute;
  top: 2.2rem;
  bottom: 8rem;
  left: 2.28rem;
  width: 1px;
  background: #bfdbfe;
}

.folder-verdict {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0 1.35rem 1.5rem;
  padding: 1.15rem 1.25rem;
  color: #f8fafc;
  background: #0f172a;
  border-radius: 10px;
}

.folder-verdict span {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #93c5fd;
}

.folder-verdict strong {
  font-size: clamp(1.55rem, 4vw, 2.2rem);
  letter-spacing: -0.04em;
}

.folder-verdict em {
  color: #64748b;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.dossier-list-secondary {
  margin-top: 1.5rem;
}

/* ——— Identidad LhexIA Ecosistema + hero vivo ——— */
.site-header {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.brand {
  gap: 0.7rem;
}

.brand .mark {
  flex: 0 0 auto;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.18rem;
}

.brand-word {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -0.055em;
}

.brand-word span {
  color: var(--neon-orange);
}

.brand-lockup small {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #64748b;
  font-size: 0.46rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  box-shadow: 0 0 8px currentColor;
}

.dot-blue { color: #3b82f6; background: currentColor; }
.dot-orange { color: #f97316; background: currentColor; }
.dot-green { color: #10b981; background: currentColor; }
.dot-violet { color: #8b5cf6; background: currentColor; }
.dot-cyan { color: #06b6d4; background: currentColor; margin-right: 0.2rem; }

.hero {
  isolation: isolate;
  background:
    radial-gradient(ellipse 60% 48% at 50% 48%, rgba(30, 64, 175, 0.13), transparent 70%),
    #050810;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(96, 165, 250, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
  animation: hero-grid-drift 22s linear infinite;
}

@keyframes hero-grid-drift {
  to { background-position: 64px 64px; }
}

.hero-glow {
  z-index: -3;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(59, 130, 246, 0.2), transparent 60%),
    radial-gradient(ellipse 48% 36% at 82% 62%, rgba(139, 92, 246, 0.1), transparent 55%),
    radial-gradient(ellipse 45% 35% at 18% 65%, rgba(16, 185, 129, 0.08), transparent 55%);
  animation: hero-glow-breathe 8s ease-in-out infinite alternate;
}

@keyframes hero-glow-breathe {
  from { opacity: 0.65; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1.04); }
}

.hero-aurora {
  position: absolute;
  z-index: -2;
  width: min(80vw, 850px);
  height: min(80vw, 850px);
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    conic-gradient(
      from 0deg,
      rgba(59, 130, 246, 0.13),
      rgba(249, 115, 22, 0.08),
      rgba(16, 185, 129, 0.1),
      rgba(139, 92, 246, 0.1),
      rgba(6, 182, 212, 0.1),
      rgba(59, 130, 246, 0.13)
    );
  filter: blur(65px);
  opacity: 0.65;
  animation: hero-aurora-spin 24s linear infinite;
}

@keyframes hero-aurora-spin {
  from { transform: translate(-50%, -50%) rotate(0deg) scale(0.9); }
  50% { transform: translate(-50%, -50%) rotate(180deg) scale(1.08); }
  to { transform: translate(-50%, -50%) rotate(360deg) scale(0.9); }
}

.hero-network {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.78;
  pointer-events: none;
}

.hero-edge {
  fill: none;
  stroke-width: 0.75;
  stroke-dasharray: 2 10;
  opacity: 0;
  animation:
    hero-edge-enter 1.8s ease forwards,
    hero-edge-flow 12s linear infinite;
}

.hero-edge.edge-a { stroke: url(#heroEdgeA); }
.hero-edge.edge-b { stroke: url(#heroEdgeB); }

@keyframes hero-edge-enter {
  to { opacity: 0.58; }
}

@keyframes hero-edge-flow {
  to { stroke-dashoffset: -120; }
}

.hero-node {
  opacity: 0;
  filter: url(#heroNodeGlow);
  animation:
    hero-node-enter 0.8s ease forwards,
    hero-node-pulse 3s ease-in-out infinite;
}

@keyframes hero-node-enter {
  from { opacity: 0; transform: scale(0); }
  to { opacity: 0.85; transform: scale(1); }
}

@keyframes hero-node-pulse {
  50% { opacity: 0.32; }
}

.hero-packet {
  filter: url(#heroNodeGlow);
  animation: hero-packet-breathe 1.2s ease-in-out infinite;
}

@keyframes hero-packet-breathe {
  50% { opacity: 0.4; }
}

.hero-source-cloud {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-source {
  position: absolute;
  padding: 0.3rem 0.55rem;
  color: #475569;
  font-size: clamp(0.5rem, 0.75vw, 0.64rem);
  font-weight: 700;
  letter-spacing: 0.13em;
  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: 999px;
  background: rgba(6, 10, 18, 0.42);
  opacity: 0;
  animation: hero-source-enter 1s ease forwards, hero-source-float 6s ease-in-out infinite;
}

.source-erp { left: 8%; top: 22%; animation-delay: 0.3s, 0.3s; }
.source-oc { left: 5%; top: 49%; animation-delay: 0.55s, 1.3s; }
.source-guides { right: 7%; top: 33%; animation-delay: 0.8s, 0.7s; }
.source-invoices { left: 13%; bottom: 18%; animation-delay: 1.05s, 1.8s; }
.source-sii { right: 13%; bottom: 16%; animation-delay: 1.3s, 0.4s; }
.source-portal { right: 6%; top: 58%; animation-delay: 1.55s, 1.1s; }
.source-api { right: 22%; bottom: 8%; animation-delay: 1.8s, 2s; }

@keyframes hero-source-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hero-source-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

.hero-inner {
  z-index: 3;
}

.hero-brand-pulse {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-bottom: 1.25rem;
}

.hero-brand-pulse span {
  width: 26px;
  height: 2px;
  border-radius: 999px;
  transform-origin: center;
  animation: hero-brand-wave 2.5s ease-in-out infinite;
}

.hero-brand-pulse span:nth-child(1) { background: #3b82f6; box-shadow: 0 0 14px #3b82f6; }
.hero-brand-pulse span:nth-child(2) { background: #f97316; box-shadow: 0 0 14px #f97316; animation-delay: 0.15s; }
.hero-brand-pulse span:nth-child(3) { background: #10b981; box-shadow: 0 0 14px #10b981; animation-delay: 0.3s; }
.hero-brand-pulse span:nth-child(4) { background: #8b5cf6; box-shadow: 0 0 14px #8b5cf6; animation-delay: 0.45s; }
.hero-brand-pulse span:nth-child(5) { background: #06b6d4; box-shadow: 0 0 14px #06b6d4; animation-delay: 0.6s; }

@keyframes hero-brand-wave {
  0%, 100% { transform: scaleX(0.65); opacity: 0.45; }
  50% { transform: scaleX(1.12); opacity: 1; }
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  opacity: 0;
  animation: hero-copy-enter 0.8s ease 0.2s forwards;
}

.hero-eyebrow i {
  display: block;
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #60a5fa);
}

.hero-eyebrow i:last-child {
  transform: rotate(180deg);
}

.hero-title {
  text-wrap: balance;
}

.hero-line {
  display: block;
  opacity: 0;
  transform: translateY(24px);
  filter: blur(8px);
  animation: hero-line-enter 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-line.line-one { animation-delay: 0.35s; }
.hero-line.line-two { animation-delay: 0.52s; }
.hero-line.line-three { animation-delay: 0.69s; }

@keyframes hero-line-enter {
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.hero-title em {
  position: relative;
  background-size: 240% 100%;
  animation: evidence-neon 5s ease-in-out infinite;
}

.hero-title em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.08em;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #f97316, #10b981, #8b5cf6, #06b6d4);
  transform-origin: left;
  animation: evidence-line 1.2s ease 1.2s both, evidence-hue 7s linear infinite;
}

@keyframes evidence-neon {
  0%, 100% { background-position: 0% 50%; filter: drop-shadow(0 0 0 transparent); }
  50% { background-position: 100% 50%; filter: drop-shadow(0 0 12px rgba(96, 165, 250, 0.35)); }
}

@keyframes evidence-line {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes evidence-hue {
  to { filter: hue-rotate(360deg); }
}

.hero-sub {
  opacity: 0;
  animation: hero-copy-enter 0.9s ease 0.9s forwards;
}

.hero .btn-primary {
  opacity: 0;
  animation: hero-copy-enter 0.9s ease 1.05s forwards, hero-button-glow 4s ease-in-out 2s infinite;
}

@keyframes hero-copy-enter {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hero-button-glow {
  50% { box-shadow: 0 0 35px rgba(59, 130, 246, 0.38); }
}

.hero-live-process {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1.6rem;
  color: #475569;
  font-size: 0.68rem;
  opacity: 0;
  animation: hero-copy-enter 0.9s ease 1.3s forwards;
}

.live-signal {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 12px #10b981;
  animation: live-signal-pulse 1.5s ease-in-out infinite;
}

@keyframes live-signal-pulse {
  50% { opacity: 0.35; transform: scale(0.7); }
}

.live-label {
  color: #94a3b8;
  transition: opacity 0.25s ease;
}

.live-divider {
  width: 1px;
  height: 12px;
  margin: 0 0.25rem;
  background: #1e293b;
}

.live-count strong {
  color: #60a5fa;
  font-variant-numeric: tabular-nums;
}

/* Más color en el ADN, sin perder precisión visual */
.dna-node.node-document:nth-child(5n + 1) { fill: #f97316; }
.dna-node.node-product:nth-child(4n + 1) { fill: #06b6d4; }
.dna-node.node-provider:nth-child(3n + 1) { fill: #10b981; }
.dna-node:nth-child(7n + 1) { fill: #8b5cf6; }

@media (max-width: 720px) {
  .brand .mark { width: 34px; height: 34px; }
  .brand-word { font-size: 1rem; }
  .brand-lockup small { font-size: 0.38rem; }
  .brand-dot { width: 3px; height: 3px; }
  .hero-source { opacity: 0.48 !important; }
  .source-oc, .source-api, .source-sii { display: none; }
  .hero-network { opacity: 0.55; }
  .hero-brand-pulse span { width: 18px; }
}

/* ——— La plataforma trabajando: movimiento con significado ——— */
.story-rail {
  display: none;
}

@media (min-width: 1320px) {
  .story-rail {
    position: fixed;
    z-index: 35;
    top: 50%;
    right: 1.25rem;
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    transform: translateY(-50%);
    pointer-events: none;
  }

  .story-rail-line {
    position: relative;
    width: 1px;
    background: rgba(148, 163, 184, 0.13);
  }

  .story-rail-line i {
    position: absolute;
    inset: 0 0 auto;
    height: 0;
    background: linear-gradient(#3b82f6, #06b6d4, #10b981);
    box-shadow: 0 0 9px rgba(56, 189, 248, 0.65);
    transition: height 0.5s ease;
  }

  .story-rail ol {
    display: grid;
    gap: 0.65rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .story-rail li {
    color: #334155;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    transition: color 0.35s ease, transform 0.35s ease;
  }

  .story-rail li.active {
    color: #93c5fd;
    transform: translateX(-4px);
  }
}

.dna-edge {
  stroke-dasharray: 3 8;
  stroke-dashoffset: 0;
}

.dna-edge.is-built {
  animation: dna-data-flow 8s linear infinite;
}

@keyframes dna-data-flow {
  to { stroke-dashoffset: -88; }
}

.dna-node {
  transform-box: fill-box;
  transform-origin: center;
}

.dna-node.is-built {
  animation: dna-node-live var(--node-speed, 4.5s) ease-in-out var(--node-delay, 0s) infinite alternate;
}

@keyframes dna-node-live {
  from { translate: calc(var(--node-dx, 1px) * -1) calc(var(--node-dy, 1px) * -1); }
  to { translate: var(--node-dx, 1px) var(--node-dy, 1px); }
}

.dna-packet {
  filter: url(#nodeGlow);
  opacity: 0.88;
}

.dna-stage[data-phase="0"] .dna-packet { opacity: 0.32; }
.dna-stage[data-phase="1"] .dna-packet { opacity: 0.62; }
.dna-stage[data-phase="2"] .dna-packet { opacity: 0.92; }
.dna-stage[data-phase="3"] .dna-packet { opacity: 0.75; }

.dna-core-particles circle {
  transform-box: fill-box;
  transform-origin: center;
  filter: url(#nodeGlow);
  animation: core-particle-think var(--think-speed, 3s) ease-in-out var(--think-delay, 0s) infinite alternate;
}

@keyframes core-particle-think {
  from { translate: calc(var(--think-x, 4px) * -1) calc(var(--think-y, 3px) * -1); opacity: 0.25; }
  to { translate: var(--think-x, 4px) var(--think-y, 3px); opacity: 0.95; }
}

.dna-thinking {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: 1.35rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 280px;
  padding: 0.62rem 0.8rem;
  border: 1px solid rgba(96, 165, 250, 0.14);
  border-radius: 7px;
  background: rgba(5, 9, 17, 0.86);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
}

.thinking-mark {
  display: flex;
  align-items: center;
  gap: 2px;
}

.thinking-mark i {
  width: 3px;
  height: 11px;
  border-radius: 4px;
  background: #60a5fa;
  box-shadow: 0 0 8px #3b82f6;
  animation: thinking-bars 0.8s ease-in-out infinite alternate;
}

.thinking-mark i:nth-child(2) { height: 16px; animation-delay: 0.18s; }
.thinking-mark i:nth-child(3) { animation-delay: 0.36s; }

@keyframes thinking-bars {
  to { transform: scaleY(0.38); opacity: 0.4; }
}

.thinking-operation {
  flex: 1;
  color: #cbd5e1;
  font-size: 0.68rem;
  font-weight: 600;
  transition: opacity 0.2s ease;
}

.thinking-confidence {
  color: #475569;
  font-size: 0.58rem;
  white-space: nowrap;
}

.thinking-confidence strong {
  color: #60a5fa;
  font-variant-numeric: tabular-nums;
}

.dna-event-stream {
  position: absolute;
  z-index: 6;
  top: 1.4rem;
  right: 1.4rem;
  width: 215px;
  padding: 0.75rem;
  border-left: 1px solid rgba(96, 165, 250, 0.15);
  background: linear-gradient(90deg, rgba(5, 9, 17, 0.62), transparent);
}

.stream-kicker {
  display: block;
  margin-bottom: 0.55rem;
  color: #3b82f6;
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dna-event-stream ol {
  display: grid;
  gap: 0.38rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dna-event-stream li {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  color: #64748b;
  font-size: 0.57rem;
  line-height: 1.35;
  animation: stream-event-in 0.45s ease both;
}

.dna-event-stream li::before {
  content: "";
  flex: 0 0 auto;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--event-color, #3b82f6);
  box-shadow: 0 0 8px var(--event-color, #3b82f6);
}

.dna-event-stream li strong {
  color: #cbd5e1;
  font-weight: 600;
}

@keyframes stream-event-in {
  from { opacity: 0; transform: translateX(10px); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

.footprint-stats dd {
  font-variant-numeric: tabular-nums;
}

.decision-proof {
  margin-top: 1rem;
  padding: 1.25rem;
  border: 1px solid rgba(96, 165, 250, 0.12);
  border-radius: 12px;
  background:
    linear-gradient(110deg, rgba(59, 130, 246, 0.07), transparent 38%),
    #080d17;
}

.decision-proof > p {
  margin: 0 0 1rem;
  color: #64748b;
  font-size: 0.76rem;
}

.decision-proof > p span {
  color: #cbd5e1;
  font-weight: 700;
}

.decision-proof-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
}

.decision-proof-flow > div {
  display: grid;
  gap: 0.2rem;
}

.decision-proof-flow em {
  color: #475569;
  font-size: 0.55rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.decision-proof-flow strong {
  color: #e2e8f0;
  font-size: clamp(0.85rem, 1.8vw, 1.08rem);
  font-variant-numeric: tabular-nums;
}

.decision-proof-flow strong b {
  color: #60a5fa;
  font: inherit;
}

.decision-proof-flow > i {
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.55);
  animation: decision-flow-pulse 1.5s ease-in-out infinite;
}

.decision-proof-flow > i:nth-of-type(2) { animation-delay: 0.25s; }
.decision-proof-flow > i:nth-of-type(3) { animation-delay: 0.5s; }

@keyframes decision-flow-pulse {
  0%, 100% { opacity: 0.2; transform: scaleX(0.35); transform-origin: left; }
  50% { opacity: 1; transform: scaleX(1); transform-origin: left; }
}

.decision-proof small {
  display: block;
  margin-top: 1rem;
  color: #334155;
  font-size: 0.58rem;
}

@media (max-width: 760px) {
  .decision-proof-flow {
    grid-template-columns: 1fr;
  }

  .decision-proof-flow > i {
    width: 1px;
    height: 12px;
    margin-left: 4px;
    background: linear-gradient(#3b82f6, #06b6d4);
  }
}

/* Contraste ejecutivo: los datos deben leerse antes que el fondo */
.dna-ingest span {
  color: #94a3b8;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
}

.dna-ingest strong {
  color: #f1f5f9;
  font-weight: 700;
}

.footprint-note {
  color: #93c5fd;
  font-weight: 600;
}

.footprint-stats dt {
  color: #94a3b8;
}

.footprint-stats dd {
  color: #f8fafc;
}

.decision-proof > p {
  color: #94a3b8;
}

.decision-proof-flow em {
  color: #94a3b8;
}

.decision-proof small {
  color: #64748b;
}

/* Del hallazgo al trabajo real: vista del expediente para el usuario */
.case-user-view {
  margin: 1.25rem;
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  color: #0f172a;
  background: #f8fafc;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  opacity: 0;
  transform: translateY(24px) scale(0.985);
  transition: opacity 0.75s ease, transform 0.75s cubic-bezier(.2,.8,.2,1);
}

.line-case.is-detected .case-user-view {
  opacity: 1;
  transform: none;
  transition-delay: 1.1s;
}

.case-user-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem;
  color: #fff;
  background:
    radial-gradient(circle at 90% 15%, rgba(6, 182, 212, 0.28), transparent 32%),
    linear-gradient(120deg, #0b1025, #111b3e);
}

.case-user-hero div > span {
  color: #67e8f9;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.case-user-hero h3 {
  margin: 0.45rem 0 0;
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  letter-spacing: -0.035em;
}

.case-user-hero p {
  margin: 0.4rem 0 0;
  color: #cbd5e1;
  font-size: 0.78rem;
}

.case-user-hero > strong {
  flex: 0 0 auto;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(165, 180, 252, 0.5);
  border-radius: 9px;
  color: #a5b4fc;
  font-size: 0.7rem;
  line-height: 1.2;
  text-align: center;
}

.case-user-disclaimer {
  margin: 0;
  padding: 0.65rem 1.5rem;
  color: #64748b;
  background: #eef2ff;
  border-bottom: 1px solid #dbe3ef;
  font-size: 0.64rem;
}

.case-user-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 0;
  padding: 1.25rem 1.5rem;
}

.case-user-meta > div {
  padding: 0.75rem;
  border: 1px solid #dbe3ef;
  border-radius: 9px;
  background: #fff;
}

.case-user-meta dt,
.case-user-validation dt {
  color: #64748b;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.case-user-meta dd,
.case-user-validation dd {
  margin: 0.2rem 0 0;
  color: #0f172a;
  font-size: 0.75rem;
  font-weight: 700;
}

.case-user-finding {
  margin: 0 1.5rem 1.25rem;
  padding: 1rem;
  border: 1px solid #fbbf24;
  border-radius: 10px;
  background: #fffbeb;
}

.case-user-finding span,
.case-user-validation-title span,
.case-user-documents > span,
.case-user-actions > span {
  display: block;
  color: #92400e;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-user-finding strong {
  display: block;
  margin-top: 0.35rem;
  color: #111827;
  font-size: 0.9rem;
}

.case-user-finding p {
  margin: 0.4rem 0 0;
  color: #475569;
  font-size: 0.7rem;
}

.case-user-validation {
  margin: 0 1.5rem 1.25rem;
  overflow: hidden;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fff;
}

.case-user-validation-title {
  padding: 0.9rem 1rem;
  color: #fff;
  background: #8f1d1d;
}

.case-user-validation-title span {
  color: #fecaca;
}

.case-user-validation-title strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

.case-user-validation > dl {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
}

.case-user-validation > dl > div {
  padding: 0.8rem 1rem;
  border-right: 1px solid #e2e8f0;
}

.case-user-validation > dl > div:last-child {
  border-right: 0;
}

.case-user-product {
  display: grid;
  grid-template-columns: 2fr repeat(3, 0.65fr);
  border-top: 1px solid #e2e8f0;
  background: #fff7f7;
}

.case-user-product > * {
  padding: 0.55rem 0.75rem;
  font-size: 0.65rem;
}

.case-user-product > span {
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
}

.case-user-product strong,
.case-user-product b {
  color: #1e293b;
}

.case-user-product b {
  text-align: center;
}

.case-user-product .warning { color: #b45309; }
.case-user-product .danger { color: #dc2626; }

.case-user-documents {
  margin: 0 1.5rem 1.25rem;
  padding: 1rem;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  background: #eef2ff;
}

.case-user-documents > span {
  color: #4338ca;
}

.case-user-documents > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.case-user-documents b {
  padding: 0.45rem 0.65rem;
  border: 1px solid #a5b4fc;
  border-radius: 6px;
  color: #3730a3;
  background: #fff;
  font-size: 0.64rem;
}

.case-user-actions {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #dbe3ef;
  background: #fff;
}

.case-user-actions > span {
  color: #2563eb;
}

.case-user-actions strong {
  color: #334155;
  font-size: 0.68rem;
}

.case-user-actions b {
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  color: #fff;
  background: linear-gradient(90deg, #4f46e5, #06b6d4);
  font-size: 0.62rem;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .case-user-view { margin: 0.75rem; }
  .case-user-meta { grid-template-columns: 1fr; padding: 1rem; }
  .case-user-finding,
  .case-user-validation,
  .case-user-documents { margin-right: 1rem; margin-left: 1rem; }
  .case-user-validation > dl { grid-template-columns: repeat(2, 1fr); }
  .case-user-product { grid-template-columns: 1.5fr repeat(3, 0.6fr); }
  .case-user-actions { grid-template-columns: 1fr; }
  .case-user-actions b { text-align: center; }
}

/* La conciliación se ejecuta; no aparece resuelta */
.line-case {
  position: relative;
}

.line-case-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.line-case-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
  box-shadow: 0 0 0 transparent;
  transition: background 0.25s, box-shadow 0.25s;
}

.line-case-badge b {
  color: inherit;
  font-weight: 500;
}

.line-case.is-analyzing .line-case-badge i {
  background: #3b82f6;
  box-shadow: 0 0 10px #3b82f6;
  animation: live-signal-pulse 1s ease-in-out infinite;
}

.line-case.is-detected .line-case-badge i {
  background: #f87171;
  box-shadow: 0 0 10px #f87171;
}

.line-case .line-event {
  opacity: 0.12;
  transform: translateY(10px);
}

.line-case.is-analyzing .line-event {
  animation: line-document-read 0.55s ease forwards;
}

.line-case.is-analyzing .line-event:nth-of-type(1) { animation-delay: 0.25s; }
.line-case.is-analyzing .line-event:nth-of-type(2) { animation-delay: 1.05s; }
.line-case.is-analyzing .line-event:nth-of-type(3) { animation-delay: 1.85s; }
.line-case.is-analyzing .line-event:nth-of-type(4) { animation-delay: 2.65s; }

@keyframes line-document-read {
  0% { opacity: 0.12; transform: translateY(10px); box-shadow: none; }
  45% { opacity: 1; transform: none; box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.55), 0 0 22px rgba(59, 130, 246, 0.12); }
  100% { opacity: 1; transform: none; box-shadow: none; }
}

.line-case .line-arrow {
  opacity: 0.15;
  transform: scaleX(0);
}

.line-case.is-analyzing .line-arrow {
  animation: line-link-read 0.35s ease forwards;
}

.line-case.is-analyzing .line-arrow:nth-of-type(1) { animation-delay: 0.8s; }
.line-case.is-analyzing .line-arrow:nth-of-type(2) { animation-delay: 1.6s; }
.line-case.is-analyzing .line-arrow:nth-of-type(3) { animation-delay: 2.4s; }

@keyframes line-link-read {
  to { opacity: 1; transform: scaleX(1); background: #3b82f6; box-shadow: 0 0 8px #3b82f6; }
}

.quantity-grid span {
  opacity: 0.1;
  transform: scale(0.7);
}

.line-case.is-analyzing .quantity-grid span {
  animation: quantity-read 0.22s ease forwards;
  animation-delay: calc(3.05s + var(--unit-index, 0) * 9ms);
}

@keyframes quantity-read {
  to { opacity: 1; transform: scale(1); }
}

.quantity-grid span.missing {
  background: #3b82f6;
  box-shadow: none;
}

.line-case.is-detected .quantity-grid span.missing {
  background: #f87171;
  box-shadow: 0 0 9px rgba(248, 113, 113, 0.75);
  animation: missing-unit-detect 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes missing-unit-detect {
  0%, 100% { transform: translateX(0) scale(1); }
  20% { transform: translateX(-3px) scale(1.15); }
  40% { transform: translateX(3px) scale(1.15); }
  60% { transform: translateX(-2px) scale(1.15); }
  80% { transform: translateX(2px) scale(1.15); }
}

.line-result {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.line-case.is-detected .line-result {
  opacity: 1;
  transform: none;
}

.line-decision {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 0.8rem;
  padding: 0 1.35rem;
  max-height: 0;
  overflow: hidden;
  background: rgba(127, 29, 29, 0.18);
  border-top: 0 solid rgba(248, 113, 113, 0.2);
  opacity: 0;
  transition: max-height 0.6s ease, padding 0.6s ease, opacity 0.4s ease, border-width 0.3s ease;
}

.line-case.is-detected .line-decision {
  max-height: 90px;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  border-top-width: 1px;
  opacity: 1;
  transition-delay: 0.5s;
}

.line-decision span {
  color: #f87171;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.line-decision strong {
  color: #fecaca;
  font-size: 0.75rem;
}

.line-decision em {
  color: #64748b;
  font-size: 0.62rem;
  font-style: normal;
  text-align: right;
}

/* El expediente abre profundidad y libera la cadena de evidencia */
.case-folder {
  perspective: 1400px;
}

.folder-cover {
  position: relative;
  z-index: 3;
  transform-origin: bottom center;
  transform-style: preserve-3d;
  transition: transform 0.9s cubic-bezier(.2,.8,.2,1), box-shadow 0.9s ease;
}

.case-folder.is-open .folder-cover {
  transform: rotateX(-10deg) translateY(-7px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

.folder-body {
  transform: translateY(-35px) scale(0.97);
  transform-origin: top center;
}

.case-folder.is-open .folder-body {
  transform: translateY(0) scale(1);
}

.folder-timeline li {
  opacity: 0;
  transform: translateY(-26px) rotateX(-9deg);
}

.case-folder.is-open .folder-timeline li {
  animation: evidence-sheet-out 0.65s cubic-bezier(.2,.8,.2,1) forwards;
}

.case-folder.is-open .folder-timeline li:nth-child(1) { animation-delay: 0.35s; }
.case-folder.is-open .folder-timeline li:nth-child(2) { animation-delay: 0.52s; }
.case-folder.is-open .folder-timeline li:nth-child(3) { animation-delay: 0.69s; }
.case-folder.is-open .folder-timeline li:nth-child(4) { animation-delay: 0.86s; }
.case-folder.is-open .folder-timeline li:nth-child(5) { animation-delay: 1.03s; }
.case-folder.is-open .folder-timeline li:nth-child(6) { animation-delay: 1.2s; }

@keyframes evidence-sheet-out {
  to { opacity: 1; transform: none; }
}

.folder-verdict {
  opacity: 0;
  transform: scale(0.97);
}

.case-folder.is-open .folder-verdict {
  animation: verdict-reveal 0.7s ease 1.45s forwards;
}

@keyframes verdict-reveal {
  45% { box-shadow: 0 0 35px rgba(59, 130, 246, 0.22); }
  to { opacity: 1; transform: none; }
}

.folder-explanation {
  padding: 2rem 1.5rem 1.2rem;
}

.folder-explanation-kicker {
  color: #2563eb;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.folder-explanation h3 {
  max-width: 700px;
  margin: 0.45rem 0 0;
  color: #0f172a;
  font-size: clamp(1.2rem, 2.8vw, 1.7rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.folder-explanation p {
  max-width: 680px;
  margin: 0.55rem 0 0;
  color: #64748b;
  font-size: 0.78rem;
}

.folder-evidence-flow {
  display: grid;
  grid-template-columns: 1fr auto 1.25fr auto 1fr;
  align-items: stretch;
  gap: 0.7rem;
  padding: 0 1.5rem 1.25rem;
}

.folder-evidence-flow > article {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 145px;
  padding: 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  opacity: 0;
  transform: translateY(-20px) scale(0.97);
}

.case-folder.is-open .folder-evidence-flow > article {
  animation: evidence-card-arrive 0.6s cubic-bezier(.2,.8,.2,1) forwards;
}

.case-folder.is-open .folder-evidence-flow > article:nth-of-type(1) { animation-delay: 0.45s; }
.case-folder.is-open .folder-evidence-flow > article:nth-of-type(2) { animation-delay: 0.75s; }
.case-folder.is-open .folder-evidence-flow > article:nth-of-type(3) { animation-delay: 1.05s; }

@keyframes evidence-card-arrive {
  to { opacity: 1; transform: none; }
}

.folder-evidence-flow > i {
  align-self: center;
  color: #3b82f6;
  font-size: 1.2rem;
  font-style: normal;
  opacity: 0;
}

.case-folder.is-open .folder-evidence-flow > i {
  animation: evidence-arrow-arrive 0.35s ease forwards;
}

.case-folder.is-open .folder-evidence-flow > i:nth-of-type(1) { animation-delay: 0.65s; }
.case-folder.is-open .folder-evidence-flow > i:nth-of-type(2) { animation-delay: 0.95s; }

@keyframes evidence-arrow-arrive {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: none; }
}

.folder-evidence-flow article > span {
  color: #64748b;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.folder-evidence-flow article > strong {
  color: #0f172a;
  font-size: 0.88rem;
}

.folder-evidence-flow article > b {
  color: #334155;
  font-size: 0.7rem;
}

.folder-evidence-flow article > em {
  margin-top: auto;
  color: #2563eb;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.folder-evidence-result {
  border-color: #fecaca !important;
  background: #fff7f7 !important;
}

.folder-evidence-result > strong {
  color: #b91c1c !important;
}

.folder-evidence-result > b {
  width: fit-content;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  color: #92400e !important;
  background: #fef3c7;
}

.folder-equation {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1.1fr;
  align-items: stretch;
  gap: 0.65rem;
  margin: 0 1.5rem 1.25rem;
  padding: 0.8rem;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  background: #eef2ff;
  opacity: 0;
  transform: translateY(10px);
}

.case-folder.is-open .folder-equation {
  animation: equation-reveal 0.55s ease 1.3s forwards;
}

@keyframes equation-reveal {
  to { opacity: 1; transform: none; }
}

.folder-equation > div {
  display: grid;
  gap: 0.2rem;
  padding: 0.65rem;
  border-radius: 7px;
  background: #fff;
}

.folder-equation span {
  color: #64748b;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
}

.folder-equation strong {
  color: #1e293b;
  font-size: 1rem;
}

.folder-equation > i {
  align-self: center;
  color: #6366f1;
  font-size: 1.2rem;
  font-style: normal;
  font-weight: 700;
}

.folder-equation-result {
  background: #fee2e2 !important;
}

.folder-equation-result strong {
  color: #b91c1c;
}

.folder-meaning {
  margin: 0 1.5rem 1.25rem;
  padding: 1rem;
  border-left: 3px solid #f59e0b;
  border-radius: 0 8px 8px 0;
  background: #fffbeb;
  opacity: 0;
}

.case-folder.is-open .folder-meaning {
  animation: meaning-reveal 0.5s ease 1.55s forwards;
}

@keyframes meaning-reveal {
  to { opacity: 1; }
}

.folder-meaning > strong {
  color: #92400e;
  font-size: 0.78rem;
}

.folder-meaning > p {
  margin: 0.35rem 0 0.75rem;
  color: #475569;
  font-size: 0.7rem;
}

.folder-meaning > span {
  display: inline-flex;
  margin: 0.2rem 0.25rem 0 0;
  padding: 0.3rem 0.45rem;
  border: 1px solid #fde68a;
  border-radius: 5px;
  color: #78350f;
  background: #fff;
  font-size: 0.58rem;
  font-weight: 700;
}

.folder-verdict {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 1rem;
}

.folder-verdict > em {
  grid-column: 2;
}

@media (max-width: 760px) {
  .folder-evidence-flow {
    grid-template-columns: 1fr;
  }

  .folder-evidence-flow > i {
    justify-self: center;
    transform: rotate(90deg);
  }

  .folder-equation {
    grid-template-columns: 1fr;
  }

  .folder-equation > i {
    justify-self: center;
  }

  .folder-verdict {
    grid-template-columns: 1fr;
  }

  .folder-verdict > em {
    grid-column: auto;
  }
}

.case-detection-run {
  margin: 1.5rem 0 2.5rem;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(96, 165, 250, 0.1);
  border-radius: 10px;
  background: rgba(10, 15, 26, 0.76);
}

.case-run-kicker {
  display: block;
  margin-bottom: 0.7rem;
  color: #3b82f6;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.case-run-track {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.case-run-track span {
  flex: 1;
  color: #94a3b8;
  font-size: 0.58rem;
  font-weight: 600;
  transition: color 0.3s, text-shadow 0.3s;
}

.case-run-track span.active {
  color: #cbd5e1;
  text-shadow: 0 0 12px rgba(96, 165, 250, 0.45);
}

.case-run-track span.complete {
  color: #34d399;
}

.case-run-track i {
  width: 18px;
  height: 1px;
  background: #334155;
  transform-origin: left;
}

.case-run-track i.active {
  background: #3b82f6;
  box-shadow: 0 0 8px #3b82f6;
  animation: case-link-complete 0.4s ease forwards;
}

@keyframes case-link-complete {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.other-findings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.other-findings-head {
  grid-column: 1 / -1;
  margin-bottom: 0.25rem;
}

.other-findings-head > span {
  color: #e2e8f0;
  font-size: 0.82rem;
  font-weight: 700;
}

.other-findings-head > p {
  margin: 0.25rem 0 0;
  color: #64748b;
  font-size: 0.68rem;
}

.finding-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  overflow: hidden;
  padding: 1.15rem;
  border: 1px solid #dbe3ef;
  border-top: 3px solid var(--finding-color);
  border-radius: 12px;
  color: #0f172a;
  background: #f8fafc;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.finding-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.28);
}

.finding-card-red { --finding-color: #ef4444; --finding-soft: #fee2e2; --finding-ink: #b91c1c; }
.finding-card-orange { --finding-color: #f59e0b; --finding-soft: #fef3c7; --finding-ink: #92400e; }
.finding-card-blue { --finding-color: #3b82f6; --finding-soft: #dbeafe; --finding-ink: #1d4ed8; }

.finding-card-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--finding-ink);
  background: var(--finding-soft);
  font-size: 0.62rem;
  font-weight: 800;
}

.finding-card-content {
  min-width: 0;
}

.finding-card-status {
  display: inline-flex;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  color: var(--finding-ink);
  background: var(--finding-soft);
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.finding-card h3 {
  margin: 0.65rem 0 0;
  color: #0f172a;
  font-size: 0.98rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.finding-card-content > p {
  min-height: 3.2em;
  margin: 0.45rem 0 0;
  color: #64748b;
  font-size: 0.68rem;
  line-height: 1.5;
}

.finding-card dl {
  display: grid;
  gap: 0.45rem;
  margin: 1rem 0 0;
  padding: 0.75rem 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.finding-card dl > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.finding-card dt {
  color: #64748b;
  font-size: 0.58rem;
}

.finding-card dd {
  margin: 0;
  color: #1e293b;
  font-size: 0.65rem;
  font-weight: 700;
  text-align: right;
}

.finding-card footer {
  margin-top: 0.85rem;
}

.finding-card footer > span {
  display: block;
  color: var(--finding-ink);
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.finding-card footer > strong {
  display: block;
  margin-top: 0.25rem;
  color: #334155;
  font-size: 0.65rem;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .other-findings {
    grid-template-columns: 1fr;
  }

  .finding-card-content > p {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .dna-event-stream { display: none; }
  .dna-thinking {
    bottom: 3.8rem;
    min-width: min(86%, 300px);
  }
  .line-decision { grid-template-columns: 1fr; gap: 0.2rem; }
  .line-decision em { text-align: left; }
  .case-run-track { align-items: flex-start; flex-direction: column; }
  .case-run-track i { width: 1px; height: 10px; margin-left: 3px; }
}
