/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --secondary-color: #7c3aed;
  --accent-color: #10b981;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-alt: #f3f4f6;
  --border-color: #e5e7eb;
  --code-bg: #1e293b;
  --code-text: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  background-color: #ffffff;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.125rem; }

p {
  margin-bottom: 1.25rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
}

code {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.9em;
  background-color: var(--bg-alt);
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

pre {
  background-color: var(--code-bg);
  color: var(--code-text);
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Hero Section */
.hero {
  background: #ffffff;
  color: var(--text-primary);
  padding: 6rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
  border-bottom: 1px solid var(--border-color);
}

.hero::before {
  display: none;
}

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

.hero-title {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  text-shadow: none;
}

.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.hero-tagline {
  font-size: 1rem;
  margin-bottom: 3rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.hero-links {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background-color: #374151;
  color: white;
  border: none;
}

.btn-secondary:hover {
  background-color: #4b5563;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(55, 65, 81, 0.3);
}

/* Sections */
.section {
  padding: 4rem 0;
  position: relative;
  z-index: 2;
}

.section-alt {
  background-color: #fafafa;
}

.section-title {
  font-size: 2.25rem;
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
  padding-bottom: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
}

/* Section Title Animation */
.section-title {
  opacity: 0;
  transform: scale(0.9) translateY(-20px);
  animation: titleAppear 0.8s ease forwards;
  animation-delay: 0.1s;
}

@keyframes titleAppear {
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Content */
.content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-primary);
}

/* Animated content elements */
.content p,
.content ul,
.content ol,
.content .highlight-box {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease forwards;
}

.content p:nth-child(1) { animation-delay: 0.1s; }
.content p:nth-child(2) { animation-delay: 0.2s; }
.content p:nth-child(3) { animation-delay: 0.3s; }
.content p:nth-child(4) { animation-delay: 0.4s; }
.content p:nth-child(5) { animation-delay: 0.5s; }

.content ul, .content ol {
  animation-delay: 0.3s;
}

.content .highlight-box {
  animation-delay: 0.5s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lead {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  line-height: 1.7;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease forwards;
  animation-delay: 0.3s;
}

.highlight-box {
  background: #f9fafb;
  border-left: 3px solid var(--primary-color);
  padding: 1.5rem;
  border-radius: 6px;
  margin: 2rem 0;
}

/* Abstract Section */
.abstract-section {
  background: #ffffff;
}

.abstract-content {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.abstract-content p {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1s ease forwards;
}

.abstract-content p:nth-child(1) { animation-delay: 0.2s; }
.abstract-content p:nth-child(2) { animation-delay: 0.5s; }

/* Scientific Tables Section */
.table-wrapper {
  margin: 2rem 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  overflow: hidden;
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.table-wrapper.table-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Model Card Layout - Table and Chart Side by Side */
.model-card-wrapper {
  margin: 4rem 0;
}

.model-card-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 0.5rem;
}

.model-card-table {
  padding: 0;
  overflow-x: visible;
}

.model-card-layout .table-container {
  padding: 0;
  overflow-x: visible;
}

.model-card-chart-container {
  display: flex;
  flex-direction: column;
  background: transparent;
  border-radius: 0;
  padding: 0;
  border: none;
}

.model-card-chart-container .chart-header {
  margin-bottom: 1rem;
}

.model-card-chart-container .chart-header h4 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.model-card-chart-container .chart-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.model-card-chart-container .chart-container {
  flex: 1;
  min-height: 400px;
  position: relative;
  background: transparent;
}

.model-card-chart-container .chart-container canvas {
  background: transparent !important;
}

.chart-3d-wrapper {
  width: 100%;
  height: 600px;
  position: relative;
}

.chart-3d-wrapper #modelCard3DChart {
  width: 100%;
  height: 100%;
}

@media (max-width: 1200px) {
  .model-card-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem;
  }
  
  .model-card-chart-container {
    order: -1;
  }
  
  .model-card-chart-container .chart-container {
    min-height: 350px;
  }
}

@media (max-width: 768px) {
  .model-card-layout {
    padding: 0.5rem;
  }
  
  .model-card-table {
    overflow-x: visible;
  }
  
  .model-card-chart-container .chart-container {
    min-height: 300px;
  }
}

.table-header {
  background: #f9fafb;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.table-visible .table-header {
  opacity: 1;
  transform: translateY(0);
}

.table-header h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.table-description {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

.table-container {
  overflow-x: visible;
  padding: 0;
}

.model-card-table {
  padding: 0;
  overflow-x: visible;
}

.scientific-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
}

.scientific-table thead {
  background: var(--text-primary);
  color: white;
  opacity: 0;
  transform: scaleX(0.95);
  transition: opacity 0.6s ease 0.3s, transform 0.6s ease 0.3s;
}

.table-visible .scientific-table thead {
  opacity: 1;
  transform: scaleX(1);
}

.scientific-table thead th {
  padding: 0.5rem 0.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  line-height: 1.4;
}

.scientific-table tbody td {
  padding: 0.5rem 0.5rem;
  text-align: center;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.scientific-table tbody td:hover {
  background-color: rgba(59, 130, 246, 0.05);
  transform: scale(1.05);
  cursor: default;
}

.scientific-table tbody tr:nth-child(even) {
  background-color: var(--bg-secondary);
}

.scientific-table tbody tr {
  opacity: 0;
  transform: translateX(-20px);
  transition: background-color 0.2s, opacity 0.5s ease, transform 0.5s ease;
}

.table-visible .scientific-table tbody tr {
  opacity: 1;
  transform: translateX(0);
}

/* Staggered animation for rows */
.table-visible .scientific-table tbody tr:nth-child(1) { transition-delay: 0.1s; }
.table-visible .scientific-table tbody tr:nth-child(2) { transition-delay: 0.2s; }
.table-visible .scientific-table tbody tr:nth-child(3) { transition-delay: 0.3s; }
.table-visible .scientific-table tbody tr:nth-child(4) { transition-delay: 0.4s; }
.table-visible .scientific-table tbody tr:nth-child(5) { transition-delay: 0.5s; }
.table-visible .scientific-table tbody tr:nth-child(6) { transition-delay: 0.6s; }
.table-visible .scientific-table tbody tr:nth-child(7) { transition-delay: 0.7s; }

.scientific-table tbody tr:hover {
  background-color: #f0f9ff;
}

.scientific-table tbody td:first-child {
  text-align: left;
  font-weight: 500;
}

/* Highlight row (our results) */
.scientific-table .highlight-row {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.scientific-table .highlight-row td {
  border: 2px solid #f59e0b;
}

.scientific-table .highlight-row:hover {
  background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%) !important;
}

/* Shine animation for highlight rows */
.table-visible .scientific-table .highlight-row::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: tableShine 2s ease-in-out 0.8s;
}

@keyframes tableShine {
  0% {
    left: -100%;
  }
  100% {
    left: 200%;
  }
}

.table-note {
  padding: 1.5rem 2rem;
  background: var(--bg-alt);
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
  border-top: 1px solid var(--border-color);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease 0.8s, transform 0.6s ease 0.8s;
}

.table-visible .table-note {
  opacity: 1;
  transform: translateY(0);
}

.table-note strong {
  color: var(--text-primary);
  position: relative;
}

.table-visible .table-note strong {
  animation: highlightPulse 2s ease-in-out 1.2s;
}

@keyframes highlightPulse {
  0%, 100% {
    color: var(--text-primary);
  }
  50% {
    color: var(--primary-color);
    text-shadow: 0 0 8px rgba(37, 99, 235, 0.3);
  }
}

.tables-summary {
  margin-top: 4rem;
  padding: 2rem;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-left: 4px solid var(--accent-color);
  border-radius: 12px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.tables-summary.summary-visible {
  opacity: 1;
  transform: translateY(0);
}

.tables-summary p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin: 0;
}

.tables-summary strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* Job Trace Table Specific Styles */
.job-trace-table {
  font-size: 0.9rem;
}

.job-trace-table code {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
}

.job-trace-table .aggregate-row {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
  border-top: 3px solid var(--primary-color);
}

.job-trace-table .aggregate-row td {
  border: 2px solid var(--primary-color);
  font-size: 0.95rem;
}

.job-trace-table td {
  text-align: center;
  vertical-align: middle;
}

.job-trace-table td:first-child {
  text-align: left;
}

.job-trace-table td:nth-child(4),
.job-trace-table td:nth-child(5),
.job-trace-table td:nth-child(9),
.job-trace-table td:nth-child(11),
.job-trace-table td:nth-child(12) {
  font-weight: 500;
}

/* Interactive Charts Section */
.chart-wrapper {
  margin: 4rem 0;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.chart-wrapper.chart-visible {
  opacity: 1;
  transform: translateY(0);
}

.chart-header {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  padding: 2rem;
  border-bottom: 3px solid var(--primary-color);
}

.chart-header h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.chart-description {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

.chart-container {
  padding: 2rem;
  position: relative;
  min-height: 400px;
}

.chart-container canvas {
  max-height: 400px;
  animation: chartFadeIn 1s ease-in-out;
}

@keyframes chartFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 3D Chart Styles */
.chart-3d-container {
  padding: 0.5rem;
  min-height: 700px;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.chart-3d-container #popw3dChart {
  width: 100% !important;
  height: 700px !important;
  position: relative;
  display: block;
  visibility: visible;
  opacity: 1;
  margin: 0;
  padding: 0;
}

.chart-3d-container #popw3dChart canvas {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 1;
  margin: 0 !important;
  padding: 0 !important;
}

.chart-3d-container #popw3dChart .js-plotly-plot {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

.chart-3d-container #popw3dChart .plotly {
  margin: 0 !important;
  padding: 0 !important;
}

.view-toggle-container {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
  justify-content: center;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
}

.view-toggle-btn:hover {
  border-color: var(--primary-color);
  background: var(--bg-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.view-toggle-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
}

.view-toggle-btn.active:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.view-toggle-btn .toggle-icon {
  font-size: 1.2rem;
}

.chart-legend-3d {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.chart-legend-3d .legend-section h4 {
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.chart-legend-3d .legend-section p {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.chart-legend-3d .legend-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.chart-legend-3d .legend-section ul li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding-left: 1.5rem;
  position: relative;
}

.chart-legend-3d .legend-section ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
}

/* Responsive adjustments for 3D chart */
@media (max-width: 1024px) {
  .chart-3d-container {
    min-height: 600px;
  }
  
  .chart-3d-container #popw3dChart {
    height: 600px;
  }
  
  .view-toggle-container {
    flex-direction: column;
    align-items: stretch;
  }
  
  .view-toggle-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .chart-3d-container {
    min-height: 500px;
    padding: 0.5rem;
  }
  
  .chart-3d-container #popw3dChart {
    height: 500px;
  }
  
  .chart-legend-3d {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.feature-card {
  background: white;
  padding: 2rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card {
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  animation: cardFadeIn 0.8s ease forwards;
}

.feature-card:nth-child(1) { animation-delay: 0.2s; }
.feature-card:nth-child(2) { animation-delay: 0.4s; }
.feature-card:nth-child(3) { animation-delay: 0.6s; }

@keyframes cardFadeIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.feature-card h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.feature-card ul {
  margin-top: 1rem;
  padding-left: 1.5rem;
}

.feature-card li {
  margin-bottom: 0.5rem;
}

/* Design Diagram */
.design-diagram {
  margin: 3rem 0;
  text-align: center;
}

.diagram-placeholder {
  background: var(--bg-alt);
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 4rem 2rem;
  margin: 2rem 0;
}

.diagram-note {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-style: italic;
  margin-top: 1rem;
}

/* Project Links */
.project-link {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--primary-color);
  transition: all 0.2s;
}

.project-link:hover {
  color: var(--primary-dark);
  border-bottom-color: var(--primary-dark);
}

/* Models Showcase */
.models-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.model-card {
  background: white;
  padding: 2rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  opacity: 0;
  transform: translateX(-30px);
  animation: cardSlideIn 0.8s ease forwards;
}

.model-card:nth-child(1) { animation-delay: 0.2s; }
.model-card:nth-child(2) { animation-delay: 0.4s; }
.model-card:nth-child(3) { animation-delay: 0.6s; }

@keyframes cardSlideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.model-card h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.model-meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  font-style: italic;
}

.model-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.stat {
  background: var(--bg-alt);
  color: var(--text-primary);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Workflow Diagram */
.workflow-diagram-container {
  width: 100%;
  max-width: 1200px;
  margin: 2rem auto;
  overflow-x: auto;
  background: white;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow-lg);
}

.workflow-diagram-container svg {
  width: 100%;
  height: auto;
  display: block;
}

.workflow-diagram {
  margin: 3rem 0;
  padding: 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.workflow-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.workflow-step {
  flex: 1;
  min-width: 150px;
  text-align: center;
}

.step-number {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 1rem;
}

.step-content h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.step-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

.workflow-arrow {
  font-size: 2rem;
  color: var(--primary-color);
  font-weight: 700;
}

/* PoPW Flow */
.popw-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.popw-step {
  text-align: center;
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.popw-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.popw-step h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--primary-color);
}

.popw-step p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Example Contract */
.example-contract {
  margin: 3rem 0;
  background: var(--bg-alt);
  padding: 2rem;
  border-radius: 12px;
}

.example-contract h3 {
  margin-bottom: 1rem;
}

/* Token Split */
.token-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.token-card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border-top: 4px solid var(--accent-color);
}

.token-card h3 {
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.token-card ul {
  list-style: none;
  padding: 0;
}

.token-card li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.token-card li:last-child {
  border-bottom: none;
}

.token-card li::before {
  content: '✓ ';
  color: var(--accent-color);
  font-weight: 700;
  margin-right: 0.5rem;
}

/* Settlement Types */
.settlement-types {
  margin: 3rem 0;
}

.settlement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.settlement-item {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--primary-color);
}

/* Future Scenarios */
.future-scenarios {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.scenario-card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border-top: 4px solid var(--secondary-color);
}

.scenario-task {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-alt);
  padding: 0.75rem;
  border-radius: 6px;
  margin: 1rem 0;
  font-weight: 500;
  color: var(--primary-color);
}

/* Architecture Layers */
.architecture-layers {
  display: grid;
  gap: 2rem;
  margin: 3rem 0;
}

.layer {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--primary-color);
  opacity: 0;
  transform: translateY(30px) rotateX(-10deg);
  animation: layerFlip 0.8s ease forwards;
  transform-origin: top;
}

