/* ============================================================
   DEEP INTELLIGENCE — Intelligence Vault Section
   "Your AI Reads Your Market First"
   
   Mission-control aesthetic. Radar visualization. 
   Scroll-triggered intelligence module cards.
   ============================================================ */

/* --- Section Container --- */
.deep-intel {
  position: relative;
  padding: var(--space-section) 0;
  overflow: hidden;
  background: var(--bg);
}

/* Subtle radial glow behind vault */
.deep-intel::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 900px;
  background: radial-gradient(
    ellipse 60% 50% at 50% 40%,
    rgba(var(--purple-rgb), 0.06) 0%,
    rgba(var(--cyan-rgb), 0.025) 35%,
    transparent 65%
  );
  pointer-events: none;
}

/* Technical grid overlay */
.deep-intel::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(var(--purple-rgb), 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--purple-rgb), 0.018) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 65% 55% at 50% 35%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 65% 55% at 50% 35%, black 0%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 2s ease;
}

.deep-intel.is-active::after {
  opacity: 1;
}

/* --- Section Header --- */
.di-header {
  text-align: center;
  margin-bottom: clamp(56px, 8vh, 88px);
  position: relative;
  z-index: 2;
}

.di-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: var(--space-4);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.di-headline {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: var(--space-6);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease 0.1s, transform 0.7s ease 0.1s;
}

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

.di-headline .gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.di-subheadline {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease 0.2s, transform 0.7s ease 0.2s;
}

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

.di-subheadline strong {
  color: var(--text-dim);
  font-weight: 600;
}

/* ═══════════════════════════════════════
   INTELLIGENCE VAULT — Central Radar
   ═══════════════════════════════════════ */
