/*
 * CHAPTER 5: AI INNOVATION & AUTOMATION
 * 10-Node Workflow Visualization
 */

.chapter-5 {
  position: relative;
  width: 100vw;
  min-height: 50vh; /* Adjust height since simulation is removed */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: var(--z-content);
  background: var(--bg-deep); 
  padding: 15vh 0;
}

.chapter-5-flow {
  position: relative;
  width: 100vw;
  height: 75vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: var(--z-content);
  background: var(--bg-deep); 
}

.c5-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
  padding: 0 2rem;
}

.c5-text {
  text-align: center;
}

.c5-text h2 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 5vw, 5rem);
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.c5-text p {
  font-size: var(--text-manifesto);
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 2rem auto;
}

.c5-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
}

.c5-stat h4 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--accent-primary);
  margin-bottom: 0.2rem;
}
.c5-stat span {
  color: var(--text-dim);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* SVG Flow Simulation Container */
.c5-simulation {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 800px; /* Maps exactly to the 1200x800 viewBox if width is 1200 */
  margin: 0 auto;
}

.c5-svg-container {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Let clicks pass to nodes */
}

/* The travelling particle */
.c5-particle {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 30px 10px var(--accent-primary);
  top: 0; left: 0;
  z-index: 10;
  opacity: 0;
  /* Origin centered for MotionPath positioning */
  transform: translate(-50%, -50%); 
}

/* Nodes along the path */
.c5-node {
  position: absolute;
  width: 160px;
  /* Centered around their absolute coords */
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  border-radius: 16px;
  background: var(--bg-glass-strong);
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1); /* Cinematic */
  cursor: pointer;
  z-index: 2;
  opacity: 0.5; /* Dim until reached */
}

.c5-node-icon {
  margin-bottom: 0.5rem;
}

.c5-node-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.5s;
}

/* Active State (When Particle hits it) */
.c5-node.active {
  opacity: 1;
  background: rgba(255,255,255,0.05);
  border-color: var(--accent-primary);
  box-shadow: 0 0 50px rgba(79, 172, 254, 0.4);
  transform: translate(-50%, -50%) scale(1.15); /* Keep translation! */
}

.c5-node.active .c5-node-title {
  color: #fff;
}

.c5-node.completed {
  opacity: 0.8;
  border-color: rgba(255,255,255,0.2);
  transform: translate(-50%, -50%) scale(1);
}

.c5-node.completed .c5-node-title {
  color: #ccc;
}
