.experiments-container {
  min-height: 100vh;
  padding: 2rem;
}

.experiments-header {
  max-width: 1200px;
  margin: 0 auto 4rem;
  text-align: center;
}

.back-link {
  display: inline-block;
  color: var(--text-light);
  text-decoration: none;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

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

.experiments-header h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text);
}

.subtitle {
  font-size: 1.25rem;
  color: var(--text-light);
}

.experiments-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.experiment-card {
  background: var(--secondary);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  border: 1px solid transparent;
}

.experiment-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--accent);
}

.experiment-preview {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--background) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.preview-animation {
  width: 100%;
  height: 100%;
}

.experiment-info {
  padding: 1.5rem;
}

.experiment-info h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.experiment-info p {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.tech-tag {
  display: inline-block;
  background: var(--background);
  color: var(--text-light);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-right: 0.5rem;
  margin-top: 0.5rem;
}

.experiments-footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-light);
  border-top: 1px solid var(--secondary);
}

.experiments-footer a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.experiments-footer a:hover {
  text-decoration: underline;
}

/* Preview animations */
.particle-preview {
  background:
    radial-gradient(circle at 30% 50%, rgba(100, 100, 255, 0.2), transparent 50%),
    radial-gradient(circle at 70% 50%, rgba(255, 100, 100, 0.2), transparent 50%);
  animation: particleFloat 4s ease-in-out infinite;
}

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

.d3-financial-preview {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  position: relative;
  overflow: hidden;
}

.d3-financial-preview::before {
  content: '';
  position: absolute;
  bottom: 20%;
  left: 10%;
  right: 10%;
  height: 60%;
  background: linear-gradient(to top, transparent, rgba(74, 158, 255, 0.3));
  clip-path: polygon(
    0% 60%,
    10% 45%,
    20% 50%,
    30% 30%,
    40% 35%,
    50% 20%,
    60% 25%,
    70% 15%,
    80% 30%,
    90% 20%,
    100% 10%,
    100% 100%,
    0% 100%
  );
  animation: chartPulse 3s ease-in-out infinite;
}

.d3-financial-preview::after {
  content: '';
  position: absolute;
  bottom: 20%;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(74, 158, 255, 0.8) 20%,
    rgba(74, 158, 255, 0.8) 80%,
    transparent
  );
  clip-path: polygon(
    0% 50%,
    10% 30%,
    20% 35%,
    30% 15%,
    40% 20%,
    50% 5%,
    60% 10%,
    70% 0%,
    80% 15%,
    90% 5%,
    100% 0%,
    100% 100%,
    90% 95%,
    80% 100%,
    70% 85%,
    60% 90%,
    50% 95%,
    40% 80%,
    30% 85%,
    20% 65%,
    10% 70%,
    0% 50%
  );
  animation: chartLine 3s ease-in-out infinite;
}

@keyframes chartPulse {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
}

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

.d3fc-preview {
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  position: relative;
  overflow: hidden;
}

.d3fc-preview::before {
  content: '';
  position: absolute;
  bottom: 25%;
  left: 5%;
  right: 5%;
  height: 50%;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 8%,
    rgba(38, 166, 154, 0.6) 8%,
    rgba(38, 166, 154, 0.6) 9%,
    transparent 9%,
    transparent 11%,
    rgba(239, 83, 80, 0.6) 11%,
    rgba(239, 83, 80, 0.6) 12%
  );
  clip-path: polygon(
    0% 70%,
    5% 55%,
    10% 60%,
    15% 45%,
    20% 50%,
    25% 35%,
    30% 40%,
    35% 28%,
    40% 32%,
    45% 22%,
    50% 18%,
    55% 25%,
    60% 30%,
    65% 38%,
    70% 42%,
    75% 50%,
    80% 55%,
    85% 48%,
    90% 52%,
    95% 45%,
    100% 40%,
    100% 100%,
    0% 100%
  );
  animation: d3fcCandlestick 4s ease-in-out infinite;
}

.d3fc-preview::after {
  content: '';
  position: absolute;
  top: 15%;
  left: 10%;
  right: 10%;
  height: 1.5px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 152, 0, 0.8) 15%,
    rgba(255, 152, 0, 0.8) 85%,
    transparent
  );
  clip-path: polygon(
    0% 50%,
    10% 45%,
    20% 35%,
    30% 38%,
    40% 28%,
    50% 32%,
    60% 25%,
    70% 30%,
    80% 28%,
    90% 33%,
    100% 30%,
    100% 70%,
    90% 67%,
    80% 72%,
    70% 70%,
    60% 75%,
    50% 68%,
    40% 72%,
    30% 62%,
    20% 65%,
    10% 55%,
    0% 50%
  );
  animation: d3fcIndicator 4s ease-in-out infinite;
}

@keyframes d3fcCandlestick {
  0%,
  100% {
    opacity: 0.7;
    transform: translateY(0);
  }
  50% {
    opacity: 0.9;
    transform: translateY(-5px);
  }
}

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

.morph-preview {
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
}

.morph-preview::after {
  content: '';
  width: 80px;
  height: 80px;
  background: var(--accent);
  animation: morph 3s ease-in-out infinite;
}

@keyframes morph {
  0%,
  100% {
    border-radius: 20%;
  }
  50% {
    border-radius: 50%;
    transform: rotate(180deg);
  }
}

.text-preview {
  background: linear-gradient(45deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--background);
  animation: textWave 2s ease-in-out infinite;
}

.text-preview::after {
  content: 'TEXT';
  animation: textDistort 2s ease-in-out infinite;
}