.layer:nth-child(1) { animation-delay: 0.2s; }
.layer:nth-child(2) { animation-delay: 0.4s; }
.layer:nth-child(3) { animation-delay: 0.6s; }
.layer:nth-child(4) { animation-delay: 0.8s; }

@keyframes layerFlip {
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
}

.layer h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.layer p {
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1rem;
}

.layer ul {
  list-style: none;
  padding: 0;
}

.layer li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.layer li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: 700;
}

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin: 3rem 0;
}

.result-card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: scale(0.9);
  animation: cardPop 0.6s ease forwards;
}

.result-card:nth-child(1) { animation-delay: 0.1s; }
.result-card:nth-child(2) { animation-delay: 0.2s; }
.result-card:nth-child(3) { animation-delay: 0.3s; }
.result-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes cardPop {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.result-card h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* PI0.5 Section */
.pi05-intro {
  background: #f9fafb;
  border-left: 3px solid var(--secondary-color);
  padding: 2rem;
  border-radius: 6px;
  margin: 2rem 0;
}

.pi05-intro h3 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.pi05-intro ul {
  margin-top: 1rem;
  padding-left: 1.5rem;
}

.pi05-intro li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.pi05-videos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  margin: 3rem 0;
}

.pi05-video-item {
  background: white;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(40px) scale(0.95);
  animation: pi05VideoAppear 0.8s ease forwards;
}

