/* ============================================
   Kapow v2 - Scroll-Driven Cinematic Website
   Pure CSS animations + IntersectionObserver
   No GSAP, no external animation libraries
   ============================================ */

/* --- Custom Properties --- */
:root {
  --bg-void: #0A0A0F;
  --bg-surface: #111118;
  --bg-elevated: #18181F;
  --border: #1E1E28;
  --border-light: #2A2A35;
  --text-primary: #F5F5F7;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;
  --text-disabled: #3F3F46;
  --accent: #FFD60A;
  --accent-hover: #E6C009;
  --accent-active: #CCB008;
  --accent-muted: rgba(255, 214, 10, 0.15);
  --accent-glow: rgba(255, 214, 10, 0.08);
  --success: #22C55E;
  --error: #EF4444;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --max-width: 1200px;
  --section-padding: 120px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--bg-void);
  overflow-x: hidden;
  overscroll-behavior: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* --- Utilities --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

/* --- Scroll Progress --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 1001;
  transition: width 50ms linear;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(10, 10, 15, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  border-bottom: 1px solid transparent;
  z-index: 1000;
  transition: background 300ms ease, backdrop-filter 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}

.nav.nav-solid {
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.nav-logo.visible {
  opacity: 1;
  pointer-events: auto;
}

.nav-logo-spark {
  transition: transform 300ms ease;
}

.nav-logo:hover .nav-logo-spark {
  transform: rotate(20deg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  transition: color 200ms ease;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link.active {
  color: var(--text-primary);
}

.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-mobile-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  transition: all 200ms ease;
}

.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.nav-mobile.open {
  display: flex;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  padding: 12px 24px;
  border: none;
  cursor: pointer;
  transition: all 200ms ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-void);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  background: var(--accent-active);
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--text-disabled);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 16px 40px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-lg);
}

/* --- Section Base --- */
.section {
  padding: var(--section-padding) 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-header h2 {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */

/* Generic scroll reveal */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   SECTION 1: HERO (Sticky Transform)
   ============================================ */

.hero-wrapper {
  height: 200vh;
  position: relative;
}

.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 64px 24px 12px;
  overflow: hidden;
}

.hero-parallax-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-dot-grid {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: radial-gradient(circle, var(--text-muted) 1px, transparent 1px);
  background-size: 32px 32px;
}

.hero-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.3s ease;
}

/* Hero Logo Zone (v3 - independent zone) */
.hero-logo-zone {
  width: 800px;
  max-width: 100%;
  margin: 24px auto 0;
  height: auto;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  padding-bottom: 4px;
  overflow: visible;
}

.hero-kapow-logo {
  width: 339px;
  height: auto;
  display: block;
  transform: rotate(-8deg);
  pointer-events: none;
  margin-left: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 800px;
  max-width: 100%;
  margin: 0 auto;
  transition: transform 0.1s linear, opacity 0.1s linear;
}

.hero-headline {
  font-size: 64px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0 0 6px 0;
  transition: transform 0.1s linear, opacity 0.1s linear;
}

.hero-subhead {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 4px 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  transition: opacity 0.1s linear;
}

.hero-supporting {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0 0 20px 0;
  line-height: 1.4;
  transition: opacity 0.1s linear;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 12px 0 6px 0;
  flex-wrap: wrap;
  position: relative;
  z-index: 3;
  transition: opacity 0.1s linear, transform 0.1s linear;
}

.hero-ctas .btn {
  padding: 10px 24px;
  font-size: 15px;
}

.hero-micro {
  font-size: 12px;
  color: var(--text-muted);
  position: relative;
  z-index: 3;
  margin: 0;
  transition: opacity 0.1s linear;
}

/* Hero Demo */
.hero-demo {
  width: 960px;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  transition: transform 0.1s linear, opacity 0.1s linear;
}

.hero-demo-stage {
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
}

/* ============================================
   SECTION 2: PROBLEM (Card Cascade)
   ============================================ */

.section-problem {
  position: relative;
  z-index: 2;
  background: var(--bg-void);
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 64px;
}

.problem-block {
  padding: 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.8s ease;
  will-change: transform, opacity;
}

/* Card from left */
.card-from-left {
  opacity: 0;
  transform: translateX(-60px) rotate(-2deg) scale(0.9);
}

.card-from-left.in-view {
  opacity: 1;
  transform: translateX(0) rotate(0deg) scale(1);
  box-shadow: 0 0 40px rgba(255, 214, 10, 0.08);
}

/* Card from right */
.card-from-right {
  opacity: 0;
  transform: translateX(60px) rotate(2deg) scale(0.9);
}

.card-from-right.in-view {
  opacity: 1;
  transform: translateX(0) rotate(0deg) scale(1);
  box-shadow: 0 0 40px rgba(255, 214, 10, 0.08);
}

/* Card from below */
.card-from-below {
  opacity: 0;
  transform: translateY(40px) scale(0.9);
}

.card-from-below.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
  box-shadow: 0 0 40px rgba(255, 214, 10, 0.08);
}

