/* ============================================
   HOW IT WORKS — Premium Split-Screen Story
   ============================================ */

.hiw-section {
  padding: 100px 0 80px;
  background: linear-gradient(180deg, var(--white) 0%, var(--bg-soft-blue) 40%, var(--bg-soft-purple) 100%);
  position: relative;
}

.hiw-section::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
  top: 10%;
  right: -10%;
  pointer-events: none;
}

.hiw-story {
  position: relative;
  margin-top: 48px;
}

.hiw-story__pin {
  position: relative;
  min-height: auto;
  display: flex;
  align-items: center;
  padding: 40px 0 48px;
}

.hiw-story__grid {
  display: grid;
  grid-template-columns: 40% 60%;
  gap: 48px;
  align-items: center;
  width: 100%;
}

/* --- Timeline (Left) --- */
.hiw-timeline {
  position: relative;
  padding-left: 8px;
}

.hiw-timeline__track {
  position: absolute;
  left: 27px;
  top: 24px;
  bottom: 24px;
  width: 3px;
  z-index: 0;
}

.hiw-timeline__line {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 3px;
}

.hiw-timeline__fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, #2563EB, #8B5CF6, #06B6D4);
  border-radius: 3px;
  transition: height 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.5);
}

.hiw-step {
  position: relative;
  display: grid;
  grid-template-columns: 48px 44px 1fr;
  gap: 12px;
  align-items: start;
  padding: 16px 16px 16px 0;
  margin-bottom: 4px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.45;
  z-index: 1;
}

.hiw-step:hover {
  opacity: 0.75;
  background: rgba(255, 255, 255, 0.5);
}

.hiw-step.is-active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(37, 99, 235, 0.1), 0 0 24px rgba(37, 99, 235, 0.12);
  transform: translateX(6px);
  animation: hiwStepGlow 2s ease-in-out infinite;
}

.hiw-step.is-done {
  opacity: 0.65;
}

.hiw-step__num {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  padding-top: 4px;
  text-align: center;
  transition: color 0.3s;
}

.hiw-step.is-active .hiw-step__num {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 0.875rem;
}

.hiw-step__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  transition: all 0.4s ease;
  position: relative;
  z-index: 2;
}

.hiw-step.is-active .hiw-step__icon {
  background: var(--gradient-primary);
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  transform: scale(1.08);
}

.hiw-step__content h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
  transition: color 0.3s;
}

.hiw-step.is-active .hiw-step__content h3 {
  font-size: 1.0625rem;
}

.hiw-step__content p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.55;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.4s ease, margin 0.4s ease;
  margin: 0;
}

.hiw-step.is-active .hiw-step__content p {
  max-height: 80px;
  opacity: 1;
  margin-top: 4px;
}

/* --- Stage (Right) --- */
.hiw-stage {
  position: relative;
  perspective: 1200px;
}

.hiw-stage__glow {
  position: absolute;
  width: 80%;
  height: 80%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(37, 99, 235, 0.18) 0%, rgba(139, 92, 246, 0.08) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: hiwGlowMorph 8s ease-in-out infinite;
}

.hiw-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.hiw-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(37, 99, 235, 0.4);
  border-radius: 50%;
}

.hiw-dashboard {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(37, 99, 235, 0.12), 0 0 0 1px rgba(37, 99, 235, 0.06);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out, box-shadow 0.4s ease;
}

.hiw-dashboard--pulse {
  animation: hiwDashPulse 0.6s ease-out;
}

.hiw-dashboard::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.4), rgba(139, 92, 246, 0.4), rgba(6, 182, 212, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 20;
  opacity: 0.7;
}

.hiw-dashboard__chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(37, 99, 235, 0.08);
  background: rgba(255, 255, 255, 0.5);
}

.hiw-dashboard__dots {
  display: flex;
  gap: 6px;
}

.hiw-dashboard__dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.hiw-dashboard__dots span:nth-child(1) { background: #EF4444; }
.hiw-dashboard__dots span:nth-child(2) { background: #F59E0B; }
.hiw-dashboard__dots span:nth-child(3) { background: #22C55E; }

.hiw-dashboard__title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  flex: 1;
}

.hiw-dashboard__status {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hiw-dashboard__status i {
  font-size: 0.4rem;
  animation: hiwBlink 1.5s ease-in-out infinite;
}

.hiw-dashboard__body {
  position: relative;
  min-height: 380px;
  padding: 24px;
  background: linear-gradient(160deg, rgba(238, 244, 255, 0.5) 0%, rgba(243, 240, 255, 0.3) 100%);
}

.hiw-scene {
  position: absolute;
  inset: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(20px) scale(0.98);
  transition: visibility 0.35s;
}

.hiw-scene.is-active,
.hiw-scene.is-leaving {
  visibility: visible;
  pointer-events: auto;
}

.hiw-scene.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  z-index: 2;
}

.hiw-float-widget {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--primary);
  box-shadow: var(--shadow-md);
  z-index: 10;
  animation: hiwFloat 3s ease-in-out infinite;
}

.hiw-float-widget i { color: var(--accent); }

/* Glass card utility */
.hiw-glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.08);
}

