/* ============================================================
   HOW IT WORKS - Frontora AI V2-Pre
   ============================================================ */

.hiw-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(16,185,129,0.1);
  color: var(--brand-700);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hiw-h1 {
  font-family: var(--font-display, 'Outfit', sans-serif);
  font-size: clamp(36px, 5.5vw, 60px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  color: var(--neutral-900);
}

.hiw-h1-accent {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hiw-h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  color: var(--neutral-900);
}

.hiw-h2 em {
  font-style: italic;
  color: var(--brand-600);
  font-weight: 700;
}

.hiw-section-sub {
  font-size: clamp(15px, 1.25vw, 17px);
  line-height: 1.55;
  color: var(--neutral-600);
  margin: 0;
  max-width: 620px;
}

/* ---------- HERO ---------- */
.hiw-hero {
  position: relative;
  padding: clamp(80px, 11vw, 120px) 0 clamp(40px, 6vw, 60px);
  background:
    radial-gradient(ellipse 70% 60% at 80% 30%, rgba(16,185,129,0.08), transparent 60%),
    var(--neutral-0);
  overflow: hidden;
  text-align: center;
}

.hiw-hero-inner {
  max-width: 880px;
  margin: 0 auto;
}

.hiw-lede {
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.6;
  color: var(--neutral-700, #404040);
  margin: 0 auto 32px;
  max-width: 620px;
}

.hiw-hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- FLOWCHART STAGE ---------- */
.hiw-flow {
  background: var(--neutral-950, #0a0a0a);
  color: white;
  padding: clamp(60px, 8vw, 100px) 0;
  scroll-margin-top: 80px;
}

.hiw-flow-header {
  text-align: center;
  margin-bottom: clamp(32px, 4vw, 48px);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.hiw-flow-header .hiw-eyebrow {
  background: rgba(16,185,129,0.18);
  color: var(--brand-500);
}

.hiw-flow-header .hiw-h2 {
  color: white;
}

.hiw-flow-header .hiw-section-sub {
  color: rgba(255,255,255,0.7);
  margin: 0 auto;
}

.hiw-flow-stage {
  position: relative;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: clamp(24px, 4vw, 40px);
}

/* Play controls */
.hiw-flow-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.hiw-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: white;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 16px -4px rgba(16,185,129,0.5);
}

.hiw-play-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -4px rgba(16,185,129,0.6);
}

.hiw-play-btn svg {
  width: 16px;
  height: 16px;
}

.hiw-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: all 0.15s ease;
}

.hiw-reset-btn:hover {
  background: rgba(255,255,255,0.14);
  color: white;
}

.hiw-reset-btn svg {
  width: 18px;
  height: 18px;
}

/* Flow grid - 3x2 nodes on desktop */
.hiw-flow-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 80px;
  margin-bottom: 32px;
  z-index: 1;
}

/* SVG connector - sits behind nodes */
.hiw-flow-connector {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

.hiw-path {
  fill: none;
  stroke: var(--brand-500);
  stroke-width: 2;
  stroke-dasharray: 6 6;
  stroke-linecap: round;
}

/* Individual node */
.hiw-node {
  position: relative;
  z-index: 2;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 20px;
  transition: all 0.4s ease;
}

.hiw-node.is-active {
  background: rgba(16,185,129,0.12);
  border-color: var(--brand-500);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px -8px rgba(16,185,129,0.4);
}

.hiw-node.is-done {
  background: rgba(16,185,129,0.06);
  border-color: rgba(16,185,129,0.3);
}

.hiw-node-num {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 11px;
  font-weight: 700;
  color: rgba(16,185,129,0.7);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.hiw-node-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(16,185,129,0.15);
  color: var(--brand-500);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  transition: all 0.3s ease;
}

.hiw-node-icon svg {
  width: 22px;
  height: 22px;
}

.hiw-node.is-active .hiw-node-icon {
  background: var(--brand-500);
  color: white;
  transform: scale(1.05);
}

.hiw-node-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
  color: white;
  line-height: 1.25;
}

.hiw-node-desc {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255,255,255,0.65);
  margin: 0 0 12px;
}

.hiw-node-meta {
  display: inline-block;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-500);
  padding: 3px 8px;
  background: rgba(16,185,129,0.12);
  border-radius: 4px;
}

/* Animated traveling dot */
.hiw-flow-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--brand-500);
  border-radius: 50%;
  z-index: 3;
  pointer-events: none;
  box-shadow: 0 0 0 4px rgba(16,185,129,0.3), 0 0 20px var(--brand-500);
  transition: opacity 0.3s ease;
}

.hiw-flow-dot-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--brand-500);
  animation: hiw-pulse-out 1.2s ease-out infinite;
}

@keyframes hiw-pulse-out {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* Live transcript */
.hiw-transcript {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  overflow: hidden;
}

.hiw-transcript-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
}

.hiw-transcript-dot {
  width: 8px;
  height: 8px;
  background: #525252;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.3s ease;
}

.hiw-transcript.is-playing .hiw-transcript-dot {
  background: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.3);
  animation: hiw-pulse-dot 1.2s ease-in-out infinite;
}

@keyframes hiw-pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hiw-transcript-title {
  font-weight: 600;
  color: white;
}

