/* Zenith Dual — scroll reveal estilo keynote */
.dual-reveal {
  --dual-purple: #7c3aed;
  --dual-purple-soft: rgba(124, 58, 237, 0.22);
  --dual-purple-glow: rgba(124, 58, 237, 0.45);
  --dual-p: 0;
  position: relative;
  isolation: isolate;
}

.dual-reveal__scroll {
  height: min(420vh, 3200px);
}

.dual-reveal__sticky {
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  min-height: 520px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.dual-reveal__mesh {
  position: absolute;
  inset: -20% -10%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 20% 30%, var(--dual-purple-soft), transparent 65%),
    radial-gradient(ellipse 50% 40% at 80% 70%, rgba(233, 20, 41, 0.12), transparent 60%),
    radial-gradient(ellipse 40% 35% at 50% 50%, rgba(108, 92, 231, 0.08), transparent 55%);
  animation: dual-mesh-drift 18s ease-in-out infinite alternate;
  opacity: 0.85;
}

@keyframes dual-mesh-drift {
  0% { transform: translate3d(-2%, -1%, 0) scale(1); }
  100% { transform: translate3d(2%, 2%, 0) scale(1.04); }
}

.dual-reveal__inner {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 2.5rem));
  margin: 0 auto;
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

@media (min-width: 900px) {
  .dual-reveal__inner {
    grid-template-columns: 0.95fr 1.05fr;
    gap: clamp(2rem, 5vw, 4rem);
  }
}

.dual-reveal__copy {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dual-reveal__kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dual-purple);
}