/* Scene 0: Capture */
.hiw-capture {
  position: relative;
  height: 320px;
}

.hiw-capture__hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  border-radius: 20px;
  background: var(--gradient-primary);
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.35);
  z-index: 3;
}

.hiw-capture__hub i { font-size: 1.5rem; }

.hiw-capture__count {
  font-style: normal;
  font-size: 1.125rem;
  font-weight: 800;
}

.hiw-capture__source {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--dark);
  box-shadow: var(--shadow-sm);
  z-index: 2;
  animation: hiwSourcePulse 2s ease-in-out infinite;
}

.hiw-capture__source i {
  font-size: 1.125rem;
  color: var(--primary);
}

.hiw-capture__source--1 { top: 8px; left: 50%; transform: translateX(-50%); }
.hiw-capture__source--2 { top: 18%; right: 8%; animation-delay: 0.2s; }
.hiw-capture__source--3 { top: 42%; right: 0; animation-delay: 0.4s; }
.hiw-capture__source--4 { bottom: 18%; right: 8%; animation-delay: 0.6s; }
.hiw-capture__source--5 { bottom: 8px; left: 50%; transform: translateX(-50%); animation-delay: 0.8s; }
.hiw-capture__source--6 { top: 42%; left: 0; animation-delay: 1s; }