.hiw-transcript-status {
  margin-left: auto;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  font-family: var(--font-mono, monospace);
}

.hiw-transcript-body {
  padding: 18px;
  min-height: 180px;
  max-height: 280px;
  overflow-y: auto;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,0.85);
}

.hiw-transcript-empty {
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 32px 16px;
  font-family: var(--font-body);
  font-size: 14px;
}

.hiw-transcript-line {
  margin-bottom: 12px;
  opacity: 0;
  animation: hiw-line-in 0.4s ease forwards;
}

.hiw-transcript-line.line-mia .speaker {
  color: var(--brand-500);
}

.hiw-transcript-line.line-customer .speaker {
  color: #f5d68a;
}

.hiw-transcript-line .speaker {
  font-weight: 700;
  margin-right: 8px;
}

@keyframes hiw-line-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- DEEPER 3-COLUMN ---------- */
.hiw-deeper {
  background: var(--neutral-100);
  padding: clamp(60px, 8vw, 100px) 0;
}

.hiw-deeper-header {
  text-align: center;
  margin-bottom: clamp(32px, 4vw, 56px);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.hiw-deeper-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.hiw-deeper-col {
  background: white;
  border: 1px solid var(--neutral-200);
  border-radius: 16px;
  padding: 28px;
}

.hiw-deeper-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.hiw-deeper-icon svg {
  width: 22px;
  height: 22px;
}

.hiw-deeper-icon-yes {
  background: rgba(16,185,129,0.12);
  color: var(--brand-700);
}

.hiw-deeper-icon-no {
  background: rgba(239,68,68,0.1);
  color: #dc2626;
}

.hiw-deeper-icon-stack {
  background: rgba(245,158,11,0.12);
  color: #c4a35a;
}

.hiw-deeper-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--neutral-900);
}

.hiw-deeper-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hiw-deeper-list li {
  font-size: 14px;
  line-height: 1.5;
  color: var(--neutral-700);
  padding-left: 22px;
  position: relative;
}

.hiw-deeper-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 12px;
  height: 2px;
  background: var(--brand-500);
  border-radius: 1px;
}

.hiw-deeper-yes .hiw-deeper-list li::before { background: var(--brand-500); }
.hiw-deeper-no .hiw-deeper-list li::before { background: #dc2626; }
.hiw-deeper-stack .hiw-deeper-list li::before { background: #c4a35a; }

.hiw-stack-list strong {
  color: var(--neutral-900);
  font-weight: 600;
}

/* ---------- TIMELINE ---------- */
.hiw-timeline {
  background: var(--neutral-0);
  padding: clamp(60px, 8vw, 100px) 0;
}

.hiw-timeline-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hiw-tl-step {
  display: flex;
  align-items: stretch;
  gap: 20px;
  position: relative;
}

.hiw-tl-marker {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  position: relative;
  z-index: 2;
}

.hiw-tl-step:not(:last-child) .hiw-tl-marker::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  width: 2px;
  height: calc(100% + 20px);
  background: linear-gradient(to bottom, var(--brand-500), rgba(16,185,129,0.2));
  transform: translateX(-50%);
  z-index: -1;
}

.hiw-tl-content {
  flex: 1;
  background: var(--neutral-100);
  border: 1px solid var(--neutral-200);
  border-radius: 12px;
  padding: 18px 22px;
}

.hiw-tl-time {
  display: inline-block;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-700);
  background: rgba(16,185,129,0.1);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.hiw-tl-content h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--neutral-900);
}

.hiw-tl-content p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--neutral-600);
  margin: 0;
}

/* ---------- FINAL CTA ---------- */
.hiw-final-cta {
  background: var(--neutral-0);
  padding: clamp(60px, 8vw, 100px) 0;
  border-top: 1px solid var(--neutral-200);
}

.hiw-final-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  align-items: center;
  max-width: 1080px;
  margin: 0 auto;
}

.hiw-final-h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
  color: var(--neutral-900);
}

.hiw-final-h2 em {
  font-style: italic;
  color: var(--brand-600);
}

.hiw-final-sub {
  font-size: 16px;
  line-height: 1.55;
  color: var(--neutral-600);
  margin: 0;
  max-width: 540px;
}

.hiw-final-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-large {
  padding: 14px 28px;
  font-size: 16px;
}

.btn-ghost-light {
  background: transparent;
  border: 1.5px solid var(--neutral-300);
  color: var(--neutral-700);
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-ghost-light:hover {
  background: var(--neutral-100);
  border-color: var(--brand-500);
  color: var(--brand-700);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .hiw-flow-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .hiw-flow-connector {
    display: none;
  }
  .hiw-deeper-grid {
    grid-template-columns: 1fr;
  }
  .hiw-final-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hiw-final-actions {
    align-items: center;
  }
}

@media (max-width: 540px) {
  .hiw-h1 { font-size: 36px; }
  .hiw-h2 { font-size: 26px; }
  .hiw-hero-actions { flex-direction: column; align-items: stretch; }
  .hiw-flow-controls { flex-wrap: wrap; }
  .hiw-tl-marker { width: 36px; height: 36px; font-size: 14px; }
  .hiw-final-h2 { font-size: 24px; }
}