.pi05-video-item:nth-child(1) { animation-delay: 0.2s; }
.pi05-video-item:nth-child(2) { animation-delay: 0.4s; }
.pi05-video-item:nth-child(3) { animation-delay: 0.6s; }
.pi05-video-item:nth-child(4) { animation-delay: 0.8s; }

@keyframes pi05VideoAppear {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pi05-video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: var(--code-bg);
  overflow: hidden;
}

.pi05-video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pi05-video-caption {
  padding: 1.5rem;
}

.pi05-video-caption h4 {
  color: var(--secondary-color);
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.pi05-video-caption p {
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 0.95rem;
  margin: 0;
}

/* ManiSkill Section */
.maniskill-intro {
  background: #f9fafb;
  border-left: 3px solid var(--primary-color);
  padding: 2rem;
  border-radius: 6px;
  margin: 2rem 0;
}

.maniskill-intro h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.maniskill-intro ul {
  margin-top: 1rem;
  padding-left: 1.5rem;
}

.maniskill-intro li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

/* Video Showcase */
.video-showcase {
  display: grid;
  gap: 3rem;
  margin: 3rem 0;
}

.video-item {
  background: white;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(40px) scale(0.95);
  animation: videoAppear 0.8s ease forwards;
}

.video-item:nth-child(1) { animation-delay: 0.2s; }
.video-item:nth-child(2) { animation-delay: 0.4s; }
.video-item:nth-child(3) { animation-delay: 0.6s; }

@keyframes videoAppear {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  background: var(--code-bg);
  overflow: hidden;
}

.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-caption {
  padding: 2rem;
}

.video-caption h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.video-caption p {
  color: var(--text-primary);
  line-height: 1.7;
  margin: 0;
}

/* Simulation Pipeline */
.simulation-pipeline {
  margin: 4rem 0;
  padding: 3rem;
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  border-radius: 12px;
}

.simulation-pipeline h3 {
  text-align: center;
  color: var(--secondary-color);
  margin-bottom: 3rem;
}

.pipeline-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.pipeline-step {
  flex: 1;
  min-width: 150px;
  text-align: center;
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.pipeline-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.pipeline-step h4 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--primary-color);
}