.dual-reveal__headline {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.dual-reveal__headline em {
  font-style: normal;
  background: linear-gradient(120deg, #fff 20%, var(--dual-purple) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

.dual-reveal__beats {
  position: relative;
  min-height: clamp(140px, 22vh, 200px);
  margin-top: 0.5rem;
}

.dual-beat {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.65rem;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s var(--ease-out), transform 0.65s var(--ease-out);
  pointer-events: none;
}

.dual-beat.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dual-beat__tag {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.dual-beat__title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.dual-beat__body {
  margin: 0;
  font-size: clamp(0.92rem, 1.8vw, 1.05rem);
  color: var(--muted);
  line-height: 1.55;
  max-width: 34ch;
}

.dual-reveal__progress {
  display: flex;
  gap: 0.45rem;
  margin-top: 1.25rem;
}

.dual-reveal__dot {
  width: 2rem;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.4s ease, transform 0.4s ease;
}

.dual-reveal__dot.is-active {
  background: linear-gradient(90deg, var(--dual-purple), var(--accent));
  transform: scaleX(1.15);
}

/* Stage */
.dual-reveal__stage {
  position: relative;
  min-height: clamp(300px, 52vh, 480px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(124, 58, 237, 0.16), transparent 55%),
    rgba(8, 8, 12, 0.92);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.dual-scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.6s var(--ease-out), transform 0.7s var(--ease-out);
  pointer-events: none;
}

.dual-scene.is-active {
  opacity: 1;
  transform: scale(1);
}

/* Beat 0 — Identity Gate */
.dual-scene--identity {
  padding: clamp(1rem, 3vw, 2rem);
}

.dual-gate {
  position: relative;
  width: min(100%, 380px);
  aspect-ratio: 1 / 1.05;
  display: grid;
  place-items: center;
}

.dual-gate__logo {
  position: absolute;
  width: clamp(72px, 18vw, 108px);
  height: clamp(72px, 18vw, 108px);
  border-radius: 28%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 60px var(--dual-purple-glow);
  transition: opacity 0.7s var(--ease-out), transform 0.8s var(--ease-out);
  z-index: 3;
}

.dual-gate__logo img {
  width: 58%;
  height: 58%;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(124, 58, 237, 0.5));
}

.dual-gate__panel {
  position: absolute;
  inset: 8% 6%;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  opacity: 0;
  transform: perspective(900px) rotateX(12deg) scale(0.88);
  transition: opacity 0.75s var(--ease-out), transform 0.85s var(--ease-out);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 1.25rem;
}

.dual-gate__label {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.dual-profiles {
  display: flex;
  gap: 0.65rem;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.dual-profile-card {
  flex: 1 1 28%;
  min-width: 88px;
  max-width: 110px;
  padding: 0.85rem 0.65rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  text-align: center;
  transform: translateY(24px);
  opacity: 0;
  transition: transform 0.65s var(--ease-out), opacity 0.55s var(--ease-out), border-color 0.4s ease;
}

.dual-profile-card:nth-child(1) { transition-delay: 0.05s; border-color: rgba(124, 58, 237, 0.35); }
.dual-profile-card:nth-child(2) { transition-delay: 0.12s; }
.dual-profile-card:nth-child(3) { transition-delay: 0.19s; border-color: rgba(233, 20, 41, 0.3); }

.dual-profile-card__avatar {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 0.45rem;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--dual-purple), #4c1d95);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.35);
}

.dual-profile-card:nth-child(2) .dual-profile-card__avatar {
  background: linear-gradient(145deg, #334155, #1e293b);
}

.dual-profile-card:nth-child(3) .dual-profile-card__avatar {
  background: linear-gradient(145deg, var(--accent), #7f1d1d);
}

.dual-profile-card__name {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
}

.dual-reveal[data-gate-open="1"] .dual-gate__logo {
  opacity: 0;
  transform: scale(0.75) translateY(-20px);
}

.dual-reveal[data-gate-open="1"] .dual-gate__panel {
  opacity: 1;
  transform: perspective(900px) rotateX(0deg) scale(1);
}

.dual-reveal[data-gate-open="1"] .dual-profile-card {
  opacity: 1;
  transform: translateY(0);
}

/* Beat 1 — Vault flow */
.dual-scene--vault {
  padding: 1.5rem;
}

.dual-vault-svg {
  width: min(100%, 420px);
  height: auto;
}

.dual-vault-svg .vault-flow {
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  animation: vault-flow-draw 2.4s ease-in-out infinite alternate;
}

.dual-vault-svg .vault-pulse {
  animation: vault-node-pulse 2s ease-in-out infinite;
}

@keyframes vault-flow-draw {
  0% { stroke-dashoffset: 120; opacity: 0.35; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes vault-node-pulse {
  0%, 100% { opacity: 0.65; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

/* Beat 2 — Ingest */
.dual-scene--ingest {
  padding: 0;
}

.dual-ingest-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.dual-ingest-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  padding: 2rem;
}

.dual-ingest-hub {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 1px solid rgba(124, 58, 237, 0.45);
  background: radial-gradient(circle, var(--dual-purple-soft), transparent 70%);
  box-shadow: 0 0 40px var(--dual-purple-glow);
  animation: ingest-hub-pulse 2.2s ease-in-out infinite;
}

@keyframes ingest-hub-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 30px var(--dual-purple-glow); }
  50% { transform: scale(1.08); box-shadow: 0 0 55px var(--dual-purple-glow); }
}

/* Beat 3 — Performance bars */
.dual-scene--perf {
  padding: clamp(1.25rem, 3vw, 2rem);
  align-content: center;
}

.dual-perf-chart {
  width: min(100%, 400px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dual-perf-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr 2.5rem;
  align-items: center;
  gap: 0.75rem;
}

.dual-perf-label {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: right;
}

.dual-perf-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.dual-perf-fill {
  height: 100%;
  border-radius: inherit;
  width: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.45));
  transition: width 1.1s var(--ease-out);
}

.dual-perf-fill--accent {
  background: linear-gradient(90deg, var(--dual-purple), #a78bfa);
  box-shadow: 0 0 16px var(--dual-purple-glow);
}

.dual-reveal[data-beat="3"] .dual-perf-fill,
.dual-reveal--static .dual-perf-fill {
  width: var(--bar-w, 0%);
}

.dual-perf-val {
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.75);
}

.dual-perf-row--hero .dual-perf-val {
  color: #c4b5fd;
}

/* Mobile — stack sin scroll pin largo */
@media (max-width: 899px) {
  .dual-reveal__scroll {
    height: auto;
  }

  .dual-reveal__sticky {
    position: relative;
    top: auto;
    height: auto;
    min-height: 0;
    padding: 3.5rem 0 2rem;
  }

  .dual-reveal__stage {
    min-height: 280px;
    order: -1;
  }

  .dual-reveal__beats {
    min-height: 0;
  }

  .dual-beat {
    position: relative;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    padding: 1.25rem 0;
    border-top: 1px solid var(--border);
  }

  .dual-beat:first-child {
    border-top: none;
    padding-top: 0;
  }

  .dual-scene {
    position: relative;
    opacity: 1;
    transform: none;
    min-height: 260px;
    margin-bottom: 0.5rem;
  }

  .dual-scene:not(:first-child) {
    display: none;
  }

  .dual-reveal__progress {
    display: none;
  }

  .dual-reveal[data-mobile-scene="1"] .dual-scene--identity { display: none; }
  .dual-reveal[data-mobile-scene="1"] .dual-scene--vault { display: grid; }
  .dual-reveal[data-mobile-scene="2"] .dual-scene--identity,
  .dual-reveal[data-mobile-scene="2"] .dual-scene--vault { display: none; }
  .dual-reveal[data-mobile-scene="2"] .dual-scene--ingest { display: grid; }
  .dual-reveal[data-mobile-scene="3"] .dual-scene--identity,
  .dual-reveal[data-mobile-scene="3"] .dual-scene--vault,
  .dual-reveal[data-mobile-scene="3"] .dual-scene--ingest { display: none; }
  .dual-reveal[data-mobile-scene="3"] .dual-scene--perf { display: grid; }
}

/* perf-lite / no-motion */
.perf-lite .dual-reveal__mesh,
.no-motion .dual-reveal__mesh {
  animation: none;
}

.perf-lite .dual-ingest-canvas,
.no-motion .dual-ingest-canvas {
  display: none;
}

.perf-lite .dual-ingest-fallback,
.no-motion .dual-ingest-fallback {
  display: grid;
}

.perf-lite .dual-reveal__scroll {
  height: min(320vh, 2400px);
}

.dual-reveal--static .dual-reveal__scroll {
  height: auto;
}

.dual-reveal--static .dual-reveal__sticky {
  position: relative;
  top: auto;
  height: auto;
  padding: 4rem 0;
}

.dual-reveal--static .dual-reveal__beats {
  min-height: 0;
}

.dual-reveal--static .dual-beat {
  position: relative;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}

.dual-reveal--static .dual-beat:first-of-type {
  border-top: none;
  padding-top: 0;
}

.dual-reveal--static .dual-scene {
  position: relative;
  opacity: 1;
  transform: none;
  min-height: 260px;
}

.dual-reveal--static .dual-scene--vault,
.dual-reveal--static .dual-scene--ingest,
.dual-reveal--static .dual-scene--perf {
  display: none;
}

.dual-reveal--static .dual-scene--identity {
  display: grid;
}

.dual-reveal--static .dual-reveal__progress {
  display: none;
}

.no-backdrop .dual-gate__panel {
  background: rgba(18, 18, 24, 0.95);
}
