:root {
  /* Galactic Web Color Palette */
  --primary-main: #667eea;
  --primary-dark: #5a67d8;
  --primary-light: #818cf8;
  --gradient-start: #667eea;
  --gradient-end: #764ba2;

  --secondary-blue: #2563eb;
  --secondary-dark-blue: #1e40af;

  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;

  --success: #059669;
  --success-light: #d1fae5;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --error: #dc2626;
  --error-light: #fee2e2;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Transitions */
  --transition-fast: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-medium: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: white;
  color: var(--neutral-800);
  line-height: 1.7;
  font-size: 16px;
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Hero Section - Enhanced Galactic Web Style */
.hero {
  background:
    /* Layered radial gradients for depth */
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(129, 140, 248, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(118, 75, 162, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse 100% 80% at 50% 100%, rgba(37, 99, 235, 0.15) 0%, transparent 40%),
    /* Base gradient */
    linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  color: white;
  padding: 96px var(--space-8);
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Subtle mesh pattern overlay */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 60px 60px, 40px 40px;
  pointer-events: none;
  opacity: 0.8;
}

/* Floating abstract shape for depth */
.hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: float-subtle 20s ease-in-out infinite;
}

/* Secondary floating orb */
.hero-orb {
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
  animation: float-subtle 25s ease-in-out infinite reverse;
}

/* Subtle glow accent line at top */
.hero-glow-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 20%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0.4) 80%,
    transparent 100%
  );
}

/* Subtle floating animation */
@keyframes float-subtle {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(10px, -15px) scale(1.02);
  }
  66% {
    transform: translate(-5px, 10px) scale(0.98);
  }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .hero::after,
  .hero-orb {
    animation: none;
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
}

.hero-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-10);
  opacity: 0.95;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

.hero-logo svg {
  height: 36px;
  width: auto;
}

.hero-logo svg path,
.hero-logo svg polygon,
.hero-logo svg ellipse {
  fill: white;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
  line-height: 1.15;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 0.85) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}

/* Decorative separator */
.hero-separator {
  width: 80px;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.7) 50%,
    transparent 100%
  );
  border-radius: 2px;
  margin: var(--space-6) auto;
}

.hero .subtitle {
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 400;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-8);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.15);
}

.hero-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.hero .author {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.01em;
}

.hero .author strong {
  font-weight: 700;
}

.hero .date {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hero .date {
  font-size: 14px;
  opacity: 0.7;
  margin-top: var(--space-2);
}

/* Section Styling */
section {
  padding: 64px 0;
}

section:nth-child(even) {
  background: var(--neutral-50);
}

.section-header {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-8);
}

.accent-bar {
  width: 4px;
  height: 32px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border-radius: 2px;
  margin-right: var(--space-4);
  flex-shrink: 0;
}

.section-header h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--neutral-800);
  letter-spacing: -0.02em;
}

p {
  margin-bottom: var(--space-6);
  color: var(--neutral-700);
}

/* Pull Quote */
.pull-quote {
  padding: var(--space-8);
  background: linear-gradient(135deg, rgba(102,126,234,0.08) 0%, rgba(118,75,162,0.08) 100%);
  border-radius: 16px;
  border-left: 4px solid var(--primary-main);
  margin: var(--space-8) 0;
  position: relative;
}

.pull-quote::before {
  content: '"';
  position: absolute;
  top: 16px;
  left: 24px;
  font-size: 72px;
  font-weight: 700;
  color: var(--primary-main);
  opacity: 0.2;
  line-height: 1;
  font-family: Georgia, serif;
}

.pull-quote p {
  font-size: 22px;
  font-weight: 500;
  font-style: italic;
  color: var(--neutral-800);
  line-height: 1.5;
  margin-bottom: 0;
  padding-left: var(--space-6);
}

/* Callout Box */
.callout_whitepaper {
  display: block;
  width: 100%;
  max-width: 100%;
  clear: both;
  position: relative;
  overflow: hidden;
  padding: var(--space-6);
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  border-radius: 12px;
  margin: var(--space-6) 0;
  box-sizing: border-box;
}

.callout_whitepaper.highlight {
  background: linear-gradient(135deg, rgba(102,126,234,0.05) 0%, rgba(118,75,162,0.05) 100%);
  border-color: var(--primary-main);
}

.callout_whitepaper h4 {
  display: block;
  width: 100%;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-main);
  margin-bottom: var(--space-3);
}