.di-vault {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1;
  margin: 0 auto clamp(56px, 8vh, 88px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* SVG Radar Container */
.di-vault__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Radar grid circles */
.di-vault__grid-ring {
  fill: none;
  stroke: rgba(var(--purple-rgb), 0.06);
  stroke-width: 0.5;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.deep-intel.is-active .di-vault__grid-ring {
  opacity: 1;
}

/* Radar crosshair lines */
.di-vault__crosshair {
  stroke: rgba(var(--purple-rgb), 0.04);
  stroke-width: 0.5;
  opacity: 0;
  transition: opacity 1.2s ease 0.3s;
}

.deep-intel.is-active .di-vault__crosshair {
  opacity: 1;
}

/* Rotating ring 1 — inner */
.di-vault__ring-1 {
  fill: none;
  stroke: rgba(var(--cyan-rgb), 0.25);
  stroke-width: 1.5;
  stroke-dasharray: 8 24;
  stroke-linecap: round;
  transform-origin: center;
  animation: vaultSpin1 20s linear infinite;
  opacity: 0;
  transition: opacity 1s ease 0.5s;
  filter: drop-shadow(0 0 3px rgba(var(--cyan-rgb), 0.3));
}

.deep-intel.is-active .di-vault__ring-1 { opacity: 1; }

/* Rotating ring 2 — mid */
.di-vault__ring-2 {
  fill: none;
  stroke: rgba(var(--purple-rgb), 0.2);
  stroke-width: 1;
  stroke-dasharray: 4 16 12 16;
  stroke-linecap: round;
  transform-origin: center;
  animation: vaultSpin2 30s linear infinite;
  opacity: 0;
  transition: opacity 1s ease 0.7s;
  filter: drop-shadow(0 0 2px rgba(var(--purple-rgb), 0.2));
}

.deep-intel.is-active .di-vault__ring-2 { opacity: 1; }

/* Rotating ring 3 — outer */
.di-vault__ring-3 {
  fill: none;
  stroke: rgba(var(--pink-rgb), 0.12);
  stroke-width: 0.8;
  stroke-dasharray: 2 20 6 20;
  stroke-linecap: round;
  transform-origin: center;
  animation: vaultSpin3 40s linear infinite;
  opacity: 0;
  transition: opacity 1s ease 0.9s;
  filter: drop-shadow(0 0 2px rgba(var(--pink-rgb), 0.15));
}

.deep-intel.is-active .di-vault__ring-3 { opacity: 1; }

/* Glow arcs — thin accent arcs */
.di-vault__arc {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 1.2s ease 1s;
}

.deep-intel.is-active .di-vault__arc { opacity: 1; }

.di-vault__arc--1 {
  stroke: rgba(var(--cyan-rgb), 0.3);
  filter: drop-shadow(0 0 6px rgba(var(--cyan-rgb), 0.4));
  animation: arcPulse1 4s ease-in-out infinite;
}

.di-vault__arc--2 {
  stroke: rgba(var(--purple-rgb), 0.25);
  filter: drop-shadow(0 0 6px rgba(var(--purple-rgb), 0.3));
  animation: arcPulse2 5s ease-in-out infinite 1.5s;
}

/* Orbit indicator dots */
.di-vault__orbit-dot {
  r: 2;
  fill: rgba(var(--cyan-rgb), 0.6);
  opacity: 0;
  transition: opacity 0.8s ease 1.2s;
  filter: drop-shadow(0 0 4px rgba(var(--cyan-rgb), 0.5));
}

.deep-intel.is-active .di-vault__orbit-dot { opacity: 1; }

.di-vault__orbit-dot--1 { animation: orbitDot1 20s linear infinite; }
.di-vault__orbit-dot--2 { animation: orbitDot2 30s linear infinite; }
.di-vault__orbit-dot--3 { animation: orbitDot3 40s linear infinite; }

/* Scanner sweep line */
.di-vault__sweep {
  stroke: rgba(var(--cyan-rgb), 0.1);
  stroke-width: 1;
  fill: url(#sweepGradient);
  transform-origin: center;
  animation: vaultSweep 6s linear infinite;
  opacity: 0;
  transition: opacity 1.5s ease 0.6s;
}

.deep-intel.is-active .di-vault__sweep { opacity: 1; }

/* Central data display */
.di-vault__center {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.di-vault__number {
  font-family: var(--font-mono);
  font-size: clamp(4.5rem, 12vw, 7.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: transparent;
  background: linear-gradient(135deg, var(--cyan) 0%, var(--purple-light) 50%, var(--pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(var(--cyan-rgb), 0.2));
  transition: filter 0.5s ease, opacity 0.5s ease;
}

.di-vault__tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.5s ease;
}

/* Vault complete state */
.di-vault.is-complete .di-vault__number {
  filter: drop-shadow(0 0 50px rgba(var(--emerald-rgb), 0.3));
}

.di-vault.is-complete .di-vault__tag {
  color: var(--emerald);
  text-shadow: 0 0 12px rgba(var(--emerald-rgb), 0.4);
}

/* Pulse ring on completion */
.di-vault__pulse-ring {
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  border: 2px solid rgba(var(--emerald-rgb), 0);
  pointer-events: none;
  z-index: 1;
}

.di-vault.is-complete .di-vault__pulse-ring {
  animation: vaultCompletePulse 1.5s ease-out forwards;
}

/* ═══════════════════════════════════════
   ANIMATIONS — Vault rings
   ═══════════════════════════════════════ */
@keyframes vaultSpin1 {
  to { transform: rotate(360deg); }
}

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

@keyframes vaultSpin3 {
  to { transform: rotate(360deg); }
}

@keyframes vaultSweep {
  to { transform: rotate(360deg); }
}

@keyframes arcPulse1 {
  0%, 100% { opacity: 0.4; stroke-width: 2; }
  50% { opacity: 1; stroke-width: 2.5; }
}

@keyframes arcPulse2 {
  0%, 100% { opacity: 0.3; stroke-width: 2; }
  50% { opacity: 0.9; stroke-width: 2.5; }
}

@keyframes orbitDot1 {
  to { transform: rotate(360deg); }
}

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

@keyframes orbitDot3 {
  to { transform: rotate(360deg); }
}

@keyframes vaultCompletePulse {
  0% {
    border-color: rgba(var(--emerald-rgb), 0.6);
    transform: scale(0.9);
    opacity: 1;
  }
  100% {
    border-color: rgba(var(--emerald-rgb), 0);
    transform: scale(1.4);
    opacity: 0;
  }
}

/* ═══════════════════════════════════════
   MODULE CARDS — Intelligence Categories
   ═══════════════════════════════════════ */
.di-modules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 24px);
  max-width: 1080px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.di-module {
  position: relative;
  background: rgba(var(--purple-rgb), 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 2.5vw, 28px);
  overflow: hidden;
  
  /* Scroll reveal */
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

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

/* Thin glow edge on hover / complete */
.di-module::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--cyan-rgb), 0.4), rgba(var(--purple-rgb), 0.3), transparent);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.di-module.is-complete::before {
  opacity: 1;
}

.di-module.is-complete {
  border-color: rgba(var(--emerald-rgb), 0.15);
  box-shadow: 0 0 24px rgba(var(--emerald-rgb), 0.04), 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Module icon */
.di-module__icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(var(--purple-rgb), 0.08);
  border: 1px solid rgba(var(--purple-rgb), 0.12);
  color: var(--purple-light);
  margin-bottom: var(--space-4);
  transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

.di-module__icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.di-module.is-complete .di-module__icon {
  background: rgba(var(--emerald-rgb), 0.08);
  border-color: rgba(var(--emerald-rgb), 0.15);
  color: var(--emerald);
}

/* Module title */
.di-module__title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-1);
}

/* Question range badge */
.di-module__range {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: var(--space-3);
  text-transform: uppercase;
}

/* Intel summary */
.di-module__summary {
  font-family: var(--font-body);
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

/* Status indicator */
.di-module__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  transition: color 0.4s ease, background 0.4s ease, border-color 0.4s ease;
}

.di-module__status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

/* Scanning state */
.di-module.is-scanning .di-module__status {
  color: var(--purple-light);
  background: rgba(var(--purple-rgb), 0.06);
  border-color: rgba(var(--purple-rgb), 0.15);
}

.di-module.is-scanning .di-module__status-dot {
  background: var(--purple-light);
  box-shadow: 0 0 6px var(--purple-light);
  animation: statusBlink 1.2s ease-in-out infinite;
}

/* Complete state */
.di-module.is-complete .di-module__status {
  color: var(--emerald);
  background: rgba(var(--emerald-rgb), 0.06);
  border-color: rgba(var(--emerald-rgb), 0.15);
}

.di-module.is-complete .di-module__status-dot {
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
  animation: none;
}

@keyframes statusBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Progress bar */
.di-module__progress {
  height: 2px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 2px;
  margin-top: var(--space-4);
  overflow: hidden;
}

.di-module__progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--purple-light));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.di-module.is-scanning .di-module__progress-fill {
  width: 60%;
  background: linear-gradient(90deg, var(--purple), var(--purple-light));
  background-size: 200% 100%;
  animation: progressShimmer 2s linear infinite;
}