@keyframes textDistort {
  0%,
  100% {
    transform: scaleX(1);
  }
  50% {
    transform: scaleX(1.2) scaleY(0.8);
  }
}

.fluid-preview {
  background: linear-gradient(
    45deg,
    #667eea 0%,
    #764ba2 25%,
    #f093fb 50%,
    #4facfe 75%,
    #00f2fe 100%
  );
  background-size: 400% 400%;
  animation: fluidGradient 8s ease infinite;
}

@keyframes fluidGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.boids-2d-preview {
  background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
  position: relative;
  overflow: hidden;
}

.boids-2d-preview::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background: #4a9eff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  animation: boid2dFly 4s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(74, 158, 255, 0.6));
}

.boids-2d-preview::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: #6ab0ff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-30deg);
  animation: boid2dFly2 5s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(106, 176, 255, 0.5));
}

@keyframes boid2dFly {
  0% {
    left: -5%;
    top: 80%;
  }
  25% {
    left: 30%;
    top: 40%;
  }
  50% {
    left: 60%;
    top: 60%;
  }
  75% {
    left: 85%;
    top: 30%;
  }
  100% {
    left: 105%;
    top: 70%;
  }
}

@keyframes boid2dFly2 {
  0% {
    left: -8%;
    top: 50%;
  }
  30% {
    left: 25%;
    top: 70%;
  }
  60% {
    left: 70%;
    top: 40%;
  }
  90% {
    left: 95%;
    top: 60%;
  }
  100% {
    left: 108%;
    top: 30%;
  }
}

.boids-3d-preview {
  background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%);
  position: relative;
  overflow: hidden;
}

.boids-3d-preview::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, #4a9eff 0%, #6ab0ff 100%);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  animation: boid3dFly 5s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(74, 158, 255, 0.7));
}

.boids-3d-preview::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 30%, rgba(74, 158, 255, 0.1) 0%, transparent 20%),
    radial-gradient(circle at 80% 70%, rgba(106, 176, 255, 0.08) 0%, transparent 25%),
    radial-gradient(circle at 50% 50%, rgba(74, 158, 255, 0.05) 0%, transparent 40%);
  animation: boid3dDepth 6s ease-in-out infinite;
}

@keyframes boid3dFly {
  0% {
    left: 10%;
    top: 70%;
    transform: rotate(-45deg) scale(0.6);
    opacity: 0.4;
  }
  25% {
    left: 35%;
    top: 35%;
    transform: rotate(-30deg) scale(1);
    opacity: 1;
  }
  50% {
    left: 60%;
    top: 55%;
    transform: rotate(-60deg) scale(0.8);
    opacity: 0.7;
  }
  75% {
    left: 80%;
    top: 25%;
    transform: rotate(-20deg) scale(1.1);
    opacity: 1;
  }
  100% {
    left: 90%;
    top: 65%;
    transform: rotate(-50deg) scale(0.5);
    opacity: 0.3;
  }
}

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

.neural-snake-preview {
  background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 100%);
  position: relative;
  overflow: hidden;
}

.neural-snake-preview::before {
  content: '';
  position: absolute;
  left: 20%;
  top: 50%;
  width: 60%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #4a9eff 10%,
    #4a9eff 20%,
    transparent 20%,
    transparent 30%,
    #4a9eff 30%,
    #4a9eff 40%,
    transparent 40%,
    transparent 50%,
    #4a9eff 50%,
    #4a9eff 60%,
    transparent 60%,
    transparent 70%,
    #4a9eff 70%,
    #4a9eff 80%,
    transparent 80%
  );
  transform: translateY(-50%);
  animation: snakeMove 3s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(74, 158, 255, 0.6));
}

.neural-snake-preview::after {
  content: '';
  position: absolute;
  right: 25%;
  top: 50%;
  width: 12px;
  height: 12px;
  background: #ff4a4a;
  border-radius: 2px;
  transform: translate(50%, -50%);
  animation: foodPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(255, 74, 74, 0.6));
}

@keyframes snakeMove {
  0% {
    left: 10%;
    top: 50%;
    transform: translateY(-50%) scaleX(1);
  }
  25% {
    left: 20%;
    top: 35%;
    transform: translateY(-50%) scaleX(1.1);
  }
  50% {
    left: 30%;
    top: 50%;
    transform: translateY(-50%) scaleX(1.2);
  }
  75% {
    left: 20%;
    top: 65%;
    transform: translateY(-50%) scaleX(1.1);
  }
  100% {
    left: 10%;
    top: 50%;
    transform: translateY(-50%) scaleX(1);
  }
}

@keyframes foodPulse {
  0%,
  100% {
    transform: translate(50%, -50%) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(50%, -50%) scale(1.3);
    opacity: 0.7;
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .experiments-header h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1.1rem;
  }

  .experiments-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .experiment-preview {
    height: 180px;
  }
}

/* Shared experiment page styles */
.experiment-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.experiment-nav {
  padding: 1rem 2rem;
  background: var(--secondary);
  border-bottom: 1px solid var(--accent);
}

.experiment-nav a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.95rem;
}

.experiment-nav a:hover {
  color: var(--text);
}

.experiment-canvas-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.experiment-canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.experiment-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.7);
  padding: 1rem;
  border-radius: 8px;
  color: white;
}

.experiment-controls label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.experiment-controls input[type='range'] {
  width: 100%;
  margin-bottom: 1rem;
}

.experiment-info-panel {
  padding: 1.5rem 2rem;
  background: var(--secondary);
  border-top: 1px solid var(--accent);
}

.experiment-info-panel h2 {
  margin-bottom: 0.5rem;
}

.experiment-info-panel p {
  color: var(--text-light);
  margin-bottom: 0.5rem;
}