.pipeline-step p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

.pipeline-arrow {
  font-size: 2rem;
  color: var(--secondary-color);
  font-weight: 700;
}

/* ManiSkill Benefits */
.maniskill-benefits {
  margin: 3rem 0;
}

.maniskill-benefits h3 {
  text-align: center;
  margin-bottom: 2rem;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}

.benefit-card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.benefit-card {
  opacity: 0;
  transform: scale(0.9) rotate(-3deg);
  animation: benefitBounce 0.6s ease forwards;
}

.benefit-card:nth-child(1) { animation-delay: 0.1s; }
.benefit-card:nth-child(2) { animation-delay: 0.2s; }
.benefit-card:nth-child(3) { animation-delay: 0.3s; }
.benefit-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes benefitBounce {
  0% {
    opacity: 0;
    transform: scale(0.8) rotate(-3deg);
  }
  60% {
    transform: scale(1.05) rotate(1deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

.benefit-card:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: var(--shadow-xl);
}

.benefit-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.benefit-card h4 {
  color: var(--primary-color);
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.benefit-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

.integration-note {
  margin-top: 3rem;
  padding: 2rem;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-left: 4px solid var(--accent-color);
  border-radius: 12px;
  font-size: 1.1rem;
  line-height: 1.8;
}

/* Video Placeholder */
.video-placeholder {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.video-box {
  background: var(--bg-alt);
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
}

.video-note {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-style: italic;
  margin-top: 1rem;
}

/* Innovation List */
.innovation-list {
  display: grid;
  gap: 2rem;
  margin: 3rem 0;
}

.innovation-item {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--accent-color);
  opacity: 0;
  transform: translateX(-40px);
  animation: slideFromLeft 0.8s ease forwards;
}

.innovation-item:nth-child(1) { animation-delay: 0.1s; }
.innovation-item:nth-child(2) { animation-delay: 0.25s; }
.innovation-item:nth-child(3) { animation-delay: 0.4s; }
.innovation-item:nth-child(4) { animation-delay: 0.55s; }
.innovation-item:nth-child(5) { animation-delay: 0.7s; }

@keyframes slideFromLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.innovation-item h3 {
  color: var(--accent-color);
  margin-bottom: 1rem;
}

/* Roadmap Timeline */
.roadmap-timeline {
  margin: 3rem 0;
  position: relative;
  padding-left: 2rem;
}

.roadmap-timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  padding-left: 3rem;
  opacity: 0;
  transform: translateX(40px);
  animation: timelineSlide 0.8s ease forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.2s; }
.timeline-item:nth-child(2) { animation-delay: 0.4s; }
.timeline-item:nth-child(3) { animation-delay: 0.6s; }
.timeline-item:nth-child(4) { animation-delay: 0.8s; }

@keyframes timelineSlide {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.timeline-marker {
  position: absolute;
  left: -1.5rem;
  top: 0;
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

.timeline-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.timeline-content h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.timeline-content ul {
  list-style: none;
  padding: 0;
}

.timeline-content li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.timeline-content li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.5rem;
}

/* Routing Diagram: Task → Router → Specialists */
.routing-diagram-wrapper {
  margin: 3rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
}

.routing-diagram-wrapper h3 {
  text-align: center;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.diagram-description {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.routing-diagram {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
  padding: 1.5rem;
  overflow-x: auto;
}

.routing-stage {
  flex: 0 0 auto;
  min-width: 200px;
  max-width: 280px;
}

.stage-box {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  opacity: 0;
  animation: stageAppear 0.6s ease forwards;
}

.stage-box:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.stage-box:nth-child(1) { animation-delay: 0.1s; }
.stage-box:nth-child(2) { animation-delay: 0.2s; }
.stage-box:nth-child(3) { animation-delay: 0.3s; }
.stage-box:nth-child(4) { animation-delay: 0.4s; }
.stage-box:nth-child(5) { animation-delay: 0.5s; }
.stage-box:nth-child(6) { animation-delay: 0.6s; }

@keyframes stageAppear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stage-input {
  border-top-color: #3b82f6;
}

.stage-classifier {
  border-top-color: #8b5cf6;
}

.stage-candidates {
  border-top-color: #f59e0b;
}

.stage-sim {
  border-top-color: #10b981;
}

.stage-winner {
  border-top-color: #ef4444;
}

.stage-settlement {
  border-top-color: #14b8a6;
}

.stage-icon {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 0.75rem;
}

.stage-box h4 {
  text-align: center;
  margin: 0.5rem 0;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.stage-detail {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  font-style: italic;
}

.stage-example,
.stage-output,
.stage-info {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  font-size: 0.85rem;
}

.stage-example code {
  display: block;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.5rem;
  border-radius: 4px;
  margin: 0.5rem 0;
  font-size: 0.8rem;
}

.stage-example small {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-secondary);
}

.routing-arrow {
  font-size: 2rem;
  color: var(--primary-color);
  font-weight: bold;
  margin: 0 0.5rem;
  flex-shrink: 0;
  animation: arrowPulse 2s infinite;
}

@keyframes arrowPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

.candidates-list {
  margin-top: 0.75rem;
}

.candidate-item {
  padding: 0.5rem;
  margin: 0.25rem 0;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-size: 0.85rem;
  border-left: 3px solid transparent;
}

.candidate-item.highlight {
  background: #fef3c7;
  border-left-color: #f59e0b;
  font-weight: 600;
}

.candidates-list small {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.scoring-results {
  margin-top: 0.75rem;
}

.score-item {
  padding: 0.5rem;
  margin: 0.25rem 0;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-size: 0.85rem;
}

.score-item.highlight {
  background: #d1fae5;
  border: 2px solid #10b981;
  font-weight: 600;
}

.winner-info {
  text-align: center;
  padding: 0.75rem;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 8px;
  font-size: 0.9rem;
}

.winner-info strong {
  display: block;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.settlement-info {
  margin-top: 0.75rem;
}

.settlement-info > div {
  padding: 0.4rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.settlement-info > div:last-child {
  border-bottom: none;
}

/* Confidence Definition */
.confidence-definition {
  margin: 3rem 0;
  padding: 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

.confidence-definition h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.confidence-formula {
  margin-top: 2rem;
}

.formula-box {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 12px;
  padding: 2rem;
  border: 2px solid var(--primary-color);
}

.formula-title {
  text-align: center;
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 2rem;
  font-family: 'JetBrains Mono', monospace;
  padding: 1rem;
  background: white;
  border-radius: 8px;
}

.formula-components {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.formula-component {
  background: white;
  padding: 1.25rem;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
  box-shadow: var(--shadow-md);
}

.formula-component strong {
  display: block;
  color: var(--primary-color);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.formula-component p {
  margin: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.formula-component code {
  display: block;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-secondary);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.formula-note {
  margin-top: 1.5rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  border-left: 4px solid #10b981;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.formula-note strong {
  color: #10b981;
}

/* Responsive for Routing Diagram */
@media (max-width: 1024px) {
  .routing-diagram {
    flex-direction: column;
  }

  .routing-arrow {
    transform: rotate(90deg);
    margin: 0.5rem 0;
  }

  .formula-components {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .routing-stage {
    min-width: 100%;
    max-width: 100%;
  }

  .stage-box {
    padding: 1.25rem;
  }
}

/* Conclusion */
.conclusion-points {
  display: grid;
  gap: 2rem;
  margin: 3rem 0;
}

.conclusion-point {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  padding: 2rem;
  border-radius: 12px;
  border-left: 4px solid var(--primary-color);
  opacity: 0;
  transform: scale(0.95) translateY(20px);
  animation: conclusionPop 0.8s ease forwards;
}

.conclusion-point:nth-child(1) { animation-delay: 0.2s; }
.conclusion-point:nth-child(2) { animation-delay: 0.4s; }
.conclusion-point:nth-child(3) { animation-delay: 0.6s; }
.conclusion-point:nth-child(4) { animation-delay: 0.8s; }

@keyframes conclusionPop {
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.final-message {
  font-size: 1.25rem;
  font-weight: 500;
  margin: 3rem 0;
  padding: 2rem;
  background: var(--bg-alt);
  border-radius: 12px;
  text-align: center;
  opacity: 0;
  transform: scale(0.95);
  animation: messagePulse 1s ease forwards;
  animation-delay: 1s;
}

@keyframes messagePulse {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.call-to-action {
  text-align: center;
  font-size: 1.125rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 3rem;
  padding: 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
  animation-delay: 1.2s;
}

/* Footer */
.footer {
  background: var(--text-primary);
  color: white;
  padding: 3rem 0;
  text-align: center;
}

.footer-content {
  max-width: 600px;
  margin: 0 auto;
}

.footer-content a {
  color: var(--accent-color);
}

.footer-note {
  margin-top: 1rem;
  font-size: 0.9rem;
  opacity: 0.7;
}

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

  .hero-subtitle {
    font-size: 1.25rem;
  }

  .section {
    padding: 3rem 0;
  }

  .section-title {
    font-size: 2rem;
  }

  .workflow-steps {
    flex-direction: column;
  }

  .workflow-arrow {
    transform: rotate(90deg);
  }

  .pipeline-steps {
    flex-direction: column;
  }

  .pipeline-arrow {
    transform: rotate(90deg);
  }

  .video-container {
    padding-bottom: 75%; /* Adjust aspect ratio for mobile */
  }

  .simulation-pipeline {
    padding: 2rem 1rem;
  }

  .container {
    padding: 0 1rem;
  }

  /* Tables responsive */
  .table-container {
    padding: 1rem;
  }

  .scientific-table {
    font-size: 0.8rem;
  }

  .scientific-table thead th,
  .scientific-table tbody td {
    padding: 0.5rem 0.4rem;
    font-size: 0.75rem;
  }

  .table-header {
    padding: 1.5rem;
  }

  .table-header h3 {
    font-size: 1.25rem;
  }

  .table-note {
    padding: 1rem;
    font-size: 0.85rem;
  }

  /* Charts responsive */
  .chart-container {
    padding: 1rem;
    min-height: 300px;
  }

  .chart-container canvas {
    max-height: 300px;
  }

  .chart-header {
    padding: 1.5rem;
  }

  .chart-header h3 {
    font-size: 1.25rem;
  }

  .chart-description {
    font-size: 0.9rem;
  }

  /* Diagram responsive */
  .architecture-diagram {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  .architecture-diagram svg {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 500px;
    display: block;
  }

  .diagram-explanation {
    padding: 1.5rem;
  }

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

  .explanation-item {
    padding: 1rem;
  }

  .explanation-number {
    min-width: 35px;
    height: 35px;
    font-size: 1.1rem;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
}

/* Architecture Diagram */
.architecture-diagram {
  width: 100%;
  max-width: 100%;
  margin: 2rem 0;
  padding: 0.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  overflow: visible;
}

.architecture-diagram svg {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 800px;
  display: block;
}

.architecture-diagram .mermaid {
  width: 100%;
  min-height: 600px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.architecture-diagram .mermaid svg {
  max-width: 100%;
  height: auto;
}

.diagram-step {
  opacity: 0;
  animation: diagramStepAppear 1s ease forwards;
}

.diagram-step:nth-child(1) { animation-delay: 0.2s; }
.diagram-step:nth-child(2) { animation-delay: 0.4s; }
.diagram-step:nth-child(3) { animation-delay: 0.6s; }
.diagram-step:nth-child(4) { animation-delay: 0.8s; }
.diagram-step:nth-child(5) { animation-delay: 1s; }
.diagram-step:nth-child(6) { animation-delay: 1.2s; }

@keyframes diagramStepAppear {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.diagram-explanation {
  margin-top: 3rem;
  padding: 2rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 12px;
}

.diagram-explanation h3 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 2rem;
  font-size: 1.75rem;
}

.explanation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.explanation-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: white;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateX(-30px);
  animation: explanationSlide 0.8s ease forwards;
}

.explanation-item:nth-child(1) { animation-delay: 1.4s; }
.explanation-item:nth-child(2) { animation-delay: 1.55s; }
.explanation-item:nth-child(3) { animation-delay: 1.7s; }
.explanation-item:nth-child(4) { animation-delay: 1.85s; }
.explanation-item:nth-child(5) { animation-delay: 2s; }
.explanation-item:nth-child(6) { animation-delay: 2.15s; }

@keyframes explanationSlide {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.explanation-number {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: bold;
  flex-shrink: 0;
}

.explanation-item p {
  margin: 0;
  line-height: 1.6;
  color: var(--text-primary);
}

.explanation-item strong {
  color: var(--primary-color);
}

/* Task Lifecycle Flow Diagram */
.flowchart-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 3rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 16px;
}

.flow-node {
  background: white;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
  min-width: 280px;
  opacity: 0;
  transform: scale(0.9) translateY(20px);
  animation: flowNodeAppear 0.6s ease forwards;
}

.flow-node:nth-child(1) { animation-delay: 0.1s; }
.flow-node:nth-child(3) { animation-delay: 0.2s; }
.flow-node:nth-child(5) { animation-delay: 0.3s; }
.flow-node:nth-child(7) { animation-delay: 0.4s; }
.flow-node:nth-child(9) { animation-delay: 0.5s; }
.flow-node:nth-child(11) { animation-delay: 0.6s; }
.flow-node:nth-child(13) { animation-delay: 0.7s; }
.flow-node:nth-child(15) { animation-delay: 0.8s; }
.flow-node:nth-child(17) { animation-delay: 0.9s; }
.flow-node:nth-child(19) { animation-delay: 1.0s; }

@keyframes flowNodeAppear {
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.flow-start {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.flow-end {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
}

.flow-decision {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.flow-process {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white;
}

.flow-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.flow-node h4 {
  margin: 0.5rem 0;
  font-size: 1.25rem;
}

.flow-node p {
  margin: 0.5rem 0 0 0;
  font-size: 0.9rem;
  opacity: 0.95;
}

.flow-arrow {
  font-size: 2rem;
  color: var(--primary-color);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Validator Consensus Diagram */
.consensus-diagram {
  margin: 3rem 0;
}

.consensus-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 3rem;
  padding: 2rem;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 16px;
}

.consensus-box {
  flex: 1;
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateX(-30px);
  animation: slideInFromLeft 0.8s ease forwards;
}

.consensus-box.consensus-output {
  transform: translateX(30px);
  animation: slideInFromRight 0.8s ease forwards;
}

.consensus-box h4 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
  text-align: center;
}

.consensus-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.consensus-item {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  border-left: 3px solid var(--primary-color);
}

.consensus-validators {
  flex: 1.5;
  opacity: 0;
  animation: fadeInScale 0.8s ease 0.4s forwards;
}

.consensus-validators h4 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
  text-align: center;
}

.validator-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.validator-node {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  font-weight: bold;
  font-size: 0.95rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease;
}

.validator-node:hover {
  transform: scale(1.05);
}

.validator-agree {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.validator-disagree {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.consensus-threshold {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  font-size: 1.1rem;
  color: var(--primary-color);
  box-shadow: var(--shadow-md);
}

.consensus-arrow {
  font-size: 3rem;
  color: var(--primary-color);
  opacity: 0;
  animation: fadeIn 0.6s ease 0.6s forwards;
}

.consensus-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.consensus-feature {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--secondary-color);
  opacity: 0;
  transform: translateY(20px);
  animation: slideInUp 0.6s ease forwards;
}

.consensus-feature:nth-child(1) { animation-delay: 0.8s; }
.consensus-feature:nth-child(2) { animation-delay: 0.9s; }
.consensus-feature:nth-child(3) { animation-delay: 1.0s; }

.consensus-feature strong {
  color: var(--secondary-color);
}

/* Reward Distribution Diagram */
.reward-flow-diagram {
  margin: 3rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, #fae8ff 0%, #f3e8ff 100%);
  border-radius: 16px;
}

.reward-source {
  display: flex;
  justify-content: center;
  margin-bottom: 3rem;
}

.reward-pool {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  padding: 2rem 3rem;
  border-radius: 16px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: scale(0.8);
  animation: popIn 0.6s ease forwards;
}

@keyframes popIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.reward-pool h3 {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
}

.pool-amount {
  font-size: 2.5rem;
  font-weight: bold;
  margin: 1rem 0;
}

.reward-pool p {
  margin: 0;
  opacity: 0.9;
}

.reward-streams {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.reward-stream {
  opacity: 0;
  animation: fadeInScale 0.6s ease forwards;
}

.reward-stream:nth-child(1) { animation-delay: 0.3s; }
.reward-stream:nth-child(2) { animation-delay: 0.5s; }
.reward-stream:nth-child(3) { animation-delay: 0.7s; }
.reward-stream:nth-child(4) { animation-delay: 0.9s; }

.stream-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1rem;
}

.stream-label {
  background: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.arrow-line {
  width: 3px;
  height: 40px;
  background: var(--primary-color);
  position: relative;
}

.arrow-line::after {
  content: '▼';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--primary-color);
  font-size: 1rem;
}

.reward-recipient {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
  transition: transform 0.3s ease;
}

.reward-recipient:hover {
  transform: translateY(-5px);
}

.recipient-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.reward-recipient h4 {
  color: var(--secondary-color);
  margin: 0.5rem 0;
}

.recipient-amount {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--primary-color);
  margin: 0.75rem 0;
}

.reward-recipient p {
  margin: 0.5rem 0 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.recipient-winner {
  border: 3px solid #10b981;
}

.reward-notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.reward-note {
  background: white;
  padding: 1.25rem;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  border-top: 3px solid var(--secondary-color);
  opacity: 0;
  transform: translateY(20px);
  animation: slideInUp 0.6s ease forwards;
}

.reward-note:nth-child(1) { animation-delay: 1.1s; }
.reward-note:nth-child(2) { animation-delay: 1.2s; }
.reward-note:nth-child(3) { animation-delay: 1.3s; }

.reward-note strong {
  color: var(--secondary-color);
}

/* AI Model Competition Diagram */
.competition-diagram {
  margin: 3rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  border-radius: 16px;
}

.competition-task {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.task-card {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  padding: 2rem 3rem;
  border-radius: 16px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  min-width: 400px;
  opacity: 0;
  transform: translateY(-30px);
  animation: dropDown 0.8s ease forwards;
}

@keyframes dropDown {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.task-card h3 {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
}

.task-desc {
  font-size: 1.2rem;
  font-style: italic;
  margin: 0.5rem 0 1.5rem 0;
}

.task-reward {
  font-size: 1.8rem;
  font-weight: bold;
  margin: 0.5rem 0;
}

.task-deadline {
  opacity: 0.9;
  margin: 0.5rem 0 0 0;
}

.competition-arrow-down {
  text-align: center;
  font-size: 3rem;
  color: var(--primary-color);
  margin: 1rem 0;
  animation: bounce 2s infinite;
}

.competition-miners {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin: 2rem 0;
}

.miner-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  opacity: 0;
  transform: scale(0.8);
  animation: minerAppear 0.6s ease forwards;
  transition: transform 0.3s ease;
}

.miner-card:hover {
  transform: scale(1.05);
}

.miner-card:nth-child(1) { animation-delay: 0.4s; }
.miner-card:nth-child(2) { animation-delay: 0.6s; }
.miner-card:nth-child(3) { animation-delay: 0.8s; }

@keyframes minerAppear {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.miner-winner {
  border: 4px solid #10b981;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
}

.winner-badge {
  position: absolute;
  top: -15px;
  right: 15px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.9rem;
  box-shadow: var(--shadow-md);
}

.miner-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.miner-icon {
  font-size: 2rem;
}

.miner-header h4 {
  margin: 0;
  color: var(--secondary-color);
  font-size: 1.2rem;
}

.miner-model {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.75rem;
  border-radius: 8px;
  text-align: center;
  font-weight: bold;
  margin-bottom: 1rem;
}

.miner-stake {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.miner-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.stat {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
  text-align: center;
}

.miner-score {
  text-align: center;
  font-size: 1.5rem;
  font-weight: bold;
  padding: 0.75rem;
  border-radius: 8px;
  margin-top: 1rem;
}

.score-1 {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.score-2 {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white;
}

.score-3 {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.competition-result {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.result-card {
  background: white;
  padding: 2rem 3rem;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  opacity: 0;
  transform: scale(0.9);
  animation: resultAppear 0.8s ease 1.2s forwards;
}

@keyframes resultAppear {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.result-card h3 {
  color: var(--secondary-color);
  margin: 0 0 1rem 0;
  text-align: center;
}

.result-winner {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 1rem;
  border-radius: 10px;
  text-align: center;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.result-payouts {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.payout-line {
  padding: 0.75rem;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 8px;
  border-left: 3px solid var(--primary-color);
}

.competition-metrics {
  margin-top: 3rem;
  padding: 2rem;
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

.competition-metrics h3 {
  color: var(--secondary-color);
  text-align: center;
  margin-bottom: 2rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.metric-item {
  text-align: center;
  padding: 1.5rem;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 12px;
  transition: transform 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: slideInUp 0.6s ease forwards;
}

.metric-item:nth-child(1) { animation-delay: 1.4s; }
.metric-item:nth-child(2) { animation-delay: 1.5s; }
.metric-item:nth-child(3) { animation-delay: 1.6s; }
.metric-item:nth-child(4) { animation-delay: 1.7s; }

.metric-item:hover {
  transform: translateY(-5px);
}

.metric-weight {
  background: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: bold;
  display: inline-block;
  margin-bottom: 1rem;
}

.metric-item h4 {
  color: var(--code-text);
  margin: 0.75rem 0;
}

.metric-item p {
  color: var(--code-text);
  opacity: 0.9;
  font-size: 0.9rem;
  margin: 0;
}

/* Additional Keyframe Animations */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive Design for New Diagrams */
@media (max-width: 1024px) {
  .consensus-row {
    flex-direction: column;
  }

  .consensus-arrow {
    transform: rotate(90deg);
  }

  .validator-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .reward-streams {
    grid-template-columns: 1fr;
  }

  .competition-miners {
    grid-template-columns: 1fr;
  }

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

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

  .reward-notes {
    grid-template-columns: 1fr;
  }

  .pi05-videos {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .flow-node {
    min-width: 200px;
    padding: 1rem 1.5rem;
  }

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

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

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Selection */
::selection {
  background: var(--primary-color);
  color: white;
}
