/* ============================================================================
   Sticky Scroll Layout for How It Works Section
   ============================================================================ */

/* Sticky Scroll Container */
.sticky-scroll-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl, 6rem);
  margin-top: var(--space-2xl, 4rem);
  /* Remove fixed min-height - let content determine height */
}

/* Left Column: Steps */
.steps-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xl, 6rem);
  padding-top: 20vh;
  padding-bottom: 40vh; /* Extra padding at bottom to keep sticky visible through step 4 */
}

/* Each step needs enough height to trigger scroll */
.steps-column .step {
  padding: var(--space-xl, 3rem);
  border-radius: var(--radius-lg, 8px);
  transition: all 0.3s ease;
  opacity: 0.4;
  min-height: 30vh; /* Ensure each step has enough scroll distance */
}

.steps-column .step.active {
  opacity: 1;
  background: var(--bg-surface, #1a1a1a);
  border: 1px solid var(--border-subtle, #27272a);
  transform: scale(1.02);
}

.steps-column .step.active .step-number {
  background: var(--accent-blue, #3b82f6);
  color: #ffffff;
  border-color: var(--accent-blue, #3b82f6);
}

/* Right Column: Sticky Illustration */
.illustration-column {
  position: relative;
  /* No fixed height - allows sticky to work based on parent container */
}

.sticky-illustration {
  position: sticky;
  top: 20vh;
  height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mockup Browser */
.mockup-browser {
  width: 100%;
  max-width: 500px;
  background: var(--bg-surface, #1a1a1a);
  border: 1px solid var(--border-subtle, #27272a);
  border-radius: var(--radius-lg, 8px);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.mockup-chrome {
  display: flex;
  align-items: center;
  padding: var(--space-sm, 1rem) var(--space-md, 1.5rem);
  background: var(--bg-elevated, #222222);
  border-bottom: 1px solid var(--border-subtle, #27272a);
}

.mockup-dots {
  display: flex;
  gap: 6px;
}

.mockup-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border-default, #3f3f46);
}

.mockup-dots span:nth-child(1) { background: #ef4444; }
.mockup-dots span:nth-child(2) { background: #f59e0b; }
.mockup-dots span:nth-child(3) { background: #22c55e; }

.mockup-content {
  position: relative;
  min-height: 300px;
  padding: var(--space-xl, 3rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Illustration States */
.illustration-state {
  position: absolute;
  inset: 0;
  padding: var(--space-xl, 3rem);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

.illustration-state.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* Mockup Text */
.mockup-text {
  font-size: 1rem;
  color: var(--text-secondary, #a1a1aa);
  line-height: 1.6;
}

.mockup-link {
  color: var(--accent-blue, #3b82f6);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: var(--font-mono, 'SF Mono', monospace);
  font-size: 0.9rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.1);
}

.mockup-link.clicked {
  animation: clickPulse 0.6s ease;
}

@keyframes clickPulse {
  0%, 100% {
    transform: scale(1);
    background: rgba(59, 130, 246, 0.1);
  }
  50% {
    transform: scale(1.05);
    background: rgba(59, 130, 246, 0.3);
  }
}

/* Mockup Cursor (Step 1) */
.mockup-cursor {
  position: absolute;
  width: 24px;
  height: 24px;
  right: 30%;
  top: 50%;
  transform: translateY(-50%);
  animation: cursorMove 2s ease-in-out infinite;
}

.mockup-cursor::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-left: 8px solid #fff;
  border-right: 8px solid transparent;
  border-bottom: 12px solid transparent;
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5));
}

@keyframes cursorMove {
  0%, 100% {
    right: 35%;
    opacity: 0.7;
  }
  50% {
    right: 30%;
    opacity: 1;
  }
}

/* Mockup Indicator - appears inline to the RIGHT of the link (matches product) */
.mockup-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.875rem;
  background: rgba(37, 99, 235, 0.95);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
  margin-left: 6px;
  vertical-align: middle;
  animation: indicatorAppear 0.3s ease-out, indicatorPulse 2s ease-in-out infinite 0.3s;
}

@keyframes indicatorAppear {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes indicatorPulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
  }
  50% {
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.5);
  }
}

/* Step 3: Clicking state */
.mockup-indicator.clicking {
  animation: indicatorClick 0.6s ease-out infinite;
}

@keyframes indicatorClick {
  0%, 100% {
    transform: scale(1);
    background: rgba(37, 99, 235, 0.95);
  }
  50% {
    transform: scale(0.9);
    background: rgba(30, 64, 175, 1);
  }
}

/* Mockup Panel (Step 4) */
.mockup-panel {
  width: 100%;
  max-width: 360px;
  background: var(--bg-elevated, #222222);
  border: 1px solid var(--border-subtle, #27272a);
  border-radius: var(--radius-md, 6px);
  overflow: hidden;
  animation: panelSlideIn 0.5s ease-out;
}

@keyframes panelSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mockup-panel-header {
  display: flex;
  align-items: center;
  gap: var(--space-xs, 0.5rem);
  padding: var(--space-sm, 1rem);
  background: var(--bg-surface, #1a1a1a);
  border-bottom: 1px solid var(--border-subtle, #27272a);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #ffffff);
}

.mockup-icon {
  font-size: 1rem;
}

.mockup-panel-content {
  padding: var(--space-md, 1.5rem);
}

.mockup-row {
  display: flex;
  gap: var(--space-sm, 1rem);
  margin-bottom: var(--space-sm, 1rem);
  font-size: 0.8125rem;
}

.mockup-label {
  color: var(--text-muted, #71717a);
  font-weight: 600;
}

.mockup-value {
  color: var(--text-secondary, #a1a1aa);
  font-family: var(--font-mono, 'SF Mono', monospace);
  font-size: 0.75rem;
  word-break: break-all;
}

.mockup-chain {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: var(--space-sm, 1rem) 0;
}

.mockup-hop {
  padding: var(--space-xs, 0.5rem);
  background: var(--bg-primary, #0a0a0a);
  border-radius: 4px;
  color: var(--text-secondary, #a1a1aa);
  font-family: var(--font-mono, 'SF Mono', monospace);
  font-size: 0.75rem;
}

.mockup-hop.final {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue, #3b82f6);
  font-weight: 600;
}

.mockup-arrow {
  text-align: center;
  color: var(--text-muted, #71717a);
  font-size: 0.875rem;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .sticky-scroll-container {
    grid-template-columns: 1fr;
    gap: var(--space-2xl, 4rem);
  }

  .illustration-column {
    order: -1;
  }

  .sticky-illustration {
    position: relative;
    top: 0;
    height: auto;
    min-height: 400px;
  }

  .steps-column {
    gap: var(--space-2xl, 4rem);
    padding-top: 0;
    padding-bottom: 0;
  }

  .steps-column .step {
    opacity: 1;
    background: var(--bg-surface, #1a1a1a);
    border: 1px solid var(--border-subtle, #27272a);
    min-height: auto; /* Reset min-height on mobile */
  }

  .steps-column .step.active {
    transform: scale(1);
  }

  /* Show all illustration states on mobile */
  .illustration-state {
    position: static;
    opacity: 1;
    transform: scale(1);
    display: none;
  }

  .illustration-state.step-1-active {
    display: flex;
  }
}

@media (max-width: 640px) {
  .mockup-browser {
    max-width: 100%;
  }

  .mockup-content {
    min-height: 250px;
    padding: var(--space-lg, 2rem);
  }

  .mockup-panel {
    max-width: 100%;
  }

  .mockup-text {
    font-size: 0.875rem;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .illustration-state,
  .steps-column .step,
  .mockup-cursor,
  .mockup-indicator,
  .mockup-panel {
    animation: none !important;
    transition: opacity 0.1s ease !important;
  }

  .mockup-indicator {
    opacity: 1;
    transform: scale(1);
  }

  .steps-column .step.active {
    transform: none;
  }
}