.problem-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.problem-block p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.problem-transition {
  text-align: center;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   SECTION 3: REFRAME (Sticky Teleprompter)
   ============================================ */

.section-reframe {
  height: 300vh;
  position: relative;
  padding: 0;
}

.reframe-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.reframe-headline {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 40px;
}

.reframe-body p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.reframe-body p:last-child {
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 0;
}

.reframe-emphasis {
  color: var(--accent) !important;
  font-size: 24px !important;
  font-weight: 600 !important;
  text-align: center;
}

/* Teleprompter effect */
.reframe-line {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reframe-line.line-active {
  opacity: 1;
  transform: translateY(0);
}

.reframe-line.line-past {
  opacity: 0.3;
  transform: translateY(0);
}

/* ============================================
   SECTION 4: USE CASES (Horizontal Scroll)
   ============================================ */

.section-usecases {
  padding: 0;
  position: relative;
}

.usecases-header {
  padding: var(--section-padding) 0 40px;
}

.usecase-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 0;
  position: relative;
}

.usecase-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms ease;
  position: relative;
}

.usecase-tab:hover {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.usecase-tab.active {
  background: rgba(255, 214, 10, 0.08);
  color: #FFD60A;
  border-color: rgba(255, 214, 10, 0.2);
}

.usecase-tab.active .usecase-tab-icon {
  color: #FFD60A;
}

.usecase-tab-icon {
  flex-shrink: 0;
}

/* Horizontal scroll track */
.usecases-track-wrapper {
  overflow: hidden;
  padding: 40px 0 var(--section-padding);
  position: relative;
}

/* Use Case Navigation Arrows */
.usecase-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.usecase-nav:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(255, 214, 10, 0.08);
}
.usecase-nav-prev {
  left: 24px;
}
.usecase-nav-next {
  right: 24px;
}
.usecase-nav.hidden {
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 768px) {
  .usecase-nav {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
  .usecase-nav-prev { left: 8px; }
  .usecase-nav-next { right: 8px; }
}

.usecases-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.usecase-panel {
  min-width: 100vw;
  padding: 0 24px;
  display: flex;
  justify-content: center;
}

.usecase-card {
  display: grid;
  grid-template-columns: 80px 1fr 280px;
  gap: 32px;
  align-items: center;
  padding: 40px 48px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  min-height: 280px;
  max-width: 1100px;
  width: 100%;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.usecase-panel.panel-active .usecase-card {
  opacity: 1;
  transform: scale(1);
}

.usecase-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.usecase-icon svg {
  opacity: 0.9;
  filter: drop-shadow(0 0 8px rgba(255, 214, 10, 0.15));
}

.usecase-text {
  min-width: 0;
}

.usecase-subhead {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.usecase-text p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.usecase-kicker {
  color: #FFD60A !important;
  font-size: 14px;
  font-weight: 500;
  margin-top: 16px;
}

/* Workflow Strip */
.workflow-strip {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.workflow-step {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 300ms ease, transform 300ms ease;
}

.panel-active .workflow-step {
  opacity: 1;
  transform: translateX(0);
}

.panel-active .workflow-step:nth-child(1) { transition-delay: 100ms; }
.panel-active .workflow-step:nth-child(3) { transition-delay: 250ms; }
.panel-active .workflow-step:nth-child(5) { transition-delay: 400ms; }
.panel-active .workflow-step:nth-child(7) { transition-delay: 550ms; }

.workflow-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  flex-shrink: 0;
}

.workflow-step-dot.done {
  border-color: #FFD60A;
  background: #FFD60A;
}

.workflow-step-dot.working {
  border-color: var(--text-primary);
  background: var(--text-primary);
  animation: statusPulse 2s ease-in-out infinite;
}

.workflow-step-dot.blocker {
  border-color: #EF4444;
  background: #EF4444;
}

.workflow-step-dot.pending {
  border-color: var(--text-muted);
}

@keyframes statusPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.workflow-step-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.workflow-step-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.workflow-step-agent {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.3;
}

.workflow-step-status {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.workflow-step-status.done {
  color: #FFD60A;
  background: rgba(255, 214, 10, 0.1);
}

.workflow-step-status.working {
  color: var(--text-primary);
  background: rgba(245, 245, 247, 0.08);
}

.workflow-step-status.pending {
  color: var(--text-muted);
  background: rgba(113, 113, 122, 0.1);
}

.workflow-step-status.blocker {
  color: #EF4444;
  background: rgba(239, 68, 68, 0.1);
}

.workflow-connector {
  width: 2px;
  height: 12px;
  background: var(--border);
  margin-left: 4px;
}

/* ============================================
   SECTION 5: FEATURES (Staggered Grid)
   ============================================ */

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

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 200ms ease;
}

.feature-card:hover {
  border-color: var(--border-light);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 1px rgba(255, 214, 10, 0.05);
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-muted);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* --- Feature Animations Container --- */
.feature-anim {
  width: 100%;
  height: 120px;
  margin-bottom: 16px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Scroll-triggered fade-in for feature cards --- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Card 1: Visual Flow Management (fg- prefix)
   ============================================ */
.fg-container {
  position: relative;
  width: 200px;
  height: 120px;
}

.fg-edges {
  position: absolute;
  inset: 0;
  width: 200px;
  height: 120px;
  pointer-events: none;
}

.fg-edge {
  stroke: var(--border);
  stroke-width: 1;
  fill: none;
}

.fg-pulse {
  fill: var(--accent);
  opacity: 0;
}

.fg-node {
  position: absolute;
  width: 72px;
  height: 28px;
  background: var(--bg-void);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  transition: border-color 600ms ease-in-out, box-shadow 600ms ease-in-out;
}

.fg-node-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
  border-radius: 4px 0 0 4px;
  transition: background 500ms ease-in-out;
}

.fg-node-label {
  font-size: 8px;
  font-family: var(--font-sans);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: 5px;
  transition: color 500ms ease-in-out;
}

.fg-node-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-disabled);
  transition: background 500ms ease-in-out, box-shadow 500ms ease-in-out;
}

/* Node positions */
.fg-node-a { left: 8px; top: 8px; }
.fg-node-b { left: 112px; top: 8px; }
.fg-node-c { left: 64px; top: 52px; }
.fg-node-d { left: 120px; top: 88px; width: 64px; height: 24px; }

/* Active state */
.fg-node.fg-active .fg-node-bar { background: var(--accent); }
.fg-node.fg-active .fg-node-dot { background: var(--accent); box-shadow: 0 0 6px rgba(255,214,10,0.4); }
.fg-node.fg-active .fg-node-label { color: var(--text-primary); }
.fg-node.fg-active { box-shadow: 0 0 8px rgba(255,214,10,0.15); }

/* Done state */
.fg-node.fg-done .fg-node-bar { background: var(--text-primary); }
.fg-node.fg-done .fg-node-dot { background: var(--text-primary); box-shadow: none; }
.fg-node.fg-done .fg-node-label { color: var(--text-secondary); }
.fg-node.fg-done { box-shadow: none; }

/* Pulse keyframes */
@keyframes fg-pulse-ab {
  0% { cx: 80; cy: 22; opacity: 1; }
  100% { cx: 112; cy: 22; opacity: 0.3; }
}
@keyframes fg-pulse-ac {
  0% { cx: 52; cy: 36; opacity: 1; }
  100% { cx: 82; cy: 52; opacity: 0.3; }
}
@keyframes fg-pulse-cd {
  0% { cx: 136; cy: 66; opacity: 1; }
  100% { cx: 142; cy: 88; opacity: 0.3; }
}
.fg-pulse.fg-p-ab { animation: fg-pulse-ab 600ms linear forwards; }
.fg-pulse.fg-p-ac { animation: fg-pulse-ac 600ms linear forwards; }
.fg-pulse.fg-p-cd { animation: fg-pulse-cd 600ms linear forwards; }

/* ============================================
   Card 2: Structured Task Hierarchies (th- prefix)
   ============================================ */
.th-container {
  position: relative;
  width: 192px;
  height: 116px;
  overflow: hidden;
}

.th-parent {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 40px;
  height: 32px;
  background: var(--bg-void);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px 0 10px;
  gap: 6px;
  transition: top 500ms ease-out, height 400ms ease-out, box-shadow 400ms ease;
}

.th-parent.th-expanded {
  top: 4px;
  height: 26px;
}

.th-parent.th-glow {
  box-shadow: 0 0 10px rgba(255,214,10,0.2);
}

.th-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  border-radius: 4px 0 0 4px;
}

