/* ===========================
   DEMO / HOW IT WORKS SECTION
   =========================== */

.demo {
  position: relative;
  padding: 120px 0;
  background: #0A0E27;
  overflow: hidden;
}

.demo::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(77, 101, 255, 0.2) 10%,
    rgba(77, 101, 255, 0.2) 90%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* Header */
.demo__header {
  text-align: center;
  margin-bottom: 80px;
  position: relative;
  z-index: 2;
}

.demo__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  color: white;
  margin: 16px 0 24px;
  letter-spacing: -0.02em;
}

.demo__subtitle {
  font-family: var(--font-body);
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.7);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Timeline Container */
.demo__timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  z-index: 2;
}

/* Individual Step */
.demo__step {
  position: relative;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 40px;
  margin-bottom: 80px;
  opacity: 0;
  transform: translateY(40px);
}

.demo__step:last-child {
  margin-bottom: 0;
}

/* Stagger even steps to the right */
.demo__step[data-step="2"],
.demo__step[data-step="4"],
.demo__step[data-step="6"] {
  grid-template-columns: 1fr 80px;
}

.demo__step[data-step="2"] .demo__step-indicator,
.demo__step[data-step="4"] .demo__step-indicator,
.demo__step[data-step="6"] .demo__step-indicator {
  order: 2;
}

.demo__step[data-step="2"] .demo__step-content,
.demo__step[data-step="4"] .demo__step-content,
.demo__step[data-step="6"] .demo__step-content {
  order: 1;
  text-align: right;
}

/* Step Indicator (Numbered Circle) */
.demo__step-indicator {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.demo__step-indicator::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(77, 101, 255, 0.1);
  border: 2px solid #4d65ff;
  box-shadow:
    0 0 20px rgba(77, 101, 255, 0.3),
    inset 0 0 20px rgba(77, 101, 255, 0.1);
  transition: all 0.3s ease;
}

.demo__step:hover .demo__step-indicator::before {
  box-shadow:
    0 0 40px rgba(77, 101, 255, 0.5),
    inset 0 0 30px rgba(77, 101, 255, 0.2);
  transform: scale(1.05);
}

.demo__step-number {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: #4d65ff;
  position: relative;
  z-index: 1;
  letter-spacing: 0.05em;
}

/* Step Content */
.demo__step-content {
  position: relative;
  padding-top: 8px;
}

.demo__step-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 600;
  color: white;
  margin: 0 0 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.demo__step-description {
  font-family: var(--font-body);
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  margin: 0 0 20px;
  max-width: 500px;
}

.demo__step[data-step="2"] .demo__step-description,
.demo__step[data-step="4"] .demo__step-description,
.demo__step[data-step="6"] .demo__step-description {
  margin-left: auto;
}

/* Step Art - CSS decorations */
.demo__step-art {
  width: 60px;
  height: 60px;
  position: relative;
  margin-top: 16px;
}

.demo__step[data-step="2"] .demo__step-art,
.demo__step[data-step="4"] .demo__step-art,
.demo__step[data-step="6"] .demo__step-art {
  margin-left: auto;
}

/* AUDIT art - scanning grid */
.demo__step-art--audit::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(90deg, transparent 48%, rgba(77, 101, 255, 0.3) 50%, transparent 52%),
    linear-gradient(0deg, transparent 48%, rgba(77, 101, 255, 0.3) 50%, transparent 52%);
  background-size: 20px 20px;
  opacity: 0.5;
}

/* DETECT art - radar sweep */
.demo__step-art--detect::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(77, 101, 255, 0.4);
  animation: pulse 2s ease-in-out infinite;
}

.demo__step-art--detect::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(77, 101, 255, 0.6) 60deg,
    transparent 120deg
  );
  animation: rotate 3s linear infinite;
}

/* REMEDIATE art - hexagon grid */
.demo__step-art--remediate::before {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: rgba(77, 101, 255, 0.3);
  border: 2px solid #4d65ff;
}

/* APPROVE art - checkmark */
.demo__step-art--approve::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 35px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%) rotate(45deg);
  border-right: 3px solid #4d65ff;
  border-bottom: 3px solid #4d65ff;
  opacity: 0.8;
}

/* AMPLIFY art - broadcast waves */
.demo__step-art--amplify::before,
.demo__step-art--amplify::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(77, 101, 255, 0.4);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: ripple 2s ease-out infinite;
}

.demo__step-art--amplify::after {
  animation-delay: 1s;
}

/* ATTRIBUTE art - trending up arrow */
.demo__step-art--attribute::before {
  content: '';
  position: absolute;
  width: 30px;
  height: 3px;
  bottom: 15px;
  left: 10px;
  background: #4d65ff;
  transform: rotate(45deg);
}

.demo__step-art--attribute::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  top: 8px;
  right: 10px;
  border-top: 3px solid #4d65ff;
  border-right: 3px solid #4d65ff;
  transform: rotate(-45deg);
}

/* Animations */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes ripple {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .demo {
    padding: 80px 0;
  }

  .demo__header {
    margin-bottom: 60px;
  }

  .demo__title {
    font-size: 2rem;
  }

  .demo__subtitle {
    font-size: 1rem;
  }

  /* Mobile: single column, all steps left-aligned */
  .demo__step,
  .demo__step[data-step="2"],
  .demo__step[data-step="4"],
  .demo__step[data-step="6"] {
    grid-template-columns: 60px 1fr;
    gap: 20px;
    margin-bottom: 60px;
  }

  .demo__step-indicator {
    width: 60px;
    height: 60px;
  }

  .demo__step-number {
    font-size: 1.25rem;
  }

  .demo__step[data-step="2"] .demo__step-indicator,
  .demo__step[data-step="4"] .demo__step-indicator,
  .demo__step[data-step="6"] .demo__step-indicator {
    order: 0;
  }

  .demo__step[data-step="2"] .demo__step-content,
  .demo__step[data-step="4"] .demo__step-content,
  .demo__step[data-step="6"] .demo__step-content {
    order: 1;
    text-align: left;
  }

  .demo__step-title {
    font-size: 1.5rem;
  }

  .demo__step-description {
    font-size: 0.9375rem;
  }

  .demo__step[data-step="2"] .demo__step-description,
  .demo__step[data-step="4"] .demo__step-description,
  .demo__step[data-step="6"] .demo__step-description {
    margin-left: 0;
  }

  .demo__step-art {
    width: 50px;
    height: 50px;
  }

  .demo__step[data-step="2"] .demo__step-art,
  .demo__step[data-step="4"] .demo__step-art,
  .demo__step[data-step="6"] .demo__step-art {
    margin-left: 0;
  }

  .demo::before {
    left: 30px;
  }
}

@media (max-width: 480px) {
  .demo {
    padding: 60px 0;
  }

  .demo__step {
    margin-bottom: 50px;
  }

  .demo__title {
    font-size: 1.75rem;
  }

  .demo__step-title {
    font-size: 1.25rem;
  }
}

/* Background Image */
.demo__bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
  filter: brightness(0.85);
}

/* Background overlay (::before is timeline line, use ::after for bg overlay) */
.demo::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(10, 14, 26, 0.6);
  pointer-events: none;
}

/* Ensure content sits above bg */
.demo .container {
  position: relative;
  z-index: 2;
}

/* Boosted step card contrast for bg image readability */
.demo__step {
  background: rgba(10, 14, 39, 0.75) !important;
  border: 1px solid rgba(77, 101, 255, 0.2) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.demo__step:hover {
  background: rgba(10, 14, 39, 0.88) !important;
  border-color: rgba(77, 101, 255, 0.4) !important;
}