.di-module.is-complete .di-module__progress-fill {
  width: 100%;
  background: linear-gradient(90deg, var(--emerald), var(--cyan));
}

@keyframes progressShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════
   FINAL STATE — Model Complete Banner
   ═══════════════════════════════════════ */
.di-final {
  text-align: center;
  margin-top: clamp(48px, 6vh, 72px);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  position: relative;
  z-index: 2;
}

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

.di-final__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: rgba(var(--emerald-rgb), 0.06);
  border: 1px solid rgba(var(--emerald-rgb), 0.15);
  border-radius: var(--radius-full);
}

.di-final__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  animation: statusBlink 2s ease-in-out infinite;
}

.di-final__text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--emerald);
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
  .di-modules {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .di-vault {
    max-width: 320px;
  }

  .di-vault__number {
    font-size: clamp(3.5rem, 18vw, 5rem);
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .di-modules {
    grid-template-columns: repeat(2, 1fr);
    max-width: 680px;
  }

  .di-vault {
    max-width: 380px;
  }
}

/* ═══════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .di-vault__ring-1,
  .di-vault__ring-2,
  .di-vault__ring-3,
  .di-vault__sweep,
  .di-vault__orbit-dot--1,
  .di-vault__orbit-dot--2,
  .di-vault__orbit-dot--3 {
    animation: none !important;
  }

  .di-module,
  .di-label,
  .di-headline,
  .di-subheadline,
  .di-final {
    transition: opacity 0.3s ease !important;
    transform: none !important;
  }

  .di-module.is-scanning .di-module__status-dot,
  .di-module.is-scanning .di-module__progress-fill {
    animation: none !important;
  }
}