.th-title {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.th-version {
  font-size: 7px;
  font-weight: 500;
  padding: 1px 5px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 300ms ease-out;
}

.th-version.th-flash {
  transform: scale(1.2);
}

.th-status {
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
  transition: color 300ms ease;
}

.th-status.th-status-working {
  color: #B8E6B8;
}

.th-status.th-status-done {
  color: #22C55E;
}

.th-approve {
  font-size: 7px;
  font-weight: 500;
  padding: 2px 7px;
  background: var(--accent);
  color: var(--bg-void);
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease-in, transform 200ms ease;
}

.th-approve.th-approve-visible {
  opacity: 1;
}

.th-approve.th-approve-pulse {
  transform: scale(1.08);
}

/* Indent line */
.th-indent-line {
  position: absolute;
  left: 16px;
  top: 32px;
  width: 1px;
  height: 0;
  background: var(--border);
  transition: height 400ms ease-out;
}

.th-indent-line.th-indent-visible {
  height: 78px;
}

/* Subtasks */
.th-subtasks {
  position: absolute;
  left: 22px;
  right: 6px;
  top: 36px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 500ms ease-out, transform 500ms ease-out;
}

.th-subtasks.th-subs-visible {
  opacity: 1;
  transform: translateY(0);
}

.th-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 4px;
  opacity: 0;
  transition: opacity 300ms ease;
}

.th-sub.th-sub-show {
  opacity: 1;
}

.th-sub-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-disabled);
  flex-shrink: 0;
  transition: background 300ms ease, box-shadow 300ms ease;
}

.th-sub.th-sub-active .th-sub-dot {
  background: var(--accent);
  box-shadow: 0 0 4px rgba(255,214,10,0.4);
}

.th-sub.th-sub-done .th-sub-dot {
  background: var(--text-disabled);
  box-shadow: none;
}

.th-sub-title {
  font-size: 8px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.th-sub-status {
  font-size: 6px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text-disabled);
  margin-left: auto;
  flex-shrink: 0;
  transition: color 300ms ease;
}

.th-sub.th-sub-active .th-sub-status {
  color: var(--accent);
}