.hiw-scene.is-active .hiw-capture__source {
  animation: hiwSourceIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.hiw-scene.is-active .hiw-capture__source--1 { animation-delay: 0.05s; }
.hiw-scene.is-active .hiw-capture__source--2 { animation-delay: 0.15s; }
.hiw-scene.is-active .hiw-capture__source--3 { animation-delay: 0.25s; }
.hiw-scene.is-active .hiw-capture__source--4 { animation-delay: 0.35s; }
.hiw-scene.is-active .hiw-capture__source--5 { animation-delay: 0.45s; }
.hiw-scene.is-active .hiw-capture__source--6 { animation-delay: 0.55s; }

.hiw-capture__source--2 i { color: #25D366; }
.hiw-capture__source--3 i { color: #1877F2; }
.hiw-capture__source--4 i { color: #EA4335; }

.hiw-capture__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.hiw-flow-path {
  fill: none;
  stroke: url(#hiwFlowGrad);
  stroke-width: 2;
  stroke-dasharray: 8 6;
  animation: hiwFlowDash 1.5s linear infinite;
}

/* Scene 1: Qualify */
.hiw-qualify {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}

.hiw-lead-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  width: 100%;
  max-width: 280px;
}

.hiw-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  flex-shrink: 0;
}

.hiw-lead-card strong { display: block; font-size: 0.9375rem; color: var(--dark); }
.hiw-lead-card small { font-size: 0.75rem; color: var(--text-muted); }

.hiw-ai-scan {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  animation: hiwScanPulse 1.5s ease-in-out infinite;
}

.hiw-ai-scan i { font-size: 1.25rem; }

.hiw-score {
  position: relative;
  width: 100px;
  height: 100px;
}

.hiw-score svg { width: 100%; height: 100%; }

.hiw-score__val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
}

.hiw-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.hiw-seg {
  padding: 6px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(8px);
}

.hiw-seg--hot {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #DC2626;
}

.hiw-scene.is-active .hiw-seg {
  animation: hiwSegIn 0.4s ease forwards;
}

.hiw-scene.is-active .hiw-seg:nth-child(2) { animation-delay: 0.15s; }
.hiw-scene.is-active .hiw-seg:nth-child(3) { animation-delay: 0.3s; }

/* Scene 2: Automate */
.hiw-automate {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.hiw-auto-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 16px;
  opacity: 0;
  transform: translateX(-20px);
}

.hiw-scene.is-active .hiw-auto-row {
  animation: hiwRowIn 0.5s ease forwards;
}

.hiw-scene.is-active .hiw-auto-row:nth-child(2) { animation-delay: 0.2s; }
.hiw-scene.is-active .hiw-auto-row:nth-child(3) { animation-delay: 0.4s; }
.hiw-scene.is-active .hiw-auto-row:nth-child(4) { animation-delay: 0.6s; }

.hiw-auto-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hiw-auto-icon--wa { background: rgba(37, 211, 102, 0.15); color: #25D366; }

.hiw-auto-text { flex: 1; }
.hiw-auto-text strong { display: block; font-size: 0.8125rem; color: var(--dark); }
.hiw-auto-text small { font-size: 0.6875rem; color: var(--text-muted); }

.hiw-auto-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #22C55E;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  opacity: 0;
  transform: scale(0);
}

.hiw-scene.is-active .hiw-auto-check {
  animation: hiwCheckPop 0.4s ease forwards 0.8s;
}

.hiw-scene.is-active .hiw-auto-row:nth-child(2) .hiw-auto-check { animation-delay: 1s; }
.hiw-scene.is-active .hiw-auto-row:nth-child(3) .hiw-auto-check { animation-delay: 1.2s; }
.hiw-scene.is-active .hiw-auto-row:nth-child(4) .hiw-auto-check { animation-delay: 1.4s; }

/* Scene 3: Kanban */
.hiw-kanban {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  min-height: 280px;
  padding-top: 8px;
}

.hiw-kanban__col {
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  min-height: 200px;
}

.hiw-kanban__col > span {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 12px;
}

.hiw-kanban__col--active {
  background: rgba(37, 99, 235, 0.06);
  border: 2px solid var(--primary);
  border-style: solid;
}

.hiw-kanban__card {
  position: absolute;
  top: 48px;
  left: 8px;
  width: calc(25% - 14px);
  padding: 12px;
  background: var(--gradient-primary);
  color: var(--white);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
  z-index: 5;
  transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
}

.hiw-kanban__card strong { display: block; font-size: 0.8125rem; }
.hiw-kanban__card em { display: block; font-size: 1rem; font-weight: 800; font-style: normal; margin: 4px 0; }
.hiw-kanban__card small { font-size: 0.625rem; opacity: 0.8; }

.hiw-kanban__card[data-stage="0"] { left: calc(0% + 8px); }
.hiw-kanban__card[data-stage="1"] { left: calc(25% + 2px); }
.hiw-kanban__card[data-stage="2"] { left: calc(50% - 4px); }
.hiw-kanban__card[data-stage="3"] { left: calc(75% - 10px); background: linear-gradient(135deg, #22C55E, #14B8A6); }

/* Scene 4: Analyze */
.hiw-analyze { width: 100%; }

.hiw-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.hiw-kpi {
  padding: 14px 12px;
  text-align: center;
}

.hiw-kpi small {
  display: block;
  font-size: 0.625rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.hiw-kpi__val {
  display: block;
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--dark);
}

.hiw-kpi__up {
  font-size: 0.625rem;
  font-weight: 600;
  color: #22C55E;
}

.hiw-analyze__chart {
  width: 100%;
  height: 100px;
  display: block;
}

.hiw-chart-line {
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
}

.hiw-scene.is-active .hiw-chart-line {
  animation: hiwDrawLine 2s ease forwards 0.3s;
}

.hiw-chart-area {
  opacity: 0;
}

.hiw-scene.is-active .hiw-chart-area {
  animation: hiwFadeIn 1s ease forwards 1s;
}

.hiw-refresh {
  text-align: center;
  margin-top: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  opacity: 0;
}

.hiw-scene.is-active .hiw-refresh {
  animation: hiwFadeIn 0.5s ease forwards 1.5s;
}

.hiw-refresh i {
  margin-right: 6px;
  animation: hiwSpin 1s linear infinite;
}

/* Scene 5: Optimize */
.hiw-optimize {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.hiw-ai-widget {
  width: 100%;
  max-width: 340px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.12);
}

.hiw-ai-widget__head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.hiw-ai-widget__head i {
  color: var(--accent);
  font-size: 1.125rem;
}

.hiw-ai-widget__insight {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--text);
  padding: 8px 0;
  opacity: 0;
  transform: translateX(-12px);
}

.hiw-scene.is-active .hiw-ai-widget__insight {
  animation: hiwRowIn 0.4s ease forwards;
}

.hiw-scene.is-active .hiw-ai-widget__insight:nth-child(3) { animation-delay: 0.2s; }
.hiw-scene.is-active .hiw-ai-widget__insight:nth-child(4) { animation-delay: 0.4s; }

.hiw-ai-widget__insight i {
  color: var(--primary);
  margin-top: 2px;
}

.hiw-revenue-counter {
  text-align: center;
  padding: 20px 32px;
  background: var(--gradient-primary);
  border-radius: 20px;
  color: var(--white);
  box-shadow: 0 12px 40px rgba(37, 99, 235, 0.35);
}

.hiw-revenue-counter small {
  display: block;
  font-size: 0.75rem;
  opacity: 0.85;
  margin-bottom: 4px;
}

.hiw-revenue-counter__val {
  display: block;
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.1;
}

.hiw-success-glow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  animation: hiwSuccessGlow 2s ease-in-out infinite;
}

/* Keyframes */
@keyframes hiwGlowMorph {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  50% { transform: translate(-48%, -52%) scale(1.08); opacity: 0.85; }
}

@keyframes hiwSourceIn {
  from { opacity: 0; transform: translateX(-50%) scale(0.8); }
  to { opacity: 1; transform: translateX(-50%) scale(1); }
}

.hiw-capture__source--2,
.hiw-capture__source--3,
.hiw-capture__source--4,
.hiw-capture__source--6 {
  animation-name: hiwSourceInSide;
}

@keyframes hiwSourceInSide {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes hiwStepGlow {
  0%, 100% { box-shadow: var(--shadow-md), 0 0 0 1px rgba(37, 99, 235, 0.1), 0 0 16px rgba(37, 99, 235, 0.08); }
  50% { box-shadow: var(--shadow-md), 0 0 0 1px rgba(37, 99, 235, 0.2), 0 0 32px rgba(139, 92, 246, 0.2); }
}

@keyframes hiwDashPulse {
  0% { box-shadow: 0 24px 64px rgba(37, 99, 235, 0.12), 0 0 0 0 rgba(37, 99, 235, 0.3); }
  50% { box-shadow: 0 28px 72px rgba(37, 99, 235, 0.2), 0 0 0 8px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 24px 64px rgba(37, 99, 235, 0.12), 0 0 0 0 rgba(37, 99, 235, 0); }
}

@keyframes hiwBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes hiwFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes hiwSourcePulse {
  0%, 100% { transform: translateX(-50%) scale(1); box-shadow: var(--shadow-sm); }
  50% { box-shadow: 0 4px 20px rgba(37, 99, 235, 0.2); }
}

.hiw-capture__source--2,
.hiw-capture__source--3,
.hiw-capture__source--4,
.hiw-capture__source--6 {
  animation-name: hiwSourcePulseSide;
}

@keyframes hiwSourcePulseSide {
  0%, 100% { transform: scale(1); }
  50% { box-shadow: 0 4px 20px rgba(37, 99, 235, 0.2); }
}

@keyframes hiwFlowDash {
  to { stroke-dashoffset: -28; }
}

@keyframes hiwScanPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes hiwSegIn {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hiwRowIn {
  to { opacity: 1; transform: translateX(0); }
}

@keyframes hiwCheckPop {
  to { opacity: 1; transform: scale(1); }
}

@keyframes hiwDrawLine {
  to { stroke-dashoffset: 0; }
}

@keyframes hiwFadeIn {
  to { opacity: 1; }
}

@keyframes hiwSpin {
  to { transform: rotate(360deg); }
}

@keyframes hiwSuccessGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 255, 255, 0); }
  50% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.4); }
}