.callout_whitepaper p {
  display: block;
  width: 100%;
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.callout_whitepaper p:last-child {
  margin-bottom: 0;
}

/* Figure Container */
.figure {
  margin: var(--space-8) 0;
  background: white;
  border: 1px solid var(--neutral-200);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.figure-header {
  background: var(--neutral-100);
  padding: var(--space-3) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border-bottom: 1px solid var(--neutral-200);
}

.figure-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.figure-dot.red { background: #ff5f57; }
.figure-dot.yellow { background: #febc2e; }
.figure-dot.green { background: #28c840; }

.figure-content {
  padding: var(--space-6);
}

.figure-caption {
  padding: var(--space-4) var(--space-6);
  background: var(--neutral-50);
  border-top: 1px solid var(--neutral-200);
  font-size: 14px;
  color: var(--neutral-500);
}

.figure-caption strong {
  color: var(--neutral-700);
}

/* Sankey Diagram */
.sankey-container {
  padding: var(--space-4);
}

.sankey-row {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-2);
}

.sankey-source {
  width: 80px;
  font-weight: 600;
  font-size: 14px;
  color: var(--neutral-800);
  text-align: right;
  padding-right: var(--space-4);
}

.sankey-flows {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sankey-flow {
  display: flex;
  align-items: center;
}

.sankey-path {
  height: 8px;
  background: linear-gradient(90deg, var(--primary-main), var(--primary-light));
  border-radius: 4px;
  position: relative;
}

.sankey-path::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 8px solid var(--primary-light);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.sankey-intermediate {
  padding: 4px 12px;
  background: var(--neutral-100);
  border-radius: 6px;
  font-size: 12px;
  color: var(--neutral-700);
  margin: 0 var(--space-3);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.sankey-intermediate .arrow {
  color: var(--success);
  font-weight: 600;
}

.sankey-target {
  width: 160px;
  font-weight: 500;
  font-size: 13px;
  color: var(--neutral-600);
  padding-left: var(--space-3);
}

/* Waterfall Chart */
.waterfall-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.waterfall-row {
  display: flex;
  align-items: center;
  height: 36px;
}

.waterfall-label {
  width: 180px;
  font-size: 14px;
  font-weight: 500;
  color: var(--neutral-600);
  padding-right: var(--space-4);
}

.waterfall-bar-container {
  flex: 1;
  height: 28px;
  background: var(--neutral-100);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.waterfall-bar {
  position: absolute;
  height: 100%;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 12px;
  font-weight: 600;
  color: white;
}

.waterfall-bar.base { background: linear-gradient(90deg, var(--neutral-400), var(--neutral-500)); }
.waterfall-bar.positive { background: linear-gradient(90deg, var(--success), #34d399); }
.waterfall-bar.negative { background: linear-gradient(90deg, var(--error), #f87171); }
.waterfall-bar.final { background: linear-gradient(90deg, var(--secondary-blue), #60a5fa); }

.waterfall-value {
  width: 60px;
  text-align: right;
  font-size: 14px;
  font-weight: 600;
  color: var(--neutral-700);
  padding-left: var(--space-3);
}

.waterfall-value.positive { color: var(--success); }
.waterfall-value.negative { color: var(--error); }
.waterfall-value.final { color: var(--secondary-blue); font-weight: 700; }

/* Expression Chart */
.expression-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.expression-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.expression-tissue {
  width: 140px;
  font-size: 13px;
  color: var(--neutral-600);
  text-align: right;
}

.expression-bar-container {
  flex: 1;
  height: 24px;
  background: var(--neutral-100);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.expression-bar {
  height: 100%;
  border-radius: 4px;
}

.expression-bar.primary { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.expression-bar.systemic { background: linear-gradient(90deg, var(--primary-main), var(--primary-light)); }
.expression-bar.weak { background: linear-gradient(90deg, var(--neutral-400), var(--neutral-500)); }
.expression-bar.other { background: linear-gradient(90deg, var(--neutral-300), var(--neutral-400)); }

.expression-legend {
  display: flex;
  gap: var(--space-6);
  justify-content: center;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--neutral-200);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--neutral-500);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-dot.primary { background: #f59e0b; }
.legend-dot.systemic { background: var(--primary-main); }
.legend-dot.weak { background: var(--neutral-400); }
.legend-dot.other { background: var(--neutral-300); }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin: var(--space-8) 0;
}

.stat-card {
  text-align: center;
  padding: var(--space-6);
  background: white;
  border-radius: 16px;
  border: 1px solid var(--neutral-200);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-value {
  font-size: 42px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.stat-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: var(--space-2);
}

/* Key Points */
.key-points {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin: var(--space-8) 0;
}

.key-point {
  padding: var(--space-6);
  background: white;
  border-radius: 12px;
  border: 1px solid var(--neutral-200);
}

.key-point h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--neutral-800);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.key-point h4 svg {
  width: 20px;
  height: 20px;
  color: var(--primary-main);
}

.key-point p {
  font-size: 14px;
  color: var(--neutral-600);
  margin-bottom: 0;
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: white;
  padding: 64px var(--space-6);
  text-align: center;
}

.cta-section h2 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.cta-section p {
  font-size: 18px;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto var(--space-8);
  color: white;
}

.cta-contact {
  display: flex;
  justify-content: center;
  gap: var(--space-8);
}

.cta-contact-item {
  text-align: center;
}

.cta-contact-item .label {
  font-size: 12px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-1);
}

.cta-contact-item .value {
  font-size: 16px;
  font-weight: 600;
}

/* Footer */
footer {
  background: var(--neutral-900);
  color: var(--neutral-400);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  font-size: 14px;
}

footer a {
  color: var(--primary-light);
  text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 32px;
  }

  .stats-grid,
  .key-points {
    grid-template-columns: 1fr;
  }

  .pull-quote p {
    font-size: 18px;
  }

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

  .waterfall-label,
  .expression-tissue {
    width: 100px;
    font-size: 12px;
  }
}

/* ============================================
   FIGURE ANIMATIONS
   ============================================ */

/* Base state for animated elements */
.figure[data-animate] .sankey-flow,
.figure[data-animate] .waterfall-row,
.figure[data-animate] .expression-row {
  opacity: 0;
  transform: translateX(-20px);
}

/* Animated state */
.figure.animate-in .sankey-flow,
.figure.animate-in .waterfall-row,
.figure.animate-in .expression-row {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* Staggered delays for sankey flows */
.figure.animate-in .sankey-flow:nth-child(1) { transition-delay: 0.1s; }
.figure.animate-in .sankey-flow:nth-child(2) { transition-delay: 0.2s; }
.figure.animate-in .sankey-flow:nth-child(3) { transition-delay: 0.3s; }
.figure.animate-in .sankey-flow:nth-child(4) { transition-delay: 0.4s; }
.figure.animate-in .sankey-flow:nth-child(5) { transition-delay: 0.5s; }
.figure.animate-in .sankey-flow:nth-child(6) { transition-delay: 0.6s; }

/* Staggered delays for waterfall rows */
.figure.animate-in .waterfall-row:nth-child(1) { transition-delay: 0.1s; }
.figure.animate-in .waterfall-row:nth-child(2) { transition-delay: 0.2s; }
.figure.animate-in .waterfall-row:nth-child(3) { transition-delay: 0.3s; }
.figure.animate-in .waterfall-row:nth-child(4) { transition-delay: 0.4s; }
.figure.animate-in .waterfall-row:nth-child(5) { transition-delay: 0.5s; }
.figure.animate-in .waterfall-row:nth-child(6) { transition-delay: 0.6s; }
.figure.animate-in .waterfall-row:nth-child(7) { transition-delay: 0.7s; }
.figure.animate-in .waterfall-row:nth-child(8) { transition-delay: 0.8s; }
.figure.animate-in .waterfall-row:nth-child(9) { transition-delay: 0.9s; }
.figure.animate-in .waterfall-row:nth-child(10) { transition-delay: 1.0s; }

/* Staggered delays for expression rows */
.figure.animate-in .expression-row:nth-child(1) { transition-delay: 0.05s; }
.figure.animate-in .expression-row:nth-child(2) { transition-delay: 0.1s; }
.figure.animate-in .expression-row:nth-child(3) { transition-delay: 0.15s; }
.figure.animate-in .expression-row:nth-child(4) { transition-delay: 0.2s; }
.figure.animate-in .expression-row:nth-child(5) { transition-delay: 0.25s; }
.figure.animate-in .expression-row:nth-child(6) { transition-delay: 0.3s; }
.figure.animate-in .expression-row:nth-child(7) { transition-delay: 0.35s; }
.figure.animate-in .expression-row:nth-child(8) { transition-delay: 0.4s; }
.figure.animate-in .expression-row:nth-child(9) { transition-delay: 0.45s; }
.figure.animate-in .expression-row:nth-child(10) { transition-delay: 0.5s; }
.figure.animate-in .expression-row:nth-child(11) { transition-delay: 0.55s; }

/* Waterfall bar animation using scaleX */
.figure[data-animate] .waterfall-bar {
  transform: scaleX(0);
  transform-origin: left center;
}

.figure.animate-in .waterfall-bar {
  transform: scaleX(1);
  transition: transform 0.8s ease-out;
}

.figure.animate-in .waterfall-row:nth-child(1) .waterfall-bar { transition-delay: 0.2s; }
.figure.animate-in .waterfall-row:nth-child(2) .waterfall-bar { transition-delay: 0.35s; }
.figure.animate-in .waterfall-row:nth-child(3) .waterfall-bar { transition-delay: 0.5s; }
.figure.animate-in .waterfall-row:nth-child(4) .waterfall-bar { transition-delay: 0.65s; }
.figure.animate-in .waterfall-row:nth-child(5) .waterfall-bar { transition-delay: 0.8s; }
.figure.animate-in .waterfall-row:nth-child(6) .waterfall-bar { transition-delay: 0.95s; }
.figure.animate-in .waterfall-row:nth-child(7) .waterfall-bar { transition-delay: 1.1s; }
.figure.animate-in .waterfall-row:nth-child(8) .waterfall-bar { transition-delay: 1.25s; }
.figure.animate-in .waterfall-row:nth-child(9) .waterfall-bar { transition-delay: 1.4s; }
.figure.animate-in .waterfall-row:nth-child(10) .waterfall-bar { transition-delay: 1.55s; }

/* Expression bar animation using scaleX */
.figure[data-animate] .expression-bar {
  transform: scaleX(0);
  transform-origin: left center;
}

.figure.animate-in .expression-bar {
  transform: scaleX(1);
  transition: transform 0.6s ease-out;
}

.figure.animate-in .expression-row:nth-child(1) .expression-bar { transition-delay: 0.15s; }
.figure.animate-in .expression-row:nth-child(2) .expression-bar { transition-delay: 0.2s; }
.figure.animate-in .expression-row:nth-child(3) .expression-bar { transition-delay: 0.25s; }
.figure.animate-in .expression-row:nth-child(4) .expression-bar { transition-delay: 0.3s; }
.figure.animate-in .expression-row:nth-child(5) .expression-bar { transition-delay: 0.35s; }
.figure.animate-in .expression-row:nth-child(6) .expression-bar { transition-delay: 0.4s; }
.figure.animate-in .expression-row:nth-child(7) .expression-bar { transition-delay: 0.45s; }
.figure.animate-in .expression-row:nth-child(8) .expression-bar { transition-delay: 0.5s; }
.figure.animate-in .expression-row:nth-child(9) .expression-bar { transition-delay: 0.55s; }
.figure.animate-in .expression-row:nth-child(10) .expression-bar { transition-delay: 0.6s; }
.figure.animate-in .expression-row:nth-child(11) .expression-bar { transition-delay: 0.65s; }

/* Sankey path flow animation - use scaleX for flex items */
.figure[data-animate] .sankey-path {
  transform: scaleX(0);
  transform-origin: left center;
}

.figure[data-animate] .sankey-flow:nth-child(odd) .sankey-path:last-child {
  transform-origin: right center;
}

.figure.animate-in .sankey-path {
  transform: scaleX(1);
  transition: transform 0.5s ease-out;
}

.figure.animate-in .sankey-flow:nth-child(1) .sankey-path { transition-delay: 0.2s; }
.figure.animate-in .sankey-flow:nth-child(2) .sankey-path { transition-delay: 0.3s; }
.figure.animate-in .sankey-flow:nth-child(3) .sankey-path { transition-delay: 0.4s; }
.figure.animate-in .sankey-flow:nth-child(4) .sankey-path { transition-delay: 0.5s; }
.figure.animate-in .sankey-flow:nth-child(5) .sankey-path { transition-delay: 0.6s; }
.figure.animate-in .sankey-flow:nth-child(6) .sankey-path { transition-delay: 0.7s; }

/* Hover effects on rows */
.waterfall-row:hover,
.expression-row:hover {
  background: rgba(102, 126, 234, 0.05);
  border-radius: 6px;
  transition: background 0.2s ease;
}

.waterfall-row:hover .waterfall-label,
.expression-row:hover .expression-tissue {
  color: var(--primary-main);
}

/* Pulse effect on final score */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
  }
}

.figure.animate-in .waterfall-row:last-child .waterfall-bar.final {
  animation: pulse-glow 2s ease-in-out 2s 2;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .figure[data-animate] .sankey-flow,
  .figure[data-animate] .waterfall-row,
  .figure[data-animate] .expression-row {
    opacity: 1;
    transform: none;
  }

  .figure[data-animate] .waterfall-bar,
  .figure[data-animate] .expression-bar,
  .figure[data-animate] .sankey-path {
    transform: scaleX(1) !important;
  }

  .figure.animate-in .waterfall-row:last-child .waterfall-bar.final {
    animation: none;
  }
}

/* Print styles */
@media print {
  .hero {
    background: var(--primary-main) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  section {
    page-break-inside: avoid;
  }

  .pull-quote {
    page-break-inside: avoid;
  }

  .figure[data-animate] .sankey-flow,
  .figure[data-animate] .waterfall-row,
  .figure[data-animate] .expression-row {
    opacity: 1;
    transform: none;
  }

  .figure[data-animate] .waterfall-bar,
  .figure[data-animate] .expression-bar,
  .figure[data-animate] .sankey-path {
    transform: scaleX(1) !important;
  }
}