.th-sub.th-sub-done .th-sub-status {
  color: var(--text-disabled);
}

.th-sub-check {
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0);
  transition: opacity 300ms ease, transform 300ms ease;
}

.th-sub.th-sub-done .th-sub-check {
  opacity: 1;
  transform: scale(1);
}

.th-sub.th-sub-done {
  opacity: 0.6;
}

/* ============================================
   Card 3: Instant Dashboard Visibility (db- prefix)
   ============================================ */
.db-container {
  width: 192px;
  height: 112px;
  background: var(--bg-void);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}

.db-filters {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.db-filter {
  font-size: 7px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--text-muted);
  cursor: default;
  transition: all 300ms ease;
}

.db-filter.db-filter-active {
  background: rgba(255,214,10,0.15);
  color: var(--accent);
}

.db-rows {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.db-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 18px;
  padding: 0 2px;
  transition: opacity 400ms ease-out, transform 400ms ease-out;
}

.db-row.db-row-hidden {
  opacity: 0;
  transform: translateY(-8px);
  height: 0;
  overflow: hidden;
  padding: 0;
  margin: 0;
}

.db-row.db-row-dim {
  opacity: 0.45;
}

.db-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 400ms ease, box-shadow 400ms ease;
}

.db-dot-yellow { background: var(--accent); }
.db-dot-done { background: var(--text-primary); }
.db-dot-muted { background: var(--text-disabled); }

.db-dot-pulse {
  box-shadow: 0 0 4px rgba(255,214,10,0.4);
}

.db-task-name {
  font-size: 8px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.db-agent {
  font-size: 7px;
  color: var(--text-muted);
  margin-left: auto;
  flex-shrink: 0;
  transition: color 400ms ease;
}

.db-agent.db-agent-bright {
  color: var(--text-primary);
}

.db-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.db-count {
  font-size: 7px;
  color: var(--text-muted);
  transition: color 200ms ease;
}

.db-views {
  font-size: 7px;
  color: var(--text-disabled);
}

/* ============================================
   Card 4: File & Deliverable Management (ft- prefix)
   ============================================ */
.ft-container {
  position: relative;
  width: 192px;
  height: 112px;
  background: var(--bg-void);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  overflow: hidden;
}

.ft-row {
  display: flex;
  align-items: center;
  height: 12px;
  line-height: 12px;
}

.ft-indent {
  display: inline-block;
  flex-shrink: 0;
}

.ft-l1 { width: 10px; }
.ft-l2 { width: 20px; }
.ft-l3 { width: 30px; }

.ft-icon {
  width: 10px;
  font-size: 7px;
  flex-shrink: 0;
  text-align: center;
}

.ft-chevron { color: var(--accent); font-size: 7px; }
.ft-chevron-r { color: var(--text-disabled); font-size: 7px; }
.ft-dash { color: var(--text-disabled); font-size: 8px; }

.ft-name {
  font-size: 8px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  white-space: nowrap;
}

.ft-name.ft-version {
  color: var(--accent);
}

.ft-name.ft-dim {
  color: var(--text-muted);
}

.ft-active-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 6px;
  flex-shrink: 0;
}

.ft-badge {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 7px;
  font-weight: 500;
  padding: 1px 5px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
}

/* Indent guide lines */
.ft-l1::before,
.ft-l2::before,
.ft-l3::before {
  content: '';
  display: inline-block;
  width: 1px;
  height: 12px;
  background: var(--border);
  vertical-align: middle;
  margin-right: 4px;
}

.ft-l2::before { margin-left: 5px; }
.ft-l3::before { margin-left: 15px; }

/* ============================================
   Card 5: Speed & Control (sc- prefix)
   ============================================ */
.sc-container {
  position: relative;
  width: 192px;
  height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sc-task {
  position: relative;
  width: 180px;
  height: 32px;
  background: var(--bg-void);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 10px 0 12px;
  gap: 8px;
}

.sc-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  border-radius: 4px 0 0 4px;
}

.sc-title {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

.sc-status {
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--accent);
  padding: 1px 5px;
  border: 1px solid rgba(255,214,10,0.3);
  border-radius: 8px;
  background: rgba(255,214,10,0.08);
}

.sc-avatar {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: auto;
  flex-shrink: 0;
}

.sc-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.sc-btn {
  font-size: 8px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 3px;
  white-space: nowrap;
  cursor: default;
}

.sc-btn-approve {
  background: var(--accent);
  color: var(--bg-void);
}

.sc-btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.sc-feedback {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 4px;
  gap: 2px;
}

.sc-flow-arrow {
  display: block;
}

.sc-feedback-text {
  font-size: 7px;
  font-style: italic;
  color: var(--text-muted);
  background: rgba(255,214,10,0.06);
  border: 1px solid rgba(255,214,10,0.15);
  border-radius: 3px;
  padding: 2px 8px;
}

.sc-return-arrow {
  display: block;
}

.sc-v2-badge {
  font-size: 7px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(255,214,10,0.12);
  border: 1px solid rgba(255,214,10,0.3);
  border-radius: 3px;
  padding: 1px 5px;
  letter-spacing: 0.3px;
}

/* ============================================
   Card 6: Skills & Integrations (sh- prefix)
   ============================================ */