/* Mobile */
@media (max-width: 1024px) {
  .hiw-story__pin {
    min-height: auto;
    padding: 24px 0 48px;
  }

  .hiw-story__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hiw-dashboard__body { min-height: 340px; }

  .hiw-step__content p {
    max-height: 80px;
    opacity: 1;
  }

  .hiw-step:not(.is-active) .hiw-step__content p {
    max-height: 0;
    opacity: 0;
  }
}

@media (max-width: 640px) {
  .hiw-section { padding-top: 72px; }

  .hiw-step {
    grid-template-columns: 40px 40px 1fr;
    gap: 8px;
    padding: 12px 8px 12px 0;
  }

  .hiw-kanban {
    grid-template-columns: repeat(2, 1fr);
    min-height: 240px;
  }

  .hiw-kanban__card {
    width: calc(50% - 14px);
  }

  .hiw-kanban__card[data-stage="2"],
  .hiw-kanban__card[data-stage="3"] {
    top: 140px;
  }

  .hiw-kpis { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .hiw-scene { transition: opacity 0.2s; transform: none; }
  .hiw-auto-row, .hiw-seg, .hiw-ai-widget__insight { opacity: 1; transform: none; animation: none; }
  .hiw-auto-check { opacity: 1; transform: scale(1); }
  .hiw-chart-line { stroke-dashoffset: 0; }
  .hiw-chart-area, .hiw-refresh { opacity: 1; }
}