.sh-container {
  position: relative;
  width: 200px;
  height: 120px;
}

.sh-lines {
  position: absolute;
  inset: 0;
  width: 200px;
  height: 120px;
  pointer-events: none;
}

.sh-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-void);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(255,214,10,0.1);
}

.sh-spoke {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-void);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* Hexagonal positions */
.sh-spoke-0 { left: 90px; top: 6px; }    /* top */
.sh-spoke-1 { left: 138px; top: 22px; }   /* top-right */
.sh-spoke-2 { left: 138px; top: 78px; }   /* bottom-right */
.sh-spoke-3 { left: 90px; top: 94px; }    /* bottom */
.sh-spoke-4 { left: 42px; top: 78px; }    /* bottom-left */
.sh-spoke-5 { left: 42px; top: 22px; }    /* top-left */

.sh-spoke.sh-active {
  border-color: var(--accent);
  color: var(--accent);
}

.sh-label {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 6px;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
}

/* ============================================
   SECTION 6: DASHBOARD (3D Perspective Reveal)
   ============================================ */

.section-dashboard {
  perspective: 1200px;
}

.browser-frame {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  max-width: 900px;
  margin: 0 auto;
}

.dashboard-reveal {
  opacity: 0;
  transform: scale(0.7) rotateX(8deg);
  transform-origin: center bottom;
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.dashboard-reveal.in-view {
  opacity: 1;
  transform: scale(1) rotateX(0deg);
}

.browser-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.browser-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.browser-title {
  margin-left: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.browser-content {
  display: grid;
  grid-template-columns: 140px 1fr;
  min-height: 280px;
}

/* Agent Sidebar */
.agent-sidebar {
  padding: 16px;
  border-right: 1px solid var(--border);
}

.agent-sidebar-header {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.agent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.dashboard-reveal.in-view .agent-row {
  opacity: 1;
  transform: translateX(0);
}

.dashboard-reveal.in-view .agent-row[data-index="0"] { transition-delay: 0.3s; }
.dashboard-reveal.in-view .agent-row[data-index="1"] { transition-delay: 0.4s; }
.dashboard-reveal.in-view .agent-row[data-index="2"] { transition-delay: 0.5s; }
.dashboard-reveal.in-view .agent-row[data-index="3"] { transition-delay: 0.6s; }
.dashboard-reveal.in-view .agent-row[data-index="4"] { transition-delay: 0.7s; }
.dashboard-reveal.in-view .agent-row[data-index="5"] { transition-delay: 0.8s; }
.dashboard-reveal.in-view .agent-row[data-index="6"] { transition-delay: 0.9s; }

.agent-name {
  font-size: 12px;
  color: var(--text-secondary);
}

.agent-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s ease;
}

.agent-row-orchestrator .agent-dot {
  background: var(--accent);
}

.dashboard-reveal.in-view .agent-row:nth-child(3) .agent-dot { background: var(--success); }
.dashboard-reveal.in-view .agent-row:nth-child(4) .agent-dot { background: var(--success); }
.dashboard-reveal.in-view .agent-row:nth-child(5) .agent-dot { background: var(--accent); }

/* Lifecycle Panel */
.lifecycle-panel {
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.lifecycle-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.lifecycle-stages {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.lifecycle-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(113, 113, 122, 0.1);
  color: var(--text-muted);
  transition: all 0.4s ease;
}

.lifecycle-badge.badge-active {
  background: var(--accent-muted);
  color: var(--accent);
}

.dashboard-reveal.in-view .lifecycle-badge[data-index="0"] { transition-delay: 1.0s; }
.dashboard-reveal.in-view .lifecycle-badge[data-index="1"] { transition-delay: 1.2s; }
.dashboard-reveal.in-view .lifecycle-badge[data-index="2"] { transition-delay: 1.4s; }
.dashboard-reveal.in-view .lifecycle-badge[data-index="3"] { transition-delay: 1.6s; }
.dashboard-reveal.in-view .lifecycle-badge[data-index="4"] { transition-delay: 1.8s; }

.dashboard-reveal.in-view .lifecycle-badge {
  background: var(--accent-muted);
  color: var(--accent);
}

.lifecycle-arrow {
  color: var(--text-disabled);
  font-size: 16px;
}

.lifecycle-bar {
  width: 100%;
  max-width: 400px;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}

.lifecycle-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dashboard-reveal.in-view .lifecycle-bar-fill {
  width: 100%;
  transition-delay: 1.0s;
}

.lifecycle-caption {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================
   SECTION 7: ORIGIN (Story + Progress Line)
   ============================================ */

.section-origin {
  position: relative;
}

.section-origin .container-narrow {
  position: relative;
}

.origin-progress-line {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.origin-progress-fill {
  width: 100%;
  height: 0%;
  background: var(--accent);
  transition: height 0.1s linear;
}

.origin-content {
  padding-left: 32px;
}

.origin-content h2 {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 40px;
}

.origin-body p {
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.origin-body p:last-child {
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 0;
}

/* ============================================
   SECTION 8: CTA (Zoom + Glow Finale)
   ============================================ */

.section-cta {
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 214, 10, 0) 0%, transparent 70%);
  pointer-events: none;
  transition: background 1s ease;
}

.cta-glow.glow-active {
  background: radial-gradient(circle, rgba(255, 214, 10, 0.12) 0%, transparent 70%);
  animation: ctaPulse 3s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

.cta-content {
  position: relative;
  z-index: 1;
}

.cta-headline {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.cta-subhead {
  font-size: 20px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.cta-buttons {
  margin-bottom: 24px;
}

.cta-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 32px;
}

.cta-links a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 200ms ease;
}

.cta-links a:hover {
  color: var(--text-primary);
}

.cta-sep {
  color: var(--text-disabled);
}

.cta-final {
  font-size: 14px;
  color: var(--text-muted);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  padding: 80px 0 40px;
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
  transition: color 200ms ease;
}

.footer-col a:hover {
  color: var(--text-secondary);
}

.footer-stagger .footer-col {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.footer-stagger.in-view .footer-col:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0s; }
.footer-stagger.in-view .footer-col:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.1s; }
.footer-stagger.in-view .footer-col:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.2s; }

.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.footer-copyright {
  font-size: 12px;
  color: var(--text-disabled);
}

/* --- Rotating Headline Word --- */
.rotating-word {
  display: inline-block;
  position: relative;
  color: var(--accent);
  min-width: 190px;
  text-align: center;
  transition: opacity 0.4s ease, transform 0.4s ease;
  vertical-align: baseline;
}

.rotating-word-out {
  opacity: 0;
  transform: translateY(-20px);
}

.rotating-word-in {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   HERO DEMO STYLES (from v1 - working version)
   ============================================ */

/* --- Command Bar --- */
.hd-command-bar {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  height: 44px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  padding: 0 16px;
  opacity: 0;
  transition: opacity 0.4s ease, box-shadow 0.3s ease;
  z-index: 10;
}

.hd-command-bar.visible {
  opacity: 1;
}

.hd-command-bar.focused {
  box-shadow: 0 0 0 1px rgba(255, 214, 10, 0.15);
}

.hd-command-bar.dimmed {
  opacity: 0.4;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hd-prompt {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
  margin-right: 10px;
  flex-shrink: 0;
}

.hd-typed-text {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
}

.hd-cursor {
  display: inline-block;
  width: 2px;
  height: 18px;
  background: var(--accent);
  margin-left: 1px;
  flex-shrink: 0;
}

@keyframes hd-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hd-cursor.blinking {
  animation: hd-blink 1.06s step-end infinite;
}

/* --- SVG Dependency Lines --- */
.hd-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.hd-dep-line {
  fill: none;
  stroke: var(--border-light, var(--border));
  stroke-width: 1.5;
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  transition: stroke 0.3s ease;
}

.hd-dep-line.drawn {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.8s ease-out, stroke 0.3s ease;
}

.hd-line-dot {
  fill: var(--accent);
  opacity: 0;
  r: 3;
}

/* --- Task Cards --- */
.hd-task {
  position: absolute;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease;
  z-index: 1;
}

.hd-task.visible {
  opacity: 1;
  transform: translateY(0);
}

.hd-task-border {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: #5BA8C8;
  transition: background 0.3s ease;
}

.hd-task-content {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 16px;
  width: 100%;
  overflow: hidden;
  min-width: 0;
}

.hd-task-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.hd-task-badge {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.hd-task-dot {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-disabled, var(--text-muted));
  transition: background 0.3s ease;
}

/* Parent Task */
.hd-parent-task {
  left: 140px;
  top: 100px;
  width: 280px;
  height: 52px;
}

/* Subtask Cards */
.hd-subtask {
  width: 240px;
  height: 44px;
}

.hd-subtask .hd-task-title {
  font-size: 12px;
}

.hd-subtask-1 {
  left: 510px;
  top: 78px;
}

.hd-subtask-2 {
  left: 510px;
  top: 138px;
}

.hd-subtask-3 {
  left: 510px;
  top: 240px;
}

/* --- Status Color States --- */
.hd-task[data-status="planning"] .hd-task-border { background: #5BA8C8; }
.hd-task[data-status="planning"] .hd-task-badge {
  color: #5BA8C8;
  background: rgba(91, 168, 200, 0.1);
}

.hd-task[data-status="pending_approval"] .hd-task-border { background: #D4A94A; }
.hd-task[data-status="pending_approval"] .hd-task-badge {
  color: #D4A94A;
  background: rgba(212, 169, 74, 0.1);
}

.hd-task[data-status="working"] .hd-task-border { background: #B8E6B8; }
.hd-task[data-status="working"] .hd-task-badge {
  color: #B8E6B8;
  background: rgba(184, 230, 184, 0.1);
}

.hd-task[data-status="blocker"] .hd-task-border { background: #EF4444; }
.hd-task[data-status="blocker"] .hd-task-badge {
  color: #EF4444;
  background: rgba(239, 68, 68, 0.15);
}
.hd-task[data-status="blocker"] {
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.35), 0 0 4px rgba(239, 68, 68, 0.2);
  animation: hd-blocker-pulse 1.5s ease-in-out infinite;
}
@keyframes hd-blocker-pulse {
  0%, 100% { box-shadow: 0 0 16px rgba(239, 68, 68, 0.35), 0 0 4px rgba(239, 68, 68, 0.2); }
  50% { box-shadow: 0 0 24px rgba(239, 68, 68, 0.5), 0 0 8px rgba(239, 68, 68, 0.3); }
}

.hd-task[data-status="done"] .hd-task-border { background: #22C55E; }
.hd-task[data-status="done"] .hd-task-badge {
  color: #22C55E;
  background: rgba(34, 197, 94, 0.1);
}

/* --- Agent Dots --- */
.hd-agent-dot {
  position: absolute;
  top: 50%;
  right: -16px;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease, background 0.3s ease;
}

.hd-agent-dot.visible {
  opacity: 1;
}

@keyframes hd-pulse-dot {
  0%, 100% { transform: translateY(-50%) scale(1); opacity: 1; }
  50% { transform: translateY(-50%) scale(1.4); opacity: 0.6; }
}

.hd-agent-dot.pulsing {
  animation: hd-pulse-dot 1.5s ease-in-out infinite;
}

.hd-agent-dot.blocked {
  background: #EF4444;
  animation: none;
}

/* --- Checkmarks --- */
.hd-task-check {
  position: absolute;
  top: 50%;
  right: -36px;
  transform: translateY(-50%) scale(0);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.hd-task-check.visible {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

@keyframes hd-check-pop {
  0% { transform: translateY(-50%) scale(0); }
  70% { transform: translateY(-50%) scale(1.15); }
  100% { transform: translateY(-50%) scale(1); }
}

.hd-task-check.pop {
  animation: hd-check-pop 0.4s ease-out forwards;
  opacity: 1;
}

/* --- Approve Button --- */
.hd-approve-btn {
  position: absolute;
  left: 200px;
  top: 170px;
  width: 80px;
  height: 32px;
  background: var(--accent);
  color: var(--bg-void);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm, 4px);
  cursor: default;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.15s ease;
  z-index: 2;
  pointer-events: none;
}

.hd-approve-btn.visible {
  opacity: 1;
  transform: translateY(0);
}

.hd-approve-btn.clicked {
  background: var(--accent-hover, #e6c109);
  transform: translateY(-1px) scale(0.97);
}

/* --- Blocker: Elevate subtask-2 when blocker is visible --- */
.hd-subtask-2.hd-blocker-elevated {
  z-index: 10;
}

/* --- Blocker Badge --- */
.hd-blocker {
  position: absolute;
  top: 100%;
  left: 12px;
  margin-top: 6px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 10px;
  padding: 4px 12px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.5s ease;
  white-space: nowrap;
  z-index: 5;
}

.hd-blocker.visible {
  opacity: 1;
  transform: translateY(0);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.35);
}

.hd-blocker-text {
  font-size: 11px;
  font-weight: 500;
  color: #F87171;
  letter-spacing: 0.01em;
}

/* --- Resolve Button --- */
.hd-resolve-btn {
  position: absolute;
  top: 100%;
  right: 12px;
  margin-top: 6px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 6px;
  padding: 3px 10px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: #F87171;
  text-decoration: none;
  cursor: default;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
  z-index: 5;
  pointer-events: none;
}

.hd-resolve-btn.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Simulated Cursor --- */
.hd-sim-cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
  transition: left 0.5s cubic-bezier(0.22, 0.61, 0.36, 1), top 0.5s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.2s ease;
}

.hd-sim-cursor.visible {
  opacity: 1;
}

/* --- Stage Glow --- */
.hd-stage-glow {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  background: radial-gradient(ellipse at center, rgba(255, 214, 10, 0.06) 0%, transparent 70%);
}

.hd-stage-glow.flash {
  opacity: 1;
}

/* --- Fade out all at once --- */
.hero-demo-stage.fading {
  opacity: 0;
  transition: opacity 0.8s ease-out;
}

.hero-demo-stage {
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* --- Reduced Motion for hero demo --- */
@media (prefers-reduced-motion: reduce) {
  .hero-demo-stage {
    opacity: 1 !important;
  }

  .hd-command-bar {
    opacity: 0.4 !important;
    transform: translateX(-50%) translateY(-8px) !important;
  }

  .hd-task {
    opacity: 1 !important;
    transform: translateY(0) !important;
  }

  .hd-dep-line {
    stroke-dashoffset: 0 !important;
  }

  .hd-task-check {
    opacity: 1 !important;
    transform: translateY(-50%) scale(1) !important;
  }

  .hd-agent-dot,
  .hd-approve-btn,
  .hd-blocker,
  .hd-resolve-btn,
  .hd-sim-cursor,
  .hd-stage-glow {
    display: none !important;
  }
}

/* --- Responsive: Tablet (768-1024px) --- */
@media (max-width: 1024px) {
  .hero-logo-zone {
    width: 100%;
    max-width: 680px;
    height: 48px;
  }

  .hero-kapow-logo {
    width: 90px;
    margin-left: 0;
  }

  .hero-content {
    width: 100%;
    max-width: 680px;
  }

  .hero-headline {
    font-size: 48px;
  }

  .rotating-word {
    min-width: 140px;
  }

  .hero-demo {
    width: 100%;
    max-width: 680px;
  }

  .hero-demo-stage {
    height: 320px;
  }

  .hd-command-bar {
    width: 400px;
  }

  .hd-parent-task {
    left: 60px;
    width: 240px;
  }

  .hd-subtask {
    width: 210px;
  }

  .hd-subtask-1 { left: 370px; top: 78px; }
  .hd-subtask-2 { left: 370px; top: 138px; }
  .hd-subtask-3 { left: 370px; top: 240px; }

  .hd-approve-btn {
    left: 100px;
  }

  .hd-lines {
    width: 100%;
  }

  .hd-subtask .hd-task-title { font-size: 11px; }
  .hd-parent-task .hd-task-title { font-size: 12px; }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile demo */
.hero-demo-mobile {
  display: none;
  text-align: center;
  margin-top: 24px;
}

.hdm-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.hdm-stages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hdm-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(113, 113, 122, 0.1);
  color: var(--text-muted);
  transition: all 300ms ease;
}

.hdm-arrow {
  color: var(--text-disabled);
  font-size: 14px;
}

/* Active states per status */
.hdm-badge.active.hdm-planning {
  color: #5BA8C8;
  background: rgba(91, 168, 200, 0.12);
  border-color: rgba(91, 168, 200, 0.4);
  box-shadow: 0 0 12px rgba(91, 168, 200, 0.2);
}

.hdm-badge.active.hdm-pending {
  color: #D4A94A;
  background: rgba(212, 169, 74, 0.12);
  border-color: rgba(212, 169, 74, 0.4);
  box-shadow: 0 0 12px rgba(212, 169, 74, 0.2);
}

.hdm-badge.active.hdm-working {
  color: #B8E6B8;
  background: rgba(184, 230, 184, 0.12);
  border-color: rgba(184, 230, 184, 0.4);
  box-shadow: 0 0 12px rgba(184, 230, 184, 0.2);
}

.hdm-badge.active.hdm-done {
  color: #22C55E;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.2);
}

.hdm-badge.active.hdm-closed {
  color: var(--text-secondary);
  background: rgba(161, 161, 170, 0.12);
  border-color: rgba(161, 161, 170, 0.4);
  box-shadow: 0 0 12px rgba(161, 161, 170, 0.15);
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .scroll-reveal,
  .card-from-left,
  .card-from-right,
  .card-from-below,
  .fade-in,
  .reframe-line,
  .dashboard-reveal,
  .footer-stagger .footer-col {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }

  .hero-content,
  .hero-demo,
  .hero-logo-zone {
    transition: none !important;
  }

  .lifecycle-bar-fill {
    width: 100% !important;
    transition: none !important;
  }

  .agent-row {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .workflow-step {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  :root {
    --section-padding: 80px;
  }

  .nav-links {
    display: none;
  }

  .nav-mobile-toggle {
    display: flex;
  }

  .hero-logo-zone {
    width: 100%;
    max-width: 100%;
    height: 44px;
    justify-content: flex-start;
    padding-left: 16px;
  }

  .hero-kapow-logo {
    width: 70px;
    margin-left: 0;
  }

  .hero-content {
    width: 100%;
    max-width: 100%;
  }

  .hero-headline {
    font-size: 36px;
  }

  .rotating-word {
    min-width: 0;
  }

  .hero-subhead {
    font-size: 16px;
  }

  .hero-demo {
    width: 100%;
    max-width: 100%;
  }

  .hero-demo-stage {
    display: none;
  }

  .hero-demo-mobile {
    display: block;
  }

  .hero-wrapper {
    height: 150vh;
  }

  .problem-grid {
    grid-template-columns: 1fr;
  }

  .section-reframe {
    height: 400vh;
  }

  .reframe-headline {
    font-size: 28px;
  }

  .reframe-emphasis {
    font-size: 20px !important;
  }

  /* Use cases: vertical stack on mobile */
  .usecases-track {
    flex-direction: column;
    transform: none !important;
  }

  .usecase-panel {
    min-width: 100%;
    display: none;
  }

  .usecase-panel.panel-active {
    display: flex;
  }

  .usecase-card {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 24px;
    opacity: 1;
    transform: none;
  }

  .usecase-icon {
    display: none;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .fade-in {
    opacity: 1 !important;
    transform: none !important;
  }

  .browser-content {
    grid-template-columns: 1fr;
  }

  .agent-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px;
  }

  .agent-sidebar-header {
    width: 100%;
    margin-bottom: 4px;
  }

  .dashboard-reveal {
    transform: scale(0.85);
  }

  .dashboard-reveal.in-view {
    transform: scale(1);
  }

  .section-header h2 {
    font-size: 28px;
  }

  .cta-headline {
    font-size: 32px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .origin-progress-line {
    display: none;
  }

  .origin-content {
    padding-left: 0;
  }

  .origin-content h2 {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .hero-headline {
    font-size: 28px;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }

  .cta-headline {
    font-size: 24px;
  }

  .lifecycle-stages {
    gap: 4px;
  }

  .lifecycle-badge {
    font-size: 8px;
    padding: 3px 6px;
  }
}

/* ============================================
   CONTENT VISIBILITY (Performance)
   ============================================ */

.section-problem,
.section-reframe,
.section-usecases,
.section-features,
.section-dashboard,
.section-origin,
.section-cta,
.footer {
  content-visibility: auto;
  contain-intrinsic-size: 0 800px;
}
